laipower/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Plugin_Admin.php

73 lines
2.0 KiB
PHP
Raw Normal View History

2023-10-22 22:21:44 +00:00
<?php
namespace W3TC;
class UserExperience_Plugin_Admin {
2023-12-08 23:23:36 +00:00
/**
* Runs the user experience feature.
*
* @return void
*/
public function run() {
2023-10-22 22:21:44 +00:00
add_filter( 'w3tc_admin_menu', array( $this, 'w3tc_admin_menu' ) );
2023-12-08 23:23:36 +00:00
add_action( 'w3tc_settings_page-w3tc_userexperience', array( $this, 'w3tc_settings_page_w3tc_userexperience' ) );
add_action( 'admin_init_w3tc_general', array( '\W3TC\UserExperience_GeneralPage', 'admin_init_w3tc_general' ) );
add_filter( 'w3tc_extensions', array( '\W3TC\UserExperience_Plugin_Admin', 'w3tc_extensions' ), 10, 2 );
2023-10-22 22:21:44 +00:00
}
2023-12-08 23:23:36 +00:00
/**
* Set user experience admin menu item.
*
* @param array $menu
*
* @return array
*/
2023-10-22 22:21:44 +00:00
public function w3tc_admin_menu( $menu ) {
$menu['w3tc_userexperience'] = array(
2023-12-08 23:23:36 +00:00
'page_title' => __( 'User Experience', 'w3-total-cache' ),
'menu_text' => __( 'User Experience', 'w3-total-cache' ),
2023-10-22 22:21:44 +00:00
'visible_always' => false,
2023-12-08 23:23:36 +00:00
'order' => 1200,
2023-10-22 22:21:44 +00:00
);
return $menu;
}
2023-12-08 23:23:36 +00:00
/**
* Configures extensions for user experience.
*
* @param array $extensions
* @param object $config
*
* @return array
*/
public static function w3tc_extensions( $extensions, $config ) {
$extensions['user-experience-defer-scripts'] = array(
'public' => false,
'extension_id' => 'user-experience-defer-scripts',
'path' => 'w3-total-cache/UserExperience_DeferScripts_Extension.php',
);
2023-10-22 22:21:44 +00:00
$extensions['user-experience-emoji'] = array(
2023-12-08 23:23:36 +00:00
'public' => false,
2023-10-22 22:21:44 +00:00
'extension_id' => 'user-experience-emoji',
2023-12-08 23:23:36 +00:00
'path' => 'w3-total-cache/UserExperience_Emoji_Extension.php',
2023-10-22 22:21:44 +00:00
);
$extensions['user-experience-oembed'] = array(
2023-12-08 23:23:36 +00:00
'public' => false,
2023-10-22 22:21:44 +00:00
'extension_id' => 'user-experience-oembed',
2023-12-08 23:23:36 +00:00
'path' => 'w3-total-cache/UserExperience_OEmbed_Extension.php',
2023-10-22 22:21:44 +00:00
);
return $extensions;
}
2023-12-08 23:23:36 +00:00
/**
* Render user experience advanced settings page.
*
* @return void
*/
2023-10-22 22:21:44 +00:00
public function w3tc_settings_page_w3tc_userexperience() {
$v = new UserExperience_Page();
$v->render_content();
}
}