*/ public function __construct( $args = array() ) { if ( ! empty( $args ) ) { $this->settings = $args; $this->settings['parent'] = $this->settings['page']; $this->_tabs_path_files = $this->get_tabs_path_files(); add_action( 'admin_init', array( $this, 'register_settings' ) ); add_action( 'admin_menu', array( &$this, 'add_setting_page' ) ); add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), 100 ); add_action( 'admin_init', array( &$this, 'add_fields' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); } } /** * Register Settings * * Generate wp-admin settings pages by registering your settings and using a few callbacks to control the output * * @return void * @since 1.0 * @author Emanuela Castorina */ public function register_settings() { register_setting( 'yit_' . $this->settings['page'] . '_options', 'yit_' . $this->settings['page'] . '_options', array( &$this, 'options_validate' ) ); } /** * Add Setting SubPage * * add Setting SubPage to wordpress administrator * * @return array validate input fields * @since 1.0 * @author Emanuela Castorina */ public function add_setting_page() { global $admin_page_hooks; $logo = YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png'; $admin_logo = function_exists( 'yit_get_option' ) ? yit_get_option( 'admin-logo-menu' ) : ''; if ( isset( $admin_logo ) && !empty( $admin_logo ) && $admin_logo != '' && $admin_logo ) { $logo = $admin_logo; } if( ! isset( $admin_page_hooks['yit_plugin_panel'] ) ) { $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' ); add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'nosuchcapability', 'yit_plugin_panel', NULL, $logo, $position ); } add_submenu_page( 'yit_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array( $this, 'yit_panel' ) ); remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' ); } /** * Show a tabbed panel to setting page * * a callback function called by add_setting_page => add_submenu_page * * @return void * @since 1.0 * @author Emanuela Castorina */ public function yit_panel() { $tabs = ''; $current_tab = $this->get_current_tab(); // tabs foreach ( $this->settings['admin-tabs'] as $tab => $tab_value ) { $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : ''; $tabs .= '' . $tab_value . ''; } ?>

message(); ?>

get_tab_title() ?>

is_show_form() ) : ?>

 

settings['page'] . '_options' ); ?>