[wp-trac] [WordPress Trac] #20756: Wrong reference returned in function &get_pages (was: wrong reference in function &get_pages)

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 13 10:28:30 UTC 2012


#20756: Wrong reference returned in function &get_pages
-----------------------------------+------------------------------
 Reporter:  thomask                |       Owner:  foxinni
     Type:  defect (bug)           |      Status:  reviewing
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Warnings/Notices       |     Version:  3.4.1
 Severity:  trivial                |  Resolution:
 Keywords:  has-patch needs-patch  |
-----------------------------------+------------------------------
Changes (by foxinni):

 * keywords:  has-patch => has-patch needs-patch
 * owner:   => foxinni
 * version:  3.3.2 => 3.4.1
 * status:  new => reviewing


Comment:

 I can confirm this issue.

 This only happens when it's used inside of a plugin, and on Multi-Site
 installs. (Needs confirming)

 The error I get:

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


 Changing `&get_pages` to `get_pages` does resolve the issue...

 Also returning an actual variable resolves the issue:

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

 Can't be sure if any of these patched/fixes are at the root of the
 problem.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20756#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list