Add a custom tab alongside Screen Options and Help

Using the WP_Screen object, is it possible to add additional tabs to a custom admin settings page?

I already have Screen Options and Help, but I also wish to add a Import/Export tab. I’ve looked in to extending the WP_Screen object, but it’s declared as final in the core (/wp-admin/includes/screen.php, line 194 {ver 4.2.1}).

I’d consider adding my import/export option to the Screen Options tab, but looking at WP_Screen object I can’t see that even this is possible. Edit This is possible using the screen_settings filter, but I’d still like to achieve my primary goal if possible.

1 Answer
1

I changed my mind about “Most important: in the hook for validating updates, set-screen-option, pass the $value back if your plugin does not recognize the $option ! It’s probably for another plugin!”

It’s better to go with what the hook suggest and send back $status (which is false) if you don’t know the $option.

To prevent conflicts with other plugins, instead I put in a $_GET[‘page’] check before adding the validator filter.

Leave a Comment