Skip to content

Commit

Permalink
lowercase shortcode arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
liedekef committed Jan 13, 2025
1 parent 0d5eed9 commit 5a7c64e
Show file tree
Hide file tree
Showing 14 changed files with 245 additions and 119 deletions.
3 changes: 3 additions & 0 deletions eme-calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
function eme_get_calendar_shortcode( $atts ) {
eme_enqueue_frontend();

// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'category' => 0,
Expand Down
3 changes: 3 additions & 0 deletions eme-categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ function eme_get_category_id_by_name_slug ($cat_name ) {
function eme_get_categories_shortcode( $atts ) {
eme_enqueue_frontend();

// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'event_id' => 0,
Expand Down
15 changes: 15 additions & 0 deletions eme-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -4539,6 +4539,9 @@ function eme_get_events_list( $limit = -1, $scope = 'future', $order = 'ASC', $f
function eme_get_events_list_shortcode( $atts ) {
eme_enqueue_frontend();

// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'limit' => -1,
Expand Down Expand Up @@ -4741,6 +4744,9 @@ function eme_display_single_event( $event_id, $template_id = 0, $ignore_url = 0

function eme_display_single_event_shortcode( $atts ) {
eme_enqueue_frontend();
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'id' => '',
Expand All @@ -4754,6 +4760,9 @@ function eme_display_single_event_shortcode( $atts ) {

function eme_get_events_page_shortcode( $atts ) {
eme_enqueue_frontend();
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'justurl' => 0,
Expand Down Expand Up @@ -8950,6 +8959,9 @@ function eme_rss_link( $justurl = 0, $echo = 0, $text = 'RSS', $scope = 'future'
}

function eme_rss_link_shortcode( $atts ) {
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'justurl' => 0,
Expand Down Expand Up @@ -10035,6 +10047,9 @@ function eme_admin_enqueue_js() {

# return number of days until next event or until the specified event
function eme_countdown_shortcode( $atts ) {
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'id' => '',
Expand Down
3 changes: 3 additions & 0 deletions eme-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

function eme_filter_form_shortcode( $atts ) {
eme_enqueue_frontend();
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'multiple' => 0,
Expand Down
3 changes: 3 additions & 0 deletions eme-fs.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ function eme_generate_fs_event_pdf( $person, $event, $template_id ) {

function eme_add_event_form_shortcode( $atts ) {
eme_enqueue_frontend();
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$eme_fs_options = get_option('eme_fs');
$is_user_logged_in=is_user_logged_in();

Expand Down
6 changes: 6 additions & 0 deletions eme-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ function eme_captcha_remove( $captcha_file ) {
}

function eme_if_shortcode($atts, $content) {
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'tag' => '',
Expand Down Expand Up @@ -623,6 +626,9 @@ function eme_if_shortcode($atts, $content) {
}

function eme_for_shortcode( $atts, $content ) {
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'min' => 1,
Expand Down
6 changes: 6 additions & 0 deletions eme-gdpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ function eme_rpi_shortcode( $atts ) {
$email = '';
}

// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts( [ 'show_info_if_logged_in' => 0 ], $atts );
$show_info_if_logged_in = filter_var( $atts['show_info_if_logged_in'], FILTER_VALIDATE_BOOLEAN );

Expand Down Expand Up @@ -293,6 +296,9 @@ function eme_cpi_shortcode( $atts ) {
$email = '';
}

// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts( [ 'show_form_if_logged_in' => 0 ], $atts );
$show_form_if_logged_in = filter_var( $atts['show_form_if_logged_in'], FILTER_VALIDATE_BOOLEAN );

Expand Down
3 changes: 3 additions & 0 deletions eme-holidays.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ function eme_get_holidays_array_by_id() {
# return number of days until next event or until the specified event
function eme_holidays_shortcode( $atts ) {
eme_enqueue_frontend();
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'id' => 0,
Expand Down
3 changes: 3 additions & 0 deletions eme-ical.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ function eme_ical_link( $justurl = 0, $echo = 0, $text = 'ICAL', $category = '',
}

function eme_ical_link_shortcode( $atts ) {
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );

$atts = shortcode_atts(
[
'justurl' => 0,
Expand Down
Loading

0 comments on commit 5a7c64e

Please sign in to comment.