Support » Requests and Feedback » Sticky post – save_post bug

  • 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'));

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

  • The topic ‘Sticky post – save_post bug’ is closed to new replies.