Changeset 7235 for trunk/src/includes/common/functions.php
- Timestamp:
- 02/17/2022 08:08:28 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/functions.php
r7152 r7235 186 186 187 187 return $data; 188 } 189 190 /** 191 * Use the previous status when restoring a topic or reply. 192 * 193 * Fixes an issue since WordPress 5.6.0. See 194 * {@link https://bbpress.trac.wordpress.org/ticket/3433}. 195 * 196 * @since 2.6.10 bbPress (r7233) 197 * 198 * @param string $new_status New status to use when untrashing. Default: 'draft' 199 * @param int $post_id Post ID 200 * @param string $previous_status Previous post status from '_wp_trash_meta_status' meta key. Default: 'pending' 201 */ 202 function bbp_fix_untrash_post_status( $new_status = 'draft', $post_id = 0, $previous_status = 'pending' ) { 203 204 // Bail if not Topic or Reply 205 if ( ! bbp_is_topic( $post_id ) && ! bbp_is_reply( $post_id ) ) { 206 return $new_status; 207 } 208 209 // Prefer the previous status, falling back to the new status 210 $retval = ! empty( $previous_status ) 211 ? $previous_status 212 : $new_status; 213 214 return $retval; 188 215 } 189 216
Note: See TracChangeset
for help on using the changeset viewer.