Changeset 33904
- Timestamp:
- 09/04/2015 09:24:04 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r33891 r33904 165 165 * 166 166 * @since 3.0.0 167 * @since 4.4.0 Introduced the `$echo` argument. 167 168 * 168 169 * @param int $post_id Optional. Post ID. Default 0. … … 180 181 * @type bool $checked_ontop Whether to move checked items out of the hierarchy and to 181 182 * the top of the list. Default true. 183 * @type bool $echo Whether to echo the generated markup. False to return the markup instead 184 * of echoing it. Default true. 182 185 * } 183 186 */ … … 189 192 'walker' => null, 190 193 'taxonomy' => 'category', 191 'checked_ontop' => true 194 'checked_ontop' => true, 195 'echo' => true, 192 196 ); 193 197 … … 252 256 } 253 257 258 $output = ''; 259 254 260 if ( $r['checked_ontop'] ) { 255 261 // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache) … … 265 271 266 272 // Put checked cats on top 267 echocall_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) );273 $output .= call_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) ); 268 274 } 269 275 // Then the rest of them 270 echo call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) ); 276 $output .= call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) ); 277 278 if ( $r['echo'] ) { 279 echo $output; 280 } 281 282 return $output; 271 283 } 272 284
Note: See TracChangeset
for help on using the changeset viewer.