Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #42814, comment 25


Ignore:
Timestamp:
01/26/2018 09:24:57 PM (7 years ago)
Author:
Kelderic
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #42814, comment 25

    initial v1  
    11I just ran into this when I began testing with PHP 7.2. In my <head> section of my theme, I call `get_the_excerpt` as part of Open Graph meta tags. I have tried passing the post ID using `get_the_ID`, and passing `$post`, but I can't get rid of the error.
     2
     3If we add:
     4
     5{{{#!php
     6if ( ! is_array($pages) ) { 
     7        $pages = [];
     8}
     9}}}
     10
     11At line 283 of post-template.php, we correct the issue. Long term, we need to check that all expected arrays are really arrays, and convert `NULL` values to empty arrays before calling `count()`.