wp-includes/plugin.php


Lines:

1 to 100 of 113
<?php

/**
 * The plugin API is located in this file, which allows for creating actions
 * and filters and hooking functions, and methods. The functions or methods will
 * then be run when the action or filter is called.
 *
 * The API callback examples reference functions, but can be methods of classes.
 * To hook methods, you'll need to pass an array one of two ways.
 *
 * Any of the syntaxes explained in the PHP documentation for the
 * {@link https://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'}
 * type are valid.
 *
 * Also see the {@link https://developer.wordpress.org/plugins/ Plugin API} for
 * more information and examples on how to use a lot of these functions.
 *
 * This file should have no external dependencies.
 *
 * @package WordPress
 * @subpackage Plugin
 * @since 1.5.0
 */

// Initialize the filter globals.
require __DIR__ . '/class-wp-hook.php';


/** @var WP_Hook[] $wp_filter */
global $wp_filter;


/** @var int[] $wp_actions */
global $wp_actions;


/** @var string[] $wp_current_filter */
global $wp_current_filter;

if ( $wp_filter ) {
  $wp_filter = WP_Hook::WP_Hook::build_preinitialized_hooks( $wp_filter );
} else {
  $wp_filter = array();
}

if ( ! isset( $wp_actions ) ) {
  $wp_actions = array();
}

if ( ! isset( $wp_current_filter ) ) {
  $wp_current_filter = array();
}

/* function add_filter() – Adds a callback function to a filter hook. */

/* function apply_filters() – Calls the callback functions that have been added to a filter hook. */

/* function apply_filters_ref_array() – Calls the callback functions that have been added to a filter hook, specifying arguments in an array. */

/* function has_filter() – Checks if any filter has been registered for a hook. */

/* function remove_filter() – Removes a callback function from a filter hook. */

/* function remove_all_filters() – Removes all of the callback functions from a filter hook. */

/* function current_filter() – Retrieves the name of the current filter hook. */

/* function doing_filter() – Returns whether or not a filter hook is currently being processed. */

/* function add_action() – Adds a callback function to an action hook. */

/* function do_action() – Calls the callback functions that have been added to an action hook. */

/* function do_action_ref_array() – Calls the callback functions that have been added to an action hook, specifying arguments in an array. */

/* function has_action() – Checks if any action has been registered for a hook. */

/* function remove_action() – Removes a callback function from an action hook. */

/* function remove_all_actions() – Removes all of the callback functions from an action hook. */

/* function current_action() – Retrieve the name of the current action. */

/* function doing_action() – Returns whether or not an action hook is currently being processed. */

/* function did_action() – Retrieves the number of times an action has been fired during the current request. */

/* function apply_filters_deprecated() – Fires functions attached to a deprecated filter hook. */

/* function do_action_deprecated() – Fires functions attached to a deprecated action hook. */

//
// Functions for handling plugins.
//

/* function plugin_basename() – Gets the basename of a plugin. */

/* function wp_register_plugin_realpath() – Register a plugin’s real path. */

/* function plugin_dir_path() – Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in. */

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      Call hooks

      API Letters: ,,