Changeset 6573 for trunk/src/includes/replies/functions.php
- Timestamp:
- 06/16/2017 09:20:52 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/functions.php
r6534 r6573 18 18 * 19 19 * @since 2.0.0 bbPress (r3349) 20 *21 * @uses bbp_parse_args()22 * @uses bbp_get_reply_post_type()23 * @uses wp_insert_post()24 * @uses update_post_meta()25 20 * 26 21 * @param array $reply_data Forum post data … … 97 92 * @param int $forum_id The forum id. 98 93 * 99 * @uses bbp_get_reply_status() To get the reply status100 * @uses bbp_get_public_status_id() To get the public status id101 * @uses bbp_increase_topic_reply_count() To bump the topics reply count by 1102 * @uses bbp_increase_forum_reply_count() To bump the forums reply count by 1103 * @uses bbp_increase_topic_reply_count_hidden() To bump the topics hidden reply104 * count by 1105 *106 94 * @return void 107 95 */ … … 127 115 * 128 116 * @param string $action The requested action to compare this function to 129 * @uses bbp_add_error() To add an error message130 * @uses bbp_verify_nonce_request() To verify the nonce and check the request131 * @uses bbp_is_anonymous() To check if an anonymous post is being made132 * @uses current_user_can() To check if the current user can publish replies133 * @uses bbp_get_current_user_id() To get the current user id134 * @uses bbp_filter_anonymous_post_data() To filter anonymous data135 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}136 * @uses remove_filter() To remove kses filters if needed137 * @uses bbp_check_for_flood() To check for flooding138 * @uses bbp_check_for_duplicate() To check for duplicates139 * @uses apply_filters() Calls 'bbp_new_reply_pre_title' with the title140 * @uses apply_filters() Calls 'bbp_new_reply_pre_content' with the content141 * @uses bbp_get_reply_post_type() To get the reply post type142 * @uses wp_set_post_terms() To set the topic tags143 * @uses wp_insert_post() To insert the reply144 * @uses do_action() Calls 'bbp_new_reply' with the reply id, topic id, forum145 117 * id, anonymous data, reply author, edit (false), and 146 118 * the reply to id 147 * @uses bbp_get_reply_url() To get the paginated url to the reply148 * @uses bbp_redirect() To redirect to the reply url149 * @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error150 * message151 119 */ 152 120 function bbp_new_reply_handler( $action = '' ) { … … 506 474 * 507 475 * @param string $action The requested action to compare this function to 508 * @uses bbp_add_error() To add an error message509 * @uses bbp_get_reply() To get the reply510 * @uses bbp_verify_nonce_request() To verify the nonce and check the request511 * @uses bbp_is_reply_anonymous() To check if the reply was by an anonymous user512 * @uses current_user_can() To check if the current user can edit that reply513 * @uses bbp_filter_anonymous_post_data() To filter anonymous data514 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}515 * @uses remove_filter() To remove kses filters if needed516 * @uses apply_filters() Calls 'bbp_edit_reply_pre_title' with the title and id517 * @uses apply_filters() Calls 'bbp_edit_reply_pre_content' with the content id518 * @uses wp_set_post_terms() To set the topic tags519 * @uses bbp_has_errors() To get the {@link WP_Error} errors520 * @uses wp_save_post_revision() To save a reply revision521 * @uses bbp_update_reply_revision_log() To update the reply revision log522 * @uses wp_update_post() To update the reply523 * @uses bbp_get_reply_topic_id() To get the reply topic id524 * @uses bbp_get_topic_forum_id() To get the topic forum id525 * @uses bbp_get_reply_to() To get the reply to id526 * @uses do_action() Calls 'bbp_edit_reply' with the reply id, topic id, forum527 476 * id, anonymous data, reply author, bool true (for edit), 528 477 * and the reply to id 529 * @uses bbp_get_reply_url() To get the paginated url to the reply530 * @uses bbp_redirect() To redirect to the reply url531 * @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error532 * message533 478 */ 534 479 function bbp_edit_reply_handler( $action = '' ) { … … 821 766 * @param bool $is_edit Optional. Is the post being edited? Defaults to false. 822 767 * @param int $reply_to Optional. Reply to id 823 * @uses bbp_get_reply_id() To get the reply id824 * @uses bbp_get_topic_id() To get the topic id825 * @uses bbp_get_forum_id() To get the forum id826 * @uses bbp_get_current_user_id() To get the current user id827 * @uses bbp_get_reply_topic_id() To get the reply topic id828 * @uses bbp_get_topic_forum_id() To get the topic forum id829 * @uses update_post_meta() To update the reply metas830 * @uses set_transient() To update the flood check transient for the ip831 * @uses bbp_update_user_last_posted() To update the users last posted time832 * @uses bbp_is_subscriptions_active() To check if the subscriptions feature is833 * activated or not834 * @uses bbp_is_user_subscribed() To check if the user is subscribed835 * @uses bbp_remove_user_subscription() To remove the user's subscription836 * @uses bbp_add_user_subscription() To add the user's subscription837 * @uses bbp_update_reply_forum_id() To update the reply forum id838 * @uses bbp_update_reply_topic_id() To update the reply topic id839 * @uses bbp_update_reply_to() To update the reply to id840 * @uses bbp_update_reply_walker() To update the ancestor counts of a reply841 768 */ 842 769 function bbp_update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = array(), $author_id = 0, $is_edit = false, $reply_to = 0 ) { … … 930 857 * @param bool $refresh If set to true, unsets all the previous parameters. 931 858 * Defaults to true 932 * @uses bbp_get_reply_id() To get the reply id933 * @uses bbp_get_reply_topic_id() To get the reply topic id934 * @uses bbp_get_reply_forum_id() To get the reply forum id935 * @uses get_post_ancestors() To get the ancestors of the reply936 * @uses bbp_is_reply() To check if the ancestor is a reply937 * @uses bbp_is_topic() To check if the ancestor is a topic938 * @uses bbp_update_topic_last_reply_id() To update the topic last reply id939 * @uses bbp_update_topic_last_active_id() To update the topic last active id940 * @uses bbp_get_topic_last_active_id() To get the topic last active id941 * @uses get_post_field() To get the post date of the last active id942 * @uses bbp_update_topic_last_active_time() To update the last active topic meta943 * @uses bbp_update_topic_voice_count() To update the topic voice count944 * @uses bbp_update_topic_reply_count() To update the topic reply count945 * @uses bbp_update_topic_reply_count_hidden() To update the topic hidden reply946 * count947 * @uses bbp_is_forum() To check if the ancestor is a forum948 * @uses bbp_update_forum_last_topic_id() To update the last topic id forum meta949 * @uses bbp_update_forum_last_reply_id() To update the last reply id forum meta950 * @uses bbp_update_forum_last_active_id() To update the forum last active id951 * @uses bbp_get_forum_last_active_id() To get the forum last active id952 * @uses bbp_update_forum_last_active_time() To update the forum last active time953 * @uses bbp_update_forum_reply_count() To update the forum reply count954 859 */ 955 860 function bbp_update_reply_walker( $reply_id, $last_active_time = '', $forum_id = 0, $topic_id = 0, $refresh = true ) { … … 1055 960 * @param int $reply_id Optional. Reply id to update 1056 961 * @param int $forum_id Optional. Forum id 1057 * @uses bbp_get_reply_id() To get the reply id1058 * @uses bbp_get_forum_id() To get the forum id1059 * @uses get_post_ancestors() To get the ancestors of a reply1060 * @uses get_post_field() To get the post type of the post1061 * @uses update_post_meta() To update the reply forum id meta1062 * @uses apply_filters() Calls 'bbp_update_reply_forum_id' with the forum id1063 * and reply id1064 962 * @return bool The forum id of the reply 1065 963 */ … … 1105 1003 * @param int $reply_id Optional. Reply id to update 1106 1004 * @param int $topic_id Optional. Topic id 1107 * @uses bbp_get_reply_id() To get the reply id1108 * @uses bbp_get_topic_id() To get the topic id1109 * @uses get_post_ancestors() To get the ancestors of a reply1110 * @uses get_post_field() To get the post type of the post1111 * @uses update_post_meta() To update the reply topic id meta1112 * @uses apply_filters() Calls 'bbp_update_reply_topic_id' with the topic id1113 * and reply id1114 1005 * @return bool The topic id of the reply 1115 1006 */ … … 1155 1046 * @param int $reply_id Reply id to update 1156 1047 * @param int $reply_to Optional. Reply to id 1157 * @uses bbp_get_reply_id() To get the reply id1158 * @uses update_post_meta() To update the reply to meta1159 * @uses apply_filters() Calls 'bbp_update_reply_to' with the reply id and1160 * and reply to id1161 1048 * @return bool The parent reply id of the reply 1162 1049 */ … … 1244 1131 * - reason: Reason for editing 1245 1132 * - revision_id: Revision id 1246 * @uses bbp_get_reply_id() To get the reply id1247 * @uses bbp_format_revision_reason() To format the reason1248 * @uses bbp_get_reply_raw_revision_log() To get the raw reply revision log1249 * @uses update_post_meta() To update the reply revision log meta1250 1133 * @return mixed False on failure, true on success 1251 1134 */ … … 1285 1168 * 1286 1169 * @param string $action The requested action to compare this function to 1287 * @uses bbp_add_error() To add an error message1288 * @uses bbp_get_reply() To get the reply1289 * @uses bbp_get_topic() To get the topics1290 * @uses bbp_verify_nonce_request() To verify the nonce and check the request1291 * @uses current_user_can() To check if the current user can edit the reply and topics1292 * @uses bbp_get_topic_post_type() To get the topic post type1293 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}1294 * @uses do_action() Calls 'bbp_pre_move_reply' with the from reply id, source1295 * and destination topic ids1296 * @uses bbp_get_reply_post_type() To get the reply post type1297 * @uses wp_update_post() To update the replies1298 * @uses bbp_update_reply_topic_id() To update the reply topic id1299 * @uses bbp_get_topic_forum_id() To get the topic forum id1300 * @uses bbp_update_reply_forum_id() To update the reply forum id1301 * @uses do_action() Calls 'bbp_split_topic_reply' with the reply id and1302 * destination topic id1303 * @uses bbp_update_topic_last_reply_id() To update the topic last reply id1304 * @uses bbp_update_topic_last_active_time() To update the topic last active meta1305 * @uses do_action() Calls 'bbp_post_split_topic' with the destination and1306 * source topic ids and source topic's forum id1307 * @uses bbp_get_topic_permalink() To get the topic permalink1308 * @uses bbp_redirect() To redirect to the topic link1309 1170 */ 1310 1171 function bbp_move_reply_handler( $action = '' ) { … … 1543 1404 * @param int $source_topic_id Source topic id 1544 1405 * @param int $destination_topic_id Destination topic id 1545 * @uses bbp_update_forum_topic_count() To update the forum topic counts1546 * @uses bbp_update_forum_reply_count() To update the forum reply counts1547 * @uses bbp_update_topic_reply_count() To update the topic reply counts1548 * @uses bbp_update_topic_voice_count() To update the topic voice counts1549 * @uses bbp_update_topic_reply_count_hidden() To update the topic hidden reply1550 * count1551 * @uses do_action() Calls 'bbp_move_reply_count' with the move reply id,1552 * source topic id & destination topic id1553 1406 */ 1554 1407 function bbp_move_reply_count( $move_reply_id, $source_topic_id, $destination_topic_id ) { … … 1584 1437 * 1585 1438 * @param string $action The requested action to compare this function to 1586 * @uses bbp_get_reply() To get the reply1587 * @uses current_user_can() To check if the user is capable of editing or1588 * deleting the reply1589 * @uses check_ajax_referer() To verify the nonce and check the referer1590 * @uses bbp_get_reply_post_type() To get the reply post type1591 * @uses bbp_is_reply_spam() To check if the reply is marked as spam1592 * @uses bbp_spam_reply() To make the reply as spam1593 * @uses bbp_unspam_reply() To unmark the reply as spam1594 * @uses wp_trash_post() To trash the reply1595 * @uses wp_untrash_post() To untrash the reply1596 * @uses wp_delete_post() To delete the reply1597 * @uses do_action() Calls 'bbp_toggle_reply_handler' with success, post data1598 * and action1599 * @uses bbp_get_reply_url() To get the reply url1600 * @uses bbp_redirect() To redirect to the reply1601 * @uses bbPress::errors:add() To log the error messages1602 1439 */ 1603 1440 function bbp_toggle_reply_handler( $action = '' ) { … … 1812 1649 * 1813 1650 * @param int $reply_id Reply id 1814 * @uses bbp_get_reply() To get the reply1815 * @uses do_action() Calls 'bbp_spam_reply' with the reply ID1816 * @uses add_post_meta() To add the previous status to a meta1817 * @uses wp_update_post() To insert the updated post1818 * @uses do_action() Calls 'bbp_spammed_reply' with the reply ID1819 1651 * @return mixed False or {@link WP_Error} on failure, reply id on success 1820 1652 */ … … 1860 1692 * 1861 1693 * @param int $reply_id Reply id 1862 * @uses bbp_get_reply() To get the reply1863 * @uses do_action() Calls 'bbp_unspam_reply' with the reply ID1864 * @uses get_post_meta() To get the previous status meta1865 * @uses delete_post_meta() To delete the previous status meta1866 * @uses wp_update_post() To insert the updated post1867 * @uses do_action() Calls 'bbp_unspammed_reply' with the reply ID1868 1694 * @return mixed False or {@link WP_Error} on failure, reply id on success 1869 1695 */ … … 1914 1740 * 1915 1741 * @param int $reply_id Reply id 1916 * @uses bbp_get_reply() To get the reply1917 * @uses bbp_get_pending_status_id() To get the pending status id1918 * @uses do_action() Calls 'bbp_approve_reply' with the reply id1919 * @uses bbp_get_public_status_id() To get the public status id1920 * @uses remove_action() To remove the auto save post revision action1921 * @uses wp_update_post() To update the reply with the new status1922 * @uses do_action() Calls 'bbp_approved_reply' with the reply id1923 1742 * @return mixed False or {@link WP_Error} on failure, reply id on success 1924 1743 */ … … 1961 1780 * 1962 1781 * @param int $reply_id Reply id 1963 * @uses bbp_get_reply() To get the reply1964 * @uses bbp_get_pending_status_id() To get the pending status id1965 * @uses do_action() Calls 'bbp_unapprove_reply' with the reply id1966 * @uses remove_action() To remove the auto save post revision action1967 * @uses wp_update_post() To update the reply with the new status1968 * @uses do_action() Calls 'bbp_unapproved_reply' with the reply id1969 1782 * @return mixed False or {@link WP_Error} on failure, reply id on success 1970 1783 */ … … 2005 1818 /** 2006 1819 * Called before deleting a reply 2007 *2008 * @uses bbp_get_reply_id() To get the reply id2009 * @uses bbp_is_reply() To check if the passed id is a reply2010 * @uses do_action() Calls 'bbp_delete_reply' with the reply id2011 1820 */ 2012 1821 function bbp_delete_reply( $reply_id = 0 ) { … … 2022 1831 /** 2023 1832 * Called before trashing a reply 2024 *2025 * @uses bbp_get_reply_id() To get the reply id2026 * @uses bbp_is_reply() To check if the passed id is a reply2027 * @uses do_action() Calls 'bbp_trash_reply' with the reply id2028 1833 */ 2029 1834 function bbp_trash_reply( $reply_id = 0 ) { … … 2039 1844 /** 2040 1845 * Called before untrashing (restoring) a reply 2041 *2042 * @uses bbp_get_reply_id() To get the reply id2043 * @uses bbp_is_reply() To check if the passed id is a reply2044 * @uses do_action() Calls 'bbp_unstrash_reply' with the reply id2045 1846 */ 2046 1847 function bbp_untrash_reply( $reply_id = 0 ) { … … 2060 1861 * 2061 1862 * @since 2.0.0 bbPress (r2993) 2062 *2063 * @uses bbp_get_reply_id() To get the reply id2064 * @uses bbp_is_reply() To check if the passed id is a reply2065 * @uses do_action() Calls 'bbp_deleted_reply' with the reply id2066 1863 */ 2067 1864 function bbp_deleted_reply( $reply_id = 0 ) { … … 2079 1876 * 2080 1877 * @since 2.0.0 bbPress (r2993) 2081 *2082 * @uses bbp_get_reply_id() To get the reply id2083 * @uses bbp_is_reply() To check if the passed id is a reply2084 * @uses do_action() Calls 'bbp_trashed_reply' with the reply id2085 1878 */ 2086 1879 function bbp_trashed_reply( $reply_id = 0 ) { … … 2098 1891 * 2099 1892 * @since 2.0.0 bbPress (r2993) 2100 *2101 * @uses bbp_get_reply_id() To get the reply id2102 * @uses bbp_is_reply() To check if the passed id is a reply2103 * @uses do_action() Calls 'bbp_untrashed_reply' with the reply id2104 1893 */ 2105 1894 function bbp_untrashed_reply( $reply_id = 0 ) { … … 2121 1910 * 2122 1911 * @param int $default Default replies per page (15) 2123 * @uses get_option() To get the setting2124 * @uses apply_filters() To allow the return value to be manipulated2125 1912 * @return int 2126 1913 */ … … 2145 1932 * 2146 1933 * @param int $default Default replies per page (25) 2147 * @uses get_option() To get the setting2148 * @uses apply_filters() To allow the return value to be manipulated2149 1934 * @return int 2150 1935 */ … … 2254 2039 * 2255 2040 * @since 2.0.0 bbPress (r3171) 2256 *2257 * @uses bbp_version()2258 * @uses bbp_is_single_topic()2259 * @uses bbp_user_can_view_forum()2260 * @uses bbp_get_topic_forum_id()2261 * @uses bbp_show_lead_topic()2262 * @uses bbp_topic_permalink()2263 * @uses bbp_topic_title()2264 * @uses bbp_get_topic_reply_count()2265 * @uses bbp_topic_content()2266 * @uses bbp_has_replies()2267 * @uses bbp_replies()2268 * @uses bbp_the_reply()2269 * @uses bbp_reply_url()2270 * @uses bbp_reply_title()2271 * @uses bbp_reply_content()2272 * @uses get_wp_title_rss()2273 * @uses get_bloginfo_rss()2274 * @uses get_option()2275 * @uses self_link()2276 * @uses the_author()2277 * @uses get_post_time()2278 * @uses rss_enclosure()2279 * @uses do_action()2280 * @uses apply_filters()2281 2041 * 2282 2042 * @param array $replies_query … … 2393 2153 2394 2154 /** 2395 * Redirect if una thorized user is attempting to edit a reply2155 * Redirect if unauthorized user is attempting to edit a reply 2396 2156 * 2397 2157 * @since 2.1.0 bbPress (r3605) 2398 *2399 * @uses bbp_is_reply_edit()2400 * @uses current_user_can()2401 * @uses bbp_get_topic_id()2402 * @uses bbp_redirect()2403 * @uses bbp_get_topic_permalink()2404 2158 */ 2405 2159 function bbp_check_reply_edit() { … … 2516 2270 * 2517 2271 * @param bool $default Optional. Default value true 2518 * @uses apply_filters() Calls 'bbp_thread_replies' with the calculated value and 2519 * the thread replies depth 2520 * @uses get_option() To get thread replies option 2272 * 2521 2273 * @return bool Are replies threaded? 2522 2274 */
Note: See TracChangeset
for help on using the changeset viewer.