Little fixes
This commit is contained in:
@@ -7,7 +7,7 @@ function sportspress_sanitize_title( $title ) {
|
||||
|
||||
elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic', 'sp_metric' ) ) ):
|
||||
|
||||
$key = $_POST['sp_key'];
|
||||
$key = isset( $_POST['sp_key'] ) ? $_POST['sp_key'] : null;
|
||||
|
||||
if ( ! $key ) $key = $_POST['post_title'];
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ function sportspress_calendar_post_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ),
|
||||
'register_meta_box_cb' => 'sportspress_calendar_meta_init',
|
||||
|
||||
@@ -10,6 +10,7 @@ function sportspress_column_post_init() {
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sportspress_column_meta_init',
|
||||
|
||||
@@ -8,6 +8,7 @@ function sportspress_list_post_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'thumbnail' ),
|
||||
'register_meta_box_cb' => 'sportspress_list_meta_init',
|
||||
|
||||
@@ -10,6 +10,7 @@ function sportspress_metric_post_init() {
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'capability_type' => 'sp_config'
|
||||
|
||||
@@ -10,6 +10,7 @@ function sportspress_outcome_post_init() {
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sportspress_outcome_meta_init',
|
||||
|
||||
@@ -8,6 +8,7 @@ function sportspress_player_post_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'thumbnail', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sportspress_player_meta_init',
|
||||
|
||||
@@ -10,6 +10,7 @@ function sportspress_result_post_init() {
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sportspress_result_meta_init',
|
||||
|
||||
@@ -8,6 +8,7 @@ function sportspress_staff_post_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'thumbnail' ),
|
||||
'register_meta_box_cb' => 'sportspress_staff_meta_init',
|
||||
|
||||
@@ -10,6 +10,7 @@ function sportspress_statistic_post_init() {
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sportspress_statistic_meta_init',
|
||||
|
||||
@@ -8,6 +8,7 @@ function sportspress_table_post_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ),
|
||||
'register_meta_box_cb' => 'sportspress_table_meta_init',
|
||||
|
||||
@@ -8,6 +8,7 @@ function sportspress_team_post_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => true,
|
||||
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sportspress_team_meta_init',
|
||||
|
||||
@@ -35,8 +35,8 @@ $args = array(
|
||||
'post_type' => 'sp_statistic',
|
||||
'numberposts' => -1,
|
||||
'posts_per_page' => -1,
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC'
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC'
|
||||
);
|
||||
$data = get_posts( $args );
|
||||
?>
|
||||
|
||||
@@ -12,12 +12,15 @@ if ( !function_exists( 'sportspress_event_details' ) ) {
|
||||
|
||||
$data = array( __( 'Date', 'sportspress' ) => $date, __( 'Time', 'sportspress' ) => $time );
|
||||
|
||||
if ( $leagues )
|
||||
$data[ __( 'League', 'sportspress' ) ] = sportspress_array_value( $leagues, 0, '—' )->name;
|
||||
|
||||
if ( $seasons )
|
||||
$data[ __( 'Season', 'sportspress' ) ] = sportspress_array_value( $seasons, 0, '—' )->name;
|
||||
if ( $leagues ):
|
||||
$league = array_pop( $leagues );
|
||||
$data[ __( 'League', 'sportspress' ) ] = $league->name;
|
||||
endif;
|
||||
|
||||
if ( $seasons ):
|
||||
$season = array_pop( $seasons );
|
||||
$data[ __( 'Season', 'sportspress' ) ] = $season->name;
|
||||
endif;
|
||||
|
||||
$output = '<h3>' . __( 'Details', 'sportspress' ) . '</h3>';
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ function sportspress_league_term_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'show_tagcloud' => false,
|
||||
'hierarchical' => true,
|
||||
'rewrite' => array( 'slug' => 'league' ),
|
||||
);
|
||||
|
||||
@@ -9,7 +9,8 @@ function sportspress_position_term_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'show_tagcloud' => false,
|
||||
'hierarchical' => true,
|
||||
'rewrite' => array( 'slug' => 'position' ),
|
||||
);
|
||||
|
||||
@@ -9,7 +9,8 @@ function sportspress_season_term_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'show_tagcloud' => false,
|
||||
'hierarchical' => true,
|
||||
'rewrite' => array( 'slug' => 'season' ),
|
||||
);
|
||||
|
||||
@@ -9,7 +9,8 @@ function sportspress_venue_term_init() {
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'show_tagcloud' => false,
|
||||
'hierarchical' => true,
|
||||
'rewrite' => array( 'slug' => 'venue' ),
|
||||
);
|
||||
|
||||
@@ -1071,9 +1071,23 @@ if ( !function_exists( 'sportspress_solve' ) ) {
|
||||
endif;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( !function_exists( 'sportspress_event_players_lineup_filter' ) ) {
|
||||
function sportspress_event_players_lineup_filter( $arr ) {
|
||||
return sportspress_array_value( $arr, 'status', 'lineup' ) == 'lineup';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !function_exists( 'sportspress_event_players_sub_filter' ) ) {
|
||||
function sportspress_event_players_sub_filter( $arr ) {
|
||||
return sportspress_array_value( $arr, 'status', 'lineup' ) == 'sub';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !function_exists( 'sportspress_get_calendar_data' ) ) {
|
||||
function sportspress_get_calendar_data( $post_id ) {
|
||||
$leagues = get_the_terms( $post_id, 'sp_league' );
|
||||
|
||||
Reference in New Issue
Block a user