Ticket #10053: 10053.2.diff
| File 10053.2.diff, 879 bytes (added by , 17 years ago) |
|---|
-
wp-includes/post.php
114 114 * @return array|bool False on failure and the type will be determined by $output parameter. 115 115 */ 116 116 function &get_children($args = '', $output = OBJECT) { 117 $kids = array(); 117 118 if ( empty( $args ) ) { 118 119 if ( isset( $GLOBALS['post'] ) ) { 119 120 $args = array('post_parent' => (int) $GLOBALS['post']->post_parent ); 120 121 } else { 121 return false;122 return $kids; 122 123 } 123 124 } elseif ( is_object( $args ) ) { 124 125 $args = array('post_parent' => (int) $args->post_parent ); … … 134 135 $r = wp_parse_args( $args, $defaults ); 135 136 136 137 $children = get_posts( $r ); 137 if ( !$children ) {138 $kids = false;138 139 if ( !$children ) 139 140 return $kids; 140 }141 141 142 142 update_post_cache($children); 143 143