Skip to content

Remember Tabs

Pedro de Carvalho edited this page Jul 29, 2026 · 1 revision

The remember_tabs feature persists the active tab state in admin settings pages and metaboxes created by the framework. When a user switches between tabs, the last active tab is remembered across page loads using localStorage.

This feature is enabled globally for all CPTs that have settings pages or metaboxes with multiple sections (tabs).

Configuration

You can simply set it to true to enable it:

return [
    'active'   => true,
    'type'     => 'cpt',
    'name'     => 'book',
    'features' => [
        'remember_tabs' => true,
    ],
];

How It Works

  • The framework loads a JavaScript file (rememberTabs.js) on admin edit screens
  • It saves the last active tab index to localStorage when the user clicks a tab
  • On page reload, the previously active tab is restored automatically
  • The feature only activates for users who can edit_posts and on post edit/new screens

Clone this wiki locally