Fix event list widget error
This commit is contained in:
@@ -1638,7 +1638,8 @@ if ( !function_exists( 'sp_get_calendar_data' ) ) {
|
||||
),
|
||||
);
|
||||
|
||||
if ( $pagenow != 'post-new.php' && $post_id ):
|
||||
if ( $pagenow != 'post-new.php' ):
|
||||
if ( $post_id ):
|
||||
$leagues = get_the_terms( $post_id, 'sp_league' );
|
||||
$seasons = get_the_terms( $post_id, 'sp_season' );
|
||||
$venues = get_the_terms( $post_id, 'sp_venue' );
|
||||
@@ -1690,10 +1691,15 @@ if ( !function_exists( 'sp_get_calendar_data' ) ) {
|
||||
);
|
||||
endif;
|
||||
|
||||
$events = get_posts( $args );
|
||||
else:
|
||||
$usecolumns = null;
|
||||
$events = null;
|
||||
endif;
|
||||
|
||||
$events = get_posts( $args );
|
||||
|
||||
else:
|
||||
$usecolumns = null;
|
||||
$events = array();
|
||||
endif;
|
||||
|
||||
if ( $admin ):
|
||||
|
||||
Reference in New Issue
Block a user