From ad11a6c479a7c6257c735dda5dac5255eb157f16 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Fri, 21 Jul 2023 15:47:01 +0300 Subject: [PATCH] - fixed singleton for shortcode; - there were a conflicts with plugins who render shortcodes in hidden mode before loading shortcodes on the page content; --- includes/core/class-shortcodes.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/core/class-shortcodes.php b/includes/core/class-shortcodes.php index 6c3f1432..d65b304e 100644 --- a/includes/core/class-shortcodes.php +++ b/includes/core/class-shortcodes.php @@ -603,21 +603,23 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) { */ public function ultimatemember( $args = array() ) { /** - * Filters variable for disable singleton shortcode loading on the same page. - * Note: Set it to `true` if you need to render the same form twice or more on the same page. + * Filters variable for enable singleton shortcode loading on the same page. + * Note: Set it to `false` if you don't need to render the same form twice or more on the same page. * * @since 2.6.8 + * @since 2.6.9 $disable argument set to `true` by default + * * @hook um_ultimatemember_shortcode_disable_singleton * - * @param {bool} $disable Disabled singleton. By default, it's `false`. + * @param {bool} $disable Disabled singleton. By default, it's `true`. * @param {array} $args Shortcode arguments. * * @return {bool} Disabled singleton or not. * - * @example Turn on ability to use ultimatemember shortcode twice. - * add_filter( 'um_ultimatemember_shortcode_disable_singleton', '__return_true' ); + * @example Turn off ability to use ultimatemember shortcode twice. + * add_filter( 'um_ultimatemember_shortcode_disable_singleton', '__return_false' ); */ - $disable_singleton_shortcode = apply_filters( 'um_ultimatemember_shortcode_disable_singleton', false, $args ); + $disable_singleton_shortcode = apply_filters( 'um_ultimatemember_shortcode_disable_singleton', true, $args ); if ( false === $disable_singleton_shortcode ) { if ( isset( $args['form_id'] ) ) { $id = $args['form_id'];