Skip to content

Commit

Permalink
Remove args not used in parsing parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Oct 24, 2023
1 parent 9cfc692 commit e588231
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/my-calendar-output.php
Original file line number Diff line number Diff line change
Expand Up @@ -1632,26 +1632,20 @@ function mc_event_is_hidden( $event ) {
* @return array $params New parameters, modified by context
*/
function mc_calendar_params( $args ) {
$name = isset( $args['name'] ) ? $args['name'] : 'calendar';
$format = isset( $args['format'] ) ? $args['format'] : 'calendar';
$category = isset( $args['category'] ) ? $args['category'] : '';
$time = isset( $args['time'] ) ? $args['time'] : 'month';
$ltype = isset( $args['ltype'] ) ? $args['ltype'] : '';
$lvalue = isset( $args['lvalue'] ) ? $args['lvalue'] : '';
$id = isset( $args['id'] ) ? $args['id'] : '';
$template = isset( $args['template'] ) ? $args['template'] : '';
$content = isset( $args['content'] ) ? $args['content'] : '';
$author = isset( $args['author'] ) ? $args['author'] : null;
$host = isset( $args['host'] ) ? $args['host'] : null;
$above = isset( $args['above'] ) ? $args['above'] : '';
$below = isset( $args['below'] ) ? $args['below'] : '';
$syear = isset( $args['year'] ) ? $args['year'] : false;
$smonth = isset( $args['month'] ) ? $args['month'] : false;
$sday = isset( $args['day'] ) ? $args['day'] : false;
$source = isset( $args['source'] ) ? $args['source'] : 'shortcode';
$search = isset( $args['search'] ) ? $args['search'] : '';
$site = ( isset( $args['site'] ) && '' !== trim( $args['site'] ) ) ? $args['site'] : false;
$months = isset( $args['months'] ) ? $args['months'] : false;
$weekends = isset( $args['weekends'] ) ? $args['weekends'] : mc_get_option( 'show_weekends' );

if ( ! in_array( $format, array( 'list', 'calendar', 'mini' ), true ) ) {
Expand All @@ -1668,7 +1662,7 @@ function mc_calendar_params( $args ) {
$category = 'all';
}

if ( isset( $_GET['format'] ) && in_array( $_GET['format'], array( 'list', 'mini' ), true ) && 'mini' !== $format ) {
if ( isset( $_GET['format'] ) && in_array( $_GET['format'], array( 'list', 'mini', 'card' ), true ) && 'mini' !== $format ) {
$format = esc_attr( $_GET['format'] );
} else {
$format = esc_attr( $format );
Expand Down

0 comments on commit e588231

Please sign in to comment.