* @return array The templates data. */ public static function get_library_data( $force_update = false ) { self::get_info_data( $force_update ); $library_data = get_option( self::LIBRARY_OPTION_KEY ); if ( empty( $library_data ) ) { return []; } return $library_data; } /** * Get feed data. * * Retrieve the feed info data from remote elementor server. * * @since 1.9.0 * @access public * @static * * @param bool $force_update Optional. Whether to force the data update or * not. Default is false. * * @return array Feed data. */ public static function get_feed_data( $force_update = false ) { self::get_info_data( $force_update ); $feed = get_option( self::FEED_OPTION_KEY ); if ( empty( $feed ) ) { return []; } return $feed; } /** * Get template content. * * Retrieve the templates content received from a remote server. * * @since 1.0.0 * @access public * @static * * @param int $template_id The template ID. * * @return object|\WP_Error The template content. */ public static function get_template_content( $template_id ) { /** @var Library $library */ $library = Plugin::$instance->common->get_component( 'connect' )->get_app( 'library' ); return $library->get_template_content( $template_id ); } /** * Send Feedback. * * Fires a request to Elementor server with the feedback data. * * @since 1.0.0 * @access public * @static * * @param string $feedback_key Feedback key. * @param string $feedback_text Feedback text. * * @return array The response of the request. */ public static function send_feedback( $feedback_key, $feedback_text ) { return wp_remote_post( self::$api_feedback_url, [ 'timeout' => 30, 'body' => [ 'api_version' => ELEMENTOR_VERSION, 'site_lang' => get_bloginfo( 'language' ), 'feedback_key' => $feedback_key, 'feedback' => $feedback_text, ], ] ); } /** * Ajax reset API data. * * Reset Elementor library API data using an ajax call. * * @since 1.0.0 * @access public * @static */ public static function ajax_reset_api_data() { check_ajax_referer( 'elementor_reset_library', '_nonce' ); if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( 'Permission denied' ); } self::get_info_data( true ); wp_send_json_success(); } /** * Init. * * Initialize Elementor API. * * @since 1.0.0 * @access public * @static */ public static function init() { add_action( 'wp_ajax_elementor_reset_library', [ __CLASS__, 'ajax_reset_api_data' ] ); } }
Fatal error: Uncaught Error: Class "Elementor\Api" not found in /htdocs/wp-content/plugins/elementor/includes/plugin.php:771 Stack trace: #0 /htdocs/wp-content/plugins/elementor/includes/plugin.php(674): Elementor\Plugin->init_components() #1 /htdocs/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('') #2 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /htdocs/wp-settings.php(704): do_action('init') #5 /htdocs/wp-config.php(78): 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 771