Changeset 3179
- Timestamp:
- 05/21/2011 07:44:31 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-reply-functions.php
r3171 r3179 28 28 */ 29 29 function bbp_update_reply_forum_id( $reply_id = 0, $forum_id = 0 ) { 30 31 // Validation 30 32 $reply_id = bbp_get_reply_id( $reply_id ); 31 33 $forum_id = bbp_get_forum_id( $forum_id ); … … 33 35 // If no forum_id was passed, walk up ancestors and look for forum type 34 36 if ( empty( $forum_id ) ) { 37 38 // Get ancestors 35 39 $ancestors = get_post_ancestors( $reply_id ); 40 41 // Loop through ancestors 36 42 foreach ( $ancestors as $ancestor ) { 43 44 // Get first parent that is a forum 37 45 if ( get_post_field( 'post_type', $ancestor ) == bbp_get_forum_post_type() ) { 38 46 $forum_id = $ancestor; 47 48 // Found a forum, so exit the loop and continue 39 49 continue; 40 50 } … … 42 52 } 43 53 44 // Update the last replyID45 update_post_meta( $reply_id, '_bbp_forum_id', (int)$forum_id );54 // Update the forum ID 55 bbp_update_forum_id( $reply_id, $forum_id ); 46 56 47 57 return apply_filters( 'bbp_update_reply_forum_id', (int) $forum_id, $reply_id ); … … 65 75 */ 66 76 function bbp_update_reply_topic_id( $reply_id = 0, $topic_id = 0 ) { 77 78 // Validation 67 79 $reply_id = bbp_get_reply_id( $reply_id ); 68 80 $topic_id = bbp_get_topic_id( $topic_id ); … … 70 82 // If no topic_id was passed, walk up ancestors and look for topic type 71 83 if ( empty( $topic_id ) ) { 84 85 // Get ancestors 72 86 $ancestors = get_post_ancestors( $reply_id ); 87 88 // Loop through ancestors 73 89 foreach ( $ancestors as $ancestor ) { 90 91 // Get first parent that is a forum 74 92 if ( get_post_field( 'post_type', $ancestor ) == bbp_get_topic_post_type() ) { 75 93 $topic_id = $ancestor; 94 95 // Found a forum, so exit the loop and continue 76 96 continue; 77 97 } … … 79 99 } 80 100 81 // Update the last replyID82 update_post_meta( $reply_id, '_bbp_topic_id', (int)$topic_id );101 // Update the topic ID 102 bbp_update_topic_id( $reply_id, $topic_id ); 83 103 84 104 return apply_filters( 'bbp_update_reply_topic_id', (int) $topic_id, $reply_id ); … … 119 139 */ 120 140 function bbp_new_reply_handler() { 141 121 142 // Only proceed if POST is a new reply 122 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && 'bbp-new-reply' === $_POST['action']) {143 if ( 'POST' == strtoupper( $_SERVER['REQUEST_METHOD'] ) && !empty( $_POST['action'] ) && ( 'bbp-new-reply' === $_POST['action'] ) ) { 123 144 global $bbp; 124 145 … … 126 147 check_admin_referer( 'bbp-new-reply' ); 127 148 128 // Prevent debug notices 129 $topic_id = $forum_id = $reply_content = ''; 130 131 // Check users ability to create new reply 132 if ( !bbp_is_anonymous() ) { 133 if ( !current_user_can( 'publish_replies' ) ) 149 // Set defaults to prevent debug notices 150 $topic_id = $forum_id = $topic_author = $anonymous_data = 0; 151 $reply_title = $reply_content = $terms = ''; 152 153 /** Reply Author ******************************************************/ 154 155 // User is anonymous 156 if ( bbp_is_anonymous() ) { 157 158 // Filter anonymous data 159 $anonymous_data = bbp_filter_anonymous_post_data(); 160 161 // Anonymous data checks out, so set cookies, etc... 162 if ( !empty( $anonymous_data ) && is_array( $anonymous_data ) ) { 163 bbp_set_current_anonymous_user_data( $anonymous_data ); 164 } 165 166 // User is logged in 167 } else { 168 169 // User cannot create replies 170 if ( !current_user_can( 'publish_replies' ) ) { 134 171 $bbp->errors->add( 'bbp_reply_permissions', __( '<strong>ERROR</strong>: You do not have permission to reply.', 'bbpress' ) ); 135 136 $anonymous_data = false; 137 $reply_author = bbp_get_current_user_id(); 138 139 // It is an anonymous post 140 } else { 141 $anonymous_data = bbp_filter_anonymous_post_data(); // Filter anonymous data 142 $reply_author = 0; 143 144 if ( !empty( $anonymous_data ) && is_array( $anonymous_data ) ) 145 bbp_set_current_anonymous_user_data( $anonymous_data ); 172 } 173 174 // Reply author is current user 175 $reply_author = bbp_get_current_user_id(); 176 146 177 } 178 179 /** Topic ID **********************************************************/ 147 180 148 181 // Handle Topic ID to append reply to … … 150 183 $bbp->errors->add( 'bbp_reply_topic_id', __( '<strong>ERROR</strong>: Topic ID is missing.', 'bbpress' ) ); 151 184 185 /** Forum ID **********************************************************/ 186 152 187 // Handle Forum ID to adjust counts of 153 188 if ( isset( $_POST['bbp_forum_id'] ) && ( !$forum_id = (int) $_POST['bbp_forum_id'] ) ) 154 189 $bbp->errors->add( 'bbp_reply_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) ); 190 191 /** Unfiltered HTML ***************************************************/ 155 192 156 193 // Remove wp_filter_kses filters from title and content for capable users and if the nonce is verified … … 160 197 } 161 198 162 // Handle Title (optional for replies) 199 /** Reply Title *******************************************************/ 200 163 201 if ( !empty( $_POST['bbp_reply_title'] ) ) 164 202 $reply_title = esc_attr( strip_tags( $_POST['bbp_reply_title'] ) ); 165 203 204 // Filter and sanitize 166 205 $reply_title = apply_filters( 'bbp_new_reply_pre_title', $reply_title ); 167 206 168 // Handle Content 169 if ( isset( $_POST['bbp_reply_content'] ) && ( !$reply_content = $_POST['bbp_reply_content'] ) ) { 207 // No reply title 208 if ( empty( $reply_title ) ) 209 $bbp->errors->add( 'bbp_reply_title', __( '<strong>ERROR</strong>: Your reply needs a title.', 'bbpress' ) ); 210 211 /** Reply Content *****************************************************/ 212 213 if ( !empty( $_POST['bbp_reply_content'] ) ) 214 $reply_content = $_POST['bbp_reply_content']; 215 216 // Filter and sanitize 217 $reply_content = apply_filters( 'bbp_new_reply_pre_content', $reply_content ); 218 219 // No reply content 220 if ( empty( $reply_content ) ) 170 221 $bbp->errors->add( 'bbp_reply_content', __( '<strong>ERROR</strong>: Your reply cannot be empty.', 'bbpress' ) ); 171 $reply_content = ''; 172 } 173 174 $reply_content = apply_filters( 'bbp_new_reply_pre_content', $reply_content ); 175 176 // Check for flood 222 223 /** Reply Flooding ****************************************************/ 224 177 225 if ( !bbp_check_for_flood( $anonymous_data, $reply_author ) ) 178 226 $bbp->errors->add( 'bbp_reply_flood', __( '<strong>ERROR</strong>: Slow down; you move too fast.', 'bbpress' ) ); 179 227 180 // Check for duplicate 228 /** Reply Duplicate ***************************************************/ 229 181 230 if ( !bbp_check_for_duplicate( array( 'post_type' => bbp_get_reply_post_type(), 'post_author' => $reply_author, 'post_content' => $reply_content, 'post_parent' => $topic_id, 'anonymous_data' => $anonymous_data ) ) ) 182 231 $bbp->errors->add( 'bbp_reply_duplicate', __( '<strong>ERROR</strong>: Duplicate reply detected; it looks as though you’ve already said that!', 'bbpress' ) ); 183 232 184 / / Handle Tags185 if ( !is_wp_error( $bbp->errors ) || !$bbp->errors->get_error_codes() ) { 186 if ( isset( $_POST['bbp_topic_tags'] ) ) {187 $tags = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ) );188 $tags = wp_set_post_terms( $topic_id, $tags, $bbp->topic_tag_id, false ); 189 190 if ( is_wp_error( $tags ) ) 191 $bbp->errors->add( 'bbp_reply_tags', __( '<strong>ERROR</strong>: There was some problem adding the tags to the topic.', 'bbpress' ));192 } 193 }233 /** Topic Tags ********************************************************/ 234 235 if ( !empty( $_POST['bbp_topic_tags'] ) ) 236 $terms = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ) ); 237 238 /** Additional Actions (Before Save) **********************************/ 239 240 do_action( 'bbp_new_reply_pre_extras' ); 241 242 /** No Errors *********************************************************/ 194 243 195 244 // Handle insertion into posts table 196 245 if ( !is_wp_error( $bbp->errors ) || !$bbp->errors->get_error_codes() ) { 246 247 /** Create new reply **********************************************/ 197 248 198 249 // Add the content of the form to $post as an array … … 209 260 $reply_id = wp_insert_post( $reply_data ); 210 261 262 /** No Errors *****************************************************/ 263 211 264 // Check for missing reply_id or error 212 265 if ( !empty( $reply_id ) && !is_wp_error( $reply_id ) ) { 213 266 267 /** Topic Tags ************************************************/ 268 269 // Insert terms 270 $terms = wp_set_post_terms( $topic_id, $terms, $bbp->topic_tag_id, false ); 271 272 // Term error 273 if ( is_wp_error( $terms ) ) 274 $bbp->errors->add( 'bbp_reply_tags', __( '<strong>ERROR</strong>: There was some problem adding the tags to the topic.', 'bbpress' ) ); 275 214 276 // Update counts, etc... 215 277 do_action( 'bbp_new_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author ); 216 278 279 /** Successful Save *******************************************/ 280 217 281 // Redirect back to new reply 218 282 wp_redirect( bbp_get_reply_url( $reply_id ) ); … … 221 285 exit(); 222 286 223 // Errors to report 287 /** Errors ********************************************************/ 288 224 289 } else { 225 290 $append_error = ( is_wp_error( $reply_id ) && $reply_id->get_error_message() ) ? $reply_id->get_error_message() . ' ' : ''; … … 261 326 */ 262 327 function bbp_edit_reply_handler() { 328 263 329 // Only proceed if POST is an reply request 264 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && 'bbp-edit-reply' === $_POST['action']) {330 if ( 'POST' == strtoupper( $_SERVER['REQUEST_METHOD'] ) && !empty( $_POST['action'] ) && ( 'bbp-edit-reply' === $_POST['action'] ) ) { 265 331 global $bbp; 266 332 267 if ( empty( $_POST['bbp_reply_id'] ) || !$reply_id = (int) $_POST['bbp_reply_id'] ) { 268 $bbp->errors->add( 'bbp_edit_reply_id', __( '<strong>ERROR</strong>: Reply ID not found!', 'bbpress' ) ); 269 } elseif ( !$reply = bbp_get_reply( $reply_id ) ) { 270 $bbp->errors->add( 'bbp_edit_reply_not_found', __( '<strong>ERROR</strong>: The reply you want to edit was not found!', 'bbpress' ) ); 333 // Set defaults to prevent debug notices 334 $reply = $reply_id = $topic_id = $forum_id = $anonymous_data = 0; 335 $reply_title = $reply_content = $reply_edit_reason = $terms = ''; 336 337 /** Reply *************************************************************/ 338 339 // Reply id was not passed 340 if ( empty( $_POST['bbp_reply_id'] ) ) 341 $bbp->errors->add( 'bbp_edit_reply_id', __( '<strong>ERROR</strong>: Reply ID not found.', 'bbpress' ) ); 342 343 // Reply id was passed 344 elseif ( is_numeric( $_POST['bbp_reply_id'] ) ) 345 $reply_id = (int) $_POST['bbp_reply_id']; 346 347 // Reply does not exist 348 if ( !$reply = bbp_get_reply( $reply_id ) ) { 349 $bbp->errors->add( 'bbp_edit_reply_not_found', __( '<strong>ERROR</strong>: The reply you want to edit was not found.', 'bbpress' ) ); 350 351 // Reply exists 271 352 } else { 272 353 … … 274 355 check_admin_referer( 'bbp-edit-reply_' . $reply_id ); 275 356 276 // Get reply parent ID's277 $topic_id = bbp_get_reply_topic_id( $reply_id );278 $forum_id = bbp_get_topic_forum_id( $topic_id );279 280 // Prevent debug notices281 $reply_content = '';282 283 357 // Check users ability to create new reply 284 358 if ( !bbp_is_reply_anonymous( $reply_id ) ) { 359 360 // User cannot edit this reply 285 361 if ( !current_user_can( 'edit_reply', $reply_id ) ) { 286 $bbp->errors->add( 'bbp_edit_reply_permissions', __( '<strong>ERROR</strong>: You do not have permission to edit that reply !', 'bbpress' ) );362 $bbp->errors->add( 'bbp_edit_reply_permissions', __( '<strong>ERROR</strong>: You do not have permission to edit that reply.', 'bbpress' ) ); 287 363 } 288 289 $anonymous_data = false;290 364 291 365 // It is an anonymous post 292 366 } else { 293 $anonymous_data = bbp_filter_anonymous_post_data( array(), true ); // Filter anonymous data 367 368 // Filter anonymous data 369 $anonymous_data = bbp_filter_anonymous_post_data( array(), true ); 294 370 } 295 296 371 } 297 372 … … 302 377 } 303 378 304 // Handle Title (optional for replies) 305 $reply_title = !empty( $_POST['bbp_reply_title'] ) ? esc_attr( strip_tags( $_POST['bbp_reply_title'] ) ) : $reply_title = $reply->post_title; 379 /** Reply Topic *******************************************************/ 380 381 $topic_id = bbp_get_reply_topic_id( $reply_id ); 382 383 /** Reply Forum *******************************************************/ 384 385 $forum_id = bbp_get_topic_forum_id( $topic_id ); 386 387 // Forum exists 388 if ( !empty( $forum_id ) && ( $forum_id != $reply->post_parent ) ) { 389 390 // Forum is a category 391 if ( bbp_is_forum_category( $forum_id ) ) 392 $bbp->errors->add( 'bbp_edit_reply_forum_category', __( '<strong>ERROR</strong>: This forum is a category. No topics or replies can be created in it.', 'bbpress' ) ); 393 394 // Forum is closed and user cannot access 395 if ( bbp_is_forum_closed( $forum_id ) && !current_user_can( 'edit_forum', $forum_id ) ) 396 $bbp->errors->add( 'bbp_edit_reply_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new topics and replies.', 'bbpress' ) ); 397 398 // Forum is private and user cannot access 399 if ( bbp_is_forum_private( $forum_id ) && !current_user_can( 'read_private_forums' ) ) 400 $bbp->errors->add( 'bbp_edit_reply_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 401 402 // Forum is hidden and user cannot access 403 if ( bbp_is_forum_hidden( $forum_id ) && !current_user_can( 'read_hidden_forums' ) ) 404 $bbp->errors->add( 'bbp_edit_reply_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 405 } 406 407 /** Reply Title *******************************************************/ 408 409 if ( !empty( $_POST['bbp_reply_title'] ) ) 410 $reply_title = esc_attr( strip_tags( $_POST['bbp_reply_title'] ) ); 411 412 // Filter and sanitize 306 413 $reply_title = apply_filters( 'bbp_edit_reply_pre_title', $reply_title, $reply_id ); 307 414 308 // Handle Content 309 if ( isset( $_POST['bbp_reply_content'] ) && ( !$reply_content = $_POST['bbp_reply_content'] ) ) 415 /** Reply Content *****************************************************/ 416 417 if ( !empty( $_POST['bbp_reply_content'] ) ) 418 $reply_content = $_POST['bbp_reply_content']; 419 420 // Filter and sanitize 421 $reply_content = apply_filters( 'bbp_edit_reply_pre_content', $reply_content, $reply_id ); 422 423 // No reply content 424 if ( empty( $reply_content ) ) 310 425 $bbp->errors->add( 'bbp_edit_reply_content', __( '<strong>ERROR</strong>: Your reply cannot be empty.', 'bbpress' ) ); 311 426 312 $reply_content = apply_filters( 'bbp_edit_reply_pre_content', $reply_content, $reply_id ); 313 314 // Handle Tags 315 if ( !is_wp_error( $bbp->errors ) || !$bbp->errors->get_error_codes() ) { 316 if ( isset( $_POST['bbp_topic_tags'] ) ) { 317 $tags = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ) ); 318 $tags = wp_set_post_terms( $topic_id, $tags, $bbp->topic_tag_id, false ); 319 320 if ( is_wp_error( $tags ) ) 321 $bbp->errors->add( 'bbp_reply_tags', __( '<strong>ERROR</strong>: There was some problem adding the tags to the topic.', 'bbpress' ) ); 322 } 323 } 427 /** Topic Tags ********************************************************/ 428 429 if ( !empty( $_POST['bbp_topic_tags'] ) ) 430 $terms = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ) ); 431 432 /** Additional Actions (Before Save) **********************************/ 433 434 do_action( 'bbp_edit_reply_pre_extras', $reply_id ); 435 436 /** No Errors *********************************************************/ 324 437 325 438 // Handle insertion into posts table … … 336 449 $reply_id = wp_update_post( $reply_data ); 337 450 338 // Revisions 339 $reply_edit_reason = !empty( $_POST['bbp_reply_edit_reason'] ) ? esc_attr( strip_tags( $_POST['bbp_reply_edit_reason'] ) ) : ''; 340 341 if ( !empty( $_POST['bbp_log_reply_edit'] ) && 1 == $_POST['bbp_log_reply_edit'] && $revision_id = wp_save_post_revision( $reply_id ) ) 342 bbp_update_reply_revision_log( array( 'reply_id' => $reply_id, 'revision_id' => $revision_id, 'author_id' => bbp_get_current_user_id(), 'reason' => $reply_edit_reason ) ); 343 344 // Check for missing reply_id or error 451 /** Topic Tags ************************************************/ 452 453 // Insert terms 454 $terms = wp_set_post_terms( $topic_id, $terms, $bbp->topic_tag_id, false ); 455 456 // Term error 457 if ( is_wp_error( $terms ) ) 458 $bbp->errors->add( 'bbp_reply_tags', __( '<strong>ERROR</strong>: There was some problem adding the tags to the topic.', 'bbpress' ) ); 459 460 /** Revisions *****************************************************/ 461 462 // Revision Reason 463 if ( !empty( $_POST['bbp_reply_edit_reason'] ) ) 464 $reply_edit_reason = esc_attr( strip_tags( $_POST['bbp_reply_edit_reason'] ) ); 465 466 // Update revision log 467 if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( 1 == $_POST['bbp_log_reply_edit'] ) && ( $revision_id = wp_save_post_revision( $reply_id ) ) ) { 468 bbp_update_reply_revision_log( array( 469 'reply_id' => $reply_id, 470 'revision_id' => $revision_id, 471 'author_id' => bbp_get_current_user_id(), 472 'reason' => $reply_edit_reason 473 ) ); 474 } 475 476 /** No Errors *****************************************************/ 477 345 478 if ( !empty( $reply_id ) && !is_wp_error( $reply_id ) ) { 346 479 … … 348 481 do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply->post_author , true /* Is edit */ ); 349 482 483 /** Additional Actions (After Save) ***************************/ 484 485 do_action( 'bbp_edit_reply_post_extras', $reply_id ); 486 487 /** Successful Edit *******************************************/ 488 350 489 // Redirect back to new reply 351 490 wp_redirect( bbp_get_reply_url( $reply_id ) ); … … 354 493 exit(); 355 494 356 // Errors to report 495 /** Errors ********************************************************/ 496 357 497 } else { 358 498 $append_error = ( is_wp_error( $reply_id ) && $reply_id->get_error_message() ) ? $reply_id->get_error_message() . ' ' : ''; … … 389 529 390 530 // Update the reply meta bidness 391 bbp_update_reply( $reply_id, (int) $_POST['parent_id'] ); 531 $parent_id = !empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0; 532 bbp_update_topic( $reply_id, $parent_id ); 392 533 } 393 534 } … … 465 606 if ( bbp_is_subscriptions_active() && !empty( $author_id ) ) { 466 607 $subscribed = bbp_is_user_subscribed( $author_id, $topic_id ); 467 $subscheck = ( !empty( $_POST['bbp_topic_subscription'] ) && 'bbp_subscribe' == $_POST['bbp_topic_subscription']) ? true : false;608 $subscheck = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' == $_POST['bbp_topic_subscription'] ) ) ? true : false; 468 609 469 610 // Subscribed and unsubscribing … … 476 617 } 477 618 619 // Reply meta relating to reply position in tree 620 bbp_update_reply_forum_id( $reply_id, $forum_id ); 621 bbp_update_reply_topic_id( $reply_id, $topic_id ); 622 478 623 // Update associated topic values if this is a new reply 479 624 if ( empty( $is_edit ) ) { … … 484 629 // Last active time 485 630 $last_active_time = current_time( 'mysql' ); 486 487 // Reply meta relating to reply position in tree488 bbp_update_reply_forum_id( $reply_id, $forum_id );489 bbp_update_reply_topic_id( $reply_id, $topic_id );490 631 491 632 // Walk up ancestors and do the dirty work … … 675 816 676 817 // Only proceed if GET is a reply toggle action 677 if ( 'GET' == $_SERVER['REQUEST_METHOD'] && !empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_reply_spam', 'bbp_toggle_reply_trash' ) ) && !empty( $_GET['reply_id']) ) {818 if ( 'GET' == strtoupper( $_SERVER['REQUEST_METHOD'] ) && !empty( $_GET['reply_id'] ) && !empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_reply_spam', 'bbp_toggle_reply_trash' ) ) ) { 678 819 global $bbp; 679 820 … … 693 834 } 694 835 836 // What action are we trying to perform? 695 837 switch ( $action ) { 696 838 839 // Toggle spam 697 840 case 'bbp_toggle_reply_spam' : 698 841 check_ajax_referer( 'spam-reply_' . $reply_id ); … … 704 847 break; 705 848 849 // Toggle trash 706 850 case 'bbp_toggle_reply_trash' : 707 851 … … 743 887 do_action( 'bbp_toggle_reply_handler', $success, $post_data, $action ); 744 888 745 // Check forerrors889 // No errors 746 890 if ( ( false != $success ) && !is_wp_error( $success ) ) { 747 891 … … 769 913 * @param int $reply_id Reply id 770 914 * @uses wp_get_single_post() To get the reply 771 * @uses do_action() Calls 'bbp_spam_reply' with the reply id before marking 772 * the reply as spam 915 * @uses do_action() Calls 'bbp_spam_reply' with the reply ID 773 916 * @uses add_post_meta() To add the previous status to a meta 774 917 * @uses wp_insert_post() To insert the updated post 775 * @uses do_action() Calls 'bbp_spammed_reply' with the reply id after marking 776 * the reply as spam 918 * @uses do_action() Calls 'bbp_spammed_reply' with the reply ID 777 919 * @return mixed False or {@link WP_Error} on failure, reply id on success 778 920 */ … … 791 933 792 934 $reply['post_status'] = $bbp->spam_status_id; 935 793 936 $reply_id = wp_insert_post( $reply ); 794 937 … … 805 948 * @param int $reply_id Reply id 806 949 * @uses wp_get_single_post() To get the reply 807 * @uses do_action() Calls 'bbp_unspam_reply' with the reply id before unmarking 808 * the reply as spam 950 * @uses do_action() Calls 'bbp_unspam_reply' with the reply ID 809 951 * @uses get_post_meta() To get the previous status meta 810 952 * @uses delete_post_meta() To delete the previous status meta 811 953 * @uses wp_insert_post() To insert the updated post 812 * @uses do_action() Calls 'bbp_unspammed_reply' with the reply id after 813 * unmarking the reply as spam 954 * @uses do_action() Calls 'bbp_unspammed_reply' with the reply ID 814 955 * @return mixed False or {@link WP_Error} on failure, reply id on success 815 956 */
Note: See TracChangeset
for help on using the changeset viewer.