Changeset 7380 for trunk/src/includes/replies/functions.php
- Timestamp:
- 12/05/2025 02:27:53 AM (6 months ago)
- File:
-
- 1 edited
-
trunk/src/includes/replies/functions.php (modified) (38 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/functions.php
r7379 r7380 19 19 * @since 2.0.0 bbPress (r3349) 20 20 * 21 * @param array $reply_data Forum post data 22 * @param array $reply_meta Forum meta data 21 * @param array $reply_data Forum post data. 22 * @param array $reply_meta Forum meta data. 23 * 24 * @return int|false Reply ID on success, false on failure. 23 25 */ 24 26 function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) { … … 103 105 * @param int $topic_id The topic id. 104 106 * @param int $forum_id The forum id. 105 *106 * @return void107 107 */ 108 108 function bbp_insert_reply_update_counts( $reply_id = 0, $topic_id = 0, $forum_id = 0 ) { … … 123 123 124 124 /** 125 * Handles the front end reply submission 125 * Handles the front end reply submission. 126 126 * 127 127 * @since 2.0.0 bbPress (r2574) … … 129 129 * @param string $action The requested action to compare this function to 130 130 * id, anonymous data, reply author, edit (false), and 131 * the reply to id 131 * the reply to id. 132 132 */ 133 133 function bbp_new_reply_handler( $action = '' ) { … … 528 528 529 529 /** 530 * Handles the front end edit reply submission 530 * Handles the front end edit reply submission. 531 531 * 532 532 * @param string $action The requested action to compare this function to 533 * id, anonymous data, reply author, bool true (for edit),534 * and the reply to id533 * id, anonymous data, reply author, bool true (for edit), 534 * and the reply to id. 535 535 */ 536 536 function bbp_edit_reply_handler( $action = '' ) { … … 847 847 848 848 /** 849 * Handle all the extra meta stuff from posting a new reply or editing a reply 850 * 851 * @param int $reply_id Optional. Reply id 852 * @param int $topic_id Optional. Topic id 853 * @param int $forum_id Optional. Forum id 849 * Handle all the extra meta stuff from posting a new reply or editing a reply. 850 * 851 * @param int $reply_id Optional. Reply id. 852 * @param int $topic_id Optional. Topic id. 853 * @param int $forum_id Optional. Forum id. 854 854 * @param array $anonymous_data Optional - if it's an anonymous post. Do not 855 855 * supply if supplying $author_id. Should be 856 * sanitized (see {@link bbp_filter_anonymous_post_data()} 857 * @param int $author_id Author id 856 * sanitized (see {@link bbp_filter_anonymous_post_data()}. 857 * @param int $author_id Author id. 858 858 * @param bool $is_edit Optional. Is the post being edited? Defaults to false. 859 * @param int $reply_to Optional. Reply to id 859 * @param int $reply_to Optional. Reply to id. 860 860 */ 861 861 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 ) { … … 953 953 954 954 /** 955 * Walk up the ancestor tree from the current reply, and update all the counts 955 * Walk up the ancestor tree from the current reply, and update all the counts. 956 956 * 957 957 * @since 2.0.0 bbPress (r2884) 958 958 * 959 * @param int $reply_id Optional. Reply id 960 * @param string $last_active_time Optional. Last active time 961 * @param int $forum_id Optional. Forum id 962 * @param int $topic_id Optional. Topic id 959 * @param int $reply_id Optional. Reply id. 960 * @param string $last_active_time Optional. Last active time. 961 * @param int $forum_id Optional. Forum id. 962 * @param int $topic_id Optional. Topic id. 963 963 * @param bool $refresh If set to true, unsets all the previous parameters. 964 * Defaults to true 964 * Defaults to true. 965 965 */ 966 966 function bbp_update_reply_walker( $reply_id, $last_active_time = '', $forum_id = 0, $topic_id = 0, $refresh = true ) { … … 1063 1063 1064 1064 /** 1065 * Update the reply with its forum id it is in 1065 * Update the reply with its forum id it is in. 1066 1066 * 1067 1067 * @since 2.0.0 bbPress (r2855) 1068 1068 * 1069 * @param int $reply_id Optional. Reply id to update 1070 * @param int $forum_id Optional. Forum id 1071 * @return bool The forum id of the reply 1069 * @param int $reply_id Optional. Reply id to update. 1070 * @param int $forum_id Optional. Forum id. 1071 * @return bool The forum id of the reply. 1072 1072 */ 1073 1073 function bbp_update_reply_forum_id( $reply_id = 0, $forum_id = 0 ) { … … 1106 1106 1107 1107 /** 1108 * Update the reply with its topic id it is in 1108 * Update the reply with its topic id it is in. 1109 1109 * 1110 1110 * @since 2.0.0 bbPress (r2855) 1111 1111 * 1112 * @param int $reply_id Optional. Reply id to update 1113 * @param int $topic_id Optional. Topic id 1114 * @return bool The topic id of the reply 1112 * @param int $reply_id Optional. Reply id to update. 1113 * @param int $topic_id Optional. Topic id. 1114 * @return bool The topic id of the reply. 1115 1115 */ 1116 1116 function bbp_update_reply_topic_id( $reply_id = 0, $topic_id = 0 ) { … … 1149 1149 1150 1150 /* 1151 * Update the meta data with its parent reply-to id, of a reply 1151 * Update the meta data with its parent reply-to id, of a reply. 1152 1152 * 1153 1153 * @since 2.4.0 bbPress (r4944) 1154 1154 * 1155 * @param int $reply_id Reply id to update 1156 * @param int $reply_to Optional. Reply to id 1157 * @return bool The parent reply id of the reply 1155 * @param int $reply_id Reply id to update. 1156 * @param int $reply_to Optional. Reply to id. 1157 * @return bool The parent reply id of the reply. 1158 1158 */ 1159 1159 function bbp_update_reply_to( $reply_id = 0, $reply_to = 0 ) { … … 1181 1181 1182 1182 /** 1183 * Get all ancestors to a reply 1183 * Get all ancestors to a reply. 1184 1184 * 1185 1185 * Because settings can be changed, this function does not care if hierarchical … … 1232 1232 1233 1233 /** 1234 * Update the revision log of the reply 1234 * Update the revision log of the reply. 1235 1235 * 1236 1236 * @since 2.0.0 bbPress (r2782) … … 1241 1241 * - reason: Reason for editing 1242 1242 * - revision_id: Revision id 1243 * @return mixed False on failure, true on success 1243 * @return mixed False on failure, true on success. 1244 1244 */ 1245 1245 function bbp_update_reply_revision_log( $args = array() ) { … … 1278 1278 1279 1279 /** 1280 * Move reply handler 1281 * 1282 * Handles the front end move reply submission 1280 * Move reply handler. 1281 * 1282 * Handles the front end move reply submission. 1283 1283 * 1284 1284 * @since 2.3.0 bbPress (r4521) 1285 1285 * 1286 * @param string $action The requested action to compare this function to 1286 * @param string $action The requested action to compare this function to. 1287 1287 */ 1288 1288 function bbp_move_reply_handler( $action = '' ) { … … 1522 1522 1523 1523 /** 1524 * Fix counts on reply move 1524 * Fix counts on reply move. 1525 1525 * 1526 1526 * When a reply is moved, update the counts of source and destination topic … … 1529 1529 * @since 2.3.0 bbPress (r4521) 1530 1530 * 1531 * @param int $move_reply_id Move reply id 1532 * @param int $source_topic_id Source topic id 1533 * @param int $destination_topic_id Destination topic id 1531 * @param int $move_reply_id Move reply id. 1532 * @param int $source_topic_id Source topic id. 1533 * @param int $destination_topic_id Destination topic id. 1534 1534 */ 1535 1535 function bbp_move_reply_count( $move_reply_id, $source_topic_id, $destination_topic_id ) { … … 1560 1560 /** 1561 1561 * Handles the front end spamming/unspamming and trashing/untrashing/deleting of 1562 * replies 1562 * replies. 1563 1563 * 1564 1564 * @since 2.0.0 bbPress (r2740) 1565 1565 * 1566 * @param string $action The requested action to compare this function to 1566 * @param string $action The requested action to compare this function to. 1567 1567 */ 1568 1568 function bbp_toggle_reply_handler( $action = '' ) { … … 1629 1629 1630 1630 /** 1631 * Do the actual reply toggling 1631 * Do the actual reply toggling. 1632 1632 * 1633 1633 * This function is used by `bbp_toggle_reply_handler()` to do the actual heavy … … 1736 1736 1737 1737 /** 1738 * Return an associative array of available reply statuses 1738 * Return an associative array of available reply statuses. 1739 1739 * 1740 1740 * @since 2.6.0 bbPress (r5399) 1741 1741 * 1742 * @param int $reply_id Optional. Reply id.1742 * @param int $reply_id Optional. Reply id. 1743 1743 * 1744 1744 * @return array … … 1760 1760 1761 1761 /** 1762 * Return array of available reply toggle actions 1762 * Return array of available reply toggle actions. 1763 1763 * 1764 1764 * @since 2.6.0 bbPress (r6133) 1765 1765 * 1766 * @param int $reply_id Optional. Reply id.1766 * @param int $reply_id Optional. Reply id. 1767 1767 * 1768 1768 * @return array … … 1819 1819 1820 1820 /** 1821 * Marks a reply as spam 1821 * Marks a reply as spam. 1822 1822 * 1823 1823 * @since 2.0.0 bbPress (r2740) 1824 1824 * 1825 * @param int $reply_id Reply id 1826 * @return mixed False or {@link WP_Error} on failure, reply id on success 1825 * @param int $reply_id Reply id. 1826 * @return mixed False or {@link WP_Error} on failure, reply id on success. 1827 1827 */ 1828 1828 function bbp_spam_reply( $reply_id = 0 ) { … … 1862 1862 1863 1863 /** 1864 * Unspams a reply 1864 * Unspams a reply. 1865 1865 * 1866 1866 * @since 2.0.0 bbPress (r2740) 1867 1867 * 1868 * @param int $reply_id Reply id 1869 * @return mixed False or {@link WP_Error} on failure, reply id on success 1868 * @param int $reply_id Reply id. 1869 * @return mixed False or {@link WP_Error} on failure, reply id on success. 1870 1870 */ 1871 1871 function bbp_unspam_reply( $reply_id = 0 ) { … … 1910 1910 1911 1911 /** 1912 * Approves a reply 1912 * Approves a reply. 1913 1913 * 1914 1914 * @since 2.6.0 bbPress (r5506) 1915 1915 * 1916 * @param int $reply_id Reply id 1917 * @return mixed False or {@link WP_Error} on failure, reply id on success 1916 * @param int $reply_id Reply id. 1917 * @return mixed False or {@link WP_Error} on failure, reply id on success. 1918 1918 */ 1919 1919 function bbp_approve_reply( $reply_id = 0 ) { … … 1956 1956 1957 1957 /** 1958 * Unapproves a reply 1958 * Unapproves a reply. 1959 1959 * 1960 1960 * @since 2.6.0 bbPress (r5506) 1961 1961 * 1962 * @param int $reply_id Reply id 1963 * @return mixed False or {@link WP_Error} on failure, reply id on success 1962 * @param int $reply_id Reply id. 1963 * @return mixed False or {@link WP_Error} on failure, reply id on success. 1964 1964 */ 1965 1965 function bbp_unapprove_reply( $reply_id = 0 ) { … … 2001 2001 2002 2002 /** 2003 * Called before deleting a reply 2003 * Called before deleting a reply. 2004 * 2005 * @since 2.0.0 bbPress (r2895) 2004 2006 */ 2005 2007 function bbp_delete_reply( $reply_id = 0 ) { … … 2014 2016 2015 2017 /** 2016 * Called before trashing a reply 2018 * Called before trashing a reply. 2019 * 2020 * @since 2.0.0 bbPress (r2895) 2017 2021 */ 2018 2022 function bbp_trash_reply( $reply_id = 0 ) { … … 2027 2031 2028 2032 /** 2029 * Called before untrashing (restoring) a reply 2033 * Called before untrashing (restoring) a reply. 2034 * 2035 * @since 2.0.0 bbPress (r2895) 2030 2036 */ 2031 2037 function bbp_untrash_reply( $reply_id = 0 ) { … … 2042 2048 2043 2049 /** 2044 * Called after deleting a reply 2050 * Called after deleting a reply. 2045 2051 * 2046 2052 * @since 2.0.0 bbPress (r2993) … … 2057 2063 2058 2064 /** 2059 * Called after trashing a reply 2065 * Called after trashing a reply. 2060 2066 * 2061 2067 * @since 2.0.0 bbPress (r2993) … … 2072 2078 2073 2079 /** 2074 * Called after untrashing (restoring) a reply 2080 * Called after untrashing (restoring) a reply. 2075 2081 * 2076 2082 * @since 2.0.0 bbPress (r2993) … … 2089 2095 2090 2096 /** 2091 * Return the replies per page setting 2097 * Return the replies per page setting. 2092 2098 * 2093 2099 * @since 2.0.0 bbPress (r3540) 2094 2100 * 2095 * @param int $default Default replies per page (15) 2101 * @param int $default Default replies per page (15). 2096 2102 * @return int 2097 2103 */ … … 2111 2117 2112 2118 /** 2113 * Return the replies per RSS page setting 2119 * Return the replies per RSS page setting. 2114 2120 * 2115 2121 * @since 2.0.0 bbPress (r3540) 2116 2122 * 2117 * @param int $default Default replies per page (25) 2123 * @param int $default Default replies per page (25). 2118 2124 * @return int 2119 2125 */ … … 2135 2141 2136 2142 /** 2137 * Check if auto embeds are enabled and hook them in if so2143 * Check if auto-embeds are enabled and hook them in if so. 2138 2144 * 2139 2145 * @since 2.1.0 bbPress (r3752) … … 2152 2158 2153 2159 /** 2154 * Used by bbp_has_replies() to add the lead topic post to the posts loop 2160 * Used by bbp_has_replies() to add the lead topic post to the posts loop. 2155 2161 * 2156 2162 * This function filters the 'post_where' of the WP_Query, and changes the query … … 2355 2361 2356 2362 /** 2357 * Redirect if unauthorized user is attempting to edit a reply 2363 * Redirect if unauthorized user is attempting to edit a reply. 2358 2364 * 2359 2365 * @since 2.1.0 bbPress (r3605) … … 2481 2487 * 2482 2488 * @since 2.4.0 bbPress (r4944) 2483 * @since 2.6.0 bbPress (r6245) Always false on user profile reply pages 2484 * 2485 * @param bool $default Optional. Default value true 2489 * @since 2.6.0 bbPress (r6245) Always false on user profile reply pages. 2490 * 2491 * @param bool $default Optional. Default value true. 2486 2492 * 2487 2493 * @return bool Are replies threaded? … … 2504 2510 2505 2511 /** 2506 * List threaded replies 2512 * List threaded replies. 2507 2513 * 2508 2514 * @since 2.4.0 bbPress (r4944) … … 2562 2568 2563 2569 /** 2564 * Validate a `reply_to` field for hierarchical replies 2570 * Validate a `reply_to` field for hierarchical replies. 2565 2571 * 2566 2572 * Checks for 2 scenarios:
Note: See TracChangeset
for help on using the changeset viewer.