Skip to content
raoabid edited this page Sep 4, 2018 · 9 revisions

Welcome to the Exopite-Simple-Options-Framework wiki!

Documentation is still in progress, we will be putting in the guide here. Not necessarily be arranged yet

Types of items this framework helps in creating

Menu | Metabox

Menu

  1. How to Create Menu
  1. Default options while create menu

How to Create Menu

Main Menu

Sub Menu

/**
 * Create a submenu page under Plugins.
 * Framework also add "Settings" to your plugin in plugins list.
 * @link https://github.com/JoeSz/Exopite-Simple-Options-Framework
 */
$config_submenu = array(
	'type'              => 'menu',                          // Required, menu or metabox
	'id'                => $this->plugin_name . '-test',    // Required, meta box id, unique per page, to save: get_option( id )
	'menu'              => 'plugins.php',                   // Required, sub page to your options page
	'submenu'           => true,                            // Required for submenu
	'title'             => 'Demo Admin Page',               //The name of this page
	'capability'        => 'manage_options',                // The capability needed to view the page
	'plugin_basename'   =>  plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ),
	// 'tabbed'            => false,
);

Default options for menu creation:

$default = array(
	'menu'          => 'plugins.php',
	// Required for submenu
	'submenu'       => false,
	//The name of this page
	'title'         => __( 'Exopite Options Framework', 'exopite-options-framework' ),
	// The capability needed to view the page
	'capability'    => 'manage_options',
	'settings_link' => true
);

available filter to override: 'exopite_sof_filter_config_default_menu_array'

Metabox

Clone this wiki locally