post_stuck
Action HookDescription
Fires once a post has been added to the sticky list.Hook Information
File Location |
wp-includes/post.php
View on GitHub
|
Hook Type | Action |
Line Number | 3263 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$post_id
|
ID of the post that was stuck. |
Usage Examples
Basic Usage
<?php
// Hook into post_stuck
add_action('post_stuck', 'my_custom_function', 10, 1);
function my_custom_function($post_id) {
// Your custom code here
}
Source Code Context
wp-includes/post.php:3263
- How this hook is used in WordPress core
<?php
3258 *
3259 * @since 4.6.0
3260 *
3261 * @param int $post_id ID of the post that was stuck.
3262 */
3263 do_action( 'post_stuck', $post_id );
3264 }
3265 }
3266
3267 /**
3268 * Un-sticks a post.
PHP Documentation
<?php
/**
* Fires once a post has been added to the sticky list.
*
* @since 4.6.0
*
* @param int $post_id ID of the post that was stuck.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-includes/post.php
Related Hooks
Related hooks will be displayed here in future updates.