ERROR. Only links to links should be returned by link in wp-includes / post.php

I keep getting this error when I add a PHP error report in my WordPress setup.

Notice: Only variable references should be returned by reference in /Users/admin/Sites/wp-includes/post.php on line 3394

I have a feeling that it is connected with taxonomies and their hierarchical setting .

Tried to track it for a while now in the plugin that I am writing .

These are the actual lines of code in WP Core, and the return is in the excact line.

  // Make sure the post type is hierarchical $hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) ); if ( !in_array( $post_type, $hierarchical_post_types ) ) return false; 

I will debug it until I find the problem, but any input would be great if I didn't find the problem in my plugin.

+4
source share
1 answer

return false; is not a variable Try something like

 if ( !in_array( $post_type, $hierarchical_post_types ) ) { $rv = false; return $rv; } 

(side note: I have no idea what Wordpress and / or the modem you are using do, but it is possible that "returning by reference" is a) unnecessary in the first place and b) a relic from the php4 implementation)

+6
source

All Articles