Support » Developing with WordPress » The wp_terms_checklist_args hook doesn’t seem to work anymore.

  • Natively, in the post editing screen, when selecting a category in wordpress, it is moved to the top.

    This confuses things as it takes the category out of its hierarchy.

    To fix this, I always used this code:

    add_filter( 'wp_terms_checklist_args',
    function ( $args ) {
    $args['checked_ontop'] = false;
    return $args;

    But recently I found that it no longer works.

    Can anyone explain what changed, and how to fix it?


    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    Your code still works as expected… in the classic editor. The block editor no longer uses PHP metaboxes for the default sidebar elements, thus wp_terms_checklist() is never called. I don’t have enough experience with the customizing the block editor to suggest an equivalent way to alter its behavior. I strongly suspect API calls are involved though.

    In any case, in the block editor, when an assigned child term is moved to the top of the list, the entire hierarchy branch should go with it, preserving hierarchical context.

    Thread Starter delaitec



    Thanks a lot for the help.

    Actually, this code was inserted a long time ago, when I was still using the classic editor. If this is the question, is there a way to correct this behavior in the block editor?

    With your help, we already have a hint of the way forward.

    Let’s see if anyone else can help,

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.