Tabbed navigation for plugin options using same row in database for all?

I’m trying to use WordPress’ native tabbed navigation on my plugin’s options page, but I’m having trouble. I’ve managed to get the options to display, though it displays every plugin option on every tab. I also get the error message ERROR: options page not found whenever I try to save settings.

I think I’ve traced this to the fact that I’m trying to use the same row in the database for all plugin options. The reason for this is that most of the options fields are dynamically generated from a remote API call, so the tabs may not be the same across all installations of the plugin. Therefore, I don’t want to predefine database rows for each tab, in case certain tabs are not in use, or tabs are added or removed based on the API response after plugin installation.

Is it possible to use a single row in the database for all plugin options in conjunction with WordPress’ tabbed navigation?

Here’s the relevant block of code in the commit containing it. I’ve linked to it because it contains references to methods and properties elsewhere in plugin code that may be relevant for context.

0

Leave a Comment