Add main result, last 5 counter, and fix countdown direction
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
<h3 class="title"><?php _e( 'Event Settings', 'sportspress' ); ?></h3>
|
||||
<?php
|
||||
settings_fields( 'sportspress_events' );
|
||||
do_settings_sections( 'sportspress_events' );
|
||||
submit_button();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'sp_result',
|
||||
'numberposts' => -1,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<h3 class="title"><?php _e( 'General Settings', 'sportspress' ); ?></h3>
|
||||
<?php
|
||||
settings_fields( 'sportspress_general' );
|
||||
do_settings_sections( 'sportspress_general' );
|
||||
submit_button();
|
||||
settings_fields( 'sportspress_general' );
|
||||
do_settings_sections( 'sportspress_general' );
|
||||
submit_button();
|
||||
|
||||
@@ -38,15 +38,31 @@ function sportspress_settings() {
|
||||
function sportspress_sport_callback() {
|
||||
global $sportspress_sports;
|
||||
$options = get_option( 'sportspress' );
|
||||
|
||||
$selected = sportspress_array_value( $options, 'sport', null );
|
||||
?>
|
||||
<select id="sportspress_sport" name="sportspress[sport]">
|
||||
<?php foreach( $sportspress_sports as $slug => $sport ): ?>
|
||||
<option value="<?php echo $slug; ?>" <?php selected( $options['sport'], $slug ); ?>><?php echo $sport['name']; ?></option>
|
||||
<option value="<?php echo $slug; ?>" <?php selected( $selected, $slug ); ?>><?php echo $sport['name']; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
function sportspress_result_callback() {
|
||||
$options = get_option( 'sportspress' );
|
||||
|
||||
$selected = sportspress_array_value( $options, 'main_result', null );
|
||||
$args = array(
|
||||
'post_type' => 'sp_result',
|
||||
'name' => 'sportspress[main_result]',
|
||||
'show_option_all' => __( '(Auto)', 'sportspress' ),
|
||||
'selected' => $selected,
|
||||
'values' => 'slug',
|
||||
);
|
||||
sportspress_dropdown_pages( $args );
|
||||
}
|
||||
|
||||
function sportspress_team_stats_callback() {
|
||||
sportspress_render_option_field( 'sportspress_stats', 'team', 'textarea' );
|
||||
}
|
||||
@@ -88,8 +104,7 @@ function sportspress_settings_init() {
|
||||
// Event Settings
|
||||
register_setting(
|
||||
'sportspress_events',
|
||||
'sportspress',
|
||||
'sportspress_validate'
|
||||
'sportspress'
|
||||
);
|
||||
|
||||
add_settings_section(
|
||||
@@ -100,9 +115,9 @@ function sportspress_settings_init() {
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'sport',
|
||||
__( 'Sport', 'sportspress' ),
|
||||
'sportspress_sport_callback',
|
||||
'result',
|
||||
__( 'Main Result', 'sportspress' ),
|
||||
'sportspress_result_callback',
|
||||
'sportspress_events',
|
||||
'events'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user