How prevent checked categories moving to the top when editing a post using hooks: WordPress


Hello Friends,

If you want to remove the checked categories moving to the top when editing a post using hooks, then just add my code in your theme function file.

class Custom_Cat_Checklist {

    static function init() {
        add_filter( 'wp_terms_checklist_args', array( __CLASS__, 'checklist_args' ) );
    }

    static function checklist_args( $args ) {
        add_action( 'admin_footer', array( __CLASS__, 'script' ) );

        $args['checked_ontop'] = false;

        return $args;
    }
}

Custom_Cat_Checklist::init();

Enjoy Code! | Raghunath Blog

Advertisements

Sr. Software Engineer

Tagged with: , , , ,
Posted in Wordpress
One comment on “How prevent checked categories moving to the top when editing a post using hooks: WordPress
  1. Desiree says:

    My spouse and I stumbled over here different page and thought I might as well check things out. I like what I see so i am just following you. Look forward to checking out your web page for a second time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: