unstick_post [ WordPress Function ]
unstick_post ( $post_id )
| Parameters: |
|
| Defined at: |
|
Unstick a post.
Sticky posts should be displayed at the top of the front page.
Source
<?php
function unstick_post($post_id) {
$stickies = get_option('sticky_posts');
if ( !is_array($stickies) )
return;
if ( ! in_array($post_id, $stickies) )
return;
$offset = array_search($post_id, $stickies);
if ( false === $offset )
return;
array_splice($stickies, $offset, 1);
update_option('sticky_posts', $stickies);
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- post.php
Jul 16, 2009 ... unstick_post(), Unstick a post. update_attached_file(), Update attachment file path based on attachment ID. update_page_cache(), Alias of ...
www.tig12.net - edit_post | A HitchHackers guide through WordPress
Feb 11, 2011... ( $ptype->cap->edit_others_posts ) ) { if ( ! empty( $post_data['sticky'] ) ) stick_post( $post_ID ); else unstick_post( $post_ID ); } return $post_ID; ...
hitchhackerguide.com - wp_delete_post | A HitchHackers guide through WordPress
Feb 12, 2011... { unstick_post($postid); } // Do raw query. wp_get_post_revisions() is filtered $ revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID ...
hitchhackerguide.com - #12702 (Enable sticky post checkbox for custom post type Publish ...
I should note that stick_post() and unstick_post() make no checks on the post type. So I'm thinking I leave [16004] in, and revert [15742] to be considered again ...
core.trac.wordpress.org