PHP 클래스 WPCOM_VIP_Plugins_UI, vip-mu-plugins-public

파일 보기 프로젝트 열기: Automattic/vip-mu-plugins-public 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

공개 메소드들

메소드 설명
__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.

비공개 메소드들

메소드 설명
__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.

메소드 상세

__clone() 공개 메소드

A dummy magic method to prevent WPCOM_VIP_Plugins_UI from being cloned
public __clone ( )

__wakeup() 공개 메소드

A dummy magic method to prevent WPCOM_VIP_Plugins_UI from being unserialized
public __wakeup ( )

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() 공개 메소드

Load the assets for this plugin on the correct screen only
public action_enqueue_scripts ( string $hook ) : void
$hook string
리턴 void

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.
public action_init ( )

activate_plugin() 공개 메소드

Activates a plugin.
public activate_plugin ( string $plugin ) : boolean | WP_Error
$plugin string The slug of the plugin to activate.
리턴 boolean | WP_Error True if the plugin was activated, a WP_Error if an error was encountered.

cleanup_active_plugins_option() 공개 메소드

Removes any invalid plugins from the option, i.e. when they're deleted.

community_plugins_menu_columns() 공개 정적인 메소드

Filters the columns of the Community Plugins table.
public static community_plugins_menu_columns ( array $columns ) : array
$columns array An array of existing columns.
리턴 array Modified list of columns.

deactivate_plugin() 공개 메소드

Deactivates a plugin.
public deactivate_plugin ( string $plugin, $force = false ) : void
$plugin string The slug of the plugin to deactivate.
리턴 void deactivate_plugins() returns nothing...so we can't actually know if it succeeded :)

display_menu_page() 공개 메소드

Outputs the contents of the menu page.
public display_menu_page ( )

get_active_plugins_option() 공개 메소드

Gets the list of VIP plugins that have been activated via the UI.
public get_active_plugins_option ( ) : array
리턴 array List of active plugin slugs.

get_menu_url() 공개 메소드

Generates a link to the plugin's menu page.
public get_menu_url ( array $extra_query_args = [] ) : string
$extra_query_args array Optional. Extra arguments to pass to add_query_arg().
리턴 string URL to the plugin's menu page.

get_plugins() 공개 메소드

Grab list of regular WP plugins
또한 보기: get_plugins()
public get_plugins ( ) : array
리턴 array Array of plugins

get_shared_plugins() 공개 메소드

Grab list of VIP Shared Plugins
또한 보기: get_plugins()
public get_shared_plugins ( ) : array
리턴 array Array of shared plugins

include_active_plugins() 공개 메소드

Includes any active plugin files that are enabled via the UI/option.

instance() 공개 정적인 메소드

Insures that only one instance of WPCOM_VIP_Plugins_UI exists in memory at any one time. Also prevents needing to define globals all over the place.
또한 보기: WPCOM_VIP_Plugins_UI()
public static instance ( ) : WPCOM_VIP_Plugins_UI
리턴 WPCOM_VIP_Plugins_UI The one true WPCOM_VIP_Plugins_UI

is_plugin_active() 공개 메소드

Determines if a given plugin slug is already activated or not.
public is_plugin_active ( string $plugin ) : string | boolean
$plugin string The slug of the VIP plugin to check.
리턴 string | boolean "option" if the plugin was activated via UI, "manual" if activated via code, and false if not activated.

validate_plugin() 공개 메소드

Validates a plugin slug.
public validate_plugin ( string $plugin ) : boolean
$plugin string The slug of the VIP plugin to validate.
리턴 boolean True if valid, false if not.

프로퍼티 상세

$activation_disabled 공개적으로 프로퍼티

Whether or not to disable the plugin activation links.
public $activation_disabled

$capability 공개적으로 프로퍼티

Required capability to access this plugin's features. Use the "wpcom_vip_plugins_ui_capability" filter to change this.
public $capability

$fpp_plugins 공개적으로 프로퍼티

List of Featured Partner Program plugins.
public $fpp_plugins

$hidden_plugins 공개적으로 프로퍼티

List of plugins that should be hidden.
public $hidden_plugins

$hook_suffix 공개적으로 프로퍼티

The $hook_suffix value for the menu page.
public $hook_suffix

$parent_menu_slug 공개적으로 프로퍼티

Parent menu's slug. Use the "wpcom_vip_plugins_ui_parent_menu_slug" filter to change this.
public $parent_menu_slug

$plugin_folder 공개적으로 프로퍼티

Path to the extra plugins folder.
public $plugin_folder