2

I'm working on a system to add custom options to the WordPress menu editor, and I'd like to integrate it with the Screen Options panel. In my research, I couldn't find anything on modifying an existing screen options menu; is this possible? See the screenshots below to better understand what I'm trying to accomplish.

Default "Screen Options" on Appearance > Menus:

default

Goal "Screen Options" on Appearance > Menus:

custom

2
  • Aren't you looking for the add_screen_option hook?
    – Johansson
    Mar 2, 2018 at 16:52
  • I did see that, but it didn't seem to be working. I'll give it another try. Mar 2, 2018 at 16:55

1 Answer 1

2

Figured this out by looking through the WordPress source code 🙂

function new_site_add_custom_screen_options($args) {
    $args["custom_option_1"] = __("Custom Option 1", "new_site");
    $args["custom_option_2"] = __("Custom Option 2", "new_site");

    return $args;
}
add_filter("manage_nav-menus_columns", "new_site_add_custom_screen_options", 20);
1
  • The format of the filter is add_filter("manage_{$screen->id}_columns". It's easy to get the screen id with the plugin Query Monitor .
    – brasofilo
    Jul 20 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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