Fix function return value used in write context.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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' ) : '—';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user