novalidate = isset($atts['novalidate']) ? ' novalidate' : ''; $tag = sprintf('
', $novalidate); $tag .= self::melange_hidden_fields(); $tag .= do_shortcode($content); $tag .= '
'; return $tag; } /** * Password reset form tag * * @param array $atts * @param string $content * * @return string */ public static function password_reset_form_tag($atts, $content) { $tag = '
'; $tag .= self::melange_hidden_fields(); $tag .= do_shortcode($content); $tag .= '
'; return $tag; } /** * Edit profile form tag * * @param array $atts * @param string $content * * @return string */ public static function edit_profile_form_tag($atts, $content) { $tag = '
'; $tag .= self::melange_hidden_fields(); $tag .= do_shortcode($content); $tag .= '
'; return $tag; } /** * @return string */ public static function custom_html_block($atts) { $atts = shortcode_atts(['custom_html' => ''], $atts); $val = $atts['custom_html']; if (ppress_is_base64($val)) { $val = base64_decode($atts['custom_html']); } if (apply_filters('ppress_sanitize_custom_html_block', true)) { $val = wp_kses_post($val); } return do_shortcode(stripslashes($val)); } /** * Registration url */ public static function link_registration($atts) { $atts = ppress_normalize_attributes($atts); if (( ! empty($atts['raw']) && ($atts['raw'] == true))) { return wp_registration_url(); } $atts = shortcode_atts( array( 'class' => '', 'id' => '', 'title' => '', 'label' => esc_html__('Sign Up', 'wp-user-avatar'), 'raw' => '', ), $atts ); $class = 'class="' . esc_attr($atts['class']) . '"'; $id = 'id="' . esc_attr($atts['id']) . '"'; $label = esc_attr($atts['label']); $title = 'title="' . esc_attr($atts['title']) . '"'; $html = '$label"; return $html; } /** Lost password url */ public static function link_lost_password($atts) { $atts = ppress_normalize_attributes($atts); if (( ! empty($atts['raw']) && ($atts['raw'] == true))) { return wp_lostpassword_url(); } $atts = shortcode_atts( array( 'class' => '', 'id' => '', 'title' => '', 'label' => esc_html__('Reset Password', 'wp-user-avatar'), 'raw' => '', ), $atts ); $class = 'class="' . esc_attr($atts['class']) . '"'; $id = 'id="' . esc_attr($atts['id']) . '"'; $label = esc_attr($atts['label']); $title = 'title="' . esc_attr($atts['title']) . '"'; $html = "$label"; return $html; } /** Login url */ public static function link_login($atts) { $atts = ppress_normalize_attributes($atts); if (( ! empty($atts['raw']) && ($atts['raw'] == true))) { return wp_login_url(); } $atts = shortcode_atts( array( 'class' => '', 'id' => '', 'title' => '', 'label' => esc_html__('Login', 'wp-user-avatar'), 'raw' => '', ), $atts ); $class = 'class="' . esc_attr($atts['class']) . '"'; $id = 'id="' . esc_attr($atts['id']) . '"'; $label = esc_attr($atts['label']); $title = 'title="' . esc_attr($atts['title']) . '"'; $html = '' . $label . ''; return $html; } /** Logout URL */ public static function link_logout($atts) { if ( ! is_user_logged_in()) { return; } $atts = ppress_normalize_attributes($atts); if (( ! empty($atts['raw']) && ($atts['raw'] == true))) { return wp_logout_url(); } $atts = shortcode_atts( array( 'class' => '', 'id' => '', 'title' => '', 'label' => esc_html__('Log Out', 'wp-user-avatar'), 'raw' => '', ), $atts ); $class = 'class="' . esc_attr($atts['class']) . '"'; $id = 'id="' . esc_attr($atts['id']) . '"'; $label = esc_attr($atts['label']); $title = 'title="' . esc_attr($atts['title']) . '"'; $html = '' . $label . ''; return $html; } /** * URL to user edit page */ public static function link_edit_profile($atts) { if ( ! is_user_logged_in()) return; $atts = ppress_normalize_attributes($atts); $atts = shortcode_atts( array( 'class' => '', 'id' => '', 'title' => '', 'label' => esc_html__('Edit Profile', 'wp-user-avatar'), 'raw' => '', ), $atts ); $class = 'class="' . esc_attr($atts['class']) . '"'; $id = 'id="' . esc_attr($atts['id']) . '"'; $label = esc_attr($atts['label']); $title = 'title="' . esc_attr($atts['title']) . '"'; $edit_profile_page_url = admin_url('profile.php'); $edit_profile_page_id = ppress_get_setting('edit_user_profile_url'); if ( ! empty($edit_profile_page_id)) { $edit_profile_page_url = get_permalink($edit_profile_page_id); } if ( ! empty($atts['raw']) && ($atts['raw'] == true)) { return $edit_profile_page_url; } $html = '' . $label . ''; return $html; } /** * Display avatar of currently logged in user * * @param $atts * * @return string */ public static function user_avatar($atts) { $atts = shortcode_atts( array( 'user' => '', 'class' => '', 'id' => '', 'size' => 300, 'alt' => '', 'original' => false, ), $atts ); $class = esc_attr($atts['class']); $id = esc_attr($atts['id']); $size = esc_attr(absint($atts['size'])); $alt = esc_attr($atts['alt']); $original = in_array($atts['original'], ['true', true], true); $user_id = self::$current_user->ID; if ( ! empty($atts['user'])) { $user_id = is_numeric($atts['user']) ? absint($atts['user']) : get_user_by('login', $atts['user']); if ($user_id instanceof \WP_User) { $user_id = $user_id->ID; } } return UserAvatar::get_avatar_img($user_id, $size, $alt, $class, $id, $original); } public static function user_cover_image($atts) { $atts = shortcode_atts([ 'user' => '', 'class' => '', 'id' => '', 'alt' => '', ], $atts); $class = esc_attr($atts['class']); $id = esc_attr($atts['id']); $alt = esc_attr($atts['alt']); if ( ! empty($id)) { $id = " id='$id'"; } $user_id = self::$current_user->ID; if ( ! empty($atts['user'])) { $user_id = is_numeric($atts['user']) ? absint($atts['user']) : get_user_by('login', $atts['user']); if ($user_id instanceof \WP_User) { $user_id = $user_id->ID; } } $url = ppress_get_cover_image_url($user_id); $avatar = "{$alt}"; return $avatar; } /** * Redirect non logged users to login page. * * @param array $atts * * @return false|string|void */ public static function redirect_non_logged_in_users($atts) { if (is_user_logged_in()) { return; } $atts = shortcode_atts( array( 'url' => '', ), $atts ); $url = empty($atts['url']) ? ppress_login_url() : esc_url_raw($atts['url']); ob_start(); ppress_content_http_redirect($url); return ob_get_clean(); } /** * Redirect logged users to login page. * * @param array $atts * * @return false|string|void */ public static function redirect_logged_in_users($atts) { if ( ! is_user_logged_in()) { return; } $atts = shortcode_atts( array( 'url' => '', ), $atts ); $url = empty($atts['url']) ? ppress_login_url() : esc_url_raw($atts['url']); ob_start(); ppress_content_http_redirect($url); return ob_get_clean(); } /** * Only logged user can view content. * * @param array $atts * @param mixed $content * * @return mixed */ public static function pp_log_in_users($atts, $content) { if (is_user_logged_in()) { return do_shortcode($content); } return ''; } /** * Only non-logged user can view content. * * @param array $atts * @param mixed $content * * @return mixed */ public static function pp_non_log_in_users($atts, $content) { if ( ! is_user_logged_in()) { return do_shortcode($content); } return ''; } /** * URL to topics started by users. * * @return string */ public static function bbp_topic_started_url() { if (function_exists('bbp_get_user_topics_created_url')) { return esc_url_raw(bbp_get_user_topics_created_url(self::$current_user->ID)); } } /** * URL to topics started by users. * * @return string */ public static function bbp_replies_created_url() { if (function_exists('bbp_user_replies_created_url')) { return esc_url_raw(bbp_get_user_replies_created_url(self::$current_user->ID)); } } /** * URL to topics started by users. * * @return string */ public static function bbp_favorites_url() { if (function_exists('bbp_get_favorites_permalink')) { return esc_url_raw(bbp_get_favorites_permalink(self::$current_user->ID)); } } /** * URL to topics started by users. * * @return string */ public static function bbp_subscriptions_url() { if (function_exists('bbp_get_subscriptions_permalink')) { return esc_url(bbp_get_subscriptions_permalink(self::$current_user->ID)); } } }
Fatal error: Uncaught Error: Class "ProfilePress\Core\ShortcodeParser\Builder\GlobalShortcodes" not found in /htdocs/wp-content/plugins/wp-user-avatar/src/ShortcodeParser/Init.php:16 Stack trace: #0 /htdocs/wp-content/plugins/wp-user-avatar/src/ShortcodeParser/Init.php(39): ProfilePress\Core\ShortcodeParser\Init->__construct() #1 /htdocs/wp-content/plugins/wp-user-avatar/src/Base.php(172): ProfilePress\Core\ShortcodeParser\Init::get_instance() #2 /htdocs/wp-content/plugins/wp-user-avatar/src/Base.php(301): ProfilePress\Core\Base->__construct() #3 /htdocs/wp-content/plugins/wp-user-avatar/wp-user-avatar.php(27): ProfilePress\Core\Base::get_instance() #4 /htdocs/wp-settings.php(560): include_once('/htdocs/wp-cont...') #5 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #6 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #7 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #8 /htdocs/index.php(17): require('/htdocs/wp-blog...') #9 {main} thrown in /htdocs/wp-content/plugins/wp-user-avatar/src/ShortcodeParser/Init.php on line 16