Changeset 6438 for trunk/src/includes/topics/functions.php
- Timestamp:
- 05/27/2017 05:04:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r6415 r6438 81 81 do_action( 'bbp_insert_topic', (int) $topic_id, (int) $topic_meta['forum_id'] ); 82 82 83 // Return new topic ID83 // Return topic_id 84 84 return $topic_id; 85 85 } … … 2019 2019 */ 2020 2020 function bbp_get_topic_statuses( $topic_id = 0 ) { 2021 return apply_filters( 'bbp_get_topic_statuses', array( 2021 2022 // Filter & return 2023 return (array) apply_filters( 'bbp_get_topic_statuses', array( 2022 2024 bbp_get_public_status_id() => _x( 'Open', 'Open the topic', 'bbpress' ), 2023 2025 bbp_get_closed_status_id() => _x( 'Closed', 'Close the topic', 'bbpress' ), … … 2038 2040 */ 2039 2041 function bbp_get_topic_types( $topic_id = 0 ) { 2040 return apply_filters( 'bbp_get_topic_types', array( 2042 2043 // Filter & return 2044 return (array) apply_filters( 'bbp_get_topic_types', array( 2041 2045 'unstick' => _x( 'Normal', 'Unstick a topic', 'bbpress' ), 2042 2046 'stick' => _x( 'Sticky', 'Make topic sticky', 'bbpress' ), … … 2055 2059 */ 2056 2060 function bbp_get_topic_toggles( $topic_id = 0 ) { 2057 return apply_filters( 'bbp_get_toggle_topic_actions', array( 2061 2062 // Filter & return 2063 return (array) apply_filters( 'bbp_get_toggle_topic_actions', array( 2058 2064 'bbp_toggle_topic_close', 2059 2065 'bbp_toggle_topic_stick', … … 2089 2095 : wp_parse_id_list( $stickies ); 2090 2096 2091 // Filter andreturn2097 // Filter & return 2092 2098 return (array) apply_filters( 'bbp_get_stickies', $stickies, $forum_id ); 2093 2099 } … … 2112 2118 : wp_parse_id_list( $stickies ); 2113 2119 2114 // Filter andreturn2120 // Filter & return 2115 2121 return (array) apply_filters( 'bbp_get_super_stickies', $stickies ); 2116 2122 } … … 2473 2479 update_post_meta( $topic_id, '_bbp_reply_count', $new_count ); 2474 2480 2481 // Filter & return 2475 2482 return (int) apply_filters( 'bbp_bump_topic_reply_count', $new_count, $topic_id, $difference ); 2476 2483 } … … 2572 2579 update_post_meta( $topic_id, '_bbp_reply_count_hidden', $new_count ); 2573 2580 2581 // Filter & return 2574 2582 return (int) apply_filters( 'bbp_bump_topic_reply_count_hidden', $new_count, $topic_id, $difference ); 2575 2583 } … … 2695 2703 update_post_meta( $topic_id, '_bbp_forum_id', $forum_id ); 2696 2704 2705 // Filter & return 2697 2706 return (int) apply_filters( 'bbp_update_topic_forum_id', $forum_id, $topic_id ); 2698 2707 } … … 2714 2723 update_post_meta( $topic_id, '_bbp_topic_id', $topic_id ); 2715 2724 2725 // Filter & return 2716 2726 return apply_filters( 'bbp_update_topic_topic_id', $topic_id ); 2717 2727 } … … 2752 2762 update_post_meta( $topic_id, '_bbp_reply_count', $reply_count ); 2753 2763 2764 // Filter & return 2754 2765 return (int) apply_filters( 'bbp_update_topic_reply_count', $reply_count, $topic_id ); 2755 2766 } … … 2799 2810 update_post_meta( $topic_id, '_bbp_reply_count_hidden', $reply_count ); 2800 2811 2812 // Filter & return 2801 2813 return (int) apply_filters( 'bbp_update_topic_reply_count_hidden', $reply_count, $topic_id ); 2802 2814 } … … 2845 2857 } 2846 2858 2859 // Filter & return 2847 2860 return (int) apply_filters( 'bbp_update_topic_last_active_id', $active_id, $topic_id ); 2848 2861 } … … 2883 2896 } 2884 2897 2898 // Filter & return 2885 2899 return apply_filters( 'bbp_update_topic_last_active_time', $new_time, $topic_id ); 2886 2900 } … … 2931 2945 } 2932 2946 2947 // Filter & return 2933 2948 return (int) apply_filters( 'bbp_update_topic_last_reply_id', $reply_id, $topic_id ); 2934 2949 } … … 2989 3004 update_post_meta( $topic_id, '_bbp_voice_count', $count ); 2990 3005 3006 // Filter & return 2991 3007 return (int) apply_filters( 'bbp_update_topic_voice_count', $count, $topic_id ); 2992 3008 } … … 3029 3045 update_post_meta( $topic_id, '_bbp_anonymous_reply_count', $replies ); 3030 3046 3047 // Filter & return 3031 3048 return (int) apply_filters( 'bbp_update_topic_anonymous_reply_count', $replies, $topic_id ); 3032 3049 } … … 3942 3959 } 3943 3960 3944 // Filter andreturn3961 // Filter & return 3945 3962 return (int) apply_filters( 'bbp_get_topics_per_page', $retval, $default ); 3946 3963 } … … 3966 3983 } 3967 3984 3968 // Filter andreturn3985 // Filter & return 3969 3986 return (int) apply_filters( 'bbp_get_topics_per_rss_page', $retval, $default ); 3970 3987 } … … 3986 4003 $topic_tags = array_filter( $terms ); 3987 4004 4005 // Filter & return 3988 4006 return apply_filters( 'bbp_get_topic_tags', $topic_tags, $topic_id ); 3989 4007 } … … 4002 4020 $topic_tags = bbp_get_topic_tags( $topic_id ); 4003 4021 $pluck = wp_list_pluck( $topic_tags, 'name' ); 4004 $terms = ! empty( $pluck ) ? implode( $sep, $pluck ) : ''; 4005 4022 $terms = ! empty( $pluck ) 4023 ? implode( $sep, $pluck ) 4024 : ''; 4025 4026 // Filter & return 4006 4027 return apply_filters( 'bbp_get_topic_tag_names', $terms, $topic_id, $sep ); 4007 4028 }
Note: See TracChangeset
for help on using the changeset viewer.