From 8b19234dcf6627350ce88c9fd820bf644def3ed7 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Mon, 28 Aug 2023 15:10:42 +0300 Subject: [PATCH] - fixed [ultimatemember] shortcode using with a wrong|empty form_id; --- includes/core/class-shortcodes.php | 4 ++++ includes/um-short-functions.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/core/class-shortcodes.php b/includes/core/class-shortcodes.php index e70dfae3..c982fc95 100644 --- a/includes/core/class-shortcodes.php +++ b/includes/core/class-shortcodes.php @@ -648,7 +648,11 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) { if ( ! array_key_exists( 'form_id', $args ) ) { return ''; } + $this->form_id = $args['form_id']; + if ( empty( $this->form_id ) ) { + return ''; + } $this->form_status = get_post_status( $this->form_id ); if ( 'publish' !== $this->form_status ) { diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 7f82e9ff..13b8e7fc 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -2303,7 +2303,7 @@ function um_get_default_cover_uri() { * @param $data * @param null $attrs * - * @return string|array + * @return int|string|array */ function um_user( $data, $attrs = null ) {