id = 'config'; $this->label = __( 'Configure', 'sportspress' ); add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_admin_field_results', array( $this, 'results_setting' ) ); add_action( 'sportspress_admin_field_outcomes', array( $this, 'outcomes_setting' ) ); add_action( 'sportspress_admin_field_columns', array( $this, 'columns_setting' ) ); add_action( 'sportspress_admin_field_metrics', array( $this, 'metrics_setting' ) ); add_action( 'sportspress_admin_field_performance', array( $this, 'performance_setting' ) ); add_action( 'sportspress_admin_field_statistics', array( $this, 'statistics_setting' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get settings array * * @return array */ public function get_settings() { $settings = array( array( 'title' => __( 'Configure SportsPress', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'config_options' ), array( 'type' => 'outcomes' ), array( 'type' => 'results' ), ); if ( SP()->mode == 'team' ) $settings[] = array( 'type' => 'performance' ); $settings[] = array( 'type' => 'columns' ); if ( SP()->mode == 'team' ): $settings = array_merge( $settings, array( array( 'type' => 'metrics' ), array( 'type' => 'statistics' ), )); endif; $settings[] = array( 'type' => 'sectionend', 'id' => 'config_options' ); // End event settings return apply_filters( 'sportspress_config_settings', $settings ); } /** * Save settings */ public function save() { if ( isset( $_POST['sportspress_primary_result'] ) ): update_option( 'sportspress_primary_result', $_POST['sportspress_primary_result'] ); endif; $settings = $this->get_settings(); SP_Admin_Settings::save_fields( $settings ); } /** * Output outcomes settings * * @access public * @return void */ public function outcomes_setting() { $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC' ); $data = get_posts( $args ); ?>
| post_title; ?> | post_name; ?> | post_excerpt; ?> |
| > | ||||
|---|---|---|---|---|
| post_name ); ?>> | post_name; ?>for, post_name; ?>against | post_excerpt; ?> |
||
| post_title; ?> | post_name; ?> | post_excerpt; ?> |
| post_title; ?> | post_name; ?> | ID ); ?> | ID ); ?> | ID ); ?> | post_excerpt; ?> |
| post_title; ?> | post_name; ?> | post_excerpt; ?> |
| post_title; ?> | post_name; ?> | ID ); ?> | ID ); ?> | post_excerpt; ?> |