Remove mode setting and unused thumbnail sizes
This commit is contained in:
@@ -59,11 +59,6 @@ class SP_Admin_Assets {
|
|||||||
wp_enqueue_style( 'sportspress-admin-equation-styles', SP()->plugin_url() . '/assets/css/equation.css', array(), SP_VERSION );
|
wp_enqueue_style( 'sportspress-admin-equation-styles', SP()->plugin_url() . '/assets/css/equation.css', array(), SP_VERSION );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SP()->mode == 'player' ):
|
|
||||||
$custom_css = '#adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before,.sp-icon-shield:before{content: "\f307"}';
|
|
||||||
wp_add_inline_style( 'sportspress-admin-menu-styles', $custom_css );
|
|
||||||
endif;
|
|
||||||
|
|
||||||
do_action( 'sportspress_admin_css' );
|
do_action( 'sportspress_admin_css' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,8 @@ class SP_Admin_Settings {
|
|||||||
$settings[] = include( 'settings/class-sp-settings-general.php' );
|
$settings[] = include( 'settings/class-sp-settings-general.php' );
|
||||||
$settings[] = include( 'settings/class-sp-settings-events.php' );
|
$settings[] = include( 'settings/class-sp-settings-events.php' );
|
||||||
$settings[] = include( 'settings/class-sp-settings-teams.php' );
|
$settings[] = include( 'settings/class-sp-settings-teams.php' );
|
||||||
|
$settings[] = include( 'settings/class-sp-settings-players.php' );
|
||||||
if ( SP()->mode == 'team' ):
|
$settings[] = include( 'settings/class-sp-settings-staff.php' );
|
||||||
$settings[] = include( 'settings/class-sp-settings-players.php' );
|
|
||||||
$settings[] = include( 'settings/class-sp-settings-staff.php' );
|
|
||||||
endif;
|
|
||||||
|
|
||||||
$settings = apply_filters( 'sportspress_get_settings_pages', $settings );
|
$settings = apply_filters( 'sportspress_get_settings_pages', $settings );
|
||||||
|
|
||||||
|
|||||||
@@ -181,10 +181,6 @@ class SP_Admin_Welcome {
|
|||||||
// Save settings
|
// Save settings
|
||||||
if ( isset( $_POST['timezone_string'] ) ):
|
if ( isset( $_POST['timezone_string'] ) ):
|
||||||
update_option( 'timezone_string', $_POST['timezone_string'] );
|
update_option( 'timezone_string', $_POST['timezone_string'] );
|
||||||
endif;
|
|
||||||
if ( isset( $_POST['sportspress_mode'] ) && ! empty( $_POST['sportspress_mode'] ) && get_option( 'sportspress_mode', null ) != $_POST['sportspress_mode'] ):
|
|
||||||
$sport = $_POST['sportspress_mode'];
|
|
||||||
update_option( 'sportspress_mode', $_POST['sportspress_mode'] );
|
|
||||||
endif;
|
endif;
|
||||||
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
|
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
|
||||||
$sport = $_POST['sportspress_sport'];
|
$sport = $_POST['sportspress_sport'];
|
||||||
@@ -235,20 +231,6 @@ class SP_Admin_Welcome {
|
|||||||
));
|
));
|
||||||
SP_Admin_Settings::output_fields( $settings );
|
SP_Admin_Settings::output_fields( $settings );
|
||||||
?>
|
?>
|
||||||
<h4><?php _e( 'Mode', 'sportspress' ); ?></h4>
|
|
||||||
<?php
|
|
||||||
$settings = array( array(
|
|
||||||
'id' => 'sportspress_mode',
|
|
||||||
'default' => 'team',
|
|
||||||
'type' => 'select',
|
|
||||||
'class' => $class,
|
|
||||||
'options' => array(
|
|
||||||
'team' => _x( 'Team', 'mode select', 'sportspress' ),
|
|
||||||
'player' => _x( 'Individual', 'mode select', 'sportspress' ),
|
|
||||||
),
|
|
||||||
));
|
|
||||||
SP_Admin_Settings::output_fields( $settings );
|
|
||||||
?>
|
|
||||||
<p class="submit sportspress-actions">
|
<p class="submit sportspress-actions">
|
||||||
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save changes', 'sportspress' ); ?>" />
|
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save changes', 'sportspress' ); ?>" />
|
||||||
<input type="hidden" name="subtab" id="last_tab" />
|
<input type="hidden" name="subtab" id="last_tab" />
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class SP_Admin_Meta_Boxes {
|
|||||||
add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Teams::save', 30, 2 );
|
add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Teams::save', 30, 2 );
|
||||||
add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Video::save', 40, 2 );
|
add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Video::save', 40, 2 );
|
||||||
add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Results::save', 50, 2 );
|
add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Results::save', 50, 2 );
|
||||||
if ( SP()->mode == 'team' ) add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Performance::save', 60, 2 );
|
add_action( 'sportspress_process_sp_event_meta', 'SP_Meta_Box_Event_Performance::save', 60, 2 );
|
||||||
|
|
||||||
// Save Calendar Meta Boxes
|
// Save Calendar Meta Boxes
|
||||||
add_action( 'sportspress_process_sp_calendar_meta', 'SP_Meta_Box_Calendar_Format::save', 10, 2 );
|
add_action( 'sportspress_process_sp_calendar_meta', 'SP_Meta_Box_Calendar_Format::save', 10, 2 );
|
||||||
@@ -62,7 +62,7 @@ class SP_Admin_Meta_Boxes {
|
|||||||
// Save Team Meta Boxes
|
// Save Team Meta Boxes
|
||||||
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Details::save', 10, 2 );
|
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Details::save', 10, 2 );
|
||||||
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Columns::save', 20, 2 );
|
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Columns::save', 20, 2 );
|
||||||
if ( SP()->mode == 'team' ) add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Lists::save', 30, 2 );
|
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Lists::save', 30, 2 );
|
||||||
|
|
||||||
// Save Table Meta Boxes
|
// Save Table Meta Boxes
|
||||||
add_action( 'sportspress_process_sp_table_meta', 'SP_Meta_Box_Table_Details::save', 10, 2 );
|
add_action( 'sportspress_process_sp_table_meta', 'SP_Meta_Box_Table_Details::save', 10, 2 );
|
||||||
@@ -124,7 +124,7 @@ class SP_Admin_Meta_Boxes {
|
|||||||
add_meta_box( 'sp_videodiv', __( 'Video', 'sportspress' ), 'SP_Meta_Box_Event_Video::output', 'sp_event', 'side', 'low' );
|
add_meta_box( 'sp_videodiv', __( 'Video', 'sportspress' ), 'SP_Meta_Box_Event_Video::output', 'sp_event', 'side', 'low' );
|
||||||
if ( sizeof( array_filter( sp_array_value( $post_meta, 'sp_team', array() ) ) ) ):
|
if ( sizeof( array_filter( sp_array_value( $post_meta, 'sp_team', array() ) ) ) ):
|
||||||
add_meta_box( 'sp_resultsdiv', __( 'Team Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' );
|
add_meta_box( 'sp_resultsdiv', __( 'Team Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' );
|
||||||
if ( SP()->mode == 'team' ) add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' );
|
add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' );
|
||||||
endif;
|
endif;
|
||||||
add_meta_box( 'sp_editordiv', __( 'Article', 'sportspress' ), 'SP_Meta_Box_Event_Editor::output', 'sp_event', 'normal', 'low' );
|
add_meta_box( 'sp_editordiv', __( 'Article', 'sportspress' ), 'SP_Meta_Box_Event_Editor::output', 'sp_event', 'normal', 'low' );
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ class SP_Admin_Meta_Boxes {
|
|||||||
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Team_Details::output', 'sp_team', 'side', 'default' );
|
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Team_Details::output', 'sp_team', 'side', 'default' );
|
||||||
if ( isset( $post ) && isset( $post->ID ) ):
|
if ( isset( $post ) && isset( $post->ID ) ):
|
||||||
if ( get_the_terms( $post->ID, 'sp_league' ) && get_the_terms( $post->ID, 'sp_season' ) ) add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' );
|
if ( get_the_terms( $post->ID, 'sp_league' ) && get_the_terms( $post->ID, 'sp_season' ) ) add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' );
|
||||||
if ( SP()->mode == 'team' ) add_meta_box( 'sp_listsdiv', __( 'Player Lists', 'sportspress' ), 'SP_Meta_Box_Team_Lists::output', 'sp_team', 'normal', 'high' );
|
add_meta_box( 'sp_listsdiv', __( 'Player Lists', 'sportspress' ), 'SP_Meta_Box_Team_Lists::output', 'sp_team', 'normal', 'high' );
|
||||||
endif;
|
endif;
|
||||||
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'low' );
|
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'low' );
|
||||||
|
|
||||||
|
|||||||
@@ -37,17 +37,13 @@ class SP_Meta_Box_Event_Teams {
|
|||||||
wp_dropdown_pages( $args );
|
wp_dropdown_pages( $args );
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
|
<ul id="sp_team-tabs" class="wp-tab-bar sp-tab-bar">
|
||||||
|
<li class="wp-tab-active"><a href="#sp_player-all"><?php _e( 'Players', 'sportspress' ); ?></a></li>
|
||||||
|
<li class="wp-tab"><a href="#sp_staff-all"><?php _e( 'Staff', 'sportspress' ); ?></a></li>
|
||||||
|
</ul>
|
||||||
<?php
|
<?php
|
||||||
if ( SP()->mode == 'team' ):
|
sp_post_checklist( $post->ID, 'sp_player', 'block', 'sp_current_team', $i );
|
||||||
?>
|
sp_post_checklist( $post->ID, 'sp_staff', 'none', 'sp_current_team', $i );
|
||||||
<ul id="sp_team-tabs" class="wp-tab-bar sp-tab-bar">
|
|
||||||
<li class="wp-tab-active"><a href="#sp_player-all"><?php _e( 'Players', 'sportspress' ); ?></a></li>
|
|
||||||
<li class="wp-tab"><a href="#sp_staff-all"><?php _e( 'Staff', 'sportspress' ); ?></a></li>
|
|
||||||
</ul>
|
|
||||||
<?php
|
|
||||||
sp_post_checklist( $post->ID, 'sp_player', 'block', 'sp_current_team', $i );
|
|
||||||
sp_post_checklist( $post->ID, 'sp_staff', 'none', 'sp_current_team', $i );
|
|
||||||
endif;
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -53,17 +53,6 @@ class SP_Settings_General extends SP_Settings_Page {
|
|||||||
'options' => $presets,
|
'options' => $presets,
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Mode', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_mode',
|
|
||||||
'default' => 'team',
|
|
||||||
'type' => 'select',
|
|
||||||
'options' => array(
|
|
||||||
'team' => _x( 'Team', 'mode select', 'sportspress' ),
|
|
||||||
'player' => _x( 'Individual', 'mode select', 'sportspress' ),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Google Maps', 'sportspress' ),
|
'title' => __( 'Google Maps', 'sportspress' ),
|
||||||
'id' => 'sportspress_map_type',
|
'id' => 'sportspress_map_type',
|
||||||
@@ -141,6 +130,15 @@ class SP_Settings_General extends SP_Settings_Page {
|
|||||||
'desc_tip' => __( 'This will enable a script allowing the tables to be sortable.', 'sportspress' ),
|
'desc_tip' => __( 'This will enable a script allowing the tables to be sortable.', 'sportspress' ),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Scrollable tables', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_enable_scrollable_tables',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
'desc_tip' => __( 'This will enable a script allowing the tables to be scrollable.', 'sportspress' ),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Live countdowns', 'sportspress' ),
|
'desc' => __( 'Live countdowns', 'sportspress' ),
|
||||||
'id' => 'sportspress_enable_live_countdowns',
|
'id' => 'sportspress_enable_live_countdowns',
|
||||||
|
|||||||
@@ -57,19 +57,15 @@ class SP_Settings_Players extends SP_Settings_Page {
|
|||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
),
|
),
|
||||||
);
|
|
||||||
|
|
||||||
if ( SP()->mode == 'team' ):
|
array(
|
||||||
$settings[] = array(
|
|
||||||
'title' => __( 'Teams', 'sportspress' ),
|
'title' => __( 'Teams', 'sportspress' ),
|
||||||
'desc' => __( 'Link teams', 'sportspress' ),
|
'desc' => __( 'Link teams', 'sportspress' ),
|
||||||
'id' => 'sportspress_list_link_teams',
|
'id' => 'sportspress_list_link_teams',
|
||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
);
|
),
|
||||||
endif;
|
|
||||||
|
|
||||||
$settings = array_merge( $settings, array(
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Pagination', 'sportspress' ),
|
'title' => __( 'Pagination', 'sportspress' ),
|
||||||
'desc' => __( 'Paginate', 'sportspress' ),
|
'desc' => __( 'Paginate', 'sportspress' ),
|
||||||
@@ -92,7 +88,7 @@ class SP_Settings_Players extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'list_options' ),
|
array( 'type' => 'sectionend', 'id' => 'list_options' ),
|
||||||
)); // End player settings
|
); // End player settings
|
||||||
|
|
||||||
return apply_filters( 'sportspress_player_settings', $settings );
|
return apply_filters( 'sportspress_player_settings', $settings );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -456,99 +456,97 @@ class SP_Post_types {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( SP()->mode == 'team' ):
|
register_post_type( 'sp_player',
|
||||||
register_post_type( 'sp_player',
|
apply_filters( 'sportspress_register_post_type_player',
|
||||||
apply_filters( 'sportspress_register_post_type_player',
|
array(
|
||||||
array(
|
'labels' => array(
|
||||||
'labels' => array(
|
'name' => __( 'Players', 'sportspress' ),
|
||||||
'name' => __( 'Players', 'sportspress' ),
|
'singular_name' => __( 'Player', 'sportspress' ),
|
||||||
'singular_name' => __( 'Player', 'sportspress' ),
|
'add_new_item' => __( 'Add New Player', 'sportspress' ),
|
||||||
'add_new_item' => __( 'Add New Player', 'sportspress' ),
|
'edit_item' => __( 'Edit Player', 'sportspress' ),
|
||||||
'edit_item' => __( 'Edit Player', 'sportspress' ),
|
'new_item' => __( 'New', 'sportspress' ),
|
||||||
'new_item' => __( 'New', 'sportspress' ),
|
'view_item' => __( 'View Player', 'sportspress' ),
|
||||||
'view_item' => __( 'View Player', 'sportspress' ),
|
'search_items' => __( 'Search', 'sportspress' ),
|
||||||
'search_items' => __( 'Search', 'sportspress' ),
|
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
),
|
||||||
),
|
'public' => true,
|
||||||
'public' => true,
|
'show_ui' => true,
|
||||||
'show_ui' => true,
|
'capability_type' => 'sp_player',
|
||||||
'capability_type' => 'sp_player',
|
'map_meta_cap' => true,
|
||||||
'map_meta_cap' => true,
|
'publicly_queryable' => true,
|
||||||
'publicly_queryable' => true,
|
'exclude_from_search' => false,
|
||||||
'exclude_from_search' => false,
|
'hierarchical' => false,
|
||||||
'hierarchical' => false,
|
'rewrite' => array( 'slug' => get_option( 'sportspress_player_slug', 'player' ) ),
|
||||||
'rewrite' => array( 'slug' => get_option( 'sportspress_player_slug', 'player' ) ),
|
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'page-attributes' ),
|
||||||
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'page-attributes' ),
|
'has_archive' => false,
|
||||||
'has_archive' => false,
|
'show_in_nav_menus' => true,
|
||||||
'show_in_nav_menus' => true,
|
'menu_icon' => 'dashicons-groups',
|
||||||
'menu_icon' => 'dashicons-groups',
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
|
||||||
register_post_type( 'sp_list',
|
register_post_type( 'sp_list',
|
||||||
apply_filters( 'sportspress_register_post_type_list',
|
apply_filters( 'sportspress_register_post_type_list',
|
||||||
array(
|
array(
|
||||||
'labels' => array(
|
'labels' => array(
|
||||||
'name' => __( 'Player Lists', 'sportspress' ),
|
'name' => __( 'Player Lists', 'sportspress' ),
|
||||||
'singular_name' => __( 'Player List', 'sportspress' ),
|
'singular_name' => __( 'Player List', 'sportspress' ),
|
||||||
'add_new_item' => __( 'Add New Player List', 'sportspress' ),
|
'add_new_item' => __( 'Add New Player List', 'sportspress' ),
|
||||||
'edit_item' => __( 'Edit Player List', 'sportspress' ),
|
'edit_item' => __( 'Edit Player List', 'sportspress' ),
|
||||||
'new_item' => __( 'New', 'sportspress' ),
|
'new_item' => __( 'New', 'sportspress' ),
|
||||||
'view_item' => __( 'View Player List', 'sportspress' ),
|
'view_item' => __( 'View Player List', 'sportspress' ),
|
||||||
'search_items' => __( 'Search', 'sportspress' ),
|
'search_items' => __( 'Search', 'sportspress' ),
|
||||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||||
),
|
),
|
||||||
'public' => true,
|
'public' => true,
|
||||||
'show_ui' => true,
|
'show_ui' => true,
|
||||||
'capability_type' => 'sp_list',
|
'capability_type' => 'sp_list',
|
||||||
'map_meta_cap' => true,
|
'map_meta_cap' => true,
|
||||||
'publicly_queryable' => true,
|
'publicly_queryable' => true,
|
||||||
'exclude_from_search' => false,
|
'exclude_from_search' => false,
|
||||||
'hierarchical' => false,
|
'hierarchical' => false,
|
||||||
'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ),
|
'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ),
|
||||||
'supports' => array( 'title', 'page-attributes', 'author', 'thumbnail' ),
|
'supports' => array( 'title', 'page-attributes', 'author', 'thumbnail' ),
|
||||||
'has_archive' => false,
|
'has_archive' => false,
|
||||||
'show_in_nav_menus' => true,
|
'show_in_nav_menus' => true,
|
||||||
'show_in_menu' => 'edit.php?post_type=sp_player',
|
'show_in_menu' => 'edit.php?post_type=sp_player',
|
||||||
'show_in_admin_bar' => true,
|
'show_in_admin_bar' => true,
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
|
||||||
register_post_type( 'sp_staff',
|
register_post_type( 'sp_staff',
|
||||||
apply_filters( 'sportspress_register_post_type_staff',
|
apply_filters( 'sportspress_register_post_type_staff',
|
||||||
array(
|
array(
|
||||||
'labels' => array(
|
'labels' => array(
|
||||||
'name' => __( 'Staff', 'sportspress' ),
|
'name' => __( 'Staff', 'sportspress' ),
|
||||||
'singular_name' => __( 'Staff', 'sportspress' ),
|
'singular_name' => __( 'Staff', 'sportspress' ),
|
||||||
'add_new_item' => __( 'Add New Staff', 'sportspress' ),
|
'add_new_item' => __( 'Add New Staff', 'sportspress' ),
|
||||||
'edit_item' => __( 'Edit Staff', 'sportspress' ),
|
'edit_item' => __( 'Edit Staff', 'sportspress' ),
|
||||||
'new_item' => __( 'New', 'sportspress' ),
|
'new_item' => __( 'New', 'sportspress' ),
|
||||||
'view_item' => __( 'View Staff', 'sportspress' ),
|
'view_item' => __( 'View Staff', 'sportspress' ),
|
||||||
'search_items' => __( 'Search', 'sportspress' ),
|
'search_items' => __( 'Search', 'sportspress' ),
|
||||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||||
),
|
),
|
||||||
'public' => true,
|
'public' => true,
|
||||||
'show_ui' => true,
|
'show_ui' => true,
|
||||||
'capability_type' => 'sp_staff',
|
'capability_type' => 'sp_staff',
|
||||||
'map_meta_cap' => true,
|
'map_meta_cap' => true,
|
||||||
'publicly_queryable' => true,
|
'publicly_queryable' => true,
|
||||||
'exclude_from_search' => false,
|
'exclude_from_search' => false,
|
||||||
'hierarchical' => false,
|
'hierarchical' => false,
|
||||||
'rewrite' => array( 'slug' => get_option( 'sportspress_staff_slug', 'staff' ) ),
|
'rewrite' => array( 'slug' => get_option( 'sportspress_staff_slug', 'staff' ) ),
|
||||||
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ),
|
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ),
|
||||||
'has_archive' => false,
|
'has_archive' => false,
|
||||||
'show_in_nav_menus' => true,
|
'show_in_nav_menus' => true,
|
||||||
'show_in_menu' => 'edit.php?post_type=sp_player',
|
'show_in_menu' => 'edit.php?post_type=sp_player',
|
||||||
'show_in_admin_bar' => true,
|
'show_in_admin_bar' => true,
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
)
|
||||||
endif;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_scheduled_events( $posts ) {
|
public function display_scheduled_events( $posts ) {
|
||||||
|
|||||||
@@ -1066,19 +1066,25 @@ if ( !function_exists( 'sp_get_next_event' ) ) {
|
|||||||
function sp_get_text_options() {
|
function sp_get_text_options() {
|
||||||
$strings = apply_filters( 'sportspress_text', array(
|
$strings = apply_filters( 'sportspress_text', array(
|
||||||
__( 'Article', 'sportspress' ),
|
__( 'Article', 'sportspress' ),
|
||||||
|
__( 'Current Team', 'sportspress' ),
|
||||||
__( 'Date', 'sportspress' ),
|
__( 'Date', 'sportspress' ),
|
||||||
__( 'Details', 'sportspress' ),
|
__( 'Details', 'sportspress' ),
|
||||||
__( 'Event', 'sportspress' ),
|
__( 'Event', 'sportspress' ),
|
||||||
__( 'League', 'sportspress' ),
|
__( 'League', 'sportspress' ),
|
||||||
__( 'Nationality', 'sportspress' ),
|
__( 'Nationality', 'sportspress' ),
|
||||||
__( 'Outcome', 'sportspress' ),
|
__( 'Outcome', 'sportspress' ),
|
||||||
|
__( 'Past Teams', 'sportspress' ),
|
||||||
__( 'Played', 'sportspress' ),
|
__( 'Played', 'sportspress' ),
|
||||||
|
__( 'Player', 'sportspress' ),
|
||||||
__( 'Pos', 'sportspress' ),
|
__( 'Pos', 'sportspress' ),
|
||||||
|
__( 'Position', 'sportspress' ),
|
||||||
__( 'Preview', 'sportspress' ),
|
__( 'Preview', 'sportspress' ),
|
||||||
__( 'Rank', 'sportspress' ),
|
__( 'Rank', 'sportspress' ),
|
||||||
__( 'Recap', 'sportspress' ),
|
__( 'Recap', 'sportspress' ),
|
||||||
__( 'Team Results', 'sportspress' ),
|
__( 'Team Results', 'sportspress' ),
|
||||||
__( 'Season', 'sportspress' ),
|
__( 'Season', 'sportspress' ),
|
||||||
|
__( 'Staff', 'sportspress' ),
|
||||||
|
__( 'Substitutes', 'sportspress' ),
|
||||||
__( 'Team', 'sportspress' ),
|
__( 'Team', 'sportspress' ),
|
||||||
__( 'Teams', 'sportspress' ),
|
__( 'Teams', 'sportspress' ),
|
||||||
__( 'Time', 'sportspress' ),
|
__( 'Time', 'sportspress' ),
|
||||||
@@ -1086,21 +1092,10 @@ function sp_get_text_options() {
|
|||||||
__( 'Total', 'sportspress' ),
|
__( 'Total', 'sportspress' ),
|
||||||
__( 'Venue', 'sportspress' ),
|
__( 'Venue', 'sportspress' ),
|
||||||
__( 'View all events', 'sportspress' ),
|
__( 'View all events', 'sportspress' ),
|
||||||
|
__( 'View all players', 'sportspress' ),
|
||||||
__( 'View full table', 'sportspress' ),
|
__( 'View full table', 'sportspress' ),
|
||||||
));
|
));
|
||||||
|
|
||||||
if ( SP()->mode == 'team' ):
|
|
||||||
$strings = array_merge( $strings, array(
|
|
||||||
__( 'Current Team', 'sportspress' ),
|
|
||||||
__( 'Past Teams', 'sportspress' ),
|
|
||||||
__( 'Player', 'sportspress' ),
|
|
||||||
__( 'Position', 'sportspress' ),
|
|
||||||
__( 'Staff', 'sportspress' ),
|
|
||||||
__( 'Substitutes', 'sportspress' ),
|
|
||||||
__( 'View all players', 'sportspress' ),
|
|
||||||
));
|
|
||||||
endif;
|
|
||||||
|
|
||||||
asort( $strings );
|
asort( $strings );
|
||||||
return $strings;
|
return $strings;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ if ( ! function_exists( 'sportspress_output_event_performance' ) ) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function sportspress_output_event_performance() {
|
function sportspress_output_event_performance() {
|
||||||
if ( SP()->mode == 'team' ) sp_get_template( 'event-performance.php' );
|
sp_get_template( 'event-performance.php' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,11 +56,6 @@ final class SportsPress {
|
|||||||
*/
|
*/
|
||||||
public $text = array();
|
public $text = array();
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
public $mode = 'team';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main SportsPress Instance
|
* Main SportsPress Instance
|
||||||
*
|
*
|
||||||
@@ -121,7 +116,6 @@ final class SportsPress {
|
|||||||
add_action( 'init', array( $this, 'init' ), 0 );
|
add_action( 'init', array( $this, 'init' ), 0 );
|
||||||
add_action( 'init', array( 'SP_Shortcodes', 'init' ) );
|
add_action( 'init', array( 'SP_Shortcodes', 'init' ) );
|
||||||
add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );
|
add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );
|
||||||
add_filter( 'gettext', array( $this, 'gettext' ), 20, 3 );
|
|
||||||
|
|
||||||
// Loaded action
|
// Loaded action
|
||||||
do_action( 'sportspress_loaded' );
|
do_action( 'sportspress_loaded' );
|
||||||
@@ -279,9 +273,6 @@ final class SportsPress {
|
|||||||
// Load string options
|
// Load string options
|
||||||
$this->text = get_option( 'sportspress_text', array() );
|
$this->text = get_option( 'sportspress_text', array() );
|
||||||
|
|
||||||
// Get mode option
|
|
||||||
$this->mode = sp_get_option( 'sportspress_mode', 'team' );
|
|
||||||
|
|
||||||
// Init action
|
// Init action
|
||||||
do_action( 'sportspress_init' );
|
do_action( 'sportspress_init' );
|
||||||
}
|
}
|
||||||
@@ -305,64 +296,12 @@ final class SportsPress {
|
|||||||
public function setup_environment() {
|
public function setup_environment() {
|
||||||
add_theme_support( 'post-thumbnails' );
|
add_theme_support( 'post-thumbnails' );
|
||||||
|
|
||||||
// Standard (3:2)
|
// Add image sizes
|
||||||
add_image_size( 'sportspress-standard', 640, 480, true );
|
|
||||||
add_image_size( 'sportspress-standard-thumbnail', 320, 240, true );
|
|
||||||
|
|
||||||
// Wide (16:9)
|
|
||||||
add_image_size( 'sportspress-wide-header', 1920, 1080, true );
|
|
||||||
add_image_size( 'sportspress-wide', 640, 360, true );
|
|
||||||
add_image_size( 'sportspress-wide-thumbnail', 320, 180, true );
|
|
||||||
|
|
||||||
// Square (1:1)
|
|
||||||
add_image_size( 'sportspress-square', 640, 640, true );
|
|
||||||
add_image_size( 'sportspress-square-thumbnail', 320, 320, true );
|
|
||||||
|
|
||||||
// Fit (Proportional)
|
|
||||||
add_image_size( 'sportspress-fit', 640, 640, false );
|
|
||||||
add_image_size( 'sportspress-fit-thumbnail', 320, 320, false );
|
add_image_size( 'sportspress-fit-thumbnail', 320, 320, false );
|
||||||
add_image_size( 'sportspress-fit-icon', 128, 128, false );
|
add_image_size( 'sportspress-fit-icon', 128, 128, false );
|
||||||
add_image_size( 'sportspress-fit-mini', 32, 32, false );
|
add_image_size( 'sportspress-fit-mini', 32, 32, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Replace team strings with player if individual mode.
|
|
||||||
*/
|
|
||||||
public function gettext( $translated_text, $untranslated_text, $domain = 'default' ) {
|
|
||||||
if ( SP()->mode == 'player' && $domain == 'sportspress' ):
|
|
||||||
switch ( $untranslated_text ):
|
|
||||||
case 'Teams':
|
|
||||||
return __( 'Players', 'sportspress' );
|
|
||||||
case 'Team':
|
|
||||||
return __( 'Player', 'sportspress' );
|
|
||||||
case 'teams':
|
|
||||||
return __( 'players', 'sportspress' );
|
|
||||||
case 'Add New Team':
|
|
||||||
return __( 'Add New Player', 'sportspress' );
|
|
||||||
case 'Edit Team':
|
|
||||||
return __( 'Edit Player', 'sportspress' );
|
|
||||||
case 'Team Options':
|
|
||||||
return __( 'Player Options', 'sportspress' );
|
|
||||||
case 'Team Results':
|
|
||||||
return __( 'Player Performance', 'sportspress' );
|
|
||||||
case 'Logo':
|
|
||||||
return __( 'Photo', 'sportspress' );
|
|
||||||
case 'Add logo':
|
|
||||||
return __( 'Add photo', 'sportspress' );
|
|
||||||
case 'Remove logo':
|
|
||||||
return __( 'Remove photo', 'sportspress' );
|
|
||||||
case 'Select Logo':
|
|
||||||
return __( 'Select Photo', 'sportspress' );
|
|
||||||
case 'Display logos':
|
|
||||||
return __( 'Display photos', 'sportspress' );
|
|
||||||
case 'Link teams':
|
|
||||||
return __( 'Link players', 'sportspress' );
|
|
||||||
endswitch;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
return $translated_text;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Helper functions ******************************************************/
|
/** Helper functions ******************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|
||||||
|
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
$date = get_the_time( get_option('date_format'), $id );
|
$date = get_the_time( get_option('date_format'), $id );
|
||||||
$time = get_the_time( get_option('time_format'), $id );
|
$time = get_the_time( get_option('time_format'), $id );
|
||||||
$leagues = get_the_terms( $id, 'sp_league' );
|
$leagues = get_the_terms( $id, 'sp_league' );
|
||||||
@@ -30,7 +31,7 @@ if ( $seasons ):
|
|||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<h4 class="sp-table-caption"><?php _e( 'Details', 'sportspress' ); ?></h4>
|
<h4 class="sp-table-caption"><?php _e( 'Details', 'sportspress' ); ?></h4>
|
||||||
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
|
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
||||||
<table class="sp-event-details sp-data-table">
|
<table class="sp-event-details sp-data-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ $defaults = array(
|
|||||||
'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
|
'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'link_venues' => get_option( 'sportspress_calendar_link_venues', 'yes' ) == 'yes' ? true : false,
|
'link_venues' => get_option( 'sportspress_calendar_link_venues', 'yes' ) == 'yes' ? true : false,
|
||||||
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
|
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
||||||
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
|
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
|
||||||
@@ -46,7 +47,7 @@ if ( isset( $columns ) ):
|
|||||||
$usecolumns = explode( ',', $columns );
|
$usecolumns = explode( ',', $columns );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
|
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
||||||
<table class="sp-event-list sp-data-table<?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
<table class="sp-event-list sp-data-table<?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ $status = $event->status();
|
|||||||
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) == 'yes' ? true : false;
|
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) == 'yes' ? true : false;
|
||||||
$link_posts = get_option( 'sportspress_event_link_players', 'yes' ) == 'yes' ? true : false;
|
$link_posts = get_option( 'sportspress_event_link_players', 'yes' ) == 'yes' ? true : false;
|
||||||
$sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;
|
$sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
|
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
|
|
||||||
if ( is_array( $teams ) ):
|
if ( is_array( $teams ) ):
|
||||||
@@ -55,7 +56,7 @@ if ( is_array( $teams ) ):
|
|||||||
sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
|
sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
|
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
||||||
<table class="sp-event-performance sp-data-table <?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $has_players && $sortable ) { ?> sp-sortable-table<?php } ?>">
|
<table class="sp-event-performance sp-data-table <?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $has_players && $sortable ) { ?> sp-sortable-table<?php } ?>">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ $data = array_filter( $data );
|
|||||||
if ( empty( $data ) )
|
if ( empty( $data ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
$show_outcomes = array_key_exists( 'outcome', $labels );
|
$show_outcomes = array_key_exists( 'outcome', $labels );
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
@@ -88,7 +89,7 @@ else:
|
|||||||
|
|
||||||
$output .= '<h4 class="sp-table-caption">' . __( 'Team Results', 'sportspress' ) . '</h4>';
|
$output .= '<h4 class="sp-table-caption">' . __( 'Team Results', 'sportspress' ) . '</h4>';
|
||||||
|
|
||||||
$output .= '<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
|
$output .= '<div class="sp-table-wrapper' . ( $scrollable ? ' sp-scrollable-table-wrapper' : '' ) . '">' .
|
||||||
'<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' .
|
'<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' .
|
||||||
'<th class="data-name">' . __( 'Team', 'sportspress' ) . '</th>';
|
'<th class="data-name">' . __( 'Team', 'sportspress' ) . '</th>';
|
||||||
foreach( $labels as $key => $label ):
|
foreach( $labels as $key => $label ):
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ $defaults = array(
|
|||||||
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
|
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
|
||||||
'link_posts' => get_option( 'sportspress_table_link_teams', 'no' ) == 'yes' ? true : false,
|
'link_posts' => get_option( 'sportspress_table_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
|
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false,
|
'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false,
|
||||||
'rows' => get_option( 'sportspress_table_rows', 10 ),
|
'rows' => get_option( 'sportspress_table_rows', 10 ),
|
||||||
@@ -26,7 +27,7 @@ extract( $defaults, EXTR_SKIP );
|
|||||||
|
|
||||||
$output = '<h4 class="sp-table-caption">' . get_the_title( $id ) . '</h4>';
|
$output = '<h4 class="sp-table-caption">' . get_the_title( $id ) . '</h4>';
|
||||||
|
|
||||||
$output .= '<div class="sp-table-wrapper sp-scrollable-table-wrapper">';
|
$output .= '<div class="sp-table-wrapper' . ( $scrollable ? ' sp-scrollable-table-wrapper' : '' ) . '">';
|
||||||
|
|
||||||
$output .= '<table class="sp-league-table sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . ( $sortable ? ' sp-sortable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
|
$output .= '<table class="sp-league-table sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . ( $sortable ? ' sp-sortable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ $defaults = array(
|
|||||||
'link_posts' => get_option( 'sportspress_list_link_players', 'yes' ) == 'yes' ? true : false,
|
'link_posts' => get_option( 'sportspress_list_link_players', 'yes' ) == 'yes' ? true : false,
|
||||||
'link_teams' => get_option( 'sportspress_list_link_teams', 'no' ) == 'yes' ? true : false,
|
'link_teams' => get_option( 'sportspress_list_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
|
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'paginated' => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false,
|
'paginated' => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false,
|
||||||
'rows' => get_option( 'sportspress_list_rows', 10 ),
|
'rows' => get_option( 'sportspress_list_rows', 10 ),
|
||||||
@@ -79,7 +80,7 @@ foreach ( $groups as $group ):
|
|||||||
$output .= '<' . $grouptag . ' class="sp-table-caption player-group-name player-list-group-name">' . $group->name . '</' . $grouptag . '>';
|
$output .= '<' . $grouptag . ' class="sp-table-caption player-group-name player-list-group-name">' . $group->name . '</' . $grouptag . '>';
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$output .= '<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
|
$output .= '<div class="sp-table-wrapper' . ( $scrollable ? ' sp-scrollable-table-wrapper' : '' ) . '">' .
|
||||||
'<table class="sp-player-list sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . ( $sortable ? ' sp-sortable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
|
'<table class="sp-player-list sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . ( $sortable ? ' sp-sortable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
|
||||||
|
|
||||||
if ( in_array( $orderby, array( 'number', 'name' ) ) ):
|
if ( in_array( $orderby, array( 'number', 'name' ) ) ):
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ if ( ! isset( $id ) )
|
|||||||
|
|
||||||
$player = new SP_Player( $id );
|
$player = new SP_Player( $id );
|
||||||
|
|
||||||
|
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
|
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
$leagues = get_the_terms( $id, 'sp_league' );
|
$leagues = get_the_terms( $id, 'sp_league' );
|
||||||
|
|
||||||
// Loop through statistics for each league
|
// Loop through statistics for each league
|
||||||
if ( is_array( $leagues ) ):
|
if ( is_array( $leagues ) ):
|
||||||
foreach ( $leagues as $league ):
|
foreach ( $leagues as $league ):
|
||||||
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
|
||||||
|
|
||||||
$data = $player->data( $league->term_id );
|
$data = $player->data( $league->term_id );
|
||||||
|
|
||||||
// The first row should be column labels
|
// The first row should be column labels
|
||||||
@@ -34,7 +34,7 @@ if ( is_array( $leagues ) ):
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
$output = '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
|
$output = '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
|
||||||
'<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
|
'<div class="sp-table-wrapper' . ( $scrollable ? ' sp-scrollable-table-wrapper' : '' ) . '">' .
|
||||||
'<table class="sp-player-statistics sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . '">' . '<thead>' . '<tr>';
|
'<table class="sp-player-statistics sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . '">' . '<thead>' . '<tr>';
|
||||||
|
|
||||||
foreach( $labels as $key => $label ):
|
foreach( $labels as $key => $label ):
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|
||||||
|
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
$leagues = get_the_terms( $id, 'sp_league' );
|
$leagues = get_the_terms( $id, 'sp_league' );
|
||||||
|
|
||||||
if ( ! $leagues )
|
if ( ! $leagues )
|
||||||
@@ -36,7 +37,7 @@ foreach ( $leagues as $league ):
|
|||||||
unset( $data[0] );
|
unset( $data[0] );
|
||||||
|
|
||||||
$output .= '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
|
$output .= '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
|
||||||
'<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
|
'<div class="sp-table-wrapper' . ( $scrollable ? ' sp-scrollable-table-wrapper' : '' ) . '">' .
|
||||||
'<table class="sp-team-columns sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
|
'<table class="sp-team-columns sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
|
||||||
|
|
||||||
foreach( $labels as $key => $label ):
|
foreach( $labels as $key => $label ):
|
||||||
|
|||||||
Reference in New Issue
Block a user