Changeset 6627 for trunk/src/includes/replies/template.php
- Timestamp:
- 07/19/2017 04:11:11 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/replies/template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/template.php
r6621 r6627 371 371 */ 372 372 function bbp_get_reply( $reply, $output = OBJECT, $filter = 'raw' ) { 373 374 // Maybe get ID from empty or int 373 375 if ( empty( $reply ) || is_numeric( $reply ) ) { 374 376 $reply = bbp_get_reply_id( $reply ); 375 377 } 376 378 379 // Bail if no post object 377 380 $reply = get_post( $reply, OBJECT, $filter ); 378 381 if ( empty( $reply ) ) { … … 380 383 } 381 384 385 // Bail if not correct post type 382 386 if ( $reply->post_type !== bbp_get_reply_post_type() ) { 383 387 return null; 384 388 } 385 389 386 if ( $output === OBJECT ) { 387 return $reply; 388 389 } elseif ( $output === ARRAY_A ) { 390 $_reply = get_object_vars( $reply ); 391 return $_reply; 392 390 // Default return value is OBJECT 391 $retval = $reply; 392 393 // Array A 394 if ( $output === ARRAY_A ) { 395 $retval = get_object_vars( $reply ); 396 397 // Array N 393 398 } elseif ( $output === ARRAY_N ) { 394 $_reply = array_values( get_object_vars( $reply ) ); 395 return $_reply; 399 $retval = array_values( get_object_vars( $reply ) ); 396 400 } 397 401 398 402 // Filter & return 399 return apply_filters( 'bbp_get_reply', $re ply, $output, $filter );403 return apply_filters( 'bbp_get_reply', $retval, $reply, $output, $filter ); 400 404 } 401 405
Note: See TracChangeset
for help on using the changeset viewer.