gs $settings ) { $fonts = $this->get_typekit_fonts(); $button_label = esc_html__( 'Get Project ID', 'elementor-pro' ); $found_label = '{{count}} ' . esc_html__( 'Fonts Families Found in project. Please note that typekit takes a few minutes to sync once you publish or update a project.', 'elementor-pro' ); if ( $fonts && is_array( $fonts ) ) { $button_label = esc_html__( 'Sync Project', 'elementor-pro' ); } $settings->add_section( Settings::TAB_INTEGRATIONS, 'typekit', [ 'callback' => function() { echo '

' . esc_html__( 'Adobe Fonts (TypeKit)', 'elementor-pro' ) . '

'; esc_html_e( 'TypeKit partners with the world’s leading type foundries to bring thousands of beautiful fonts to designers every day.', 'elementor-pro' ); }, 'fields' => [ self::TYPEKIT_KIT_ID_OPTION_NAME => [ 'label' => esc_html__( 'Project ID', 'elementor-pro' ), 'field_args' => [ 'type' => 'text', 'desc' => sprintf( /* translators: 1: Link opening tag, 2: Link closing tag. */ esc_html__( 'Enter Your %1$sTypeKit Project ID%2$s.', 'elementor-pro' ), '', '' ), ], 'setting_args' => [ 'sanitize_callback' => [ $this, 'sanitize_kit_id_settings' ], ], ], 'validate_api_data' => [ 'field_args' => [ 'type' => 'raw_html', 'html' => sprintf( '

', esc_html( $found_label ), self::TYPEKIT_KIT_ID_OPTION_NAME . '_fetch', wp_create_nonce( self::TYPEKIT_KIT_ID_OPTION_NAME ), $button_label ), ], ], ], ] ); } public function register_fonts_in_control( $fonts ) { $typekit_fonts = $this->get_kit_fonts(); if ( $typekit_fonts ) { return array_merge( $typekit_fonts, $fonts ); } return $fonts; } public function print_font_link( $font ) { if ( $this->kit_enqueued ) { return; } if ( $this->is_font_in_kit( $font ) ) { $kit_url = sprintf( self::TYPEKIT_FONTS_LINK, $this->get_typekit_kit_id() ); echo ''; $this->kit_enqueued = true; } } private function is_font_in_kit( $font ) { $kit_fonts = $this->get_kit_fonts(); if ( ! $kit_fonts || ! is_array( $kit_fonts ) ) { return false; } return in_array( $font, array_keys( $kit_fonts ) ); } public function integrations_admin_ajax_handler() { check_ajax_referer( self::TYPEKIT_KIT_ID_OPTION_NAME, '_nonce' ); if ( ! current_user_can( Fonts_Manager::CAPABILITY ) ) { wp_send_json_error( 'Permission denied' ); } $kit_id = Utils::_unstable_get_super_global_value( $_POST, 'kit_id' ); if ( ! $kit_id ) { wp_send_json_error(); } $fonts = []; try { update_option( 'elementor_' . self::TYPEKIT_KIT_ID_OPTION_NAME, sanitize_text_field( $kit_id ) ); $fonts = $this->fetch_typekit_data(); } catch ( \Exception $exception ) { wp_send_json_error(); } wp_send_json_success( [ 'fonts' => $fonts, 'count' => count( $fonts ), ] ); } protected function actions() { parent::actions(); if ( is_admin() ) { add_action( 'elementor/admin/after_create_settings/' . Settings::PAGE_ID, [ $this, 'register_admin_fields' ], 100 ); } add_filter( 'elementor/fonts/additional_fonts', [ $this, 'register_fonts_in_control' ] ); add_action( 'elementor/fonts/print_font_links/' . $this->get_type(), [ $this, 'print_font_link' ] ); add_action( 'wp_ajax_elementor_pro_admin_fetch_fonts', [ $this, 'integrations_admin_ajax_handler' ] ); } }
Fatal error: Uncaught Error: Class 'ElementorPro\Modules\AssetsManager\AssetTypes\Fonts\Typekit_Fonts' not found in /home/sportuga/public_html/wp-content/plugins/elementor-pro/modules/assets-manager/asset-types/fonts-manager.php:613 Stack trace: #0 /home/sportuga/public_html/wp-content/plugins/elementor-pro/modules/assets-manager/module.php(48): ElementorPro\Modules\AssetsManager\AssetTypes\Fonts_Manager->__construct() #1 /home/sportuga/public_html/wp-content/plugins/elementor/core/base/module.php(85): ElementorPro\Modules\AssetsManager\Module->__construct() #2 /home/sportuga/public_html/wp-content/plugins/elementor-pro/core/modules-manager.php(93): Elementor\Core\Base\Module::instance() #3 /home/sportuga/public_html/wp-content/plugins/elementor-pro/plugin.php(375): ElementorPro\Core\Modules_Manager->__construct() #4 /home/sportuga/public_html/wp-includes/class-wp-hook.php(324): ElementorPro\Plugin->on_elementor_init('') #5 /home/sportuga/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) in /home/sportuga/public_html/wp-content/plugins/elementor-pro/modules/assets-manager/asset-types/fonts-manager.php on line 613