Changeset 6438 for trunk/src/includes/replies/template.php
- Timestamp:
- 05/27/2017 05:04:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/template.php
r6437 r6438 33 33 */ 34 34 function bbp_get_reply_post_type() { 35 36 // Filter & return 35 37 return apply_filters( 'bbp_get_reply_post_type', bbpress()->reply_post_type ); 36 38 } … … 44 46 */ 45 47 function bbp_get_reply_post_type_labels() { 46 return apply_filters( 'bbp_get_reply_post_type_labels', array( 48 49 // Filter & return 50 return (array) apply_filters( 'bbp_get_reply_post_type_labels', array( 47 51 'name' => __( 'Replies', 'bbpress' ), 48 52 'menu_name' => __( 'Replies', 'bbpress' ), … … 75 79 */ 76 80 function bbp_get_reply_post_type_rewrite() { 77 return apply_filters( 'bbp_get_reply_post_type_rewrite', array( 81 82 // Filter & return 83 return (array) apply_filters( 'bbp_get_reply_post_type_rewrite', array( 78 84 'slug' => bbp_get_reply_slug(), 79 85 'with_front' => false … … 89 95 */ 90 96 function bbp_get_reply_post_type_supports() { 91 return apply_filters( 'bbp_get_reply_post_type_supports', array( 97 98 // Filter & return 99 return (array) apply_filters( 'bbp_get_reply_post_type_supports', array( 92 100 'title', 93 101 'editor', … … 283 291 } 284 292 285 // Return object293 // Filter & return 286 294 return apply_filters( 'bbp_has_replies', $bbp->reply_query->have_posts(), $bbp->reply_query ); 287 295 } … … 379 387 } 380 388 389 // Filter & return 381 390 return (int) apply_filters( 'bbp_get_reply_id', $bbp_reply_id, $reply_id ); 382 391 } … … 422 431 } 423 432 433 // Filter & return 424 434 return apply_filters( 'bbp_get_reply', $reply, $output, $filter ); 425 435 } … … 451 461 $reply_id = bbp_get_reply_id( $reply_id ); 452 462 463 // Filter & return 453 464 return apply_filters( 'bbp_get_reply_permalink', get_permalink( $reply_id ), $reply_id ); 454 465 } … … 524 535 } 525 536 537 // Filter & return 526 538 return apply_filters( 'bbp_get_reply_url', $url, $reply_id, $redirect_to ); 527 539 } … … 555 567 $title = get_the_title( $reply_id ); 556 568 569 // Filter & return 557 570 return apply_filters( 'bbp_get_reply_title', $title, $reply_id ); 558 571 } … … 582 595 $reply_title = sprintf( __( 'Reply To: %s', 'bbpress' ), $topic_title ); 583 596 597 // Filter & return 584 598 return apply_filters( 'bbp_get_reply_title_fallback', $reply_title, $post_id, $topic_title ); 585 599 } … … 620 634 $content = get_post_field( 'post_content', $reply_id ); 621 635 636 // Filter & return 622 637 return apply_filters( 'bbp_get_reply_content', $content, $reply_id ); 623 638 } … … 673 688 } 674 689 690 // Filter & return 675 691 return apply_filters( 'bbp_get_reply_excerpt', $excerpt, $reply_id, $length ); 676 692 } … … 719 735 } 720 736 737 // Filter & return 721 738 return apply_filters( 'bbp_get_reply_post_date', $result, $reply_id, $humanize, $gmt, $date, $time ); 722 739 } … … 744 761 $reply_id = bbp_get_reply_id( $reply_id ); 745 762 763 // Filter & return 746 764 return apply_filters( 'bbp_reply_append_revisions', $content . bbp_get_reply_revision_log( $reply_id ), $content, $reply_id ); 747 765 } … … 827 845 $r .= "\n" . '</ul>' . "\n\n"; 828 846 847 // Filter & return 829 848 return apply_filters( 'bbp_get_reply_revision_log', $r, $reply_id ); 830 849 } … … 846 865 $revision_log = empty( $revision_log ) ? array() : $revision_log; 847 866 867 // Filter & return 848 868 return apply_filters( 'bbp_get_reply_raw_revision_log', $revision_log, $reply_id ); 849 869 } … … 865 885 $revisions = wp_get_post_revisions( $reply_id, array( 'order' => 'ASC' ) ); 866 886 887 // Filter & return 867 888 return apply_filters( 'bbp_get_reply_revisions', $revisions, $reply_id ); 868 889 } … … 914 935 function bbp_get_reply_status( $reply_id = 0 ) { 915 936 $reply_id = bbp_get_reply_id( $reply_id ); 937 938 // Filter & return 916 939 return apply_filters( 'bbp_get_reply_status', get_post_status( $reply_id ), $reply_id ); 917 940 } … … 932 955 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 933 956 957 // Filter & return 934 958 return (bool) apply_filters( 'bbp_is_reply_published', (bool) $reply_status, $reply_id ); 935 959 } … … 950 974 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 951 975 976 // Filter & return 952 977 return (bool) apply_filters( 'bbp_is_reply_spam', (bool) $reply_status, $reply_id ); 953 978 } … … 968 993 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 969 994 995 // Filter & return 970 996 return (bool) apply_filters( 'bbp_is_reply_trash', (bool) $reply_status, $reply_id ); 971 997 } … … 987 1013 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 988 1014 1015 // Filter & return 989 1016 return (bool) apply_filters( 'bbp_is_reply_pending', (bool) $reply_status, $reply_id ); 990 1017 } … … 1006 1033 $reply_status = bbp_get_reply_status( $reply_id ) === $status; 1007 1034 1035 // Filter & return 1008 1036 return (bool) apply_filters( 'bbp_is_reply_private', (bool) $reply_status, $reply_id ); 1009 1037 } … … 1034 1062 } 1035 1063 1064 // Filter & return 1036 1065 return (bool) apply_filters( 'bbp_is_reply_anonymous', $retval, $reply_id ); 1037 1066 } … … 1080 1109 } 1081 1110 1111 // Filter & return 1082 1112 return apply_filters( 'bbp_get_reply_author', $author, $reply_id ); 1083 1113 } … … 1110 1140 $author_id = get_post_field( 'post_author', $reply_id ); 1111 1141 1142 // Filter & return 1112 1143 return (int) apply_filters( 'bbp_get_reply_author_id', $author_id, $reply_id ); 1113 1144 } … … 1172 1203 } 1173 1204 1205 // Filter & return 1174 1206 return apply_filters( 'bbp_get_reply_author_display_name', $author_name, $reply_id ); 1175 1207 } … … 1217 1249 } 1218 1250 1251 // Filter & return 1219 1252 return apply_filters( 'bbp_get_reply_author_avatar', $author_avatar, $reply_id, $size ); 1220 1253 } … … 1327 1360 } 1328 1361 1362 // Filter & return 1329 1363 return apply_filters( 'bbp_get_reply_author_link', $author_link, $r ); 1330 1364 } … … 1371 1405 } 1372 1406 1407 // Filter & return 1373 1408 return apply_filters( 'bbp_get_reply_author_url', $author_url, $reply_id ); 1374 1409 } … … 1424 1459 } 1425 1460 1461 // Filter & return 1426 1462 return apply_filters( 'bbp_get_reply_author_email', $author_email, $reply_id ); 1427 1463 } … … 1474 1510 } 1475 1511 1512 // Filter & return 1476 1513 return apply_filters( 'bbp_get_reply_author_role', $author_role, $r ); 1477 1514 } … … 1505 1542 $topic_id = bbp_get_reply_topic_id( $reply_id ); 1506 1543 1544 // Filter & return 1507 1545 return apply_filters( 'bbp_get_reply_topic_title', bbp_get_topic_title( $topic_id ), $reply_id ); 1508 1546 } … … 1546 1584 } 1547 1585 1586 // Filter & return 1548 1587 return (int) apply_filters( 'bbp_get_reply_topic_id', $topic_id, $reply_id ); 1549 1588 } … … 1586 1625 } 1587 1626 1627 // Filter & return 1588 1628 return (int) apply_filters( 'bbp_get_reply_forum_id', $forum_id, $reply_id ); 1589 1629 } … … 1664 1704 } 1665 1705 1706 // Filter & return 1666 1707 return (int) apply_filters( 'bbp_get_reply_to', $reply_to, $reply_id ); 1667 1708 } … … 1743 1784 $retval = $r['link_before'] . '<a role="button" href="' . esc_url( $r['uri'] ) . '" class="bbp-reply-to-link"' . $onclick . '>' . $r['reply_text'] . '</a>' . $r['link_after']; 1744 1785 1786 // Filter & return 1745 1787 return apply_filters( 'bbp_get_reply_to_link', $retval, $r, $args ); 1746 1788 } … … 1788 1830 $retval = sprintf( '<a href="%1$s" id="bbp-cancel-reply-to-link"%2$s>%3$s</a>', esc_url( $link ), $style, esc_html( $text ) ); 1789 1831 1832 // Filter & return 1790 1833 return apply_filters( 'bbp_get_cancel_reply_to_link', $retval, $link, $text ); 1791 1834 } … … 1856 1899 } 1857 1900 1901 // Filter & return 1858 1902 return (int) apply_filters( 'bbp_get_reply_position', $reply_position, $reply_id, $topic_id ); 1859 1903 } … … 1958 2002 $retval = $r['before'] . $links . $r['after']; 1959 2003 2004 // Filter & return 1960 2005 return apply_filters( 'bbp_get_reply_admin_links', $retval, $r, $args ); 1961 2006 } … … 2024 2069 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-reply-edit-link">' . $r['edit_text'] . '</a>' . $r['link_after']; 2025 2070 2071 // Filter & return 2026 2072 return apply_filters( 'bbp_get_reply_edit_link', $retval, $r, $args ); 2027 2073 } … … 2079 2125 $url = bbp_add_view_all( $url ); 2080 2126 2127 // Filter & return 2081 2128 return apply_filters( 'bbp_get_reply_edit_url', $url, $reply_id ); 2082 2129 } … … 2162 2209 $retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after']; 2163 2210 2211 // Filter & return 2164 2212 return apply_filters( 'bbp_get_reply_trash_link', $retval, $r, $args ); 2165 2213 } … … 2225 2273 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-reply-spam-link">' . $display . '</a>' . $r['link_after']; 2226 2274 2275 // Filter & return 2227 2276 return apply_filters( 'bbp_get_reply_spam_link', $retval, $r, $args ); 2228 2277 } … … 2295 2344 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-reply-move-link">' . $r['split_text'] . '</a>' . $r['link_after']; 2296 2345 2346 // Filter & return 2297 2347 return apply_filters( 'bbp_get_reply_move_link', $retval, $r, $args ); 2298 2348 } … … 2365 2415 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-topic-split-link">' . $r['split_text'] . '</a>' . $r['link_after']; 2366 2416 2417 // Filter & return 2367 2418 return apply_filters( 'bbp_get_topic_split_link', $retval, $r, $args ); 2368 2419 } … … 2428 2479 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-reply-approve-link">' . $display . '</a>' . $r['link_after']; 2429 2480 2481 // Filter & return 2430 2482 return apply_filters( 'bbp_get_reply_approve_link', $retval, $r, $args ); 2431 2483 } … … 2547 2599 } 2548 2600 2549 // Filter andreturn2601 // Filter & return 2550 2602 return apply_filters( 'bbp_get_topic_pagination_count', $retstr ); 2551 2603 } … … 2577 2629 } 2578 2630 2631 // Filter & return 2579 2632 return apply_filters( 'bbp_get_topic_pagination_links', $bbp->reply_query->pagination_links ); 2580 2633 } … … 2616 2669 } 2617 2670 2671 // Filter & return 2618 2672 return apply_filters( 'bbp_get_form_reply_content', $reply_content ); 2619 2673 } … … 2654 2708 } 2655 2709 2710 // Filter & return 2656 2711 return apply_filters( 'bbp_get_form_reply_to', $reply_to ); 2657 2712 } … … 2743 2798 ) ); 2744 2799 2745 // Filter andreturn2800 // Filter & return 2746 2801 return apply_filters( 'bbp_get_reply_to_dropdown', $retval, $reply_id, $reply_to, $topic_id ); 2747 2802 } … … 2780 2835 $checked = checked( $reply_revision, true, false ); 2781 2836 2837 // Filter & return 2782 2838 return apply_filters( 'bbp_get_form_reply_log_edit', $checked, $reply_revision ); 2783 2839 } … … 2813 2869 } 2814 2870 2871 // Filter & return 2815 2872 return apply_filters( 'bbp_get_form_reply_edit_reason', $reply_edit_reason ); 2816 2873 } … … 2893 2950 <?php 2894 2951 2895 // Return the results2952 // Filter & return 2896 2953 return apply_filters( 'bbp_get_form_reply_status_dropdown', ob_get_clean(), $r ); 2897 2954 }
Note: See TracChangeset
for help on using the changeset viewer.