Fix function return value used in write context.

This commit is contained in:
Brian Miyaji
2014-08-26 04:12:03 +10:00
parent 7e93edfee8
commit 7cb6143089
6 changed files with 12 additions and 6 deletions

View File

@@ -80,7 +80,8 @@ if ( class_exists( 'WP_Importer' ) ) {
case 2:
check_admin_referer( 'import-upload' );
if ( isset( $_POST['sp_import'] ) ):
$this->import( $_POST['sp_import'], array_values( array_filter( sp_array_value( $_POST, 'sp_columns', array( 'post_title' ) ) ) ) );
$columns = array_filter( sp_array_value( $_POST, 'sp_columns', array( 'post_title' ) ) );
$this->import( $_POST['sp_import'], array_values( $columns ) );
endif;
break;
endswitch;

View File

@@ -123,7 +123,8 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
break;
case 'sp_team':
$teams = (array)get_post_meta( $post_id, 'sp_team', false );
$teams = array_unique( array_filter( $teams ) );
$teams = array_filter( $teams );
$teams = array_unique( $teams );
if ( empty( $teams ) ):
echo '—';
else:

View File

@@ -62,7 +62,8 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
public function custom_columns( $column, $post_id ) {
switch ( $column ):
case 'sp_player':
echo sizeof( array_filter( get_post_meta( $post_id, 'sp_player' ) ) );
$players = array_filter( get_post_meta( $post_id, 'sp_player' ) );
echo sizeof( $players );
break;
case 'sp_league':
echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : '—';

View File

@@ -66,7 +66,8 @@ class SP_Admin_CPT_Table extends SP_Admin_CPT {
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : '—';
break;
case 'sp_team':
echo sizeof( array_filter( get_post_meta( $post_id, 'sp_team' ) ) );
$teams = array_filter( get_post_meta( $post_id, 'sp_team' ) );
echo sizeof( $teams );
break;
endswitch;
}