I added a simple settings page according to this in my custom plugin:
$plugin_admin_options = new Vendor_Admin_Options();
$this->loader->add_filter('mb_settings_pages', $plugin_admin_options, 'addOptionsPage', 1);
$this->loader->add_filter('rwmb_meta_boxes', $plugin_admin_options, 'addOptions');
class Vendor_Admin_Options
{
/**
* @param $settings_pages
* @return array
*/
public function addOptionsPage($settings_pages)
{
$settings_pages[] = array(
'id' => 'vendor',
'option_name' => 'vendor',
'menu_title' => 'VENDOR',
'icon_url' => 'dashicons-admin-settings',
'page_title' => 'Vendor Settings',
'style' => 'no-boxes',
'columns' => 1,
'parent' => 'options-general.php',
'tabs' => array(
'general' => __('Data', 'vendor'),
'design' => __('Colors', 'vendor'),
),
'position' => -10,
'help_tabs' => array(
array(
'title' => 'Data',
'content' => '<p>Content</p>',
),
),
);
return $settings_pages;
}
...
}
But the addOptionsPage function only executes on the default network site, not on the other sites. What could be the problem?
I checked the execution, addOptionsPage
only on the default site, but addOptions
is executed on the other sites aswell.