WordPress.org

Ready to get started?Download WordPress

Forums

Sticky post - save_post bug (1 post)

  1. vlad.paun
    Member
    Posted 4 years ago #

    I have been trying to unset a sticky post in certain cases, but this cannot be done with wordpress save_post hook. For example :

    add_action('save_post', array(&$this, 'check_for_sticky') , 15);
        function check_for_sticky($postID){
            global $wpdb;
               $the_stickys = array();
               $wpdb->query($wpdb->prepare("UPDATE $wpdb->options SET option_value=%s WHERE option_name = %s",serialize($the_stickys),'sticky_posts'));
               return;

    On first save it doesn't work, but on the second one does.

Topic Closed

This topic has been closed to new replies.

About this Topic