Action hook 'untrashed_post_comments'

in WP Core File wp-includes/post.php at line 4231

View Source

untrashed_post_comments

Action Hook
Description
Fires after comments are restored for a post from the Trash.

Hook Information

File Location wp-includes/post.php View on GitHub
Hook Type Action
Line Number 4231

Hook Parameters

Type Name Description
int $post_id Post ID.

Usage Examples

Basic Usage
<?php
// Hook into untrashed_post_comments
add_action('untrashed_post_comments', 'my_custom_function', 10, 1);

function my_custom_function($post_id) {
    // Your custom code here
}

Source Code Context

wp-includes/post.php:4231 - How this hook is used in WordPress core
<?php
4226  	 *
4227  	 * @since 2.9.0
4228  	 *
4229  	 * @param int $post_id Post ID.
4230  	 */
4231  	do_action( 'untrashed_post_comments', $post_id );
4232  }
4233  
4234  /**
4235   * Retrieves the list of categories for a post.
4236   *

PHP Documentation

<?php
/**
	 * Fires after comments are restored for a post from the Trash.
	 *
	 * @since 2.9.0
	 *
	 * @param int $post_id Post ID.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.