Свойство | Type | Description | |
---|---|---|---|
$activation_disabled | Whether or not to disable the plugin activation links. | ||
$capability | Required capability to access this plugin's features. Use the "wpcom_vip_plugins_ui_capability" filter to change this. | ||
$fpp_plugins | List of Featured Partner Program plugins. | ||
$hidden_plugins | List of plugins that should be hidden. | ||
$hook_suffix | The $hook_suffix value for the menu page. | ||
$parent_menu_slug | Parent menu's slug. Use the "wpcom_vip_plugins_ui_parent_menu_slug" filter to change this. | ||
$plugin_folder | Path to the extra plugins folder. |
Méthode | Description | |
---|---|---|
__clone ( ) | A dummy magic method to prevent WPCOM_VIP_Plugins_UI from being cloned | |
__wakeup ( ) | A dummy magic method to prevent WPCOM_VIP_Plugins_UI from being unserialized | |
action_admin_menu_add_menu_item ( ) | Adds the new menu item and registers a few more hook callbacks relating to the menu page. | |
action_admin_post_plugin_activate ( ) | Handles the plugin activation links and activates the requested plugin. | |
action_admin_post_plugin_deactivate ( ) | Handles the plugin deactivation links and deactivates the requested plugin. | |
action_enqueue_scripts ( string $hook ) : void | Load the assets for this plugin on the correct screen only | |
action_init ( ) | Now that we've given the theme time to register its own filters, set up the rest of the plugin's hooks and run some filters. | |
activate_plugin ( string $plugin ) : boolean | WP_Error | Activates a plugin. | |
add_activate_or_deactive_action_link ( array $actions, string $plugin ) : array | Filters an array of action links to add an activation or deactivation link. | |
cleanup_active_plugins_option ( ) | Removes any invalid plugins from the option, i.e. when they're deleted. | |
community_plugins_menu_columns ( array $columns ) : array | Filters the columns of the Community Plugins table. | |
deactivate_plugin ( string $plugin, $force = false ) : void | Deactivates a plugin. | |
display_menu_page ( ) | Outputs the contents of the menu page. | |
get_active_plugins_option ( ) : array | Gets the list of VIP plugins that have been activated via the UI. | |
get_menu_url ( array $extra_query_args = [] ) : string | Generates a link to the plugin's menu page. | |
get_plugin_activation_link ( string $plugin ) : string | Generates the URL to activate a VIP plugin. | |
get_plugin_deactivation_link ( string $plugin ) : string | Generates the URL to deactivate a VIP plugin. | |
get_plugins ( ) : array | Grab list of regular WP plugins | |
get_shared_plugins ( ) : array | Grab list of VIP Shared Plugins | |
include_active_plugins ( ) | Includes any active plugin files that are enabled via the UI/option. | |
instance ( ) : WPCOM_VIP_Plugins_UI | Main WPCOM_VIP_Plugins_UI Instance | |
is_plugin_active ( string $plugin ) : string | boolean | Determines if a given plugin slug is already activated or not. | |
validate_plugin ( string $plugin ) : boolean | Validates a plugin slug. |
Méthode | Description | |
---|---|---|
__construct ( ) | A dummy constructor to prevent WPCOM_VIP_Plugins_UI from being loaded more than once. | |
setup_actions ( ) | Set up early action hooks for this plugin | |
setup_globals ( ) | Set up the class variables. |
public __clone ( ) |
public __wakeup ( ) |
public action_admin_post_plugin_activate ( ) |
public action_admin_post_plugin_deactivate ( ) |
public action_enqueue_scripts ( string $hook ) : void | ||
$hook | string | |
Résultat | void |
public action_init ( ) |
public activate_plugin ( string $plugin ) : boolean | WP_Error | ||
$plugin | string | The slug of the plugin to activate. |
Résultat | boolean | WP_Error | True if the plugin was activated, a WP_Error if an error was encountered. |
public cleanup_active_plugins_option ( ) |
public deactivate_plugin ( string $plugin, $force = false ) : void | ||
$plugin | string | The slug of the plugin to deactivate. |
Résultat | void | deactivate_plugins() returns nothing...so we can't actually know if it succeeded :) |
public get_active_plugins_option ( ) : array | ||
Résultat | array | List of active plugin slugs. |
public get_plugin_activation_link ( string $plugin ) : string | ||
$plugin | string | The slug of the VIP plugin to activate. |
Résultat | string | Activation URL. |
public get_plugin_deactivation_link ( string $plugin ) : string | ||
$plugin | string | The slug of the VIP plugin to deactivate. |
Résultat | string | Deactivation URL. |
public get_plugins ( ) : array | ||
Résultat | array | Array of plugins |
public include_active_plugins ( ) |
public static instance ( ) : WPCOM_VIP_Plugins_UI | ||
Résultat | WPCOM_VIP_Plugins_UI | The one true WPCOM_VIP_Plugins_UI |
public validate_plugin ( string $plugin ) : boolean | ||
$plugin | string | The slug of the VIP plugin to validate. |
Résultat | boolean | True if valid, false if not. |
public $activation_disabled |
public $capability |