WP_REST_Templates_Controller::get_wp_templates_author_text_field()wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Returns a human readable text for the author of the template.
|
WP_REST_Plugins_Controller::validate_plugin_param()wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php | Checks that the “plugin” parameter is a valid path.
|
WP_REST_Plugins_Controller::sanitize_plugin_param()wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php | Sanitizes the “plugin” parameter to be a proper plugin file with “.php” appended.
|
wp_skip_paused_plugins()wp-includes/load.php | Filters a given list of plugins, removing any paused plugins from it.
|
wp_ajax_delete_plugin()wp-admin/includes/ajax-actions.php | Handles deleting a plugin via AJAX.
|
wp_ajax_update_plugin()wp-admin/includes/ajax-actions.php | Handles updating a plugin via AJAX.
|
is_uninstallable_plugin()wp-admin/includes/plugin.php | Determines whether the plugin can be uninstalled.
|
uninstall_plugin()wp-admin/includes/plugin.php | Uninstalls a single plugin.
|
add_menu_page()wp-admin/includes/plugin.php | Adds a top-level menu page.
|
add_submenu_page()wp-admin/includes/plugin.php | Adds a submenu page.
|
deactivate_plugins()wp-admin/includes/plugin.php | Deactivates a single plugin or multiple plugins.
|
activate_plugin()wp-admin/includes/plugin.php | Attempts activation of plugin in a “sandbox” and redirects on success.
|
get_plugin_data()wp-admin/includes/plugin.php | Parses the plugin contents to retrieve plugin’s metadata.
|
_get_plugin_data_markup_translate()wp-admin/includes/plugin.php | Sanitizes plugin data, optionally adds markup, optionally translates.
|
get_plugin_files()wp-admin/includes/plugin.php | Gets a list of a plugin’s files.
|
get_plugins()wp-admin/includes/plugin.php | Checks the plugins directory and retrieve all plugin files with plugin data.
|
plugins_url()wp-includes/link-template.php | Retrieves a URL within the plugins or mu-plugins directory.
|
register_activation_hook()wp-includes/plugin.php | Set the activation hook for a plugin.
|
register_deactivation_hook()wp-includes/plugin.php | Sets the deactivation hook for a plugin.
|
register_uninstall_hook()wp-includes/plugin.php | Sets the uninstallation hook for a plugin.
|
If your plugin file is located at /home/www/wp-content/plugins/wpdocs-plugin/wpdocs-plugin.php, and you call:
The
$x
variable will equal to “wpdocs-plugin/wpdocs-plugin.php”.wp-content/plugin.php
) and for a must-use plugin (e.g.wp-content/mu-plugins/plugin.php
),plugin_basename( __FILE__ )
returnsplugin.php
. Note that in these particular contexts,plugin_basename( __FILE__ )
andbasename( __FILE__ )
return the same value. However these functions are not equivalent for plugin files residing inside a subdirectory.If you want to add a plugin action link but need to use the callback action from another file or class than you can try this way
And now in other file you can easily use this contrast
so it is good practice to define a CONSTANT for
plugin_basename( __FILE__ )
and reuse it again.If you need to access a directory within your awesome plugin, eg, a class directory, you can access it by:
$lang_dir variable will now be “your-awesome-plugin/class”, you can now use this to reference files within the class directory.