Enable multiselect outcomes close #8

This commit is contained in:
Brian Miyaji
2014-03-11 13:52:12 +11:00
parent d6fa4fc79e
commit dd92b6384c
5 changed files with 70 additions and 67 deletions

View File

@@ -22,6 +22,6 @@ function sportspress_admin_enqueue_scripts( $hook ) {
wp_enqueue_script( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL .'assets/js/admin.js', array( 'jquery' ), time(), true );
// Localize scripts.
wp_localize_script( 'sportspress-admin', 'localized_strings', array( 'remove_text' => __( '— Remove —', 'sportspress' ), 'days' => __( 'days', 'sportspress' ), 'hrs' => __( 'hrs', 'sportspress' ), 'mins' => __( 'mins', 'sportspress' ), 'secs' => __( 'secs', 'sportspress' ) ) );
wp_localize_script( 'sportspress-admin', 'localized_strings', array( 'none' => __( 'None', 'sportspress' ), 'remove_text' => __( '— Remove —', 'sportspress' ), 'days' => __( 'days', 'sportspress' ), 'hrs' => __( 'hrs', 'sportspress' ), 'mins' => __( 'mins', 'sportspress' ), 'secs' => __( 'secs', 'sportspress' ) ) );
}
add_action( 'admin_enqueue_scripts', 'sportspress_admin_enqueue_scripts' );

View File

@@ -54,23 +54,7 @@ function sportspress_manage_posts_custom_column( $column, $post_id ) {
endif;
if ( $team_result != null ):
echo ' — ' . $team_result;
endif;
$outcome_slug = sportspress_array_value( $team_results, 'outcome', null );
if ( $outcome_slug && $outcome_slug != '-1' ):
$args=array(
'name' => $outcome_slug,
'post_type' => 'sp_outcome',
'post_status' => 'publish',
'posts_per_page' => 1
);
$outcomes = get_posts( $args );
if ( sizeof( $outcomes ) ):
$outcome = reset( $outcomes );
echo ' (' . $outcome->post_title . ')';
endif;
echo ' <strong>' . $team_result . '</strong>';
endif;
echo '<br>';