bbp_delete_topic

  • do_action( 'bbp_delete_topic', $topic_id )

    Source Reference:

    • Component: bbPress:: bbp-topic
      File: /bbp-includes/bbp-topic-functions.php :: Trac Source Line: 2716
       */
      function bbp_delete_topic( $topic_id = 0 ) {
      
      	// Validate topic ID
      	$topic_id = bbp_get_topic_id( $topic_id );
      
      	if ( empty( $topic_id ) || !bbp_is_topic( $topic_id ) )
      		return false;
      
      	do_action( 'bbp_delete_topic', $topic_id );
      
      	// Valid topic/reply statuses
      	$post_stati = join( ',', array( bbp_get_public_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() ) );
      
      	// Topic is being permanently deleted, so its replies gotta go too
      	if ( bbp_has_replies( array(
      		'post_type'      => bbp_get_reply_post_type(),
      		'post_status'    => $post_stati,
      		'posts_per_page' => -1,
      		'meta_query'     => array( array(
      

Hook: add_action: bbp_delete_topic instances (3)

  • add_action( 'bbp_delete_topic',  'bbp_remove_topic_from_all_favorites'   )
    $function_to_add: bbp_remove_topic_from_all_favorites
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: bbPress :: bbp-core
      File: /bbp-includes/bbp-core-hooks.php :: Trac Source Line: 193
      add_action( 'deleted_post',   'bbp_deleted_topic'   );
      
      // Topic/Reply Actions
      add_action( 'template_redirect', 'bbp_toggle_topic_handler', 1 );
      add_action( 'template_redirect', 'bbp_toggle_reply_handler', 1 );
      
      // Favorites
      add_action( 'template_redirect', 'bbp_favorites_handler',              1 );
      add_action( 'bbp_trash_topic',   'bbp_remove_topic_from_all_favorites'   );
      add_action( 'bbp_delete_topic',  'bbp_remove_topic_from_all_favorites'   );
      
      // Subscriptions
      add_action( 'template_redirect', 'bbp_subscriptions_handler',              1    );
      add_action( 'bbp_trash_topic',   'bbp_remove_topic_from_all_subscriptions'      );
      add_action( 'bbp_delete_topic',  'bbp_remove_topic_from_all_subscriptions'      );
      add_action( 'bbp_new_reply',     'bbp_notify_subscribers',                 1, 5 );
      
      // Sticky
      add_action( 'bbp_trash_topic',  'bbp_unstick_topic' );
      add_action( 'bbp_delete_topic', 'bbp_unstick_topic' );
      

Hook: add_action: bbp_delete_topic instances (3)

  • add_action( 'bbp_delete_topic',  'bbp_remove_topic_from_all_subscriptions'      )
    $function_to_add: bbp_remove_topic_from_all_subscriptions
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: bbPress :: bbp-core
      File: /bbp-includes/bbp-core-hooks.php :: Trac Source Line: 198
      // Favorites
      add_action( 'template_redirect', 'bbp_favorites_handler',              1 );
      add_action( 'bbp_trash_topic',   'bbp_remove_topic_from_all_favorites'   );
      add_action( 'bbp_delete_topic',  'bbp_remove_topic_from_all_favorites'   );
      
      // Subscriptions
      add_action( 'template_redirect', 'bbp_subscriptions_handler',              1    );
      add_action( 'bbp_trash_topic',   'bbp_remove_topic_from_all_subscriptions'      );
      add_action( 'bbp_delete_topic',  'bbp_remove_topic_from_all_subscriptions'      );
      add_action( 'bbp_new_reply',     'bbp_notify_subscribers',                 1, 5 );
      
      // Sticky
      add_action( 'bbp_trash_topic',  'bbp_unstick_topic' );
      add_action( 'bbp_delete_topic', 'bbp_unstick_topic' );
      
      // Update topic branch
      add_action( 'bbp_trashed_topic',   'bbp_update_topic_walker' );
      add_action( 'bbp_untrashed_topic', 'bbp_update_topic_walker' );
      add_action( 'bbp_deleted_topic',   'bbp_update_topic_walker' );
      

Hook: add_action: bbp_delete_topic instances (3)

  • add_action( 'bbp_delete_topic', 'bbp_unstick_topic' )
    $function_to_add: bbp_unstick_topic
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: bbPress :: bbp-core
      File: /bbp-includes/bbp-core-hooks.php :: Trac Source Line: 203
      // Subscriptions
      add_action( 'template_redirect', 'bbp_subscriptions_handler',              1    );
      add_action( 'bbp_trash_topic',   'bbp_remove_topic_from_all_subscriptions'      );
      add_action( 'bbp_delete_topic',  'bbp_remove_topic_from_all_subscriptions'      );
      add_action( 'bbp_new_reply',     'bbp_notify_subscribers',                 1, 5 );
      
      // Sticky
      add_action( 'bbp_trash_topic',  'bbp_unstick_topic' );
      add_action( 'bbp_delete_topic', 'bbp_unstick_topic' );
      
      // Update topic branch
      add_action( 'bbp_trashed_topic',   'bbp_update_topic_walker' );
      add_action( 'bbp_untrashed_topic', 'bbp_update_topic_walker' );
      add_action( 'bbp_deleted_topic',   'bbp_update_topic_walker' );
      add_action( 'bbp_spammed_topic',   'bbp_update_topic_walker' );
      add_action( 'bbp_unspammed_topic', 'bbp_update_topic_walker' );
      
      // Update reply branch
      add_action( 'bbp_trashed_reply',   'bbp_update_reply_walker' );
      

Comments are closed.