mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- fixed "is_block" argument for ultimatemember shortcodes;
- added sanitize shortcode arguments functions;
This commit is contained in:
@@ -606,12 +606,16 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
|
||||
$args = shortcode_atts(
|
||||
array(
|
||||
'form_id' => '',
|
||||
'is_block' => 0,
|
||||
'is_block' => false,
|
||||
),
|
||||
$args,
|
||||
'ultimatemember'
|
||||
);
|
||||
|
||||
// Sanitize shortcode arguments.
|
||||
$args['form_id'] = ! empty( $args['form_id'] ) ? absint( $args['form_id'] ) : '';
|
||||
$args['is_block'] = (bool) $args['is_block'];
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -779,7 +783,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $args['is_block'] ) && 1 === (int) $args['is_block'] && 'profile' === $mode && ! is_user_logged_in() ) {
|
||||
if ( 'profile' === $mode && ! empty( $args['is_block'] ) && ! is_user_logged_in() ) {
|
||||
ob_get_clean();
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user