tice viewed. * * Whether the notice was viewed by the user. * * @since 1.0.0 * @access public * @static * * @param int $notice_id The notice ID. * * @return bool Whether the notice was viewed by the user. */ public static function is_user_notice_viewed( $notice_id ) { $notices = self::get_user_notices(); if ( empty( $notices ) || empty( $notices[ $notice_id ] ) ) { return false; } return true; } /** * Set admin notice as viewed. * * Flag the user admin notice as viewed using an authenticated ajax request. * * Fired by `wp_ajax_elementor_set_admin_notice_viewed` action. * * @since 1.0.0 * @access public * @static */ public static function ajax_set_admin_notice_viewed() { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification $notice_id = Utils::get_super_global_value( $_REQUEST, 'notice_id' ); if ( ! $notice_id ) { wp_die(); } $notices = self::get_user_notices(); if ( empty( $notices ) ) { $notices = []; } $notices[ $notice_id ] = 'true'; update_user_meta( get_current_user_id(), self::ADMIN_NOTICES_KEY, $notices ); if ( ! wp_doing_ajax() ) { wp_safe_redirect( admin_url() ); die; } wp_die(); } /** * @since 2.1.0 * @access public * @static */ public static function set_introduction_viewed( array $data ) { $user_introduction_meta = self::get_introduction_meta(); $user_introduction_meta[ $data['introductionKey'] ] = true; update_user_meta( get_current_user_id(), self::INTRODUCTION_KEY, $user_introduction_meta ); } /** * @throws \Exception */ public static function register_as_beta_tester( array $data ) { if ( ! current_user_can( 'install_plugins' ) ) { throw new \Exception( __( 'You do not have permissions to install plugins on this site.', 'elementor' ) ); } update_user_meta( get_current_user_id(), self::BETA_TESTER_META_KEY, true ); $response = wp_safe_remote_post( self::BETA_TESTER_API_URL, [ 'timeout' => 25, 'body' => [ 'api_version' => ELEMENTOR_VERSION, 'site_lang' => get_bloginfo( 'language' ), 'beta_tester_email' => $data['betaTesterEmail'], ], ] ); $response_code = (int) wp_remote_retrieve_response_code( $response ); if ( 200 === $response_code ) { self::set_introduction_viewed( [ 'introductionKey' => Beta_Testers::BETA_TESTER_SIGNUP, ] ); } } /** * @param string $key * * @return array|mixed|string * @since 2.1.0 * @access public * @static */ public static function get_introduction_meta( $key = '' ) { $user_introduction_meta = get_user_meta( get_current_user_id(), self::INTRODUCTION_KEY, true ); if ( ! $user_introduction_meta ) { $user_introduction_meta = []; } if ( $key ) { return empty( $user_introduction_meta[ $key ] ) ? '' : $user_introduction_meta[ $key ]; } return $user_introduction_meta; } /** * Get a user option with default value as fallback. * * @param string $option - Option key. * @param int $user_id - User ID * @param mixed $default - Default fallback value. * * @return mixed */ public static function get_user_option_with_default( $option, $user_id, $default ) { $value = get_user_option( $option, $user_id ); return ( false === $value ) ? $default : $value; } }
Fatal error: Uncaught Error: Class "Elementor\User" not found in /htdocs/wp-content/plugins/elementor/includes/plugin.php:743 Stack trace: #0 /htdocs/wp-content/plugins/elementor/includes/plugin.php(647): Elementor\Plugin->init_components() #1 /htdocs/wp-includes/class-wp-hook.php(310): Elementor\Plugin->init('') #2 /htdocs/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #3 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /htdocs/wp-settings.php(632): do_action('init') #5 /htdocs/wp-config.php(96): 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/elementor/includes/plugin.php on line 743