#43368 closed defect (bug) (duplicate)
Fix the warning of count() in php 7.2.0
Reported by: | anonymized_15003776 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.1 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
When the version of PHP was 7.2.0, count() will now yield a warning on invalid countable types passed to the array_or_countable parameter.
/wp-includes/post-template.php
Line:284
if ( $page > count( $pages ) ) $page = count( $pages );
to
if ( $page > count( $pages ? : [] ) ) $page = count( $pages ? : [] );
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hi there and thanks for your report!
Please note that this is already being tracked in #42814.