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

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

  1. 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

Your email address will not be published. Required fields are marked *