Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




unstick_post [ WordPress Function ]

unstick_post ( $post_id )
Parameters:
  • (int) $post_id Post ID.
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$offset1);

    
update_option('sticky_posts'$stickies);
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics