comment_id_not_found
Action HookDescription
Fires when a comment is attempted on a post that does not exist.Hook Information
File Location |
wp-includes/comment.php
View on GitHub
|
Hook Type | Action |
Line Number | 3592 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$comment_post_id
|
Post ID. |
Usage Examples
Basic Usage
<?php
// Hook into comment_id_not_found
add_action('comment_id_not_found', 'my_custom_function', 10, 1);
function my_custom_function($comment_post_id) {
// Your custom code here
}
Source Code Context
wp-includes/comment.php:3592
- How this hook is used in WordPress core
<?php
3587 *
3588 * @since 1.5.0
3589 *
3590 * @param int $comment_post_id Post ID.
3591 */
3592 do_action( 'comment_id_not_found', $comment_post_id );
3593
3594 return new WP_Error( 'comment_id_not_found' );
3595
3596 }
3597
PHP Documentation
<?php
/**
* Fires when a comment is attempted on a post that does not exist.
*
* @since 1.5.0
*
* @param int $comment_post_id Post ID.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-includes/comment.php
Related Hooks
Related hooks will be displayed here in future updates.