Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#43600 closed defect (bug) (duplicate)

“Warning: count()” error on php 7.2

Reported by: spabrice's profile SpabRice Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.4
Component: Posts, Post Types Keywords:
Focuses: template Cc:


I'm currently working with php 7.2 and when I use get_the_content() or get_the_excerpt() outside of a single template, in the functions.php for example, I get the following Warning:

Warning: count(): Parameter must be an array or an object that implements Countable in /Applications/MAMP/htdocs/wordpress/wp-kona/wp-includes/post-template.php on line 284

What's wrong with it? Is it a wordpress core bug?

Change History (1)

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to Posts, Post Types
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @SpabRice, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #42814.

Note: See TracTickets for help on using tickets.