Airplane_Mode_Core::plugin_add_tabs PHP Method

plugin_add_tabs() public method

Remove the tabs on the plugin page to add new items since they require the WP connection and will fail.
public plugin_add_tabs ( array $nonmenu_tabs ) : array
$nonmenu_tabs array All the tabs displayed.
return array $nonmenu_tabs The remaining tabs.
        public function plugin_add_tabs($nonmenu_tabs)
        {
            // Bail if disabled.
            if (!$this->enabled()) {
                return $nonmenu_tabs;
            }
            // Set an array of tabs to be removed with optional filter.
            if (false === ($remove = apply_filters('airplane_mode_bulk_items', array('featured', 'popular', 'recommended', 'favorites', 'beta')))) {
                return $nonmenu_tabs;
            }
            // Loop the item array and unset each.
            foreach ($remove as $key) {
                unset($nonmenu_tabs[$key]);
            }
            // Return the tabs.
            return $nonmenu_tabs;
        }