' . esc_html( $tab[ 'title' ] ) . ''; } } /** * Output nonce, action, and option_page fields for a settings page. * Prints out all settings sections added to a particular settings page * * @param string $tab_slug - Slug of tub to check. * * @since 1.0 * @access protected * * @return void **/ protected function do_settings_base( $tab_slug = null ) { /** Foolproof. */ if ( null === $tab_slug ) { return; } settings_fields( 'SelectionLite' . $tab_slug . 'OptionsGroup' ); do_settings_sections( 'SelectionLite' . $tab_slug. 'OptionsGroup' ); } /** * Registers a setting and its data. * Add a new section to a settings page. * * @param string $tab_slug - Slug of tub to check. * * @since 1.0 * @access protected * * @return void **/ protected function add_settings_base( $tab_slug = null ) { /** Foolproof. */ if ( null === $tab_slug ) { return; } /** Status Tab. */ register_setting( 'SelectionLite' . $tab_slug . 'OptionsGroup', 'mdp_selection_lite_' . $tab_slug . '_settings' ); add_settings_section( 'mdp_selection_lite_' . $tab_slug . '_page_status_section', '', null, 'SelectionLite' . $tab_slug . 'OptionsGroup' ); } /** * Check if tab is enabled by tab slug. * * @param string $tab_slug - Tab slug. * * @since 1.0 * @access private * * @return bool **/ public static function is_tab_enabled( $tab_slug ) { /** Get all tabs and settings. */ $tabs = Plugin::get_tabs(); return isset( $tabs[ $tab_slug ][ 'enabled' ] ) && $tabs[ $tab_slug ][ 'enabled' ]; } }