php function 'count' versus wordpress array field 'count'
-
PHP has the count function, that counts the number of elements in an array.
I am currently using the WordPress function get_terms. This returns an array with one of the fields inside this array called count. ( http://codex.ww.wp.xz.cn/Function_Reference/get_terms#Return_Values )
When I loop out this array, using foreach, I get to this line at a certain point:
$term->count
This should and does return the number of posts inside the currently looped taxonomy term.Here’s my question: will the count in the rule above make the server think, hello php function. I am going to execute you and get an error somehow.
I don’t know how to say this more clearly. Isn’t count a php reserved term?
The topic ‘php function 'count' versus wordpress array field 'count'’ is closed to new replies.