[wp-trac] [WordPress Trac] #42814: PHP 7.2 Warning: ...wp-includes/post-template.php on line 284
WordPress Trac
noreply at wordpress.org
Mon Jan 8 17:42:46 UTC 2018
#42814: PHP 7.2 Warning: ...wp-includes/post-template.php on line 284
---------------------------------------------+-----------------------------
Reporter: internetwerk | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Awaiting
Component: General | Review
Severity: normal | Version: 4.9.1
Keywords: needs-testing reporter-feedback | Resolution:
| Focuses:
---------------------------------------------+-----------------------------
Comment (by Cibulka):
In my case, it was a call to `get_the_excerpt()`, when the page had none.
I have fixed it roughly this way:
global $post;
$excerpt = !empty($post->post_excerpt) ? get_the_excerpt() : null;
PHP 7.2 as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42814#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list