Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to turn this off as I have a custom ordering process using custom fields.

share|improve this question

2 Answers 2

You can't turn it off, because it's hard-coded into the submit metabox for the post post type, you can however hide the sticky checkbox and update the sticky array to unstick any currently stuck posts.

Hide the sticky checkbox

Add additional CSS to the post and post-new pages

add_action( 'admin_print_styles', 'hide_sticky_option' );
function hide_sticky_option() {
    global $post_type, $pagenow;
    if( 'post.php' != $pagenow && 'post-new.php' != $pagenow )
        return;
    ?>
    <style type="text/css">#sticky-span { display:none!important }</style>
    <?php
}

Unstick any currently stuck posts

Add this one of your theme files, load a page that calls that file, then remove

update_option( 'sticky_posts', array() );

Hope that helps. :)

share|improve this answer

Your code was really helpful for me, but the "sticky post" option is still showing on the quick edit at the "All posts" page, so I've made some changes to fix this:

// Hide sticky posts
add_action( 'admin_print_styles', 'hide_sticky_option' );
function hide_sticky_option() {
global $post_type, $pagenow;
if( 'post.php' != $pagenow && 'post-new.php' != $pagenow && 'edit.php' != $pagenow )
    return;
?>
<style type="text/css">#sticky-span { display:none!important }
.quick-edit-row .inline-edit-col-right div.inline-edit-col > :last-child > label.alignleft:last-child{ display:none!important; }</style>
<?php
}

// Unsticky all posts
update_option( 'sticky_posts', array() );
share|improve this answer
    
Can you please add an explanation, so that someone who doesn't have the knowledge can learn from your answer - thanks. –  ialocin Jul 10 at 20:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.