芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/cepali.edu.mx/wp-content/plugins/elementor/app/modules/kit-library/module.php
add_submenu( [ 'page_title' => esc_html__( 'Kit Library', 'elementor' ), 'menu_title' => '
' . esc_html__( 'Kit Library', 'elementor' ) . '
', 'menu_slug' => Plugin::$instance->app->get_base_url() . '#/kit-library', 'index' => 40, ] ); } /** * Register the admin menu the old way. */ private function register_admin_menu_legacy( Admin_Menu_Manager $admin_menu ) { $admin_menu->register( Plugin::$instance->app->get_base_url() . '#/kit-library', new Kit_Library_Menu_Item() ); } private function set_kit_library_settings() { if ( ! Plugin::$instance->common ) { return; } /** @var ConnectModule $connect */ $connect = Plugin::$instance->common->get_component( 'connect' ); /** @var Kit_Library $kit_library */ $kit_library = $connect->get_app( 'kit-library' ); Plugin::$instance->app->set_settings( 'kit-library', [ 'has_access_to_module' => current_user_can( 'administrator' ), 'subscription_plans' => $this->apply_filter_subscription_plans( $connect->get_subscription_plans( 'kit-library' ) ), 'is_pro' => false, 'is_library_connected' => $kit_library->is_connected(), 'library_connect_url' => $kit_library->get_admin_url( 'authorize', [ 'utm_source' => 'kit-library', 'utm_medium' => 'wp-dash', 'utm_campaign' => 'library-connect', 'utm_term' => '%%page%%', // Will be replaced in the frontend. ] ), 'access_level' => ConnectModule::ACCESS_LEVEL_CORE, 'access_tier' => ConnectModule::ACCESS_TIER_FREE, 'app_url' => Plugin::$instance->app->get_base_url() . '#/' . $this->get_name(), ] ); } private function apply_filter_subscription_plans( array $subscription_plans ): array { foreach ( $subscription_plans as $key => $plan ) { if ( null === $plan['promotion_url'] ) { continue; } $subscription_plans[ $key ] = Filtered_Promotions_Manager::get_filtered_promotion_data( $plan, 'elementor/kit_library/' . $key . '/promotion', 'promotion_url' ); } return $subscription_plans; } /** * Module constructor. */ public function __construct() { Plugin::$instance->data_manager_v2->register_controller( new Kits_Controller() ); Plugin::$instance->data_manager_v2->register_controller( new Taxonomies_Controller() ); // Assigning this action here since the repository is being loaded by demand. add_action( 'elementor/experiments/feature-state-change/container', [ Repository::class, 'clear_cache' ], 10, 0 ); add_action( 'elementor/admin/menu/register', function( Admin_Menu_Manager $admin_menu ) { $this->register_admin_menu_legacy( $admin_menu ); }, Source_Local::ADMIN_MENU_PRIORITY + 30 ); add_action( 'elementor/connect/apps/register', function ( ConnectModule $connect_module ) { $connect_module->register_app( 'kit-library', Kit_Library::get_class_name() ); } ); add_action( 'elementor/init', function () { $this->set_kit_library_settings(); }, 12 /** after the initiation of the connect kit library */ ); } }