id ] = $this->label; return $pages; } /** * Get settings array * * @return array */ public function get_settings() { return array(); } /** * Output the settings */ public function output() { $settings = $this->get_settings(); SP_Admin_Settings::output_fields( $settings ); } /** * Save settings */ public function save() { global $current_section; $settings = $this->get_settings(); SP_Admin_Settings::save_fields( $settings ); if ( $current_section ) do_action( 'sportspress_update_options_' . $this->template . '_' . $current_section ); if ( ! empty( $this->templates ) ) update_option( 'sportspress_' . $this->template . '_template_order', sp_array_value( $_POST, 'sportspress_' . $this->template . '_template_order', false ) ); if ( isset( $_POST['sportspress_template_visibility'] ) && is_array( $_POST['sportspress_template_visibility'] ) ) { foreach ( $_POST['sportspress_template_visibility'] as $option => $toggled ) { if ( $toggled ) { update_option( $option, 'yes' ); } else { update_option( $option, 'no' ); } } } } /** * Layout settings * * @access public * @return void */ public function layout_setting() { $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $this->templates ); $layout = get_option( 'sportspress_' . $this->template . '_template_order' ); if ( false === $layout ) { $layout = array_keys( $templates ); } $templates = array_merge( array_flip( $layout ), $templates ); $slice = array_search( 'tabs', array_keys( $templates ) ); if ( $slice ) { $templates = array_slice( $templates, 0, $slice ); } ?>