bbp_new_reply_pre_set_terms

  • apply_filters( 'bbp_new_reply_pre_set_terms', $terms, $topic_id, $reply_id )

    Source Reference:

    • Component: bbPress :: bbp-reply
      File: /bbp-includes/bbp-reply-functions.php :: Trac Source Line: 250
      		/** No Errors *********************************************************/
      
      		// Check for missing reply_id or error
      		if ( !empty( $reply_id ) && !is_wp_error( $reply_id ) ) {
      
      			/** Topic Tags ****************************************************/
      
      			// Just in time manipulation of reply terms before being edited
      			$terms = apply_filters( 'bbp_new_reply_pre_set_terms', $terms, $topic_id, $reply_id );
      
      			// Insert terms
      			$terms = wp_set_post_terms( $topic_id, $terms, bbp_get_topic_tag_tax_id(), false );
      
      			// Term error
      			if ( is_wp_error( $terms ) ) {
      				bbp_add_error( 'bbp_reply_tags', __( '<strong>ERROR</strong>: There was a problem adding the tags to the topic.', 'bbpress' ) );
      			}
      
      			/** Trash Check ***************************************************/
      

Hook: add_filter: bbp_new_reply_pre_set_terms instances (1)

  • add_filter( 'bbp_new_reply_pre_set_terms', array( $this, 'filter_post_terms' ), 1, 3 )
    $tag: bbp_new_reply_pre_set_terms
    $function_to_add: array( $this
    $priority: 0
    $accepted_args: 1

    Source Reference:

    • Component: bbPress :: bbp-core
      File: /bbp-includes/bbp-extend-akismet.php :: Trac Source Line: 169
      		if ( 'true' == $post_data['bbp_akismet_result'] ) {
      
      			// Let plugins do their thing
      			do_action( 'bbp_akismet_spam_caught' );
      
      			// This is spam
      			$post_data['post_status'] = bbp_get_spam_status_id();
      
      			// We don't want your spam tags here
      			add_filter( 'bbp_new_reply_pre_set_terms', array( $this, 'filter_post_terms' ), 1, 3 );
      
      			// @todo Spam counter?
      		}
      
      		// @todo Topic/reply moderation? No true/false response - 'pending' or 'draft'
      		// @todo Auto-delete old spam?
      
      		// Log the last post
      		$this->last_post = $post_data;
      

Comments are closed.