code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
wordpress WP_REST_Widget_Types_Controller::get_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Widget\_Types\_Controller::get\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
==========================================================================================================
Retrieves a single widget type from the collection.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function get_item( $request ) {
$widget_id = $request['id'];
$widget_type = $this->get_widget( $widget_id );
if ( is_wp_error( $widget_type ) ) {
return $widget_type;
}
$data = $this->prepare_item_for_response( $widget_type, $request );
return rest_ensure_response( $data );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Prepares a widget type object for serialization. |
| [WP\_REST\_Widget\_Types\_Controller::get\_widget()](get_widget) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Gets the details about the requested widget. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::get_widget_preview( string $widget, array $instance ): string WP\_REST\_Widget\_Types\_Controller::get\_widget\_preview( string $widget, array $instance ): string
====================================================================================================
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Returns the output of [WP\_Widget::widget()](../wp_widget/widget) when called with the provided instance. Used by encode\_form\_data() to preview a widget.
`$widget` string Required The widget's PHP class name (see class-wp-widget.php). `$instance` array Required Widget instance settings. string
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
private function get_widget_preview( $widget, $instance ) {
ob_start();
the_widget( $widget, $instance );
return ob_get_clean();
}
```
| Uses | Description |
| --- | --- |
| [the\_widget()](../../functions/the_widget) wp-includes/widgets.php | Output an arbitrary widget as a template tag. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::encode\_form\_data()](encode_form_data) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | An RPC-style endpoint which can be used by clients to turn user input in a widget admin form into an encoded instance object. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::prepare_item_for_response( array $item, WP_REST_Request $request ): WP_REST_Response WP\_REST\_Widget\_Types\_Controller::prepare\_item\_for\_response( array $item, WP\_REST\_Request $request ): WP\_REST\_Response
================================================================================================================================
Prepares a widget type object for serialization.
`$item` array Required Widget type data. `$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response) Widget type data.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function prepare_item_for_response( $item, $request ) {
// Restores the more descriptive, specific name for use within this method.
$widget_type = $item;
$fields = $this->get_fields_for_response( $request );
$data = array(
'id' => $widget_type['id'],
);
$schema = $this->get_item_schema();
$extra_fields = array(
'name',
'description',
'is_multi',
'classname',
'widget_class',
'option_name',
'customize_selective_refresh',
);
foreach ( $extra_fields as $extra_field ) {
if ( ! rest_is_field_included( $extra_field, $fields ) ) {
continue;
}
if ( isset( $widget_type[ $extra_field ] ) ) {
$field = $widget_type[ $extra_field ];
} elseif ( array_key_exists( 'default', $schema['properties'][ $extra_field ] ) ) {
$field = $schema['properties'][ $extra_field ]['default'];
} else {
$field = '';
}
$data[ $extra_field ] = rest_sanitize_value_from_schema( $field, $schema['properties'][ $extra_field ] );
}
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
$data = $this->add_additional_fields_to_object( $data, $request );
$data = $this->filter_response_by_context( $data, $context );
$response = rest_ensure_response( $data );
if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) {
$response->add_links( $this->prepare_links( $widget_type ) );
}
/**
* Filters the REST API response for a widget type.
*
* @since 5.8.0
*
* @param WP_REST_Response $response The response object.
* @param array $widget_type The array of widget data.
* @param WP_REST_Request $request The request object.
*/
return apply_filters( 'rest_prepare_widget_type', $response, $widget_type, $request );
}
```
[apply\_filters( 'rest\_prepare\_widget\_type', WP\_REST\_Response $response, array $widget\_type, WP\_REST\_Request $request )](../../hooks/rest_prepare_widget_type)
Filters the REST API response for a widget type.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_item\_schema()](get_item_schema) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Retrieves the widget type’s schema, conforming to JSON Schema. |
| [WP\_REST\_Widget\_Types\_Controller::prepare\_links()](prepare_links) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Prepares links for the widget type. |
| [rest\_is\_field\_included()](../../functions/rest_is_field_included) wp-includes/rest-api.php | Given an array of fields to include in a response, some of which may be `nested.fields`, determine whether the provided field should be included in the response body. |
| [rest\_sanitize\_value\_from\_schema()](../../functions/rest_sanitize_value_from_schema) wp-includes/rest-api.php | Sanitize a value based on a schema. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_item()](get_item) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Retrieves a single widget type from the collection. |
| [WP\_REST\_Widget\_Types\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Retrieves the list of all widget types. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$widget_type` to `$item` to match parent class for PHP 8 named parameter support. |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::prepare_links( array $widget_type ): array WP\_REST\_Widget\_Types\_Controller::prepare\_links( array $widget\_type ): array
=================================================================================
Prepares links for the widget type.
`$widget_type` array Required Widget type data. array Links for the given widget type.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
protected function prepare_links( $widget_type ) {
return array(
'collection' => array(
'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
),
'self' => array(
'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $widget_type['id'] ) ),
),
);
}
```
| Uses | Description |
| --- | --- |
| [rest\_url()](../../functions/rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Prepares a widget type object for serialization. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::get_items( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Widget\_Types\_Controller::get\_items( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
===========================================================================================================
Retrieves the list of all widget types.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function get_items( $request ) {
$data = array();
foreach ( $this->get_widgets() as $widget ) {
$widget_type = $this->prepare_item_for_response( $widget, $request );
$data[] = $this->prepare_response_for_collection( $widget_type );
}
return rest_ensure_response( $data );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_widgets()](get_widgets) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Normalize array of widgets. |
| [WP\_REST\_Widget\_Types\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Prepares a widget type object for serialization. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::get_widget_form( WP_Widget $widget_object, array $instance ): string WP\_REST\_Widget\_Types\_Controller::get\_widget\_form( WP\_Widget $widget\_object, array $instance ): string
=============================================================================================================
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Returns the output of [WP\_Widget::form()](../wp_widget/form) when called with the provided instance. Used by encode\_form\_data() to preview a widget’s form.
`$widget_object` [WP\_Widget](../wp_widget) Required Widget object to call widget() on. `$instance` array Required Widget instance settings. string
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
private function get_widget_form( $widget_object, $instance ) {
ob_start();
/** This filter is documented in wp-includes/class-wp-widget.php */
$instance = apply_filters(
'widget_form_callback',
$instance,
$widget_object
);
if ( false !== $instance ) {
$return = $widget_object->form( $instance );
/** This filter is documented in wp-includes/class-wp-widget.php */
do_action_ref_array(
'in_widget_form',
array( &$widget_object, &$return, $instance )
);
}
return ob_get_clean();
}
```
[do\_action\_ref\_array( 'in\_widget\_form', WP\_Widget $widget, null $return, array $instance )](../../hooks/in_widget_form)
Fires at the end of the widget control form.
[apply\_filters( 'widget\_form\_callback', array $instance, WP\_Widget $widget )](../../hooks/widget_form_callback)
Filters the widget instance’s settings before displaying the control form.
| Uses | Description |
| --- | --- |
| [do\_action\_ref\_array()](../../functions/do_action_ref_array) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook, specifying arguments in an array. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::encode\_form\_data()](encode_form_data) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | An RPC-style endpoint which can be used by clients to turn user input in a widget admin form into an encoded instance object. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::get_widget( string $id ): array|WP_Error WP\_REST\_Widget\_Types\_Controller::get\_widget( string $id ): array|WP\_Error
===============================================================================
Gets the details about the requested widget.
`$id` string Required The widget type id. array|[WP\_Error](../wp_error) The array of widget data if the name is valid, [WP\_Error](../wp_error) otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function get_widget( $id ) {
foreach ( $this->get_widgets() as $widget ) {
if ( $id === $widget['id'] ) {
return $widget;
}
}
return new WP_Error( 'rest_widget_type_invalid', __( 'Invalid widget type.' ), array( 'status' => 404 ) );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_widgets()](get_widgets) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Normalize array of widgets. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_item()](get_item) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Retrieves a single widget type from the collection. |
| [WP\_REST\_Widget\_Types\_Controller::get\_item\_permissions\_check()](get_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Checks if a given request has access to read a widget type. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::get_items_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Widget\_Types\_Controller::get\_items\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
=================================================================================================================
Checks whether a given request has permission to read widget types.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has read access, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function get_items_permissions_check( $request ) {
return $this->check_read_permission();
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::check\_read\_permission()](check_read_permission) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Checks whether the user can read widget types. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::register_routes() WP\_REST\_Widget\_Types\_Controller::register\_routes()
=======================================================
Registers the widget type routes.
* [register\_rest\_route()](../../functions/register_rest_route)
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->rest_base,
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
'args' => $this->get_collection_params(),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/(?P<id>[a-zA-Z0-9_-]+)',
array(
'args' => array(
'id' => array(
'description' => __( 'The widget type id.' ),
'type' => 'string',
),
),
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item' ),
'permission_callback' => array( $this, 'get_item_permissions_check' ),
'args' => $this->get_collection_params(),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/(?P<id>[a-zA-Z0-9_-]+)/encode',
array(
'args' => array(
'id' => array(
'description' => __( 'The widget type id.' ),
'type' => 'string',
'required' => true,
),
'instance' => array(
'description' => __( 'Current instance settings of the widget.' ),
'type' => 'object',
),
'form_data' => array(
'description' => __( 'Serialized widget form data to encode into instance settings.' ),
'type' => 'string',
'sanitize_callback' => static function( $string ) {
$array = array();
wp_parse_str( $string, $array );
return $array;
},
),
),
array(
'methods' => WP_REST_Server::CREATABLE,
'permission_callback' => array( $this, 'get_item_permissions_check' ),
'callback' => array( $this, 'encode_form_data' ),
),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/(?P<id>[a-zA-Z0-9_-]+)/render',
array(
array(
'methods' => WP_REST_Server::CREATABLE,
'permission_callback' => array( $this, 'get_item_permissions_check' ),
'callback' => array( $this, 'render' ),
'args' => array(
'id' => array(
'description' => __( 'The widget type id.' ),
'type' => 'string',
'required' => true,
),
'instance' => array(
'description' => __( 'Current instance settings of the widget.' ),
'type' => 'object',
),
),
),
)
);
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_collection\_params()](get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Retrieves the query params for collections. |
| [register\_rest\_route()](../../functions/register_rest_route) wp-includes/rest-api.php | Registers a REST API route. |
| [wp\_parse\_str()](../../functions/wp_parse_str) wp-includes/formatting.php | Parses a string into variables to be stored in an array. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
| programming_docs |
wordpress WP_REST_Widget_Types_Controller::get_collection_params(): array WP\_REST\_Widget\_Types\_Controller::get\_collection\_params(): array
=====================================================================
Retrieves the query params for collections.
array Collection parameters.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function get_collection_params() {
return array(
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
);
}
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::register\_routes()](register_routes) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Registers the widget type routes. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::render_legacy_widget_preview_iframe( string $id_base, array $instance ): string WP\_REST\_Widget\_Types\_Controller::render\_legacy\_widget\_preview\_iframe( string $id\_base, array $instance ): string
=========================================================================================================================
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Renders a page containing a preview of the requested Legacy Widget block.
`$id_base` string Required The id base of the requested widget. `$instance` array Required The widget instance attributes. string Rendered Legacy Widget block preview.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
private function render_legacy_widget_preview_iframe( $id_base, $instance ) {
if ( ! defined( 'IFRAME_REQUEST' ) ) {
define( 'IFRAME_REQUEST', true );
}
ob_start();
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="profile" href="https://gmpg.org/xfn/11" />
<?php wp_head(); ?>
<style>
/* Reset theme styles */
html, body, #page, #content {
padding: 0 !important;
margin: 0 !important;
}
</style>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site">
<div id="content" class="site-content">
<?php
$registry = WP_Block_Type_Registry::get_instance();
$block = $registry->get_registered( 'core/legacy-widget' );
echo $block->render(
array(
'idBase' => $id_base,
'instance' => $instance,
)
);
?>
</div><!-- #content -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>
<?php
return ob_get_clean();
}
```
| Uses | Description |
| --- | --- |
| [WP\_Block\_Type\_Registry::get\_instance()](../wp_block_type_registry/get_instance) wp-includes/class-wp-block-type-registry.php | Utility method to retrieve the main instance of the class. |
| [language\_attributes()](../../functions/language_attributes) wp-includes/general-template.php | Displays the language attributes for the ‘html’ tag. |
| [wp\_head()](../../functions/wp_head) wp-includes/general-template.php | Fires the wp\_head action. |
| [wp\_footer()](../../functions/wp_footer) wp-includes/general-template.php | Fires the wp\_footer action. |
| [bloginfo()](../../functions/bloginfo) wp-includes/general-template.php | Displays information about the current site. |
| [body\_class()](../../functions/body_class) wp-includes/post-template.php | Displays the class names for the body element. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::render()](render) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Renders a single Legacy Widget and wraps it in a JSON-encodable array. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::check_read_permission(): true|WP_Error WP\_REST\_Widget\_Types\_Controller::check\_read\_permission(): true|WP\_Error
==============================================================================
Checks whether the user can read widget types.
true|[WP\_Error](../wp_error) True if the widget type is visible, [WP\_Error](../wp_error) otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
protected function check_read_permission() {
if ( ! current_user_can( 'edit_theme_options' ) ) {
return new WP_Error(
'rest_cannot_manage_widgets',
__( 'Sorry, you are not allowed to manage widgets on this site.' ),
array(
'status' => rest_authorization_required_code(),
)
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_items\_permissions\_check()](get_items_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Checks whether a given request has permission to read widget types. |
| [WP\_REST\_Widget\_Types\_Controller::get\_item\_permissions\_check()](get_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Checks if a given request has access to read a widget type. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::__construct() WP\_REST\_Widget\_Types\_Controller::\_\_construct()
====================================================
Constructor.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function __construct() {
$this->namespace = 'wp/v2';
$this->rest_base = 'widget-types';
}
```
| Used By | Description |
| --- | --- |
| [create\_initial\_rest\_routes()](../../functions/create_initial_rest_routes) wp-includes/rest-api.php | Registers default REST API routes. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::get_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Widget\_Types\_Controller::get\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
================================================================================================================
Checks if a given request has access to read a widget type.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has read access for the item, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function get_item_permissions_check( $request ) {
$check = $this->check_read_permission();
if ( is_wp_error( $check ) ) {
return $check;
}
$widget_id = $request['id'];
$widget_type = $this->get_widget( $widget_id );
if ( is_wp_error( $widget_type ) ) {
return $widget_type;
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::check\_read\_permission()](check_read_permission) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Checks whether the user can read widget types. |
| [WP\_REST\_Widget\_Types\_Controller::get\_widget()](get_widget) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Gets the details about the requested widget. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::render( WP_REST_Request $request ): array WP\_REST\_Widget\_Types\_Controller::render( WP\_REST\_Request $request ): array
================================================================================
Renders a single Legacy Widget and wraps it in a JSON-encodable array.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. array An array with rendered Legacy Widget HTML.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function render( $request ) {
return array(
'preview' => $this->render_legacy_widget_preview_iframe(
$request['id'],
isset( $request['instance'] ) ? $request['instance'] : null
),
);
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::render\_legacy\_widget\_preview\_iframe()](render_legacy_widget_preview_iframe) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Renders a page containing a preview of the requested Legacy Widget block. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::get_widgets(): array WP\_REST\_Widget\_Types\_Controller::get\_widgets(): array
==========================================================
Normalize array of widgets.
array Array of widgets.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
protected function get_widgets() {
global $wp_widget_factory, $wp_registered_widgets;
$widgets = array();
foreach ( $wp_registered_widgets as $widget ) {
$parsed_id = wp_parse_widget_id( $widget['id'] );
$widget_object = $wp_widget_factory->get_widget_object( $parsed_id['id_base'] );
$widget['id'] = $parsed_id['id_base'];
$widget['is_multi'] = (bool) $widget_object;
if ( isset( $widget['name'] ) ) {
$widget['name'] = html_entity_decode( $widget['name'], ENT_QUOTES, get_bloginfo( 'charset' ) );
}
if ( isset( $widget['description'] ) ) {
$widget['description'] = html_entity_decode( $widget['description'], ENT_QUOTES, get_bloginfo( 'charset' ) );
}
unset( $widget['callback'] );
$classname = '';
foreach ( (array) $widget['classname'] as $cn ) {
if ( is_string( $cn ) ) {
$classname .= '_' . $cn;
} elseif ( is_object( $cn ) ) {
$classname .= '_' . get_class( $cn );
}
}
$widget['classname'] = ltrim( $classname, '_' );
$widgets[ $widget['id'] ] = $widget;
}
ksort( $widgets );
return $widgets;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Widget\_Factory::get\_widget\_object()](../wp_widget_factory/get_widget_object) wp-includes/class-wp-widget-factory.php | Returns the registered [WP\_Widget](../wp_widget) object for the given widget type. |
| [wp\_parse\_widget\_id()](../../functions/wp_parse_widget_id) wp-includes/widgets.php | Converts a widget ID into its id\_base and number components. |
| [get\_bloginfo()](../../functions/get_bloginfo) wp-includes/general-template.php | Retrieves information about the current site. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Retrieves the list of all widget types. |
| [WP\_REST\_Widget\_Types\_Controller::get\_widget()](get_widget) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Gets the details about the requested widget. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::encode_form_data( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Widget\_Types\_Controller::encode\_form\_data( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
===================================================================================================================
An RPC-style endpoint which can be used by clients to turn user input in a widget admin form into an encoded instance object.
Accepts:
* id: A widget type ID.
* instance: A widget’s encoded instance object. Optional.
* form\_data: Form data from submitting a widget’s admin form. Optional.
Returns:
* instance: The encoded instance object after updating the widget with the given form data.
* form: The widget’s admin form after updating the widget with the given form data.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function encode_form_data( $request ) {
global $wp_widget_factory;
$id = $request['id'];
$widget_object = $wp_widget_factory->get_widget_object( $id );
if ( ! $widget_object ) {
return new WP_Error(
'rest_invalid_widget',
__( 'Cannot preview a widget that does not extend WP_Widget.' ),
array( 'status' => 400 )
);
}
// Set the widget's number so that the id attributes in the HTML that we
// return are predictable.
if ( isset( $request['number'] ) && is_numeric( $request['number'] ) ) {
$widget_object->_set( (int) $request['number'] );
} else {
$widget_object->_set( -1 );
}
if ( isset( $request['instance']['encoded'], $request['instance']['hash'] ) ) {
$serialized_instance = base64_decode( $request['instance']['encoded'] );
if ( ! hash_equals( wp_hash( $serialized_instance ), $request['instance']['hash'] ) ) {
return new WP_Error(
'rest_invalid_widget',
__( 'The provided instance is malformed.' ),
array( 'status' => 400 )
);
}
$instance = unserialize( $serialized_instance );
} else {
$instance = array();
}
if (
isset( $request['form_data'][ "widget-$id" ] ) &&
is_array( $request['form_data'][ "widget-$id" ] )
) {
$new_instance = array_values( $request['form_data'][ "widget-$id" ] )[0];
$old_instance = $instance;
$instance = $widget_object->update( $new_instance, $old_instance );
/** This filter is documented in wp-includes/class-wp-widget.php */
$instance = apply_filters(
'widget_update_callback',
$instance,
$new_instance,
$old_instance,
$widget_object
);
}
$serialized_instance = serialize( $instance );
$widget_key = $wp_widget_factory->get_widget_key( $id );
$response = array(
'form' => trim(
$this->get_widget_form(
$widget_object,
$instance
)
),
'preview' => trim(
$this->get_widget_preview(
$widget_key,
$instance
)
),
'instance' => array(
'encoded' => base64_encode( $serialized_instance ),
'hash' => wp_hash( $serialized_instance ),
),
);
if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) {
// Use new stdClass so that JSON result is {} and not [].
$response['instance']['raw'] = empty( $instance ) ? new stdClass : $instance;
}
return rest_ensure_response( $response );
}
```
[apply\_filters( 'widget\_update\_callback', array $instance, array $new\_instance, array $old\_instance, WP\_Widget $widget )](../../hooks/widget_update_callback)
Filters a widget’s settings before saving.
| Uses | Description |
| --- | --- |
| [WP\_Widget\_Factory::get\_widget\_object()](../wp_widget_factory/get_widget_object) wp-includes/class-wp-widget-factory.php | Returns the registered [WP\_Widget](../wp_widget) object for the given widget type. |
| [WP\_Widget\_Factory::get\_widget\_key()](../wp_widget_factory/get_widget_key) wp-includes/class-wp-widget-factory.php | Returns the registered key for the given widget type. |
| [WP\_REST\_Widget\_Types\_Controller::get\_widget\_form()](get_widget_form) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Returns the output of [WP\_Widget::form()](../wp_widget/form) when called with the provided instance. Used by encode\_form\_data() to preview a widget’s form. |
| [WP\_REST\_Widget\_Types\_Controller::get\_widget\_preview()](get_widget_preview) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Returns the output of [WP\_Widget::widget()](../wp_widget/widget) when called with the provided instance. Used by encode\_form\_data() to preview a widget. |
| [wp\_hash()](../../functions/wp_hash) wp-includes/pluggable.php | Gets hash of given string. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress WP_REST_Widget_Types_Controller::get_item_schema(): array WP\_REST\_Widget\_Types\_Controller::get\_item\_schema(): array
===============================================================
Retrieves the widget type’s schema, conforming to JSON Schema.
array Item schema data.
File: `wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php/)
```
public function get_item_schema() {
if ( $this->schema ) {
return $this->add_additional_fields_schema( $this->schema );
}
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'widget-type',
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Unique slug identifying the widget type.' ),
'type' => 'string',
'context' => array( 'embed', 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'Human-readable name identifying the widget type.' ),
'type' => 'string',
'default' => '',
'context' => array( 'embed', 'view', 'edit' ),
'readonly' => true,
),
'description' => array(
'description' => __( 'Description of the widget.' ),
'type' => 'string',
'default' => '',
'context' => array( 'view', 'edit', 'embed' ),
),
'is_multi' => array(
'description' => __( 'Whether the widget supports multiple instances' ),
'type' => 'boolean',
'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true,
),
'classname' => array(
'description' => __( 'Class name' ),
'type' => 'string',
'default' => '',
'context' => array( 'embed', 'view', 'edit' ),
'readonly' => true,
),
),
);
$this->schema = $schema;
return $this->add_additional_fields_schema( $this->schema );
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Prepares a widget type object for serialization. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
| programming_docs |
wordpress WP_REST_Post_Meta_Fields::get_meta_subtype(): string WP\_REST\_Post\_Meta\_Fields::get\_meta\_subtype(): string
==========================================================
Retrieves the post meta subtype.
string Subtype for the meta type, or empty string if no specific subtype.
File: `wp-includes/rest-api/fields/class-wp-rest-post-meta-fields.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/fields/class-wp-rest-post-meta-fields.php/)
```
protected function get_meta_subtype() {
return $this->post_type;
}
```
| Version | Description |
| --- | --- |
| [4.9.8](https://developer.wordpress.org/reference/since/4.9.8/) | Introduced. |
wordpress WP_REST_Post_Meta_Fields::get_rest_field_type(): string WP\_REST\_Post\_Meta\_Fields::get\_rest\_field\_type(): string
==============================================================
Retrieves the type for [register\_rest\_field()](../../functions/register_rest_field) .
* [register\_rest\_field()](../../functions/register_rest_field)
string The REST field type.
File: `wp-includes/rest-api/fields/class-wp-rest-post-meta-fields.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/fields/class-wp-rest-post-meta-fields.php/)
```
public function get_rest_field_type() {
return $this->post_type;
}
```
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Post_Meta_Fields::__construct( string $post_type ) WP\_REST\_Post\_Meta\_Fields::\_\_construct( string $post\_type )
=================================================================
Constructor.
`$post_type` string Required Post type to register fields for. File: `wp-includes/rest-api/fields/class-wp-rest-post-meta-fields.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/fields/class-wp-rest-post-meta-fields.php/)
```
public function __construct( $post_type ) {
$this->post_type = $post_type;
}
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::\_\_construct()](../wp_rest_posts_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Constructor. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Post_Meta_Fields::get_meta_type(): string WP\_REST\_Post\_Meta\_Fields::get\_meta\_type(): string
=======================================================
Retrieves the post meta type.
string The meta type.
File: `wp-includes/rest-api/fields/class-wp-rest-post-meta-fields.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/fields/class-wp-rest-post-meta-fields.php/)
```
protected function get_meta_type() {
return 'post';
}
```
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress Walker_Category_Checklist::start_lvl( string $output, int $depth, array $args = array() ) Walker\_Category\_Checklist::start\_lvl( string $output, int $depth, array $args = array() )
============================================================================================
Starts the list before the elements are added.
* [Walker:start\_lvl()](../../functions/walkerstart_lvl)
`$output` string Required Used to append additional content (passed by reference). `$depth` int Required Depth of category. Used for tab indentation. `$args` array Optional An array of arguments. @see [wp\_terms\_checklist()](../../functions/wp_terms_checklist) More Arguments from wp\_terms\_checklist( ... $args ) Array or string of arguments for generating a terms checklist.
* `descendants_and_self`intID of the category to output along with its descendants.
Default 0.
* `selected_cats`int[]Array of category IDs to mark as checked. Default false.
* `popular_cats`int[]Array of category IDs to receive the "popular-category" class.
Default false.
* `walker`[Walker](../walker)
[Walker](../walker) object to use to build the output. Default empty which results in a [Walker\_Category\_Checklist](../walker_category_checklist) instance being used.
* `taxonomy`stringTaxonomy to generate the checklist for. Default `'category'`.
* `checked_ontop`boolWhether to move checked items out of the hierarchy and to the top of the list. Default true.
* `echo`boolWhether to echo the generated markup. False to return the markup instead of echoing it. Default true.
Default: `array()`
File: `wp-admin/includes/class-walker-category-checklist.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-walker-category-checklist.php/)
```
public function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth );
$output .= "$indent<ul class='children'>\n";
}
```
| Version | Description |
| --- | --- |
| [2.5.1](https://developer.wordpress.org/reference/since/2.5.1/) | Introduced. |
wordpress Walker_Category_Checklist::start_el( string $output, WP_Term $data_object, int $depth, array $args = array(), int $current_object_id ) Walker\_Category\_Checklist::start\_el( string $output, WP\_Term $data\_object, int $depth, array $args = array(), int $current\_object\_id )
=============================================================================================================================================
Start the element output.
* [Walker::start\_el()](../walker/start_el)
`$output` string Required Used to append additional content (passed by reference). `$data_object` [WP\_Term](../wp_term) Required The current term object. `$depth` int Required Depth of the term in reference to parents. Default 0. `$args` array Optional An array of arguments. @see [wp\_terms\_checklist()](../../functions/wp_terms_checklist) More Arguments from wp\_terms\_checklist( ... $args ) Array or string of arguments for generating a terms checklist.
* `descendants_and_self`intID of the category to output along with its descendants.
Default 0.
* `selected_cats`int[]Array of category IDs to mark as checked. Default false.
* `popular_cats`int[]Array of category IDs to receive the "popular-category" class.
Default false.
* `walker`[Walker](../walker)
[Walker](../walker) object to use to build the output. Default empty which results in a [Walker\_Category\_Checklist](../walker_category_checklist) instance being used.
* `taxonomy`stringTaxonomy to generate the checklist for. Default `'category'`.
* `checked_ontop`boolWhether to move checked items out of the hierarchy and to the top of the list. Default true.
* `echo`boolWhether to echo the generated markup. False to return the markup instead of echoing it. Default true.
Default: `array()`
`$current_object_id` int Optional ID of the current term. Default 0. File: `wp-admin/includes/class-walker-category-checklist.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-walker-category-checklist.php/)
```
public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) {
// Restores the more descriptive, specific name for use within this method.
$category = $data_object;
if ( empty( $args['taxonomy'] ) ) {
$taxonomy = 'category';
} else {
$taxonomy = $args['taxonomy'];
}
if ( 'category' === $taxonomy ) {
$name = 'post_category';
} else {
$name = 'tax_input[' . $taxonomy . ']';
}
$args['popular_cats'] = ! empty( $args['popular_cats'] ) ? array_map( 'intval', $args['popular_cats'] ) : array();
$class = in_array( $category->term_id, $args['popular_cats'], true ) ? ' class="popular-category"' : '';
$args['selected_cats'] = ! empty( $args['selected_cats'] ) ? array_map( 'intval', $args['selected_cats'] ) : array();
if ( ! empty( $args['list_only'] ) ) {
$aria_checked = 'false';
$inner_class = 'category';
if ( in_array( $category->term_id, $args['selected_cats'], true ) ) {
$inner_class .= ' selected';
$aria_checked = 'true';
}
$output .= "\n" . '<li' . $class . '>' .
'<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
' tabindex="0" role="checkbox" aria-checked="' . $aria_checked . '">' .
/** This filter is documented in wp-includes/category-template.php */
esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
} else {
$is_selected = in_array( $category->term_id, $args['selected_cats'], true );
$is_disabled = ! empty( $args['disabled'] );
$output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
'<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' .
checked( $is_selected, true, false ) .
disabled( $is_disabled, true, false ) . ' /> ' .
/** This filter is documented in wp-includes/category-template.php */
esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';
}
}
```
[apply\_filters( 'the\_category', string $thelist, string $separator, string $parents )](../../hooks/the_category)
Filters the category or list of categories.
| Uses | Description |
| --- | --- |
| [disabled()](../../functions/disabled) wp-includes/general-template.php | Outputs the HTML disabled attribute. |
| [checked()](../../functions/checked) wp-includes/general-template.php | Outputs the HTML checked attribute. |
| [esc\_html()](../../functions/esc_html) wp-includes/formatting.php | Escaping for HTML blocks. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$category` to `$data_object` and `$id` to `$current_object_id` to match parent class for PHP 8 named parameter support. |
| [2.5.1](https://developer.wordpress.org/reference/since/2.5.1/) | Introduced. |
wordpress Walker_Category_Checklist::end_lvl( string $output, int $depth, array $args = array() ) Walker\_Category\_Checklist::end\_lvl( string $output, int $depth, array $args = array() )
==========================================================================================
Ends the list of after the elements are added.
* [Walker::end\_lvl()](../walker/end_lvl)
`$output` string Required Used to append additional content (passed by reference). `$depth` int Required Depth of category. Used for tab indentation. `$args` array Optional An array of arguments. @see [wp\_terms\_checklist()](../../functions/wp_terms_checklist) More Arguments from wp\_terms\_checklist( ... $args ) Array or string of arguments for generating a terms checklist.
* `descendants_and_self`intID of the category to output along with its descendants.
Default 0.
* `selected_cats`int[]Array of category IDs to mark as checked. Default false.
* `popular_cats`int[]Array of category IDs to receive the "popular-category" class.
Default false.
* `walker`[Walker](../walker)
[Walker](../walker) object to use to build the output. Default empty which results in a [Walker\_Category\_Checklist](../walker_category_checklist) instance being used.
* `taxonomy`stringTaxonomy to generate the checklist for. Default `'category'`.
* `checked_ontop`boolWhether to move checked items out of the hierarchy and to the top of the list. Default true.
* `echo`boolWhether to echo the generated markup. False to return the markup instead of echoing it. Default true.
Default: `array()`
File: `wp-admin/includes/class-walker-category-checklist.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-walker-category-checklist.php/)
```
public function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth );
$output .= "$indent</ul>\n";
}
```
| Version | Description |
| --- | --- |
| [2.5.1](https://developer.wordpress.org/reference/since/2.5.1/) | Introduced. |
wordpress Walker_Category_Checklist::end_el( string $output, WP_Term $data_object, int $depth, array $args = array() ) Walker\_Category\_Checklist::end\_el( string $output, WP\_Term $data\_object, int $depth, array $args = array() )
=================================================================================================================
Ends the element output, if needed.
* [Walker::end\_el()](../walker/end_el)
`$output` string Required Used to append additional content (passed by reference). `$data_object` [WP\_Term](../wp_term) Required The current term object. `$depth` int Required Depth of the term in reference to parents. Default 0. `$args` array Optional An array of arguments. @see [wp\_terms\_checklist()](../../functions/wp_terms_checklist) More Arguments from wp\_terms\_checklist( ... $args ) Array or string of arguments for generating a terms checklist.
* `descendants_and_self`intID of the category to output along with its descendants.
Default 0.
* `selected_cats`int[]Array of category IDs to mark as checked. Default false.
* `popular_cats`int[]Array of category IDs to receive the "popular-category" class.
Default false.
* `walker`[Walker](../walker)
[Walker](../walker) object to use to build the output. Default empty which results in a [Walker\_Category\_Checklist](../walker_category_checklist) instance being used.
* `taxonomy`stringTaxonomy to generate the checklist for. Default `'category'`.
* `checked_ontop`boolWhether to move checked items out of the hierarchy and to the top of the list. Default true.
* `echo`boolWhether to echo the generated markup. False to return the markup instead of echoing it. Default true.
Default: `array()`
File: `wp-admin/includes/class-walker-category-checklist.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-walker-category-checklist.php/)
```
public function end_el( &$output, $data_object, $depth = 0, $args = array() ) {
$output .= "</li>\n";
}
```
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. |
| [2.5.1](https://developer.wordpress.org/reference/since/2.5.1/) | Introduced. |
wordpress WP_REST_Search_Handler::search_items( WP_REST_Request $request ): array WP\_REST\_Search\_Handler::search\_items( WP\_REST\_Request $request ): array
=============================================================================
Searches the object type content for a given search request.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full REST request. array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the total count for the matching search results.
File: `wp-includes/rest-api/search/class-wp-rest-search-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/search/class-wp-rest-search-handler.php/)
```
abstract public function search_items( WP_REST_Request $request );
```
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress WP_REST_Search_Handler::get_subtypes(): array WP\_REST\_Search\_Handler::get\_subtypes(): array
=================================================
Gets the object subtypes managed by this search handler.
array Array of object subtype identifiers.
File: `wp-includes/rest-api/search/class-wp-rest-search-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/search/class-wp-rest-search-handler.php/)
```
public function get_subtypes() {
return $this->subtypes;
}
```
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress WP_REST_Search_Handler::prepare_item( int|string $id, array $fields ): array WP\_REST\_Search\_Handler::prepare\_item( int|string $id, array $fields ): array
================================================================================
Prepares the search result for a given ID.
`$id` int|string Required Item ID. `$fields` array Required Fields to include for the item. array Associative array containing all fields for the item.
File: `wp-includes/rest-api/search/class-wp-rest-search-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/search/class-wp-rest-search-handler.php/)
```
abstract public function prepare_item( $id, array $fields );
```
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The `$id` parameter can accept a string. |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress WP_REST_Search_Handler::prepare_item_links( int|string $id ): array WP\_REST\_Search\_Handler::prepare\_item\_links( int|string $id ): array
========================================================================
Prepares links for the search result of a given ID.
`$id` int|string Required Item ID. array Links for the given item.
File: `wp-includes/rest-api/search/class-wp-rest-search-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/search/class-wp-rest-search-handler.php/)
```
abstract public function prepare_item_links( $id );
```
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The `$id` parameter can accept a string. |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress WP_REST_Search_Handler::get_type(): string WP\_REST\_Search\_Handler::get\_type(): string
==============================================
Gets the object type managed by this search handler.
string Object type identifier.
File: `wp-includes/rest-api/search/class-wp-rest-search-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/search/class-wp-rest-search-handler.php/)
```
public function get_type() {
return $this->type;
}
```
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress WP_REST_Block_Directory_Controller::find_plugin_for_slug( string $slug ): string WP\_REST\_Block\_Directory\_Controller::find\_plugin\_for\_slug( string $slug ): string
=======================================================================================
Finds an installed plugin for the given slug.
`$slug` string Required The WordPress.org directory slug for a plugin. string The plugin file found matching it.
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
protected function find_plugin_for_slug( $slug ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
$plugin_files = get_plugins( '/' . $slug );
if ( ! $plugin_files ) {
return '';
}
$plugin_files = array_keys( $plugin_files );
return $slug . '/' . reset( $plugin_files );
}
```
| Uses | Description |
| --- | --- |
| [get\_plugins()](../../functions/get_plugins) wp-admin/includes/plugin.php | Checks the plugins directory and retrieve all plugin files with plugin data. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::prepare\_links()](prepare_links) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Generates a list of links to include in the response for the plugin. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress WP_REST_Block_Directory_Controller::prepare_item_for_response( array $item, WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Block\_Directory\_Controller::prepare\_item\_for\_response( array $item, WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
=============================================================================================================================================
Parse block metadata for a block, and prepare it for an API response.
`$item` array Required The plugin metadata. `$request` [WP\_REST\_Request](../wp_rest_request) Required Request object. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
public function prepare_item_for_response( $item, $request ) {
// Restores the more descriptive, specific name for use within this method.
$plugin = $item;
$fields = $this->get_fields_for_response( $request );
// There might be multiple blocks in a plugin. Only the first block is mapped.
$block_data = reset( $plugin['blocks'] );
// A data array containing the properties we'll return.
$block = array(
'name' => $block_data['name'],
'title' => ( $block_data['title'] ? $block_data['title'] : $plugin['name'] ),
'description' => wp_trim_words( $plugin['short_description'], 30, '...' ),
'id' => $plugin['slug'],
'rating' => $plugin['rating'] / 20,
'rating_count' => (int) $plugin['num_ratings'],
'active_installs' => (int) $plugin['active_installs'],
'author_block_rating' => $plugin['author_block_rating'] / 20,
'author_block_count' => (int) $plugin['author_block_count'],
'author' => wp_strip_all_tags( $plugin['author'] ),
'icon' => ( isset( $plugin['icons']['1x'] ) ? $plugin['icons']['1x'] : 'block-default' ),
'last_updated' => gmdate( 'Y-m-d\TH:i:s', strtotime( $plugin['last_updated'] ) ),
'humanized_updated' => sprintf(
/* translators: %s: Human-readable time difference. */
__( '%s ago' ),
human_time_diff( strtotime( $plugin['last_updated'] ) )
),
);
$this->add_additional_fields_to_object( $block, $request );
$response = new WP_REST_Response( $block );
if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) {
$response->add_links( $this->prepare_links( $plugin ) );
}
return $response;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::prepare\_links()](prepare_links) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Generates a list of links to include in the response for the plugin. |
| [rest\_is\_field\_included()](../../functions/rest_is_field_included) wp-includes/rest-api.php | Given an array of fields to include in a response, some of which may be `nested.fields`, determine whether the provided field should be included in the response body. |
| [wp\_strip\_all\_tags()](../../functions/wp_strip_all_tags) wp-includes/formatting.php | Properly strips all HTML tags including script and style |
| [wp\_trim\_words()](../../functions/wp_trim_words) wp-includes/formatting.php | Trims text to a certain number of words. |
| [human\_time\_diff()](../../functions/human_time_diff) wp-includes/formatting.php | Determines the difference between two timestamps. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Search and retrieve blocks metadata |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$plugin` to `$item` to match parent class for PHP 8 named parameter support. |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress WP_REST_Block_Directory_Controller::prepare_links( array $plugin ): array WP\_REST\_Block\_Directory\_Controller::prepare\_links( array $plugin ): array
==============================================================================
Generates a list of links to include in the response for the plugin.
`$plugin` array Required The plugin data from WordPress.org. array
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
protected function prepare_links( $plugin ) {
$links = array(
'https://api.w.org/install-plugin' => array(
'href' => add_query_arg( 'slug', urlencode( $plugin['slug'] ), rest_url( 'wp/v2/plugins' ) ),
),
);
$plugin_file = $this->find_plugin_for_slug( $plugin['slug'] );
if ( $plugin_file ) {
$links['https://api.w.org/plugin'] = array(
'href' => rest_url( 'wp/v2/plugins/' . substr( $plugin_file, 0, - 4 ) ),
'embeddable' => true,
);
}
return $links;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::find\_plugin\_for\_slug()](find_plugin_for_slug) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Finds an installed plugin for the given slug. |
| [rest\_url()](../../functions/rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint. |
| [add\_query\_arg()](../../functions/add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Parse block metadata for a block, and prepare it for an API response. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress WP_REST_Block_Directory_Controller::get_items( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Block\_Directory\_Controller::get\_items( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
==============================================================================================================
Search and retrieve blocks metadata
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
public function get_items( $request ) {
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
require_once ABSPATH . 'wp-admin/includes/plugin.php';
$response = plugins_api(
'query_plugins',
array(
'block' => $request['term'],
'per_page' => $request['per_page'],
'page' => $request['page'],
)
);
if ( is_wp_error( $response ) ) {
$response->add_data( array( 'status' => 500 ) );
return $response;
}
$result = array();
foreach ( $response->plugins as $plugin ) {
// If the API returned a plugin with empty data for 'blocks', skip it.
if ( empty( $plugin['blocks'] ) ) {
continue;
}
$data = $this->prepare_item_for_response( $plugin, $request );
$result[] = $this->prepare_response_for_collection( $data );
}
return rest_ensure_response( $result );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Parse block metadata for a block, and prepare it for an API response. |
| [plugins\_api()](../../functions/plugins_api) wp-admin/includes/plugin-install.php | Retrieves plugin installer pages from the WordPress.org Plugins API. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress WP_REST_Block_Directory_Controller::get_items_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Block\_Directory\_Controller::get\_items\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
====================================================================================================================
Checks whether a given request has permission to install and activate plugins.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has permission, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
public function get_items_permissions_check( $request ) {
if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'activate_plugins' ) ) {
return new WP_Error(
'rest_block_directory_cannot_view',
__( 'Sorry, you are not allowed to browse the block directory.' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress WP_REST_Block_Directory_Controller::register_routes() WP\_REST\_Block\_Directory\_Controller::register\_routes()
==========================================================
Registers the necessary REST API routes.
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/search',
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
'args' => $this->get_collection_params(),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::get\_collection\_params()](get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Retrieves the search params for the blocks collection. |
| [register\_rest\_route()](../../functions/register_rest_route) wp-includes/rest-api.php | Registers a REST API route. |
wordpress WP_REST_Block_Directory_Controller::get_collection_params(): array WP\_REST\_Block\_Directory\_Controller::get\_collection\_params(): array
========================================================================
Retrieves the search params for the blocks collection.
array Collection parameters.
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
public function get_collection_params() {
$query_params = parent::get_collection_params();
$query_params['context']['default'] = 'view';
$query_params['term'] = array(
'description' => __( 'Limit result set to blocks matching the search term.' ),
'type' => 'string',
'required' => true,
'minLength' => 1,
);
unset( $query_params['search'] );
/**
* Filters REST API collection parameters for the block directory controller.
*
* @since 5.5.0
*
* @param array $query_params JSON Schema-formatted collection parameters.
*/
return apply_filters( 'rest_block_directory_collection_params', $query_params );
}
```
[apply\_filters( 'rest\_block\_directory\_collection\_params', array $query\_params )](../../hooks/rest_block_directory_collection_params)
Filters REST API collection parameters for the block directory controller.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Controller::get\_collection\_params()](../wp_rest_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-controller.php | Retrieves the query params for the collections. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::register\_routes()](register_routes) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Registers the necessary REST API routes. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress WP_REST_Block_Directory_Controller::__construct() WP\_REST\_Block\_Directory\_Controller::\_\_construct()
=======================================================
Constructs the controller.
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
public function __construct() {
$this->namespace = 'wp/v2';
$this->rest_base = 'block-directory';
}
```
| Used By | Description |
| --- | --- |
| [create\_initial\_rest\_routes()](../../functions/create_initial_rest_routes) wp-includes/rest-api.php | Registers default REST API routes. |
wordpress WP_REST_Block_Directory_Controller::get_item_schema(): array WP\_REST\_Block\_Directory\_Controller::get\_item\_schema(): array
==================================================================
Retrieves the theme’s schema, conforming to JSON Schema.
array Item schema data.
File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
public function get_item_schema() {
if ( $this->schema ) {
return $this->add_additional_fields_schema( $this->schema );
}
$this->schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'block-directory-item',
'type' => 'object',
'properties' => array(
'name' => array(
'description' => __( 'The block name, in namespace/block-name format.' ),
'type' => 'string',
'context' => array( 'view' ),
),
'title' => array(
'description' => __( 'The block title, in human readable format.' ),
'type' => 'string',
'context' => array( 'view' ),
),
'description' => array(
'description' => __( 'A short description of the block, in human readable format.' ),
'type' => 'string',
'context' => array( 'view' ),
),
'id' => array(
'description' => __( 'The block slug.' ),
'type' => 'string',
'context' => array( 'view' ),
),
'rating' => array(
'description' => __( 'The star rating of the block.' ),
'type' => 'number',
'context' => array( 'view' ),
),
'rating_count' => array(
'description' => __( 'The number of ratings.' ),
'type' => 'integer',
'context' => array( 'view' ),
),
'active_installs' => array(
'description' => __( 'The number sites that have activated this block.' ),
'type' => 'integer',
'context' => array( 'view' ),
),
'author_block_rating' => array(
'description' => __( 'The average rating of blocks published by the same author.' ),
'type' => 'number',
'context' => array( 'view' ),
),
'author_block_count' => array(
'description' => __( 'The number of blocks published by the same author.' ),
'type' => 'integer',
'context' => array( 'view' ),
),
'author' => array(
'description' => __( 'The WordPress.org username of the block author.' ),
'type' => 'string',
'context' => array( 'view' ),
),
'icon' => array(
'description' => __( 'The block icon.' ),
'type' => 'string',
'format' => 'uri',
'context' => array( 'view' ),
),
'last_updated' => array(
'description' => __( 'The date when the block was last updated.' ),
'type' => 'string',
'format' => 'date-time',
'context' => array( 'view' ),
),
'humanized_updated' => array(
'description' => __( 'The date when the block was last updated, in fuzzy human readable format.' ),
'type' => 'string',
'context' => array( 'view' ),
),
),
);
return $this->add_additional_fields_schema( $this->schema );
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress WP_Http_Cookie::getHeaderValue(): string WP\_Http\_Cookie::getHeaderValue(): string
==========================================
Convert cookie name and value back to header string.
string Header encoded cookie name and value.
File: `wp-includes/class-wp-http-cookie.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-cookie.php/)
```
public function getHeaderValue() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
if ( ! isset( $this->name ) || ! isset( $this->value ) ) {
return '';
}
/**
* Filters the header-encoded cookie value.
*
* @since 3.4.0
*
* @param string $value The cookie value.
* @param string $name The cookie name.
*/
return $this->name . '=' . apply_filters( 'wp_http_cookie_value', $this->value, $this->name );
}
```
[apply\_filters( 'wp\_http\_cookie\_value', string $value, string $name )](../../hooks/wp_http_cookie_value)
Filters the header-encoded cookie value.
| Uses | Description |
| --- | --- |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Http\_Cookie::getFullHeader()](getfullheader) wp-includes/class-wp-http-cookie.php | Retrieve cookie header for usage in the rest of the WordPress HTTP API. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress WP_Http_Cookie::test( string $url ): bool WP\_Http\_Cookie::test( string $url ): bool
===========================================
Confirms that it’s OK to send this cookie to the URL checked against.
Decision is based on RFC 2109/2965, so look there for details on validity.
`$url` string Required URL you intend to send this cookie to bool true if allowed, false otherwise.
File: `wp-includes/class-wp-http-cookie.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-cookie.php/)
```
public function test( $url ) {
if ( is_null( $this->name ) ) {
return false;
}
// Expires - if expired then nothing else matters.
if ( isset( $this->expires ) && time() > $this->expires ) {
return false;
}
// Get details on the URL we're thinking about sending to.
$url = parse_url( $url );
$url['port'] = isset( $url['port'] ) ? $url['port'] : ( 'https' === $url['scheme'] ? 443 : 80 );
$url['path'] = isset( $url['path'] ) ? $url['path'] : '/';
// Values to use for comparison against the URL.
$path = isset( $this->path ) ? $this->path : '/';
$port = isset( $this->port ) ? $this->port : null;
$domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] );
if ( false === stripos( $domain, '.' ) ) {
$domain .= '.local';
}
// Host - very basic check that the request URL ends with the domain restriction (minus leading dot).
$domain = ( '.' === substr( $domain, 0, 1 ) ) ? substr( $domain, 1 ) : $domain;
if ( substr( $url['host'], -strlen( $domain ) ) !== $domain ) {
return false;
}
// Port - supports "port-lists" in the format: "80,8000,8080".
if ( ! empty( $port ) && ! in_array( $url['port'], array_map( 'intval', explode( ',', $port ) ), true ) ) {
return false;
}
// Path - request path must start with path restriction.
if ( substr( $url['path'], 0, strlen( $path ) ) !== $path ) {
return false;
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [stripos()](../../functions/stripos) wp-includes/class-pop3.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress WP_Http_Cookie::getFullHeader(): string WP\_Http\_Cookie::getFullHeader(): string
=========================================
Retrieve cookie header for usage in the rest of the WordPress HTTP API.
string
File: `wp-includes/class-wp-http-cookie.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-cookie.php/)
```
public function getFullHeader() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
return 'Cookie: ' . $this->getHeaderValue();
}
```
| Uses | Description |
| --- | --- |
| [WP\_Http\_Cookie::getHeaderValue()](getheadervalue) wp-includes/class-wp-http-cookie.php | Convert cookie name and value back to header string. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress WP_Http_Cookie::get_attributes(): array WP\_Http\_Cookie::get\_attributes(): array
==========================================
Retrieves cookie attributes.
array List of attributes.
* `expires`string|int|nullWhen the cookie expires. Unix timestamp or formatted date.
* `path`stringCookie URL path.
* `domain`stringCookie domain.
File: `wp-includes/class-wp-http-cookie.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-cookie.php/)
```
public function get_attributes() {
return array(
'expires' => $this->expires,
'path' => $this->path,
'domain' => $this->domain,
);
}
```
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress WP_Http_Cookie::__construct( string|array $data, string $requested_url = '' ) WP\_Http\_Cookie::\_\_construct( string|array $data, string $requested\_url = '' )
==================================================================================
Sets up this cookie object.
The parameter $data should be either an associative array containing the indices names below or a header string detailing it.
`$data` string|array Required Raw cookie data as header string or data array.
* `name`stringCookie name.
* `value`mixedValue. Should NOT already be urlencoded.
* `expires`string|int|nullOptional. Unix timestamp or formatted date. Default null.
* `path`stringOptional. Path. Default `'/'`.
* `domain`stringOptional. Domain. Default host of parsed $requested\_url.
* `port`int|stringOptional. Port or comma-separated list of ports. Default null.
* `host_only`boolOptional. host-only storage flag. Default true.
`$requested_url` string Optional The URL which the cookie was set on, used for default $domain and $port values. Default: `''`
File: `wp-includes/class-wp-http-cookie.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-cookie.php/)
```
public function __construct( $data, $requested_url = '' ) {
if ( $requested_url ) {
$parsed_url = parse_url( $requested_url );
}
if ( isset( $parsed_url['host'] ) ) {
$this->domain = $parsed_url['host'];
}
$this->path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : '/';
if ( '/' !== substr( $this->path, -1 ) ) {
$this->path = dirname( $this->path ) . '/';
}
if ( is_string( $data ) ) {
// Assume it's a header string direct from a previous request.
$pairs = explode( ';', $data );
// Special handling for first pair; name=value. Also be careful of "=" in value.
$name = trim( substr( $pairs[0], 0, strpos( $pairs[0], '=' ) ) );
$value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 );
$this->name = $name;
$this->value = urldecode( $value );
// Removes name=value from items.
array_shift( $pairs );
// Set everything else as a property.
foreach ( $pairs as $pair ) {
$pair = rtrim( $pair );
// Handle the cookie ending in ; which results in a empty final pair.
if ( empty( $pair ) ) {
continue;
}
list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' );
$key = strtolower( trim( $key ) );
if ( 'expires' === $key ) {
$val = strtotime( $val );
}
$this->$key = $val;
}
} else {
if ( ! isset( $data['name'] ) ) {
return;
}
// Set properties based directly on parameters.
foreach ( array( 'name', 'value', 'path', 'domain', 'port', 'host_only' ) as $field ) {
if ( isset( $data[ $field ] ) ) {
$this->$field = $data[ $field ];
}
}
if ( isset( $data['expires'] ) ) {
$this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] );
} else {
$this->expires = null;
}
}
}
```
| Used By | Description |
| --- | --- |
| [WP\_HTTP\_Requests\_Response::get\_cookies()](../wp_http_requests_response/get_cookies) wp-includes/class-wp-http-requests-response.php | Retrieves cookies from the response. |
| [WP\_Http::processHeaders()](../wp_http/processheaders) wp-includes/class-wp-http.php | Transforms header string into an array. |
| [WP\_Http::buildCookieHeader()](../wp_http/buildcookieheader) wp-includes/class-wp-http.php | Takes the arguments for a ::request() and checks for the cookie array. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Added `host_only` to the `$data` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress WP_Metadata_Lazyloader::queue_objects( string $object_type, array $object_ids ): void|WP_Error WP\_Metadata\_Lazyloader::queue\_objects( string $object\_type, array $object\_ids ): void|WP\_Error
====================================================================================================
Adds objects to the metadata lazy-load queue.
`$object_type` string Required Type of object whose meta is to be lazy-loaded. Accepts `'term'` or `'comment'`. `$object_ids` array Required Array of object IDs. void|[WP\_Error](../wp_error) [WP\_Error](../wp_error) on failure.
File: `wp-includes/class-wp-metadata-lazyloader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-metadata-lazyloader.php/)
```
public function queue_objects( $object_type, $object_ids ) {
if ( ! isset( $this->settings[ $object_type ] ) ) {
return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );
}
$type_settings = $this->settings[ $object_type ];
if ( ! isset( $this->pending_objects[ $object_type ] ) ) {
$this->pending_objects[ $object_type ] = array();
}
foreach ( $object_ids as $object_id ) {
// Keyed by ID for faster lookup.
if ( ! isset( $this->pending_objects[ $object_type ][ $object_id ] ) ) {
$this->pending_objects[ $object_type ][ $object_id ] = 1;
}
}
add_filter( $type_settings['filter'], $type_settings['callback'] );
/**
* Fires after objects are added to the metadata lazy-load queue.
*
* @since 4.5.0
*
* @param array $object_ids Array of object IDs.
* @param string $object_type Type of object being queued.
* @param WP_Metadata_Lazyloader $lazyloader The lazy-loader object.
*/
do_action( 'metadata_lazyloader_queued_objects', $object_ids, $object_type, $this );
}
```
[do\_action( 'metadata\_lazyloader\_queued\_objects', array $object\_ids, string $object\_type, WP\_Metadata\_Lazyloader $lazyloader )](../../hooks/metadata_lazyloader_queued_objects)
Fires after objects are added to the metadata lazy-load queue.
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [add\_filter()](../../functions/add_filter) wp-includes/plugin.php | Adds a callback function to a filter hook. |
| [do\_action()](../../functions/do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress WP_Metadata_Lazyloader::lazyload_comment_meta( mixed $check ): mixed WP\_Metadata\_Lazyloader::lazyload\_comment\_meta( mixed $check ): mixed
========================================================================
Lazy-loads comment meta for queued comments.
This method is public so that it can be used as a filter callback. As a rule, there is no need to invoke it directly, from either inside or outside the `WP_Query` object.
`$check` mixed Required The `$check` param passed from the ['get\_comment\_metadata'](../../hooks/get_comment_metadata) hook. mixed The original value of `$check`, so as not to short-circuit `get_comment_metadata()`.
File: `wp-includes/class-wp-metadata-lazyloader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-metadata-lazyloader.php/)
```
public function lazyload_comment_meta( $check ) {
if ( ! empty( $this->pending_objects['comment'] ) ) {
update_meta_cache( 'comment', array_keys( $this->pending_objects['comment'] ) );
// No need to run again for this set of comments.
$this->reset_queue( 'comment' );
}
return $check;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Metadata\_Lazyloader::reset\_queue()](reset_queue) wp-includes/class-wp-metadata-lazyloader.php | Resets lazy-load queue for a given object type. |
| [update\_meta\_cache()](../../functions/update_meta_cache) wp-includes/meta.php | Updates the metadata cache for the specified objects. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress WP_Metadata_Lazyloader::reset_queue( string $object_type ): void|WP_Error WP\_Metadata\_Lazyloader::reset\_queue( string $object\_type ): void|WP\_Error
==============================================================================
Resets lazy-load queue for a given object type.
`$object_type` string Required Object type. Accepts `'comment'` or `'term'`. void|[WP\_Error](../wp_error) [WP\_Error](../wp_error) on failure.
File: `wp-includes/class-wp-metadata-lazyloader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-metadata-lazyloader.php/)
```
public function reset_queue( $object_type ) {
if ( ! isset( $this->settings[ $object_type ] ) ) {
return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );
}
$type_settings = $this->settings[ $object_type ];
$this->pending_objects[ $object_type ] = array();
remove_filter( $type_settings['filter'], $type_settings['callback'] );
}
```
| Uses | Description |
| --- | --- |
| [remove\_filter()](../../functions/remove_filter) wp-includes/plugin.php | Removes a callback function from a filter hook. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_Metadata\_Lazyloader::lazyload\_term\_meta()](lazyload_term_meta) wp-includes/class-wp-metadata-lazyloader.php | Lazy-loads term meta for queued terms. |
| [WP\_Metadata\_Lazyloader::lazyload\_comment\_meta()](lazyload_comment_meta) wp-includes/class-wp-metadata-lazyloader.php | Lazy-loads comment meta for queued comments. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress WP_Metadata_Lazyloader::lazyload_term_meta( mixed $check ): mixed WP\_Metadata\_Lazyloader::lazyload\_term\_meta( mixed $check ): mixed
=====================================================================
Lazy-loads term meta for queued terms.
This method is public so that it can be used as a filter callback. As a rule, there is no need to invoke it directly.
`$check` mixed Required The `$check` param passed from the `'get_term_metadata'` hook. mixed In order not to short-circuit `get_metadata()`. Generally, this is `null`, but it could be another value if filtered by a plugin.
File: `wp-includes/class-wp-metadata-lazyloader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-metadata-lazyloader.php/)
```
public function lazyload_term_meta( $check ) {
if ( ! empty( $this->pending_objects['term'] ) ) {
update_termmeta_cache( array_keys( $this->pending_objects['term'] ) );
// No need to run again for this set of terms.
$this->reset_queue( 'term' );
}
return $check;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Metadata\_Lazyloader::reset\_queue()](reset_queue) wp-includes/class-wp-metadata-lazyloader.php | Resets lazy-load queue for a given object type. |
| [update\_termmeta\_cache()](../../functions/update_termmeta_cache) wp-includes/taxonomy.php | Updates metadata cache for list of term IDs. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress WP_Metadata_Lazyloader::__construct() WP\_Metadata\_Lazyloader::\_\_construct()
=========================================
Constructor.
File: `wp-includes/class-wp-metadata-lazyloader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-metadata-lazyloader.php/)
```
public function __construct() {
$this->settings = array(
'term' => array(
'filter' => 'get_term_metadata',
'callback' => array( $this, 'lazyload_term_meta' ),
),
'comment' => array(
'filter' => 'get_comment_metadata',
'callback' => array( $this, 'lazyload_comment_meta' ),
),
);
}
```
| Used By | Description |
| --- | --- |
| [wp\_metadata\_lazyloader()](../../functions/wp_metadata_lazyloader) wp-includes/meta.php | Retrieves the queue for lazy-loading metadata. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress WP_Recovery_Mode::is_network_plugin( array $extension ): bool WP\_Recovery\_Mode::is\_network\_plugin( array $extension ): bool
=================================================================
Checks whether the given extension a network activated plugin.
`$extension` array Required Extension data. bool True if network plugin, false otherwise.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
protected function is_network_plugin( $extension ) {
if ( 'plugin' !== $extension['type'] ) {
return false;
}
if ( ! is_multisite() ) {
return false;
}
$network_plugins = wp_get_active_network_plugins();
foreach ( $network_plugins as $plugin ) {
if ( 0 === strpos( $plugin, $extension['slug'] . '/' ) ) {
return true;
}
}
return false;
}
```
| Uses | Description |
| --- | --- |
| [wp\_get\_active\_network\_plugins()](../../functions/wp_get_active_network_plugins) wp-includes/ms-load.php | Returns array of network plugin files to be included in global scope. |
| [is\_multisite()](../../functions/is_multisite) wp-includes/load.php | If Multisite is enabled. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::handle\_error()](handle_error) wp-includes/class-wp-recovery-mode.php | Handles a fatal error occurring. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::handle_error( array $error ): true|WP_Error WP\_Recovery\_Mode::handle\_error( array $error ): true|WP\_Error
=================================================================
Handles a fatal error occurring.
The calling API should immediately die() after calling this function.
`$error` array Required Error details from `error_get_last()`. true|[WP\_Error](../wp_error) True if the error was handled and headers have already been sent.
Or the request will exit to try and catch multiple errors at once.
[WP\_Error](../wp_error) if an error occurred preventing it from being handled.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function handle_error( array $error ) {
$extension = $this->get_extension_for_error( $error );
if ( ! $extension || $this->is_network_plugin( $extension ) ) {
return new WP_Error( 'invalid_source', __( 'Error not caused by a plugin or theme.' ) );
}
if ( ! $this->is_active() ) {
if ( ! is_protected_endpoint() ) {
return new WP_Error( 'non_protected_endpoint', __( 'Error occurred on a non-protected endpoint.' ) );
}
if ( ! function_exists( 'wp_generate_password' ) ) {
require_once ABSPATH . WPINC . '/pluggable.php';
}
return $this->email_service->maybe_send_recovery_mode_email( $this->get_email_rate_limit(), $error, $extension );
}
if ( ! $this->store_error( $error ) ) {
return new WP_Error( 'storage_error', __( 'Failed to store the error.' ) );
}
if ( headers_sent() ) {
return true;
}
$this->redirect_protected();
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode::get\_extension\_for\_error()](get_extension_for_error) wp-includes/class-wp-recovery-mode.php | Gets the extension that the error occurred in. |
| [WP\_Recovery\_Mode::is\_network\_plugin()](is_network_plugin) wp-includes/class-wp-recovery-mode.php | Checks whether the given extension a network activated plugin. |
| [WP\_Recovery\_Mode::store\_error()](store_error) wp-includes/class-wp-recovery-mode.php | Stores the given error so that the extension causing it is paused. |
| [WP\_Recovery\_Mode::redirect\_protected()](redirect_protected) wp-includes/class-wp-recovery-mode.php | Redirects the current request to allow recovering multiple errors in one go. |
| [WP\_Recovery\_Mode::is\_active()](is_active) wp-includes/class-wp-recovery-mode.php | Checks whether recovery mode is active. |
| [WP\_Recovery\_Mode::get\_email\_rate\_limit()](get_email_rate_limit) wp-includes/class-wp-recovery-mode.php | Gets the rate limit between sending new recovery mode email links. |
| [is\_protected\_endpoint()](../../functions/is_protected_endpoint) wp-includes/load.php | Determines whether we are currently on an endpoint that should be protected against WSODs. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_Fatal\_Error\_Handler::handle()](../wp_fatal_error_handler/handle) wp-includes/class-wp-fatal-error-handler.php | Runs the shutdown handler. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
| programming_docs |
wordpress WP_Recovery_Mode::get_session_id(): string WP\_Recovery\_Mode::get\_session\_id(): string
==============================================
Gets the recovery mode session ID.
string The session ID if recovery mode is active, empty string otherwise.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function get_session_id() {
return $this->session_id;
}
```
| Used By | Description |
| --- | --- |
| [WP\_Paused\_Extensions\_Storage::get\_option\_name()](../wp_paused_extensions_storage/get_option_name) wp-includes/class-wp-paused-extensions-storage.php | Get the option name for storing paused extensions. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::is_initialized(): bool WP\_Recovery\_Mode::is\_initialized(): bool
===========================================
Checks whether recovery mode has been initialized.
Recovery mode should not be used until this point. Initialization happens immediately before loading plugins.
bool
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function is_initialized() {
return $this->is_initialized;
}
```
| Used By | Description |
| --- | --- |
| [WP\_Fatal\_Error\_Handler::display\_default\_error\_template()](../wp_fatal_error_handler/display_default_error_template) wp-includes/class-wp-fatal-error-handler.php | Displays the default PHP error template. |
| [WP\_Fatal\_Error\_Handler::handle()](../wp_fatal_error_handler/handle) wp-includes/class-wp-fatal-error-handler.php | Runs the shutdown handler. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::is_active(): bool WP\_Recovery\_Mode::is\_active(): bool
======================================
Checks whether recovery mode is active.
This will not change after recovery mode has been initialized. [WP\_Recovery\_Mode::run()](../wp_recovery_mode/run).
bool True if recovery mode is active, false otherwise.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function is_active() {
return $this->is_active;
}
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::handle\_error()](handle_error) wp-includes/class-wp-recovery-mode.php | Handles a fatal error occurring. |
| [WP\_Recovery\_Mode::exit\_recovery\_mode()](exit_recovery_mode) wp-includes/class-wp-recovery-mode.php | Ends the current recovery mode session. |
| [WP\_Recovery\_Mode::handle\_exit\_recovery\_mode()](handle_exit_recovery_mode) wp-includes/class-wp-recovery-mode.php | Handles a request to exit Recovery Mode. |
| [wp\_is\_recovery\_mode()](../../functions/wp_is_recovery_mode) wp-includes/load.php | Is WordPress in Recovery Mode. |
| [WP\_Paused\_Extensions\_Storage::get\_option\_name()](../wp_paused_extensions_storage/get_option_name) wp-includes/class-wp-paused-extensions-storage.php | Get the option name for storing paused extensions. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::initialize() WP\_Recovery\_Mode::initialize()
================================
Initialize recovery mode for the current request.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function initialize() {
$this->is_initialized = true;
add_action( 'wp_logout', array( $this, 'exit_recovery_mode' ) );
add_action( 'login_form_' . self::EXIT_ACTION, array( $this, 'handle_exit_recovery_mode' ) );
add_action( 'recovery_mode_clean_expired_keys', array( $this, 'clean_expired_keys' ) );
if ( ! wp_next_scheduled( 'recovery_mode_clean_expired_keys' ) && ! wp_installing() ) {
wp_schedule_event( time(), 'daily', 'recovery_mode_clean_expired_keys' );
}
if ( defined( 'WP_RECOVERY_MODE_SESSION_ID' ) ) {
$this->is_active = true;
$this->session_id = WP_RECOVERY_MODE_SESSION_ID;
return;
}
if ( $this->cookie_service->is_cookie_set() ) {
$this->handle_cookie();
return;
}
$this->link_service->handle_begin_link( $this->get_link_ttl() );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode::handle\_cookie()](handle_cookie) wp-includes/class-wp-recovery-mode.php | Handles checking for the recovery mode cookie and validating it. |
| [WP\_Recovery\_Mode::get\_link\_ttl()](get_link_ttl) wp-includes/class-wp-recovery-mode.php | Gets the number of seconds the recovery mode link is valid for. |
| [wp\_installing()](../../functions/wp_installing) wp-includes/load.php | Check or set whether WordPress is in “installation” mode. |
| [wp\_next\_scheduled()](../../functions/wp_next_scheduled) wp-includes/cron.php | Retrieve the next timestamp for an event. |
| [wp\_schedule\_event()](../../functions/wp_schedule_event) wp-includes/cron.php | Schedules a recurring event. |
| [add\_action()](../../functions/add_action) wp-includes/plugin.php | Adds a callback function to an action hook. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::exit_recovery_mode(): bool WP\_Recovery\_Mode::exit\_recovery\_mode(): bool
================================================
Ends the current recovery mode session.
bool True on success, false on failure.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function exit_recovery_mode() {
if ( ! $this->is_active() ) {
return false;
}
$this->email_service->clear_rate_limit();
$this->cookie_service->clear_cookie();
wp_paused_plugins()->delete_all();
wp_paused_themes()->delete_all();
return true;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode::is\_active()](is_active) wp-includes/class-wp-recovery-mode.php | Checks whether recovery mode is active. |
| [wp\_paused\_plugins()](../../functions/wp_paused_plugins) wp-includes/error-protection.php | Get the instance for storing paused plugins. |
| [wp\_paused\_themes()](../../functions/wp_paused_themes) wp-includes/error-protection.php | Get the instance for storing paused extensions. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::handle\_exit\_recovery\_mode()](handle_exit_recovery_mode) wp-includes/class-wp-recovery-mode.php | Handles a request to exit Recovery Mode. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::get_email_rate_limit(): int WP\_Recovery\_Mode::get\_email\_rate\_limit(): int
==================================================
Gets the rate limit between sending new recovery mode email links.
int Rate limit in seconds.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
protected function get_email_rate_limit() {
/**
* Filters the rate limit between sending new recovery mode email links.
*
* @since 5.2.0
*
* @param int $rate_limit Time to wait in seconds. Defaults to 1 day.
*/
return apply_filters( 'recovery_mode_email_rate_limit', DAY_IN_SECONDS );
}
```
[apply\_filters( 'recovery\_mode\_email\_rate\_limit', int $rate\_limit )](../../hooks/recovery_mode_email_rate_limit)
Filters the rate limit between sending new recovery mode email links.
| Uses | Description |
| --- | --- |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::handle\_error()](handle_error) wp-includes/class-wp-recovery-mode.php | Handles a fatal error occurring. |
| [WP\_Recovery\_Mode::get\_link\_ttl()](get_link_ttl) wp-includes/class-wp-recovery-mode.php | Gets the number of seconds the recovery mode link is valid for. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::handle_cookie() WP\_Recovery\_Mode::handle\_cookie()
====================================
Handles checking for the recovery mode cookie and validating it.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
protected function handle_cookie() {
$validated = $this->cookie_service->validate_cookie();
if ( is_wp_error( $validated ) ) {
$this->cookie_service->clear_cookie();
$validated->add_data( array( 'status' => 403 ) );
wp_die( $validated );
}
$session_id = $this->cookie_service->get_session_id_from_cookie();
if ( is_wp_error( $session_id ) ) {
$this->cookie_service->clear_cookie();
$session_id->add_data( array( 'status' => 403 ) );
wp_die( $session_id );
}
$this->is_active = true;
$this->session_id = $session_id;
}
```
| Uses | Description |
| --- | --- |
| [wp\_die()](../../functions/wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::initialize()](initialize) wp-includes/class-wp-recovery-mode.php | Initialize recovery mode for the current request. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::handle_exit_recovery_mode() WP\_Recovery\_Mode::handle\_exit\_recovery\_mode()
==================================================
Handles a request to exit Recovery Mode.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function handle_exit_recovery_mode() {
$redirect_to = wp_get_referer();
// Safety check in case referrer returns false.
if ( ! $redirect_to ) {
$redirect_to = is_user_logged_in() ? admin_url() : home_url();
}
if ( ! $this->is_active() ) {
wp_safe_redirect( $redirect_to );
die;
}
if ( ! isset( $_GET['action'] ) || self::EXIT_ACTION !== $_GET['action'] ) {
return;
}
if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], self::EXIT_ACTION ) ) {
wp_die( __( 'Exit recovery mode link expired.' ), 403 );
}
if ( ! $this->exit_recovery_mode() ) {
wp_die( __( 'Failed to exit recovery mode. Please try again later.' ) );
}
wp_safe_redirect( $redirect_to );
die;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode::is\_active()](is_active) wp-includes/class-wp-recovery-mode.php | Checks whether recovery mode is active. |
| [WP\_Recovery\_Mode::exit\_recovery\_mode()](exit_recovery_mode) wp-includes/class-wp-recovery-mode.php | Ends the current recovery mode session. |
| [wp\_verify\_nonce()](../../functions/wp_verify_nonce) wp-includes/pluggable.php | Verifies that a correct security nonce was used with time limit. |
| [wp\_safe\_redirect()](../../functions/wp_safe_redirect) wp-includes/pluggable.php | Performs a safe (local) redirect, using [wp\_redirect()](../../functions/wp_redirect) . |
| [wp\_get\_referer()](../../functions/wp_get_referer) wp-includes/functions.php | Retrieves referer from ‘\_wp\_http\_referer’ or HTTP referer. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_user\_logged\_in()](../../functions/is_user_logged_in) wp-includes/pluggable.php | Determines whether the current visitor is a logged in user. |
| [wp\_die()](../../functions/wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [admin\_url()](../../functions/admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for the current site. |
| [home\_url()](../../functions/home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::get_link_ttl(): int WP\_Recovery\_Mode::get\_link\_ttl(): int
=========================================
Gets the number of seconds the recovery mode link is valid for.
int Interval in seconds.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
protected function get_link_ttl() {
$rate_limit = $this->get_email_rate_limit();
$valid_for = $rate_limit;
/**
* Filters the amount of time the recovery mode email link is valid for.
*
* The ttl must be at least as long as the email rate limit.
*
* @since 5.2.0
*
* @param int $valid_for The number of seconds the link is valid for.
*/
$valid_for = apply_filters( 'recovery_mode_email_link_ttl', $valid_for );
return max( $valid_for, $rate_limit );
}
```
[apply\_filters( 'recovery\_mode\_email\_link\_ttl', int $valid\_for )](../../hooks/recovery_mode_email_link_ttl)
Filters the amount of time the recovery mode email link is valid for.
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode::get\_email\_rate\_limit()](get_email_rate_limit) wp-includes/class-wp-recovery-mode.php | Gets the rate limit between sending new recovery mode email links. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::initialize()](initialize) wp-includes/class-wp-recovery-mode.php | Initialize recovery mode for the current request. |
| [WP\_Recovery\_Mode::clean\_expired\_keys()](clean_expired_keys) wp-includes/class-wp-recovery-mode.php | Cleans any recovery mode keys that have expired according to the link TTL. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::get_extension_for_error( array $error ): array|false WP\_Recovery\_Mode::get\_extension\_for\_error( array $error ): array|false
===========================================================================
Gets the extension that the error occurred in.
`$error` array Required Error details from `error_get_last()`. array|false Extension details.
* `slug`stringThe extension slug. This is the plugin or theme's directory.
* `type`stringThe extension type. Either `'plugin'` or `'theme'`.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
protected function get_extension_for_error( $error ) {
global $wp_theme_directories;
if ( ! isset( $error['file'] ) ) {
return false;
}
if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
return false;
}
$error_file = wp_normalize_path( $error['file'] );
$wp_plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
if ( 0 === strpos( $error_file, $wp_plugin_dir ) ) {
$path = str_replace( $wp_plugin_dir . '/', '', $error_file );
$parts = explode( '/', $path );
return array(
'type' => 'plugin',
'slug' => $parts[0],
);
}
if ( empty( $wp_theme_directories ) ) {
return false;
}
foreach ( $wp_theme_directories as $theme_directory ) {
$theme_directory = wp_normalize_path( $theme_directory );
if ( 0 === strpos( $error_file, $theme_directory ) ) {
$path = str_replace( $theme_directory . '/', '', $error_file );
$parts = explode( '/', $path );
return array(
'type' => 'theme',
'slug' => $parts[0],
);
}
}
return false;
}
```
| Uses | Description |
| --- | --- |
| [wp\_normalize\_path()](../../functions/wp_normalize_path) wp-includes/functions.php | Normalizes a filesystem path. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::store\_error()](store_error) wp-includes/class-wp-recovery-mode.php | Stores the given error so that the extension causing it is paused. |
| [WP\_Recovery\_Mode::handle\_error()](handle_error) wp-includes/class-wp-recovery-mode.php | Handles a fatal error occurring. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::redirect_protected() WP\_Recovery\_Mode::redirect\_protected()
=========================================
Redirects the current request to allow recovering multiple errors in one go.
The redirection will only happen when on a protected endpoint.
It must be ensured that this method is only called when an error actually occurred and will not occur on the next request again. Otherwise it will create a redirect loop.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
protected function redirect_protected() {
// Pluggable is usually loaded after plugins, so we manually include it here for redirection functionality.
if ( ! function_exists( 'wp_safe_redirect' ) ) {
require_once ABSPATH . WPINC . '/pluggable.php';
}
$scheme = is_ssl() ? 'https://' : 'http://';
$url = "{$scheme}{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
wp_safe_redirect( $url );
exit;
}
```
| Uses | Description |
| --- | --- |
| [wp\_safe\_redirect()](../../functions/wp_safe_redirect) wp-includes/pluggable.php | Performs a safe (local) redirect, using [wp\_redirect()](../../functions/wp_redirect) . |
| [is\_ssl()](../../functions/is_ssl) wp-includes/load.php | Determines if SSL is used. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::handle\_error()](handle_error) wp-includes/class-wp-recovery-mode.php | Handles a fatal error occurring. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::__construct() WP\_Recovery\_Mode::\_\_construct()
===================================
[WP\_Recovery\_Mode](../wp_recovery_mode) constructor.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function __construct() {
$this->cookie_service = new WP_Recovery_Mode_Cookie_Service();
$this->key_service = new WP_Recovery_Mode_Key_Service();
$this->link_service = new WP_Recovery_Mode_Link_Service( $this->cookie_service, $this->key_service );
$this->email_service = new WP_Recovery_Mode_Email_Service( $this->link_service );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Email\_Service::\_\_construct()](../wp_recovery_mode_email_service/__construct) wp-includes/class-wp-recovery-mode-email-service.php | [WP\_Recovery\_Mode\_Email\_Service](../wp_recovery_mode_email_service) constructor. |
| [WP\_Recovery\_Mode\_Link\_Service::\_\_construct()](../wp_recovery_mode_link_service/__construct) wp-includes/class-wp-recovery-mode-link-service.php | [WP\_Recovery\_Mode\_Link\_Service](../wp_recovery_mode_link_service) constructor. |
| Used By | Description |
| --- | --- |
| [wp\_recovery\_mode()](../../functions/wp_recovery_mode) wp-includes/error-protection.php | Access the WordPress Recovery Mode instance. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
| programming_docs |
wordpress WP_Recovery_Mode::clean_expired_keys() WP\_Recovery\_Mode::clean\_expired\_keys()
==========================================
Cleans any recovery mode keys that have expired according to the link TTL.
Executes on a daily cron schedule.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
public function clean_expired_keys() {
$this->key_service->clean_expired_keys( $this->get_link_ttl() );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode::get\_link\_ttl()](get_link_ttl) wp-includes/class-wp-recovery-mode.php | Gets the number of seconds the recovery mode link is valid for. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode::store_error( array $error ): bool WP\_Recovery\_Mode::store\_error( array $error ): bool
======================================================
Stores the given error so that the extension causing it is paused.
`$error` array Required Error details from `error_get_last()`. bool True if the error was stored successfully, false otherwise.
File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
protected function store_error( $error ) {
$extension = $this->get_extension_for_error( $error );
if ( ! $extension ) {
return false;
}
switch ( $extension['type'] ) {
case 'plugin':
return wp_paused_plugins()->set( $extension['slug'], $error );
case 'theme':
return wp_paused_themes()->set( $extension['slug'], $error );
default:
return false;
}
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode::get\_extension\_for\_error()](get_extension_for_error) wp-includes/class-wp-recovery-mode.php | Gets the extension that the error occurred in. |
| [wp\_paused\_plugins()](../../functions/wp_paused_plugins) wp-includes/error-protection.php | Get the instance for storing paused plugins. |
| [wp\_paused\_themes()](../../functions/wp_paused_themes) wp-includes/error-protection.php | Get the instance for storing paused extensions. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::handle\_error()](handle_error) wp-includes/class-wp-recovery-mode.php | Handles a fatal error occurring. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Meta_Query::get_sql_clauses(): string[] WP\_Meta\_Query::get\_sql\_clauses(): string[]
==============================================
Generate SQL clauses to be appended to a main query.
Called by the public [WP\_Meta\_Query::get\_sql()](get_sql), this method is abstracted out to maintain parity with the other Query classes.
string[] Array containing JOIN and WHERE SQL clauses to append to the main query.
* `join`stringSQL fragment to append to the main JOIN clause.
* `where`stringSQL fragment to append to the main WHERE clause.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
protected function get_sql_clauses() {
/*
* $queries are passed by reference to get_sql_for_query() for recursion.
* To keep $this->queries unaltered, pass a copy.
*/
$queries = $this->queries;
$sql = $this->get_sql_for_query( $queries );
if ( ! empty( $sql['where'] ) ) {
$sql['where'] = ' AND ' . $sql['where'];
}
return $sql;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql\_for\_query()](get_sql_for_query) wp-includes/class-wp-meta-query.php | Generate SQL clauses for a single query array. |
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql()](get_sql) wp-includes/class-wp-meta-query.php | Generates SQL clauses to be appended to a main query. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress WP_Meta_Query::find_compatible_table_alias( array $clause, array $parent_query ): string|false WP\_Meta\_Query::find\_compatible\_table\_alias( array $clause, array $parent\_query ): string|false
====================================================================================================
Identify an existing table alias that is compatible with the current query clause.
We avoid unnecessary table joins by allowing each clause to look for an existing table alias that is compatible with the query that it needs to perform.
An existing alias is compatible if (a) it is a sibling of `$clause` (ie, it’s under the scope of the same relation), and (b) the combination of operator and relation between the clauses allows for a shared table join.
In the case of [WP\_Meta\_Query](../wp_meta_query), this only applies to ‘IN’ clauses that are connected by the relation ‘OR’.
`$clause` array Required Query clause. `$parent_query` array Required Parent query of $clause. string|false Table alias if found, otherwise false.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
protected function find_compatible_table_alias( $clause, $parent_query ) {
$alias = false;
foreach ( $parent_query as $sibling ) {
// If the sibling has no alias yet, there's nothing to check.
if ( empty( $sibling['alias'] ) ) {
continue;
}
// We're only interested in siblings that are first-order clauses.
if ( ! is_array( $sibling ) || ! $this->is_first_order_clause( $sibling ) ) {
continue;
}
$compatible_compares = array();
// Clauses connected by OR can share joins as long as they have "positive" operators.
if ( 'OR' === $parent_query['relation'] ) {
$compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' );
// Clauses joined by AND with "negative" operators share a join only if they also share a key.
} elseif ( isset( $sibling['key'] ) && isset( $clause['key'] ) && $sibling['key'] === $clause['key'] ) {
$compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' );
}
$clause_compare = strtoupper( $clause['compare'] );
$sibling_compare = strtoupper( $sibling['compare'] );
if ( in_array( $clause_compare, $compatible_compares, true ) && in_array( $sibling_compare, $compatible_compares, true ) ) {
$alias = preg_replace( '/\W/', '_', $sibling['alias'] );
break;
}
}
/**
* Filters the table alias identified as compatible with the current clause.
*
* @since 4.1.0
*
* @param string|false $alias Table alias, or false if none was found.
* @param array $clause First-order query clause.
* @param array $parent_query Parent of $clause.
* @param WP_Meta_Query $query WP_Meta_Query object.
*/
return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this );
}
```
[apply\_filters( 'meta\_query\_find\_compatible\_table\_alias', string|false $alias, array $clause, array $parent\_query, WP\_Meta\_Query $query )](../../hooks/meta_query_find_compatible_table_alias)
Filters the table alias identified as compatible with the current clause.
| Uses | Description |
| --- | --- |
| [WP\_Meta\_Query::is\_first\_order\_clause()](is_first_order_clause) wp-includes/class-wp-meta-query.php | Determine whether a query clause is first-order. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql\_for\_clause()](get_sql_for_clause) wp-includes/class-wp-meta-query.php | Generate SQL JOIN and WHERE clauses for a first-order query clause. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress WP_Meta_Query::is_first_order_clause( array $query ): bool WP\_Meta\_Query::is\_first\_order\_clause( array $query ): bool
===============================================================
Determine whether a query clause is first-order.
A first-order meta query clause is one that has either a ‘key’ or a ‘value’ array key.
`$query` array Required Meta query arguments. bool Whether the query clause is a first-order clause.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
protected function is_first_order_clause( $query ) {
return isset( $query['key'] ) || isset( $query['value'] );
}
```
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::find\_compatible\_table\_alias()](find_compatible_table_alias) wp-includes/class-wp-meta-query.php | Identify an existing table alias that is compatible with the current query clause. |
| [WP\_Meta\_Query::sanitize\_query()](sanitize_query) wp-includes/class-wp-meta-query.php | Ensure the ‘meta\_query’ argument passed to the class constructor is well-formed. |
| [WP\_Meta\_Query::get\_sql\_for\_query()](get_sql_for_query) wp-includes/class-wp-meta-query.php | Generate SQL clauses for a single query array. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress WP_Meta_Query::get_cast_for_type( string $type = '' ): string WP\_Meta\_Query::get\_cast\_for\_type( string $type = '' ): string
==================================================================
Return the appropriate alias for the given meta type if applicable.
`$type` string Optional MySQL type to cast meta\_value. Default: `''`
string MySQL type.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
public function get_cast_for_type( $type = '' ) {
if ( empty( $type ) ) {
return 'CHAR';
}
$meta_type = strtoupper( $type );
if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) ) {
return 'CHAR';
}
if ( 'NUMERIC' === $meta_type ) {
$meta_type = 'SIGNED';
}
return $meta_type;
}
```
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql\_for\_clause()](get_sql_for_clause) wp-includes/class-wp-meta-query.php | Generate SQL JOIN and WHERE clauses for a first-order query clause. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress WP_Meta_Query::get_sql_for_clause( array $clause, array $parent_query, string $clause_key = '' ): string[] WP\_Meta\_Query::get\_sql\_for\_clause( array $clause, array $parent\_query, string $clause\_key = '' ): string[]
=================================================================================================================
Generate SQL JOIN and WHERE clauses for a first-order query clause.
"First-order" means that it’s an array with a ‘key’ or ‘value’.
`$clause` array Required Query clause (passed by reference). `$parent_query` array Required Parent query array. `$clause_key` string Optional The array key used to name the clause in the original `$meta_query` parameters. If not provided, a key will be generated automatically. Default: `''`
string[] Array containing JOIN and WHERE SQL clauses to append to a first-order query.
* `join`stringSQL fragment to append to the main JOIN clause.
* `where`stringSQL fragment to append to the main WHERE clause.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
public function get_sql_for_clause( &$clause, $parent_query, $clause_key = '' ) {
global $wpdb;
$sql_chunks = array(
'where' => array(),
'join' => array(),
);
if ( isset( $clause['compare'] ) ) {
$clause['compare'] = strtoupper( $clause['compare'] );
} else {
$clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '=';
}
$non_numeric_operators = array(
'=',
'!=',
'LIKE',
'NOT LIKE',
'IN',
'NOT IN',
'EXISTS',
'NOT EXISTS',
'RLIKE',
'REGEXP',
'NOT REGEXP',
);
$numeric_operators = array(
'>',
'>=',
'<',
'<=',
'BETWEEN',
'NOT BETWEEN',
);
if ( ! in_array( $clause['compare'], $non_numeric_operators, true ) && ! in_array( $clause['compare'], $numeric_operators, true ) ) {
$clause['compare'] = '=';
}
if ( isset( $clause['compare_key'] ) ) {
$clause['compare_key'] = strtoupper( $clause['compare_key'] );
} else {
$clause['compare_key'] = isset( $clause['key'] ) && is_array( $clause['key'] ) ? 'IN' : '=';
}
if ( ! in_array( $clause['compare_key'], $non_numeric_operators, true ) ) {
$clause['compare_key'] = '=';
}
$meta_compare = $clause['compare'];
$meta_compare_key = $clause['compare_key'];
// First build the JOIN clause, if one is required.
$join = '';
// We prefer to avoid joins if possible. Look for an existing join compatible with this clause.
$alias = $this->find_compatible_table_alias( $clause, $parent_query );
if ( false === $alias ) {
$i = count( $this->table_aliases );
$alias = $i ? 'mt' . $i : $this->meta_table;
// JOIN clauses for NOT EXISTS have their own syntax.
if ( 'NOT EXISTS' === $meta_compare ) {
$join .= " LEFT JOIN $this->meta_table";
$join .= $i ? " AS $alias" : '';
if ( 'LIKE' === $meta_compare_key ) {
$join .= $wpdb->prepare( " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key LIKE %s )", '%' . $wpdb->esc_like( $clause['key'] ) . '%' );
} else {
$join .= $wpdb->prepare( " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] );
}
// All other JOIN clauses.
} else {
$join .= " INNER JOIN $this->meta_table";
$join .= $i ? " AS $alias" : '';
$join .= " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column )";
}
$this->table_aliases[] = $alias;
$sql_chunks['join'][] = $join;
}
// Save the alias to this clause, for future siblings to find.
$clause['alias'] = $alias;
// Determine the data type.
$_meta_type = isset( $clause['type'] ) ? $clause['type'] : '';
$meta_type = $this->get_cast_for_type( $_meta_type );
$clause['cast'] = $meta_type;
// Fallback for clause keys is the table alias. Key must be a string.
if ( is_int( $clause_key ) || ! $clause_key ) {
$clause_key = $clause['alias'];
}
// Ensure unique clause keys, so none are overwritten.
$iterator = 1;
$clause_key_base = $clause_key;
while ( isset( $this->clauses[ $clause_key ] ) ) {
$clause_key = $clause_key_base . '-' . $iterator;
$iterator++;
}
// Store the clause in our flat array.
$this->clauses[ $clause_key ] =& $clause;
// Next, build the WHERE clause.
// meta_key.
if ( array_key_exists( 'key', $clause ) ) {
if ( 'NOT EXISTS' === $meta_compare ) {
$sql_chunks['where'][] = $alias . '.' . $this->meta_id_column . ' IS NULL';
} else {
/**
* In joined clauses negative operators have to be nested into a
* NOT EXISTS clause and flipped, to avoid returning records with
* matching post IDs but different meta keys. Here we prepare the
* nested clause.
*/
if ( in_array( $meta_compare_key, array( '!=', 'NOT IN', 'NOT LIKE', 'NOT EXISTS', 'NOT REGEXP' ), true ) ) {
// Negative clauses may be reused.
$i = count( $this->table_aliases );
$subquery_alias = $i ? 'mt' . $i : $this->meta_table;
$this->table_aliases[] = $subquery_alias;
$meta_compare_string_start = 'NOT EXISTS (';
$meta_compare_string_start .= "SELECT 1 FROM $wpdb->postmeta $subquery_alias ";
$meta_compare_string_start .= "WHERE $subquery_alias.post_ID = $alias.post_ID ";
$meta_compare_string_end = 'LIMIT 1';
$meta_compare_string_end .= ')';
}
switch ( $meta_compare_key ) {
case '=':
case 'EXISTS':
$where = $wpdb->prepare( "$alias.meta_key = %s", trim( $clause['key'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
break;
case 'LIKE':
$meta_compare_value = '%' . $wpdb->esc_like( trim( $clause['key'] ) ) . '%';
$where = $wpdb->prepare( "$alias.meta_key LIKE %s", $meta_compare_value ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
break;
case 'IN':
$meta_compare_string = "$alias.meta_key IN (" . substr( str_repeat( ',%s', count( $clause['key'] ) ), 1 ) . ')';
$where = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
break;
case 'RLIKE':
case 'REGEXP':
$operator = $meta_compare_key;
if ( isset( $clause['type_key'] ) && 'BINARY' === strtoupper( $clause['type_key'] ) ) {
$cast = 'BINARY';
$meta_key = "CAST($alias.meta_key AS BINARY)";
} else {
$cast = '';
$meta_key = "$alias.meta_key";
}
$where = $wpdb->prepare( "$meta_key $operator $cast %s", trim( $clause['key'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
break;
case '!=':
case 'NOT EXISTS':
$meta_compare_string = $meta_compare_string_start . "AND $subquery_alias.meta_key = %s " . $meta_compare_string_end;
$where = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
break;
case 'NOT LIKE':
$meta_compare_string = $meta_compare_string_start . "AND $subquery_alias.meta_key LIKE %s " . $meta_compare_string_end;
$meta_compare_value = '%' . $wpdb->esc_like( trim( $clause['key'] ) ) . '%';
$where = $wpdb->prepare( $meta_compare_string, $meta_compare_value ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
break;
case 'NOT IN':
$array_subclause = '(' . substr( str_repeat( ',%s', count( $clause['key'] ) ), 1 ) . ') ';
$meta_compare_string = $meta_compare_string_start . "AND $subquery_alias.meta_key IN " . $array_subclause . $meta_compare_string_end;
$where = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
break;
case 'NOT REGEXP':
$operator = $meta_compare_key;
if ( isset( $clause['type_key'] ) && 'BINARY' === strtoupper( $clause['type_key'] ) ) {
$cast = 'BINARY';
$meta_key = "CAST($subquery_alias.meta_key AS BINARY)";
} else {
$cast = '';
$meta_key = "$subquery_alias.meta_key";
}
$meta_compare_string = $meta_compare_string_start . "AND $meta_key REGEXP $cast %s " . $meta_compare_string_end;
$where = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
break;
}
$sql_chunks['where'][] = $where;
}
}
// meta_value.
if ( array_key_exists( 'value', $clause ) ) {
$meta_value = $clause['value'];
if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) {
if ( ! is_array( $meta_value ) ) {
$meta_value = preg_split( '/[,\s]+/', $meta_value );
}
} elseif ( is_string( $meta_value ) ) {
$meta_value = trim( $meta_value );
}
switch ( $meta_compare ) {
case 'IN':
case 'NOT IN':
$meta_compare_string = '(' . substr( str_repeat( ',%s', count( $meta_value ) ), 1 ) . ')';
$where = $wpdb->prepare( $meta_compare_string, $meta_value );
break;
case 'BETWEEN':
case 'NOT BETWEEN':
$where = $wpdb->prepare( '%s AND %s', $meta_value[0], $meta_value[1] );
break;
case 'LIKE':
case 'NOT LIKE':
$meta_value = '%' . $wpdb->esc_like( $meta_value ) . '%';
$where = $wpdb->prepare( '%s', $meta_value );
break;
// EXISTS with a value is interpreted as '='.
case 'EXISTS':
$meta_compare = '=';
$where = $wpdb->prepare( '%s', $meta_value );
break;
// 'value' is ignored for NOT EXISTS.
case 'NOT EXISTS':
$where = '';
break;
default:
$where = $wpdb->prepare( '%s', $meta_value );
break;
}
if ( $where ) {
if ( 'CHAR' === $meta_type ) {
$sql_chunks['where'][] = "$alias.meta_value {$meta_compare} {$where}";
} else {
$sql_chunks['where'][] = "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$where}";
}
}
}
/*
* Multiple WHERE clauses (for meta_key and meta_value) should
* be joined in parentheses.
*/
if ( 1 < count( $sql_chunks['where'] ) ) {
$sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' );
}
return $sql_chunks;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Meta\_Query::find\_compatible\_table\_alias()](find_compatible_table_alias) wp-includes/class-wp-meta-query.php | Identify an existing table alias that is compatible with the current query clause. |
| [wpdb::esc\_like()](../wpdb/esc_like) wp-includes/class-wpdb.php | First half of escaping for `LIKE` special characters `%` and `_` before preparing for SQL. |
| [WP\_Meta\_Query::get\_cast\_for\_type()](get_cast_for_type) wp-includes/class-wp-meta-query.php | Return the appropriate alias for the given meta type if applicable. |
| [wpdb::prepare()](../wpdb/prepare) wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql\_for\_query()](get_sql_for_query) wp-includes/class-wp-meta-query.php | Generate SQL clauses for a single query array. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
| programming_docs |
wordpress WP_Meta_Query::sanitize_query( array $queries ): array WP\_Meta\_Query::sanitize\_query( array $queries ): array
=========================================================
Ensure the ‘meta\_query’ argument passed to the class constructor is well-formed.
Eliminates empty items and ensures that a ‘relation’ is set.
`$queries` array Required Array of query clauses. array Sanitized array of query clauses.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
public function sanitize_query( $queries ) {
$clean_queries = array();
if ( ! is_array( $queries ) ) {
return $clean_queries;
}
foreach ( $queries as $key => $query ) {
if ( 'relation' === $key ) {
$relation = $query;
} elseif ( ! is_array( $query ) ) {
continue;
// First-order clause.
} elseif ( $this->is_first_order_clause( $query ) ) {
if ( isset( $query['value'] ) && array() === $query['value'] ) {
unset( $query['value'] );
}
$clean_queries[ $key ] = $query;
// Otherwise, it's a nested query, so we recurse.
} else {
$cleaned_query = $this->sanitize_query( $query );
if ( ! empty( $cleaned_query ) ) {
$clean_queries[ $key ] = $cleaned_query;
}
}
}
if ( empty( $clean_queries ) ) {
return $clean_queries;
}
// Sanitize the 'relation' key provided in the query.
if ( isset( $relation ) && 'OR' === strtoupper( $relation ) ) {
$clean_queries['relation'] = 'OR';
$this->has_or_relation = true;
/*
* If there is only a single clause, call the relation 'OR'.
* This value will not actually be used to join clauses, but it
* simplifies the logic around combining key-only queries.
*/
} elseif ( 1 === count( $clean_queries ) ) {
$clean_queries['relation'] = 'OR';
// Default to AND.
} else {
$clean_queries['relation'] = 'AND';
}
return $clean_queries;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Meta\_Query::is\_first\_order\_clause()](is_first_order_clause) wp-includes/class-wp-meta-query.php | Determine whether a query clause is first-order. |
| [WP\_Meta\_Query::sanitize\_query()](sanitize_query) wp-includes/class-wp-meta-query.php | Ensure the ‘meta\_query’ argument passed to the class constructor is well-formed. |
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::sanitize\_query()](sanitize_query) wp-includes/class-wp-meta-query.php | Ensure the ‘meta\_query’ argument passed to the class constructor is well-formed. |
| [WP\_Meta\_Query::\_\_construct()](__construct) wp-includes/class-wp-meta-query.php | Constructor. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress WP_Meta_Query::get_sql( string $type, string $primary_table, string $primary_id_column, object $context = null ): string[]|false WP\_Meta\_Query::get\_sql( string $type, string $primary\_table, string $primary\_id\_column, object $context = null ): string[]|false
======================================================================================================================================
Generates SQL clauses to be appended to a main query.
`$type` string Required Type of meta. Possible values include but are not limited to `'post'`, `'comment'`, `'blog'`, `'term'`, and `'user'`. `$primary_table` string Required Database table where the object being filtered is stored (eg wp\_users). `$primary_id_column` string Required ID column for the filtered object in $primary\_table. `$context` object Optional The main query object that corresponds to the type, for example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`. Default: `null`
string[]|false Array containing JOIN and WHERE SQL clauses to append to the main query, or false if no table exists for the requested meta type.
* `join`stringSQL fragment to append to the main JOIN clause.
* `where`stringSQL fragment to append to the main WHERE clause.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
public function get_sql( $type, $primary_table, $primary_id_column, $context = null ) {
$meta_table = _get_meta_table( $type );
if ( ! $meta_table ) {
return false;
}
$this->table_aliases = array();
$this->meta_table = $meta_table;
$this->meta_id_column = sanitize_key( $type . '_id' );
$this->primary_table = $primary_table;
$this->primary_id_column = $primary_id_column;
$sql = $this->get_sql_clauses();
/*
* If any JOINs are LEFT JOINs (as in the case of NOT EXISTS), then all JOINs should
* be LEFT. Otherwise posts with no metadata will be excluded from results.
*/
if ( false !== strpos( $sql['join'], 'LEFT JOIN' ) ) {
$sql['join'] = str_replace( 'INNER JOIN', 'LEFT JOIN', $sql['join'] );
}
/**
* Filters the meta query's generated SQL.
*
* @since 3.1.0
*
* @param string[] $sql Array containing the query's JOIN and WHERE clauses.
* @param array $queries Array of meta queries.
* @param string $type Type of meta. Possible values include but are not limited
* to 'post', 'comment', 'blog', 'term', and 'user'.
* @param string $primary_table Primary table.
* @param string $primary_id_column Primary column ID.
* @param object $context The main query object that corresponds to the type, for
* example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`.
*/
return apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) );
}
```
[apply\_filters\_ref\_array( 'get\_meta\_sql', string[] $sql, array $queries, string $type, string $primary\_table, string $primary\_id\_column, object $context )](../../hooks/get_meta_sql)
Filters the meta query’s generated SQL.
| Uses | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql\_clauses()](get_sql_clauses) wp-includes/class-wp-meta-query.php | Generate SQL clauses to be appended to a main query. |
| [apply\_filters\_ref\_array()](../../functions/apply_filters_ref_array) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook, specifying arguments in an array. |
| [\_get\_meta\_table()](../../functions/_get_meta_table) wp-includes/meta.php | Retrieves the name of the metadata table for the specified object type. |
| [sanitize\_key()](../../functions/sanitize_key) wp-includes/formatting.php | Sanitizes a string key. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress WP_Meta_Query::has_or_relation(): bool WP\_Meta\_Query::has\_or\_relation(): bool
==========================================
Checks whether the current query has any OR relations.
In some cases, the presence of an OR relation somewhere in the query will require the use of a `DISTINCT` or `GROUP BY` keyword in the `SELECT` clause. The current method can be used in these cases to determine whether such a clause is necessary.
bool True if the query contains any `OR` relations, otherwise false.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
public function has_or_relation() {
return $this->has_or_relation;
}
```
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress WP_Meta_Query::parse_query_vars( array $qv ) WP\_Meta\_Query::parse\_query\_vars( array $qv )
================================================
Constructs a meta query based on ‘meta\_\*’ query vars
`$qv` array Required The query variables File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
public function parse_query_vars( $qv ) {
$meta_query = array();
/*
* For orderby=meta_value to work correctly, simple query needs to be
* first (so that its table join is against an unaliased meta table) and
* needs to be its own clause (so it doesn't interfere with the logic of
* the rest of the meta_query).
*/
$primary_meta_query = array();
foreach ( array( 'key', 'compare', 'type', 'compare_key', 'type_key' ) as $key ) {
if ( ! empty( $qv[ "meta_$key" ] ) ) {
$primary_meta_query[ $key ] = $qv[ "meta_$key" ];
}
}
// WP_Query sets 'meta_value' = '' by default.
if ( isset( $qv['meta_value'] ) && '' !== $qv['meta_value'] && ( ! is_array( $qv['meta_value'] ) || $qv['meta_value'] ) ) {
$primary_meta_query['value'] = $qv['meta_value'];
}
$existing_meta_query = isset( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ? $qv['meta_query'] : array();
if ( ! empty( $primary_meta_query ) && ! empty( $existing_meta_query ) ) {
$meta_query = array(
'relation' => 'AND',
$primary_meta_query,
$existing_meta_query,
);
} elseif ( ! empty( $primary_meta_query ) ) {
$meta_query = array(
$primary_meta_query,
);
} elseif ( ! empty( $existing_meta_query ) ) {
$meta_query = $existing_meta_query;
}
$this->__construct( $meta_query );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Meta\_Query::\_\_construct()](__construct) wp-includes/class-wp-meta-query.php | Constructor. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress WP_Meta_Query::__construct( array $meta_query = false ) WP\_Meta\_Query::\_\_construct( array $meta\_query = false )
============================================================
Constructor.
`$meta_query` array Optional Array of meta query clauses. When first-order clauses or sub-clauses use strings as their array keys, they may be referenced in the 'orderby' parameter of the parent query.
* `relation`stringOptional. The MySQL keyword used to join the clauses of the query.
Accepts `'AND'` or `'OR'`. Default `'AND'`.
* `...$0`array Optional. An array of first-order clause parameters, or another fully-formed meta query.
+ `key`string|string[]Meta key or keys to filter by.
+ `compare_key`stringMySQL operator used for comparing the $key. Accepts:
- `'='`
- `'!='`
- `'LIKE'`
- 'NOT LIKE'
- `'IN'`
- 'NOT IN'
- `'REGEXP'`
- 'NOT REGEXP'
- `'RLIKE'`,
- `'EXISTS'` (alias of `'='`)
- 'NOT EXISTS' (alias of `'!='`) Default is `'IN'` when `$key` is an array, `'='` otherwise.
+ `type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons. Accepts `'BINARY'` for case-sensitive regular expression comparisons. Default is `''`.
+ `value`string|string[]Meta value or values to filter by.
+ `compare`stringMySQL operator used for comparing the $value. Accepts:
- `'='`,
- `'!='`
- `'>'`
- `'>='`
- `'<'`
- `'<='`
- `'LIKE'`
- 'NOT LIKE'
- `'IN'`
- 'NOT IN'
- `'BETWEEN'`
- 'NOT BETWEEN'
- `'REGEXP'`
- 'NOT REGEXP'
- `'RLIKE'`
- `'EXISTS'`
- 'NOT EXISTS' Default is `'IN'` when `$value` is an array, `'='` otherwise.
+ `type`stringMySQL data type that the meta\_value column will be CAST to for comparisons. Accepts:
- `'NUMERIC'`
- `'BINARY'`
- `'CHAR'`
- `'DATE'`
- `'DATETIME'`
- `'DECIMAL'`
- `'SIGNED'`
- `'TIME'`
- `'UNSIGNED'` Default is `'CHAR'`. Default: `false`
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
public function __construct( $meta_query = false ) {
if ( ! $meta_query ) {
return;
}
if ( isset( $meta_query['relation'] ) && 'OR' === strtoupper( $meta_query['relation'] ) ) {
$this->relation = 'OR';
} else {
$this->relation = 'AND';
}
$this->queries = $this->sanitize_query( $meta_query );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Meta\_Query::sanitize\_query()](sanitize_query) wp-includes/class-wp-meta-query.php | Ensure the ‘meta\_query’ argument passed to the class constructor is well-formed. |
| Used By | Description |
| --- | --- |
| [WP\_Term\_Query::get\_terms()](../wp_term_query/get_terms) wp-includes/class-wp-term-query.php | Retrieves the query results. |
| [WP\_Site\_Query::get\_sites()](../wp_site_query/get_sites) wp-includes/class-wp-site-query.php | Retrieves a list of sites matching the query vars. |
| [WP\_Comment\_Query::get\_comments()](../wp_comment_query/get_comments) wp-includes/class-wp-comment-query.php | Get a list of comments matching the query vars. |
| [WP\_Query::get\_posts()](../wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| [WP\_User\_Query::prepare\_query()](../wp_user_query/prepare_query) wp-includes/class-wp-user-query.php | Prepares the query variables. |
| [get\_meta\_sql()](../../functions/get_meta_sql) wp-includes/meta.php | Given a meta query, generates SQL clauses to be appended to a main query. |
| [WP\_Meta\_Query::parse\_query\_vars()](parse_query_vars) wp-includes/class-wp-meta-query.php | Constructs a meta query based on ‘meta\_\*’ query vars |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Increased the number of operators available to `$compare_key`. Introduced `$type_key`, which enables the `$key` to be cast to a new data type for comparisons. |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced `$compare_key` clause parameter, which enables LIKE key matches. |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced support for naming query clauses by associative array keys. |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress WP_Meta_Query::get_sql_for_query( array $query, int $depth ): string[] WP\_Meta\_Query::get\_sql\_for\_query( array $query, int $depth ): string[]
===========================================================================
Generate SQL clauses for a single query array.
If nested subqueries are found, this method recurses the tree to produce the properly nested SQL.
`$query` array Required Query to parse (passed by reference). `$depth` int Optional Number of tree levels deep we currently are.
Used to calculate indentation. Default 0. string[] Array containing JOIN and WHERE SQL clauses to append to a single query array.
* `join`stringSQL fragment to append to the main JOIN clause.
* `where`stringSQL fragment to append to the main WHERE clause.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
protected function get_sql_for_query( &$query, $depth = 0 ) {
$sql_chunks = array(
'join' => array(),
'where' => array(),
);
$sql = array(
'join' => '',
'where' => '',
);
$indent = '';
for ( $i = 0; $i < $depth; $i++ ) {
$indent .= ' ';
}
foreach ( $query as $key => &$clause ) {
if ( 'relation' === $key ) {
$relation = $query['relation'];
} elseif ( is_array( $clause ) ) {
// This is a first-order clause.
if ( $this->is_first_order_clause( $clause ) ) {
$clause_sql = $this->get_sql_for_clause( $clause, $query, $key );
$where_count = count( $clause_sql['where'] );
if ( ! $where_count ) {
$sql_chunks['where'][] = '';
} elseif ( 1 === $where_count ) {
$sql_chunks['where'][] = $clause_sql['where'][0];
} else {
$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
}
$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );
// This is a subquery, so we recurse.
} else {
$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );
$sql_chunks['where'][] = $clause_sql['where'];
$sql_chunks['join'][] = $clause_sql['join'];
}
}
}
// Filter to remove empties.
$sql_chunks['join'] = array_filter( $sql_chunks['join'] );
$sql_chunks['where'] = array_filter( $sql_chunks['where'] );
if ( empty( $relation ) ) {
$relation = 'AND';
}
// Filter duplicate JOIN clauses and combine into a single string.
if ( ! empty( $sql_chunks['join'] ) ) {
$sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) );
}
// Generate a single WHERE clause with proper brackets and indentation.
if ( ! empty( $sql_chunks['where'] ) ) {
$sql['where'] = '( ' . "\n " . $indent . implode( ' ' . "\n " . $indent . $relation . ' ' . "\n " . $indent, $sql_chunks['where'] ) . "\n" . $indent . ')';
}
return $sql;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql\_for\_clause()](get_sql_for_clause) wp-includes/class-wp-meta-query.php | Generate SQL JOIN and WHERE clauses for a first-order query clause. |
| [WP\_Meta\_Query::is\_first\_order\_clause()](is_first_order_clause) wp-includes/class-wp-meta-query.php | Determine whether a query clause is first-order. |
| [WP\_Meta\_Query::get\_sql\_for\_query()](get_sql_for_query) wp-includes/class-wp-meta-query.php | Generate SQL clauses for a single query array. |
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql\_clauses()](get_sql_clauses) wp-includes/class-wp-meta-query.php | Generate SQL clauses to be appended to a main query. |
| [WP\_Meta\_Query::get\_sql\_for\_query()](get_sql_for_query) wp-includes/class-wp-meta-query.php | Generate SQL clauses for a single query array. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress WP_Meta_Query::get_clauses(): array WP\_Meta\_Query::get\_clauses(): array
======================================
Get a flattened list of sanitized meta clauses.
This array should be used for clause lookup, as when the table alias and CAST type must be determined for a value of ‘orderby’ corresponding to a meta clause.
array Meta clauses.
File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
public function get_clauses() {
return $this->clauses;
}
```
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress WP_Terms_List_Table::single_row( WP_Term $tag, int $level ) WP\_Terms\_List\_Table::single\_row( WP\_Term $tag, int $level )
================================================================
`$tag` [WP\_Term](../wp_term) Required Term object. `$level` int Required File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function single_row( $tag, $level = 0 ) {
global $taxonomy;
$tag = sanitize_term( $tag, $taxonomy );
$this->level = $level;
if ( $tag->parent ) {
$count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );
$level = 'level-' . $count;
} else {
$level = 'level-0';
}
echo '<tr id="tag-' . $tag->term_id . '" class="' . $level . '">';
$this->single_row_columns( $tag );
echo '</tr>';
}
```
| Uses | Description |
| --- | --- |
| [get\_ancestors()](../../functions/get_ancestors) wp-includes/taxonomy.php | Gets an array of ancestor IDs for a given object. |
| [sanitize\_term()](../../functions/sanitize_term) wp-includes/taxonomy.php | Sanitizes all term fields. |
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::display\_rows\_or\_placeholder()](display_rows_or_placeholder) wp-admin/includes/class-wp-terms-list-table.php | |
| [WP\_Terms\_List\_Table::\_rows()](_rows) wp-admin/includes/class-wp-terms-list-table.php | |
| programming_docs |
wordpress WP_Terms_List_Table::current_action(): string WP\_Terms\_List\_Table::current\_action(): string
=================================================
string
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function current_action() {
if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && 'delete' === $_REQUEST['action'] ) {
return 'bulk-delete';
}
return parent::current_action();
}
```
| Uses | Description |
| --- | --- |
| [WP\_List\_Table::current\_action()](../wp_list_table/current_action) wp-admin/includes/class-wp-list-table.php | Gets the current action selected from the bulk actions dropdown. |
wordpress WP_Terms_List_Table::prepare_items() WP\_Terms\_List\_Table::prepare\_items()
========================================
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function prepare_items() {
$taxonomy = $this->screen->taxonomy;
$tags_per_page = $this->get_items_per_page( "edit_{$taxonomy}_per_page" );
if ( 'post_tag' === $taxonomy ) {
/**
* Filters the number of terms displayed per page for the Tags list table.
*
* @since 2.8.0
*
* @param int $tags_per_page Number of tags to be displayed. Default 20.
*/
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
/**
* Filters the number of terms displayed per page for the Tags list table.
*
* @since 2.7.0
* @deprecated 2.8.0 Use {@see 'edit_tags_per_page'} instead.
*
* @param int $tags_per_page Number of tags to be displayed. Default 20.
*/
$tags_per_page = apply_filters_deprecated( 'tagsperpage', array( $tags_per_page ), '2.8.0', 'edit_tags_per_page' );
} elseif ( 'category' === $taxonomy ) {
/**
* Filters the number of terms displayed per page for the Categories list table.
*
* @since 2.8.0
*
* @param int $tags_per_page Number of categories to be displayed. Default 20.
*/
$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page );
}
$search = ! empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';
$args = array(
'taxonomy' => $taxonomy,
'search' => $search,
'page' => $this->get_pagenum(),
'number' => $tags_per_page,
'hide_empty' => 0,
);
if ( ! empty( $_REQUEST['orderby'] ) ) {
$args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) );
}
if ( ! empty( $_REQUEST['order'] ) ) {
$args['order'] = trim( wp_unslash( $_REQUEST['order'] ) );
}
$args['offset'] = ( $args['page'] - 1 ) * $args['number'];
// Save the values because 'number' and 'offset' can be subsequently overridden.
$this->callback_args = $args;
if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
// We'll need the full set of terms then.
$args['number'] = 0;
$args['offset'] = $args['number'];
}
$this->items = get_terms( $args );
$this->set_pagination_args(
array(
'total_items' => wp_count_terms(
array(
'taxonomy' => $taxonomy,
'search' => $search,
)
),
'per_page' => $tags_per_page,
)
);
}
```
[apply\_filters( 'edit\_categories\_per\_page', int $tags\_per\_page )](../../hooks/edit_categories_per_page)
Filters the number of terms displayed per page for the Categories list table.
[apply\_filters( 'edit\_tags\_per\_page', int $tags\_per\_page )](../../hooks/edit_tags_per_page)
Filters the number of terms displayed per page for the Tags list table.
[apply\_filters\_deprecated( 'tagsperpage', int $tags\_per\_page )](../../hooks/tagsperpage)
Filters the number of terms displayed per page for the Tags list table.
| Uses | Description |
| --- | --- |
| [apply\_filters\_deprecated()](../../functions/apply_filters_deprecated) wp-includes/plugin.php | Fires functions attached to a deprecated filter hook. |
| [wp\_count\_terms()](../../functions/wp_count_terms) wp-includes/taxonomy.php | Counts how many terms are in taxonomy. |
| [get\_terms()](../../functions/get_terms) wp-includes/taxonomy.php | Retrieves the terms in a given taxonomy or list of taxonomies. |
| [is\_taxonomy\_hierarchical()](../../functions/is_taxonomy_hierarchical) wp-includes/taxonomy.php | Determines whether the taxonomy object is hierarchical. |
| [wp\_unslash()](../../functions/wp_unslash) wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
wordpress WP_Terms_List_Table::ajax_user_can(): bool WP\_Terms\_List\_Table::ajax\_user\_can(): bool
===============================================
bool
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function ajax_user_can() {
return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms );
}
```
| Uses | Description |
| --- | --- |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [get\_taxonomy()](../../functions/get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
wordpress WP_Terms_List_Table::column_posts( WP_Term $tag ): string WP\_Terms\_List\_Table::column\_posts( WP\_Term $tag ): string
==============================================================
`$tag` [WP\_Term](../wp_term) Required Term object. string
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function column_posts( $tag ) {
$count = number_format_i18n( $tag->count );
$tax = get_taxonomy( $this->screen->taxonomy );
$ptype_object = get_post_type_object( $this->screen->post_type );
if ( ! $ptype_object->show_ui ) {
return $count;
}
if ( $tax->query_var ) {
$args = array( $tax->query_var => $tag->slug );
} else {
$args = array(
'taxonomy' => $tax->name,
'term' => $tag->slug,
);
}
if ( 'post' !== $this->screen->post_type ) {
$args['post_type'] = $this->screen->post_type;
}
if ( 'attachment' === $this->screen->post_type ) {
return "<a href='" . esc_url( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>";
}
return "<a href='" . esc_url( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
}
```
| Uses | Description |
| --- | --- |
| [esc\_url()](../../functions/esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [add\_query\_arg()](../../functions/add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [number\_format\_i18n()](../../functions/number_format_i18n) wp-includes/functions.php | Converts float number to format based on the locale. |
| [get\_taxonomy()](../../functions/get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [get\_post\_type\_object()](../../functions/get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
wordpress WP_Terms_List_Table::no_items() WP\_Terms\_List\_Table::no\_items()
===================================
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function no_items() {
echo get_taxonomy( $this->screen->taxonomy )->labels->not_found;
}
```
| Uses | Description |
| --- | --- |
| [get\_taxonomy()](../../functions/get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::display\_rows\_or\_placeholder()](display_rows_or_placeholder) wp-admin/includes/class-wp-terms-list-table.php | |
wordpress WP_Terms_List_Table::get_default_primary_column_name(): string WP\_Terms\_List\_Table::get\_default\_primary\_column\_name(): string
=====================================================================
Gets the name of the default primary column.
string Name of the default primary column, in this case, `'name'`.
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
protected function get_default_primary_column_name() {
return 'name';
}
```
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress WP_Terms_List_Table::handle_row_actions( WP_Term $item, string $column_name, string $primary ): string WP\_Terms\_List\_Table::handle\_row\_actions( WP\_Term $item, string $column\_name, string $primary ): string
=============================================================================================================
Generates and displays row action links.
`$item` [WP\_Term](../wp_term) Required Tag being acted upon. `$column_name` string Required Current column name. `$primary` string Required Primary column name. string Row actions output for terms, or an empty string if the current column is not the primary column.
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
protected function handle_row_actions( $item, $column_name, $primary ) {
if ( $primary !== $column_name ) {
return '';
}
// Restores the more descriptive, specific name for use within this method.
$tag = $item;
$taxonomy = $this->screen->taxonomy;
$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
$edit_link = add_query_arg(
'wp_http_referer',
urlencode( wp_unslash( $uri ) ),
get_edit_term_link( $tag, $taxonomy, $this->screen->post_type )
);
$actions = array();
if ( current_user_can( 'edit_term', $tag->term_id ) ) {
$actions['edit'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
esc_url( $edit_link ),
/* translators: %s: Taxonomy term name. */
esc_attr( sprintf( __( 'Edit “%s”' ), $tag->name ) ),
__( 'Edit' )
);
$actions['inline hide-if-no-js'] = sprintf(
'<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
/* translators: %s: Taxonomy term name. */
esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $tag->name ) ),
__( 'Quick Edit' )
);
}
if ( current_user_can( 'delete_term', $tag->term_id ) ) {
$actions['delete'] = sprintf(
'<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>',
wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ),
/* translators: %s: Taxonomy term name. */
esc_attr( sprintf( __( 'Delete “%s”' ), $tag->name ) ),
__( 'Delete' )
);
}
if ( is_term_publicly_viewable( $tag ) ) {
$actions['view'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
get_term_link( $tag ),
/* translators: %s: Taxonomy term name. */
esc_attr( sprintf( __( 'View “%s” archive' ), $tag->name ) ),
__( 'View' )
);
}
/**
* Filters the action links displayed for each term in the Tags list table.
*
* @since 2.8.0
* @since 3.0.0 Deprecated in favor of {@see '{$taxonomy}_row_actions'} filter.
* @since 5.4.2 Restored (un-deprecated).
*
* @param string[] $actions An array of action links to be displayed. Default
* 'Edit', 'Quick Edit', 'Delete', and 'View'.
* @param WP_Term $tag Term object.
*/
$actions = apply_filters( 'tag_row_actions', $actions, $tag );
/**
* Filters the action links displayed for each term in the terms list table.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `category_row_actions`
* - `post_tag_row_actions`
*
* @since 3.0.0
*
* @param string[] $actions An array of action links to be displayed. Default
* 'Edit', 'Quick Edit', 'Delete', and 'View'.
* @param WP_Term $tag Term object.
*/
$actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
return $this->row_actions( $actions );
}
```
[apply\_filters( 'tag\_row\_actions', string[] $actions, WP\_Term $tag )](../../hooks/tag_row_actions)
Filters the action links displayed for each term in the Tags list table.
[apply\_filters( "{$taxonomy}\_row\_actions", string[] $actions, WP\_Term $tag )](../../hooks/taxonomy_row_actions)
Filters the action links displayed for each term in the terms list table.
| Uses | Description |
| --- | --- |
| [is\_term\_publicly\_viewable()](../../functions/is_term_publicly_viewable) wp-includes/taxonomy.php | Determines whether a term is publicly viewable. |
| [wp\_doing\_ajax()](../../functions/wp_doing_ajax) wp-includes/load.php | Determines whether the current request is a WordPress Ajax request. |
| [wp\_get\_referer()](../../functions/wp_get_referer) wp-includes/functions.php | Retrieves referer from ‘\_wp\_http\_referer’ or HTTP referer. |
| [get\_term\_link()](../../functions/get_term_link) wp-includes/taxonomy.php | Generates a permalink for a taxonomy term archive. |
| [get\_edit\_term\_link()](../../functions/get_edit_term_link) wp-includes/link-template.php | Retrieves the URL for editing a given term. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_unslash()](../../functions/wp_unslash) wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| [esc\_url()](../../functions/esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [esc\_attr()](../../functions/esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [wp\_nonce\_url()](../../functions/wp_nonce_url) wp-includes/functions.php | Retrieves URL with nonce added to URL query. |
| [add\_query\_arg()](../../functions/add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support. |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress WP_Terms_List_Table::get_sortable_columns(): array WP\_Terms\_List\_Table::get\_sortable\_columns(): array
=======================================================
array
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
protected function get_sortable_columns() {
return array(
'name' => 'name',
'description' => 'description',
'slug' => 'slug',
'posts' => 'count',
'links' => 'count',
);
}
```
wordpress WP_Terms_List_Table::display_rows_or_placeholder() WP\_Terms\_List\_Table::display\_rows\_or\_placeholder()
========================================================
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function display_rows_or_placeholder() {
$taxonomy = $this->screen->taxonomy;
$number = $this->callback_args['number'];
$offset = $this->callback_args['offset'];
// Convert it to table rows.
$count = 0;
if ( empty( $this->items ) || ! is_array( $this->items ) ) {
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
$this->no_items();
echo '</td></tr>';
return;
}
if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $this->callback_args['orderby'] ) ) {
if ( ! empty( $this->callback_args['search'] ) ) {// Ignore children on searches.
$children = array();
} else {
$children = _get_term_hierarchy( $taxonomy );
}
/*
* Some funky recursion to get the job done (paging & parents mainly) is contained within.
* Skip it for non-hierarchical taxonomies for performance sake.
*/
$this->_rows( $taxonomy, $this->items, $children, $offset, $number, $count );
} else {
foreach ( $this->items as $term ) {
$this->single_row( $term );
}
}
}
```
| Uses | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::no\_items()](no_items) wp-admin/includes/class-wp-terms-list-table.php | |
| [WP\_Terms\_List\_Table::\_rows()](_rows) wp-admin/includes/class-wp-terms-list-table.php | |
| [WP\_Terms\_List\_Table::single\_row()](single_row) wp-admin/includes/class-wp-terms-list-table.php | |
| [\_get\_term\_hierarchy()](../../functions/_get_term_hierarchy) wp-includes/taxonomy.php | Retrieves children of taxonomy as term IDs. |
| [is\_taxonomy\_hierarchical()](../../functions/is_taxonomy_hierarchical) wp-includes/taxonomy.php | Determines whether the taxonomy object is hierarchical. |
wordpress WP_Terms_List_Table::has_items(): bool WP\_Terms\_List\_Table::has\_items(): bool
==========================================
bool
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
'total_items' => wp_count_terms(
array(
'taxonomy' => $taxonomy,
'search' => $search,
```
wordpress WP_Terms_List_Table::column_description( WP_Term $tag ): string WP\_Terms\_List\_Table::column\_description( WP\_Term $tag ): string
====================================================================
`$tag` [WP\_Term](../wp_term) Required Term object. string
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function column_description( $tag ) {
if ( $tag->description ) {
return $tag->description;
} else {
return '<span aria-hidden="true">—</span><span class="screen-reader-text">' . __( 'No description' ) . '</span>';
}
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
wordpress WP_Terms_List_Table::column_cb( WP_Term $item ): string WP\_Terms\_List\_Table::column\_cb( WP\_Term $item ): string
============================================================
`$item` [WP\_Term](../wp_term) Required Term object. string
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function column_cb( $item ) {
// Restores the more descriptive, specific name for use within this method.
$tag = $item;
if ( current_user_can( 'delete_term', $tag->term_id ) ) {
return sprintf(
'<label class="screen-reader-text" for="cb-select-%1$s">%2$s</label>' .
'<input type="checkbox" name="delete_tags[]" value="%1$s" id="cb-select-%1$s" />',
$tag->term_id,
/* translators: %s: Taxonomy term name. */
sprintf( __( 'Select %s' ), $tag->name )
);
}
return ' ';
}
```
| Uses | Description |
| --- | --- |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
| programming_docs |
wordpress WP_Terms_List_Table::get_columns(): array WP\_Terms\_List\_Table::get\_columns(): array
=============================================
array
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function get_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'name' => _x( 'Name', 'term name' ),
'description' => __( 'Description' ),
'slug' => __( 'Slug' ),
);
if ( 'link_category' === $this->screen->taxonomy ) {
$columns['links'] = __( 'Links' );
} else {
$columns['posts'] = _x( 'Count', 'Number/count of items' );
}
return $columns;
}
```
| Uses | Description |
| --- | --- |
| [\_x()](../../functions/_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
wordpress WP_Terms_List_Table::get_bulk_actions(): array WP\_Terms\_List\_Table::get\_bulk\_actions(): array
===================================================
array
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
protected function get_bulk_actions() {
$actions = array();
if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) ) {
$actions['delete'] = __( 'Delete' );
}
return $actions;
}
```
| Uses | Description |
| --- | --- |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_taxonomy()](../../functions/get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
wordpress WP_Terms_List_Table::__construct( array $args = array() ) WP\_Terms\_List\_Table::\_\_construct( array $args = array() )
==============================================================
Constructor.
* [WP\_List\_Table::\_\_construct()](../wp_list_table/__construct): for more information on default arguments.
`$args` array Optional An associative array of arguments. Default: `array()`
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function __construct( $args = array() ) {
global $post_type, $taxonomy, $action, $tax;
parent::__construct(
array(
'plural' => 'tags',
'singular' => 'tag',
'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
)
);
$action = $this->screen->action;
$post_type = $this->screen->post_type;
$taxonomy = $this->screen->taxonomy;
if ( empty( $taxonomy ) ) {
$taxonomy = 'post_tag';
}
if ( ! taxonomy_exists( $taxonomy ) ) {
wp_die( __( 'Invalid taxonomy.' ) );
}
$tax = get_taxonomy( $taxonomy );
// @todo Still needed? Maybe just the show_ui part.
if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ), true ) ) {
$post_type = 'post';
}
}
```
| Uses | Description |
| --- | --- |
| [WP\_List\_Table::\_\_construct()](../wp_list_table/__construct) wp-admin/includes/class-wp-list-table.php | Constructor. |
| [taxonomy\_exists()](../../functions/taxonomy_exists) wp-includes/taxonomy.php | Determines whether the taxonomy name exists. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_die()](../../functions/wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [get\_taxonomy()](../../functions/get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [get\_post\_types()](../../functions/get_post_types) wp-includes/post.php | Gets a list of all registered post type objects. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress WP_Terms_List_Table::_rows( string $taxonomy, array $terms, array $children, int $start, int $per_page, int $count, int $parent_term, int $level ) WP\_Terms\_List\_Table::\_rows( string $taxonomy, array $terms, array $children, int $start, int $per\_page, int $count, int $parent\_term, int $level )
========================================================================================================================================================
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
`$taxonomy` string Required `$terms` array Required `$children` array Required `$start` int Required `$per_page` int Required `$count` int Required `$parent_term` int Required `$level` int Required File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent_term = 0, $level = 0 ) {
$end = $start + $per_page;
foreach ( $terms as $key => $term ) {
if ( $count >= $end ) {
break;
}
if ( $term->parent !== $parent_term && empty( $_REQUEST['s'] ) ) {
continue;
}
// If the page starts in a subtree, print the parents.
if ( $count === $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) {
$my_parents = array();
$parent_ids = array();
$p = $term->parent;
while ( $p ) {
$my_parent = get_term( $p, $taxonomy );
$my_parents[] = $my_parent;
$p = $my_parent->parent;
if ( in_array( $p, $parent_ids, true ) ) { // Prevent parent loops.
break;
}
$parent_ids[] = $p;
}
unset( $parent_ids );
$num_parents = count( $my_parents );
while ( $my_parent = array_pop( $my_parents ) ) {
echo "\t";
$this->single_row( $my_parent, $level - $num_parents );
$num_parents--;
}
}
if ( $count >= $start ) {
echo "\t";
$this->single_row( $term, $level );
}
++$count;
unset( $terms[ $key ] );
if ( isset( $children[ $term->term_id ] ) && empty( $_REQUEST['s'] ) ) {
$this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
}
}
}
```
| Uses | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::single\_row()](single_row) wp-admin/includes/class-wp-terms-list-table.php | |
| [WP\_Terms\_List\_Table::\_rows()](_rows) wp-admin/includes/class-wp-terms-list-table.php | |
| [get\_term()](../../functions/get_term) wp-includes/taxonomy.php | Gets all term data from database by term ID. |
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::display\_rows\_or\_placeholder()](display_rows_or_placeholder) wp-admin/includes/class-wp-terms-list-table.php | |
| [WP\_Terms\_List\_Table::\_rows()](_rows) wp-admin/includes/class-wp-terms-list-table.php | |
wordpress WP_Terms_List_Table::column_slug( WP_Term $tag ): string WP\_Terms\_List\_Table::column\_slug( WP\_Term $tag ): string
=============================================================
`$tag` [WP\_Term](../wp_term) Required Term object. string
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function column_slug( $tag ) {
/** This filter is documented in wp-admin/edit-tag-form.php */
return apply_filters( 'editable_slug', $tag->slug, $tag );
}
```
[apply\_filters( 'editable\_slug', string $slug, WP\_Term|WP\_Post $tag )](../../hooks/editable_slug)
Filters the editable slug for a post or term.
| Uses | Description |
| --- | --- |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
wordpress WP_Terms_List_Table::column_name( WP_Term $tag ): string WP\_Terms\_List\_Table::column\_name( WP\_Term $tag ): string
=============================================================
`$tag` [WP\_Term](../wp_term) Required Term object. string
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function column_name( $tag ) {
$taxonomy = $this->screen->taxonomy;
$pad = str_repeat( '— ', max( 0, $this->level ) );
/**
* Filters display of the term name in the terms list table.
*
* The default output may include padding due to the term's
* current level in the term hierarchy.
*
* @since 2.5.0
*
* @see WP_Terms_List_Table::column_name()
*
* @param string $pad_tag_name The term name, padded if not top-level.
* @param WP_Term $tag Term object.
*/
$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
$qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
$edit_link = get_edit_term_link( $tag, $taxonomy, $this->screen->post_type );
if ( $edit_link ) {
$edit_link = add_query_arg(
'wp_http_referer',
urlencode( wp_unslash( $uri ) ),
$edit_link
);
$name = sprintf(
'<a class="row-title" href="%s" aria-label="%s">%s</a>',
esc_url( $edit_link ),
/* translators: %s: Taxonomy term name. */
esc_attr( sprintf( __( '“%s” (Edit)' ), $tag->name ) ),
$name
);
}
$output = sprintf(
'<strong>%s</strong><br />',
$name
);
$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
$output .= '<div class="name">' . $qe_data->name . '</div>';
/** This filter is documented in wp-admin/edit-tag-form.php */
$output .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>';
$output .= '<div class="parent">' . $qe_data->parent . '</div></div>';
return $output;
}
```
[apply\_filters( 'editable\_slug', string $slug, WP\_Term|WP\_Post $tag )](../../hooks/editable_slug)
Filters the editable slug for a post or term.
[apply\_filters( 'term\_name', string $pad\_tag\_name, WP\_Term $tag )](../../hooks/term_name)
Filters display of the term name in the terms list table.
| Uses | Description |
| --- | --- |
| [wp\_doing\_ajax()](../../functions/wp_doing_ajax) wp-includes/load.php | Determines whether the current request is a WordPress Ajax request. |
| [wp\_get\_referer()](../../functions/wp_get_referer) wp-includes/functions.php | Retrieves referer from ‘\_wp\_http\_referer’ or HTTP referer. |
| [get\_edit\_term\_link()](../../functions/get_edit_term_link) wp-includes/link-template.php | Retrieves the URL for editing a given term. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_unslash()](../../functions/wp_unslash) wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| [esc\_url()](../../functions/esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [esc\_attr()](../../functions/esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [add\_query\_arg()](../../functions/add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [get\_term()](../../functions/get_term) wp-includes/taxonomy.php | Gets all term data from database by term ID. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
wordpress WP_Terms_List_Table::column_default( WP_Term $item, string $column_name ): string WP\_Terms\_List\_Table::column\_default( WP\_Term $item, string $column\_name ): string
=======================================================================================
`$item` [WP\_Term](../wp_term) Required Term object. `$column_name` string Required Name of the column. string
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function column_default( $item, $column_name ) {
/**
* Filters the displayed columns in the terms list table.
*
* The dynamic portion of the hook name, `$this->screen->taxonomy`,
* refers to the slug of the current taxonomy.
*
* Possible hook names include:
*
* - `manage_category_custom_column`
* - `manage_post_tag_custom_column`
*
* @since 2.8.0
*
* @param string $string Custom column output. Default empty.
* @param string $column_name Name of the column.
* @param int $term_id Term ID.
*/
return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $item->term_id );
}
```
[apply\_filters( "manage\_{$this->screen->taxonomy}\_custom\_column", string $string, string $column\_name, int $term\_id )](../../hooks/manage_this-screen-taxonomy_custom_column)
Filters the displayed columns in the terms list table.
| Uses | Description |
| --- | --- |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress WP_Terms_List_Table::inline_edit() WP\_Terms\_List\_Table::inline\_edit()
======================================
Outputs the hidden row displayed when inline editing
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function inline_edit() {
$tax = get_taxonomy( $this->screen->taxonomy );
if ( ! current_user_can( $tax->cap->edit_terms ) ) {
return;
}
?>
<form method="get">
<table style="display: none"><tbody id="inlineedit">
<tr id="inline-edit" class="inline-edit-row" style="display: none">
<td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
<div class="inline-edit-wrapper">
<fieldset>
<legend class="inline-edit-legend"><?php _e( 'Quick Edit' ); ?></legend>
<div class="inline-edit-col">
<label>
<span class="title"><?php _ex( 'Name', 'term name' ); ?></span>
<span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
</label>
<label>
<span class="title"><?php _e( 'Slug' ); ?></span>
<span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
</label>
</div>
</fieldset>
<?php
$core_columns = array(
'cb' => true,
'description' => true,
'name' => true,
'slug' => true,
'posts' => true,
);
list( $columns ) = $this->get_column_info();
foreach ( $columns as $column_name => $column_display_name ) {
if ( isset( $core_columns[ $column_name ] ) ) {
continue;
}
/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
}
?>
<div class="inline-edit-save submit">
<button type="button" class="save button button-primary"><?php echo $tax->labels->update_item; ?></button>
<button type="button" class="cancel button"><?php _e( 'Cancel' ); ?></button>
<span class="spinner"></span>
<?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" />
<input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" />
<div class="notice notice-error notice-alt inline hidden">
<p class="error"></p>
</div>
</div>
</div>
</td></tr>
</tbody></table>
</form>
<?php
}
```
[do\_action( 'quick\_edit\_custom\_box', string $column\_name, string $post\_type, string $taxonomy )](../../hooks/quick_edit_custom_box)
Fires once for each column in Quick Edit mode.
| Uses | Description |
| --- | --- |
| [\_ex()](../../functions/_ex) wp-includes/l10n.php | Displays translated string with gettext context. |
| [wp\_nonce\_field()](../../functions/wp_nonce_field) wp-includes/functions.php | Retrieves or display nonce hidden field for forms. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_e()](../../functions/_e) wp-includes/l10n.php | Displays translated text. |
| [esc\_attr()](../../functions/esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [get\_taxonomy()](../../functions/get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [do\_action()](../../functions/do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress WP_Terms_List_Table::column_links( WP_Term $tag ): string WP\_Terms\_List\_Table::column\_links( WP\_Term $tag ): string
==============================================================
`$tag` [WP\_Term](../wp_term) Required Term object. string
File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
public function column_links( $tag ) {
$count = number_format_i18n( $tag->count );
if ( $count ) {
$count = "<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>";
}
return $count;
}
```
| Uses | Description |
| --- | --- |
| [number\_format\_i18n()](../../functions/number_format_i18n) wp-includes/functions.php | Converts float number to format based on the locale. |
wordpress Language_Pack_Upgrader_Skin::after() Language\_Pack\_Upgrader\_Skin::after()
=======================================
File: `wp-admin/includes/class-language-pack-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-language-pack-upgrader-skin.php/)
```
public function after() {
echo '</div>';
}
```
wordpress Language_Pack_Upgrader_Skin::__construct( array $args = array() ) Language\_Pack\_Upgrader\_Skin::\_\_construct( array $args = array() )
======================================================================
`$args` array Optional Default: `array()`
File: `wp-admin/includes/class-language-pack-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-language-pack-upgrader-skin.php/)
```
public function __construct( $args = array() ) {
$defaults = array(
'url' => '',
'nonce' => '',
'title' => __( 'Update Translations' ),
'skip_header_footer' => false,
);
$args = wp_parse_args( $args, $defaults );
if ( $args['skip_header_footer'] ) {
$this->done_header = true;
$this->done_footer = true;
$this->display_footer_actions = false;
}
parent::__construct( $args );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Upgrader\_Skin::\_\_construct()](../wp_upgrader_skin/__construct) wp-admin/includes/class-wp-upgrader-skin.php | Constructor. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_parse\_args()](../../functions/wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| Used By | Description |
| --- | --- |
| [Language\_Pack\_Upgrader::async\_upgrade()](../language_pack_upgrader/async_upgrade) wp-admin/includes/class-language-pack-upgrader.php | Asynchronously upgrades language packs after other upgrades have been made. |
| programming_docs |
wordpress Language_Pack_Upgrader_Skin::error( string|WP_Error $errors ) Language\_Pack\_Upgrader\_Skin::error( string|WP\_Error $errors )
=================================================================
`$errors` string|[WP\_Error](../wp_error) Required Errors. File: `wp-admin/includes/class-language-pack-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-language-pack-upgrader-skin.php/)
```
public function error( $errors ) {
echo '<div class="lp-error">';
parent::error( $errors );
echo '</div>';
}
```
| Uses | Description |
| --- | --- |
| [WP\_Upgrader\_Skin::error()](../wp_upgrader_skin/error) wp-admin/includes/class-wp-upgrader-skin.php | |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress Language_Pack_Upgrader_Skin::bulk_footer() Language\_Pack\_Upgrader\_Skin::bulk\_footer()
==============================================
File: `wp-admin/includes/class-language-pack-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-language-pack-upgrader-skin.php/)
```
public function bulk_footer() {
$this->decrement_update_count( 'translation' );
$update_actions = array(
'updates_page' => sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'update-core.php' ),
__( 'Go to WordPress Updates page' )
),
);
/**
* Filters the list of action links available following a translations update.
*
* @since 3.7.0
*
* @param string[] $update_actions Array of translations update links.
*/
$update_actions = apply_filters( 'update_translations_complete_actions', $update_actions );
if ( $update_actions && $this->display_footer_actions ) {
$this->feedback( implode( ' | ', $update_actions ) );
}
}
```
[apply\_filters( 'update\_translations\_complete\_actions', string[] $update\_actions )](../../hooks/update_translations_complete_actions)
Filters the list of action links available following a translations update.
| Uses | Description |
| --- | --- |
| [self\_admin\_url()](../../functions/self_admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for either the current site or the network depending on context. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
wordpress Language_Pack_Upgrader_Skin::before() Language\_Pack\_Upgrader\_Skin::before()
========================================
File: `wp-admin/includes/class-language-pack-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-language-pack-upgrader-skin.php/)
```
public function before() {
$name = $this->upgrader->get_name_for_update( $this->language_update );
echo '<div class="update-messages lp-show-latest">';
/* translators: 1: Project name (plugin, theme, or WordPress), 2: Language. */
printf( '<h2>' . __( 'Updating translations for %1$s (%2$s)…' ) . '</h2>', $name, $this->language_update->language );
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
wordpress WP_Image_Editor::get_default_quality( string $mime_type ): int WP\_Image\_Editor::get\_default\_quality( string $mime\_type ): int
===================================================================
Returns the default compression quality setting for the mime type.
`$mime_type` string Required int The default quality setting for the mime type.
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
protected function get_default_quality( $mime_type ) {
switch ( $mime_type ) {
case 'image/webp':
$quality = 86;
break;
case 'image/jpeg':
default:
$quality = $this->default_quality;
}
return $quality;
}
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::set\_quality()](set_quality) wp-includes/class-wp-image-editor.php | Sets Image Compression quality on a 1-100% scale. |
| Version | Description |
| --- | --- |
| [5.8.1](https://developer.wordpress.org/reference/since/5.8.1/) | Introduced. |
wordpress WP_Image_Editor::load(): true|WP_Error WP\_Image\_Editor::load(): true|WP\_Error
=========================================
Loads image from $this->file into editor.
true|[WP\_Error](../wp_error) True if loaded; [WP\_Error](../wp_error) on failure.
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
abstract public function load();
```
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::get_extension( string $mime_type = null ): string|false WP\_Image\_Editor::get\_extension( string $mime\_type = null ): string|false
============================================================================
Returns first matched extension from Mime-type, as mapped from [wp\_get\_mime\_types()](../../functions/wp_get_mime_types)
`$mime_type` string Optional Default: `null`
string|false
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
protected static function get_extension( $mime_type = null ) {
if ( empty( $mime_type ) ) {
return false;
}
return wp_get_default_extension_for_mime_type( $mime_type );
}
```
| Uses | Description |
| --- | --- |
| [wp\_get\_default\_extension\_for\_mime\_type()](../../functions/wp_get_default_extension_for_mime_type) wp-includes/functions.php | Returns first matched extension for the mime-type, as mapped from [wp\_get\_mime\_types()](../../functions/wp_get_mime_types) . |
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::get\_output\_format()](get_output_format) wp-includes/class-wp-image-editor.php | Returns preferred mime-type and extension based on provided file’s extension and mime, or current file’s extension and mime. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::supports_mime_type( string $mime_type ): bool WP\_Image\_Editor::supports\_mime\_type( string $mime\_type ): bool
===================================================================
Checks to see if editor supports the mime-type specified.
Must be overridden in a subclass.
`$mime_type` string Required bool
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public static function supports_mime_type( $mime_type ) {
return false;
}
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::get\_output\_format()](get_output_format) wp-includes/class-wp-image-editor.php | Returns preferred mime-type and extension based on provided file’s extension and mime, or current file’s extension and mime. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::flip( bool $horz, bool $vert ): true|WP_Error WP\_Image\_Editor::flip( bool $horz, bool $vert ): true|WP\_Error
=================================================================
Flips current image.
`$horz` bool Required Flip along Horizontal Axis `$vert` bool Required Flip along Vertical Axis true|[WP\_Error](../wp_error)
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
abstract public function flip( $horz, $vert );
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::maybe\_exif\_rotate()](maybe_exif_rotate) wp-includes/class-wp-image-editor.php | Check if a JPEG image has EXIF Orientation tag and rotate it if needed. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::get_mime_type( string $extension = null ): string|false WP\_Image\_Editor::get\_mime\_type( string $extension = null ): string|false
============================================================================
Returns first matched mime-type from extension, as mapped from [wp\_get\_mime\_types()](../../functions/wp_get_mime_types)
`$extension` string Optional Default: `null`
string|false
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
protected static function get_mime_type( $extension = null ) {
if ( ! $extension ) {
return false;
}
$mime_types = wp_get_mime_types();
$extensions = array_keys( $mime_types );
foreach ( $extensions as $_extension ) {
if ( preg_match( "/{$extension}/i", $_extension ) ) {
return $mime_types[ $_extension ];
}
}
return false;
}
```
| Uses | Description |
| --- | --- |
| [wp\_get\_mime\_types()](../../functions/wp_get_mime_types) wp-includes/functions.php | Retrieves the list of mime types and file extensions. |
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::get\_output\_format()](get_output_format) wp-includes/class-wp-image-editor.php | Returns preferred mime-type and extension based on provided file’s extension and mime, or current file’s extension and mime. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::get_suffix(): string|false WP\_Image\_Editor::get\_suffix(): string|false
==============================================
Builds and returns proper suffix for file based on height and width.
string|false suffix
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public function get_suffix() {
if ( ! $this->get_size() ) {
return false;
}
return "{$this->size['width']}x{$this->size['height']}";
}
```
| Uses | Description |
| --- | --- |
| [WP\_Image\_Editor::get\_size()](get_size) wp-includes/class-wp-image-editor.php | Gets dimensions of image. |
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::generate\_filename()](generate_filename) wp-includes/class-wp-image-editor.php | Builds an output filename based on current file, and adding proper suffix |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::get_quality(): int WP\_Image\_Editor::get\_quality(): int
======================================
Gets the Image Compression quality on a 1-100% scale.
int Compression Quality. Range: [1,100]
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public function get_quality() {
if ( ! $this->quality ) {
$this->set_quality();
}
return $this->quality;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Image\_Editor::set\_quality()](set_quality) wp-includes/class-wp-image-editor.php | Sets Image Compression quality on a 1-100% scale. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress WP_Image_Editor::generate_filename( string $suffix = null, string $dest_path = null, string $extension = null ): string WP\_Image\_Editor::generate\_filename( string $suffix = null, string $dest\_path = null, string $extension = null ): string
===========================================================================================================================
Builds an output filename based on current file, and adding proper suffix
`$suffix` string Optional Default: `null`
`$dest_path` string Optional Default: `null`
`$extension` string Optional Default: `null`
string filename
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public function generate_filename( $suffix = null, $dest_path = null, $extension = null ) {
// $suffix will be appended to the destination filename, just before the extension.
if ( ! $suffix ) {
$suffix = $this->get_suffix();
}
$dir = pathinfo( $this->file, PATHINFO_DIRNAME );
$ext = pathinfo( $this->file, PATHINFO_EXTENSION );
$name = wp_basename( $this->file, ".$ext" );
$new_ext = strtolower( $extension ? $extension : $ext );
if ( ! is_null( $dest_path ) ) {
if ( ! wp_is_stream( $dest_path ) ) {
$_dest_path = realpath( $dest_path );
if ( $_dest_path ) {
$dir = $_dest_path;
}
} else {
$dir = $dest_path;
}
}
return trailingslashit( $dir ) . "{$name}-{$suffix}.{$new_ext}";
}
```
| Uses | Description |
| --- | --- |
| [wp\_is\_stream()](../../functions/wp_is_stream) wp-includes/functions.php | Tests if a given path is a stream URL |
| [WP\_Image\_Editor::get\_suffix()](get_suffix) wp-includes/class-wp-image-editor.php | Builds and returns proper suffix for file based on height and width. |
| [wp\_basename()](../../functions/wp_basename) wp-includes/formatting.php | i18n-friendly version of basename(). |
| [trailingslashit()](../../functions/trailingslashit) wp-includes/formatting.php | Appends a trailing slash. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::get_output_format( string $filename = null, string $mime_type = null ): array WP\_Image\_Editor::get\_output\_format( string $filename = null, string $mime\_type = null ): array
===================================================================================================
Returns preferred mime-type and extension based on provided file’s extension and mime, or current file’s extension and mime.
Will default to $this->default\_mime\_type if requested is not supported.
Provides corrected filename only if filename is provided.
`$filename` string Optional Default: `null`
`$mime_type` string Optional Default: `null`
array `filename|null`, extension, mime-type
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
protected function get_output_format( $filename = null, $mime_type = null ) {
$new_ext = null;
// By default, assume specified type takes priority.
if ( $mime_type ) {
$new_ext = $this->get_extension( $mime_type );
}
if ( $filename ) {
$file_ext = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
$file_mime = $this->get_mime_type( $file_ext );
} else {
// If no file specified, grab editor's current extension and mime-type.
$file_ext = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );
$file_mime = $this->mime_type;
}
// Check to see if specified mime-type is the same as type implied by
// file extension. If so, prefer extension from file.
if ( ! $mime_type || ( $file_mime == $mime_type ) ) {
$mime_type = $file_mime;
$new_ext = $file_ext;
}
/**
* Filters the image editor output format mapping.
*
* Enables filtering the mime type used to save images. By default,
* the mapping array is empty, so the mime type matches the source image.
*
* @see WP_Image_Editor::get_output_format()
*
* @since 5.8.0
*
* @param string[] $output_format {
* An array of mime type mappings. Maps a source mime type to a new
* destination mime type. Default empty array.
*
* @type string ...$0 The new mime type.
* }
* @param string $filename Path to the image.
* @param string $mime_type The source image mime type.
*/
$output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );
if ( isset( $output_format[ $mime_type ] )
&& $this->supports_mime_type( $output_format[ $mime_type ] )
) {
$mime_type = $output_format[ $mime_type ];
$new_ext = $this->get_extension( $mime_type );
}
// Double-check that the mime-type selected is supported by the editor.
// If not, choose a default instead.
if ( ! $this->supports_mime_type( $mime_type ) ) {
/**
* Filters default mime type prior to getting the file extension.
*
* @see wp_get_mime_types()
*
* @since 3.5.0
*
* @param string $mime_type Mime type string.
*/
$mime_type = apply_filters( 'image_editor_default_mime_type', $this->default_mime_type );
$new_ext = $this->get_extension( $mime_type );
}
// Ensure both $filename and $new_ext are not empty.
// $this->get_extension() returns false on error which would effectively remove the extension
// from $filename. That shouldn't happen, files without extensions are not supported.
if ( $filename && $new_ext ) {
$dir = pathinfo( $filename, PATHINFO_DIRNAME );
$ext = pathinfo( $filename, PATHINFO_EXTENSION );
$filename = trailingslashit( $dir ) . wp_basename( $filename, ".$ext" ) . ".{$new_ext}";
}
if ( $mime_type && ( $mime_type !== $this->mime_type ) ) {
// The image will be converted when saving. Set the quality for the new mime-type if not already set.
if ( $mime_type !== $this->output_mime_type ) {
$this->output_mime_type = $mime_type;
}
$this->set_quality();
} elseif ( ! empty( $this->output_mime_type ) ) {
// Reset output_mime_type and quality.
$this->output_mime_type = null;
$this->set_quality();
}
return array( $filename, $new_ext, $mime_type );
}
```
[apply\_filters( 'image\_editor\_default\_mime\_type', string $mime\_type )](../../hooks/image_editor_default_mime_type)
Filters default mime type prior to getting the file extension.
[apply\_filters( 'image\_editor\_output\_format', string[] $output\_format, string $filename, string $mime\_type )](../../hooks/image_editor_output_format)
Filters the image editor output format mapping.
| Uses | Description |
| --- | --- |
| [WP\_Image\_Editor::get\_extension()](get_extension) wp-includes/class-wp-image-editor.php | Returns first matched extension from Mime-type, as mapped from [wp\_get\_mime\_types()](../../functions/wp_get_mime_types) |
| [WP\_Image\_Editor::get\_mime\_type()](get_mime_type) wp-includes/class-wp-image-editor.php | Returns first matched mime-type from extension, as mapped from [wp\_get\_mime\_types()](../../functions/wp_get_mime_types) |
| [WP\_Image\_Editor::set\_quality()](set_quality) wp-includes/class-wp-image-editor.php | Sets Image Compression quality on a 1-100% scale. |
| [WP\_Image\_Editor::supports\_mime\_type()](supports_mime_type) wp-includes/class-wp-image-editor.php | Checks to see if editor supports the mime-type specified. |
| [wp\_basename()](../../functions/wp_basename) wp-includes/formatting.php | i18n-friendly version of basename(). |
| [trailingslashit()](../../functions/trailingslashit) wp-includes/formatting.php | Appends a trailing slash. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
| programming_docs |
wordpress WP_Image_Editor::resize( int|null $max_w, int|null $max_h, bool $crop = false ): true|WP_Error WP\_Image\_Editor::resize( int|null $max\_w, int|null $max\_h, bool $crop = false ): true|WP\_Error
===================================================================================================
Resizes current image.
At minimum, either a height or width must be provided.
If one of the two is set to null, the resize will maintain aspect ratio according to the provided dimension.
`$max_w` int|null Required Image width. `$max_h` int|null Required Image height. `$crop` bool Optional Default: `false`
true|[WP\_Error](../wp_error)
Crop value:
1. If false (default), images will not be cropped.
2. If an array in the form of array( x\_crop\_position, y\_crop\_position ):
– x\_crop\_position accepts ‘left’ ‘center’, or ‘right’.
– y\_crop\_position accepts ‘top’, ‘center’, or ‘bottom’.
Images will be cropped to the specified dimensions within the defined crop area.
3. If true, images will be cropped to the specified dimensions using center p
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
abstract public function resize( $max_w, $max_h, $crop = false );
```
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::stream( string $mime_type = null ): true|WP_Error WP\_Image\_Editor::stream( string $mime\_type = null ): true|WP\_Error
======================================================================
Streams current image to browser.
`$mime_type` string Optional The mime type of the image. Default: `null`
true|[WP\_Error](../wp_error) True on success, [WP\_Error](../wp_error) object on failure.
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
abstract public function stream( $mime_type = null );
```
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::rotate( float $angle ): true|WP_Error WP\_Image\_Editor::rotate( float $angle ): true|WP\_Error
=========================================================
Rotates current image counter-clockwise by $angle.
`$angle` float Required true|[WP\_Error](../wp_error)
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
abstract public function rotate( $angle );
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::maybe\_exif\_rotate()](maybe_exif_rotate) wp-includes/class-wp-image-editor.php | Check if a JPEG image has EXIF Orientation tag and rotate it if needed. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::test( array $args = array() ): bool WP\_Image\_Editor::test( array $args = array() ): bool
======================================================
Checks to see if current environment supports the editor chosen.
Must be overridden in a subclass.
`$args` array Optional Default: `array()`
bool
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public static function test( $args = array() ) {
return false;
}
```
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::save( string $destfilename = null, string $mime_type = null ): array|WP_Error WP\_Image\_Editor::save( string $destfilename = null, string $mime\_type = null ): array|WP\_Error
==================================================================================================
Saves current image to file.
`$destfilename` string Optional Destination filename. Default: `null`
`$mime_type` string Optional The mime-type. Default: `null`
array|[WP\_Error](../wp_error) Array on success or [WP\_Error](../wp_error) if the file failed to save.
* `path`stringPath to the image file.
* `file`stringName of the image file.
* `width`intImage width.
* `height`intImage height.
* `mime-type`stringThe mime type of the image.
* `filesize`intFile size of the image.
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
abstract public function save( $destfilename = null, $mime_type = null );
```
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | The `$filesize` value was added to the returned array. |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::set_quality( int $quality = null ): true|WP_Error WP\_Image\_Editor::set\_quality( int $quality = null ): true|WP\_Error
======================================================================
Sets Image Compression quality on a 1-100% scale.
`$quality` int Optional Compression Quality. Range: [1,100] Default: `null`
true|[WP\_Error](../wp_error) True if set successfully; [WP\_Error](../wp_error) on failure.
Default quality defined in [WP\_Image\_Editor](../wp_image_editor) class is 90.
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public function set_quality( $quality = null ) {
// Use the output mime type if present. If not, fall back to the input/initial mime type.
$mime_type = ! empty( $this->output_mime_type ) ? $this->output_mime_type : $this->mime_type;
// Get the default quality setting for the mime type.
$default_quality = $this->get_default_quality( $mime_type );
if ( null === $quality ) {
/**
* Filters the default image compression quality setting.
*
* Applies only during initial editor instantiation, or when set_quality() is run
* manually without the `$quality` argument.
*
* The WP_Image_Editor::set_quality() method has priority over the filter.
*
* @since 3.5.0
*
* @param int $quality Quality level between 1 (low) and 100 (high).
* @param string $mime_type Image mime type.
*/
$quality = apply_filters( 'wp_editor_set_quality', $default_quality, $mime_type );
if ( 'image/jpeg' === $mime_type ) {
/**
* Filters the JPEG compression quality for backward-compatibility.
*
* Applies only during initial editor instantiation, or when set_quality() is run
* manually without the `$quality` argument.
*
* The WP_Image_Editor::set_quality() method has priority over the filter.
*
* The filter is evaluated under two contexts: 'image_resize', and 'edit_image',
* (when a JPEG image is saved to file).
*
* @since 2.5.0
*
* @param int $quality Quality level between 0 (low) and 100 (high) of the JPEG.
* @param string $context Context of the filter.
*/
$quality = apply_filters( 'jpeg_quality', $quality, 'image_resize' );
}
if ( $quality < 0 || $quality > 100 ) {
$quality = $default_quality;
}
}
// Allow 0, but squash to 1 due to identical images in GD, and for backward compatibility.
if ( 0 === $quality ) {
$quality = 1;
}
if ( ( $quality >= 1 ) && ( $quality <= 100 ) ) {
$this->quality = $quality;
return true;
} else {
return new WP_Error( 'invalid_image_quality', __( 'Attempted to set image quality outside of the range [1,100].' ) );
}
}
```
[apply\_filters( 'jpeg\_quality', int $quality, string $context )](../../hooks/jpeg_quality)
Filters the JPEG compression quality for backward-compatibility.
[apply\_filters( 'wp\_editor\_set\_quality', int $quality, string $mime\_type )](../../hooks/wp_editor_set_quality)
Filters the default image compression quality setting.
| Uses | Description |
| --- | --- |
| [WP\_Image\_Editor::get\_default\_quality()](get_default_quality) wp-includes/class-wp-image-editor.php | Returns the default compression quality setting for the mime type. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::get\_quality()](get_quality) wp-includes/class-wp-image-editor.php | Gets the Image Compression quality on a 1-100% scale. |
| [WP\_Image\_Editor\_Imagick::set\_quality()](../wp_image_editor_imagick/set_quality) wp-includes/class-wp-image-editor-imagick.php | Sets Image Compression quality on a 1-100% scale. |
| [WP\_Image\_Editor::get\_output\_format()](get_output_format) wp-includes/class-wp-image-editor.php | Returns preferred mime-type and extension based on provided file’s extension and mime, or current file’s extension and mime. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::crop( int $src_x, int $src_y, int $src_w, int $src_h, int $dst_w = null, int $dst_h = null, bool $src_abs = false ): true|WP_Error WP\_Image\_Editor::crop( int $src\_x, int $src\_y, int $src\_w, int $src\_h, int $dst\_w = null, int $dst\_h = null, bool $src\_abs = false ): true|WP\_Error
=============================================================================================================================================================
Crops Image.
`$src_x` int Required The start x position to crop from. `$src_y` int Required The start y position to crop from. `$src_w` int Required The width to crop. `$src_h` int Required The height to crop. `$dst_w` int Optional The destination width. Default: `null`
`$dst_h` int Optional The destination height. Default: `null`
`$src_abs` bool Optional If the source crop points are absolute. Default: `false`
true|[WP\_Error](../wp_error)
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );
```
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::update_size( int $width = null, int $height = null ): true WP\_Image\_Editor::update\_size( int $width = null, int $height = null ): true
==============================================================================
Sets current image size.
`$width` int Optional Default: `null`
`$height` int Optional Default: `null`
true
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
protected function update_size( $width = null, $height = null ) {
$this->size = array(
'width' => (int) $width,
'height' => (int) $height,
);
return true;
}
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor\_Imagick::update\_size()](../wp_image_editor_imagick/update_size) wp-includes/class-wp-image-editor-imagick.php | Sets or updates current image size. |
| [WP\_Image\_Editor\_GD::update\_size()](../wp_image_editor_gd/update_size) wp-includes/class-wp-image-editor-gd.php | Sets or updates current image size. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::__construct( string $file ) WP\_Image\_Editor::\_\_construct( string $file )
================================================
Each instance handles a single file.
`$file` string Required Path to the file to load. File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public function __construct( $file ) {
$this->file = $file;
}
```
wordpress WP_Image_Editor::maybe_exif_rotate(): bool|WP_Error WP\_Image\_Editor::maybe\_exif\_rotate(): bool|WP\_Error
========================================================
Check if a JPEG image has EXIF Orientation tag and rotate it if needed.
bool|[WP\_Error](../wp_error) True if the image was rotated. False if not rotated (no EXIF data or the image doesn't need to be rotated).
[WP\_Error](../wp_error) if error while rotating.
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public function maybe_exif_rotate() {
$orientation = null;
if ( is_callable( 'exif_read_data' ) && 'image/jpeg' === $this->mime_type ) {
$exif_data = @exif_read_data( $this->file );
if ( ! empty( $exif_data['Orientation'] ) ) {
$orientation = (int) $exif_data['Orientation'];
}
}
/**
* Filters the `$orientation` value to correct it before rotating or to prevent rotating the image.
*
* @since 5.3.0
*
* @param int $orientation EXIF Orientation value as retrieved from the image file.
* @param string $file Path to the image file.
*/
$orientation = apply_filters( 'wp_image_maybe_exif_rotate', $orientation, $this->file );
if ( ! $orientation || 1 === $orientation ) {
return false;
}
switch ( $orientation ) {
case 2:
// Flip horizontally.
$result = $this->flip( false, true );
break;
case 3:
// Rotate 180 degrees or flip horizontally and vertically.
// Flipping seems faster and uses less resources.
$result = $this->flip( true, true );
break;
case 4:
// Flip vertically.
$result = $this->flip( true, false );
break;
case 5:
// Rotate 90 degrees counter-clockwise and flip vertically.
$result = $this->rotate( 90 );
if ( ! is_wp_error( $result ) ) {
$result = $this->flip( true, false );
}
break;
case 6:
// Rotate 90 degrees clockwise (270 counter-clockwise).
$result = $this->rotate( 270 );
break;
case 7:
// Rotate 90 degrees counter-clockwise and flip horizontally.
$result = $this->rotate( 90 );
if ( ! is_wp_error( $result ) ) {
$result = $this->flip( false, true );
}
break;
case 8:
// Rotate 90 degrees counter-clockwise.
$result = $this->rotate( 90 );
break;
}
return $result;
}
```
[apply\_filters( 'wp\_image\_maybe\_exif\_rotate', int $orientation, string $file )](../../hooks/wp_image_maybe_exif_rotate)
Filters the `$orientation` value to correct it before rotating or to prevent rotating the image.
| Uses | Description |
| --- | --- |
| [WP\_Image\_Editor::flip()](flip) wp-includes/class-wp-image-editor.php | Flips current image. |
| [WP\_Image\_Editor::rotate()](rotate) wp-includes/class-wp-image-editor.php | Rotates current image counter-clockwise by $angle. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor\_Imagick::maybe\_exif\_rotate()](../wp_image_editor_imagick/maybe_exif_rotate) wp-includes/class-wp-image-editor-imagick.php | Check if a JPEG image has EXIF Orientation tag and rotate it if needed. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress WP_Image_Editor::multi_resize( array $sizes ): array WP\_Image\_Editor::multi\_resize( array $sizes ): array
=======================================================
Resize multiple images from a single source.
`$sizes` array Required An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
* `...$0`array
+ `width`intImage width.
+ `height`intImage height.
+ `crop`boolOptional. Whether to crop the image. Default false. array An array of resized images metadata by size.
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
abstract public function multi_resize( $sizes );
```
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::make_image( string $filename, callable $callback, array $arguments ): bool WP\_Image\_Editor::make\_image( string $filename, callable $callback, array $arguments ): bool
==============================================================================================
Either calls editor’s save function or handles file as a stream.
`$filename` string Required `$callback` callable Required `$arguments` array Required bool
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
protected function make_image( $filename, $callback, $arguments ) {
$stream = wp_is_stream( $filename );
if ( $stream ) {
ob_start();
} else {
// The directory containing the original file may no longer exist when using a replication plugin.
wp_mkdir_p( dirname( $filename ) );
}
$result = call_user_func_array( $callback, $arguments );
if ( $result && $stream ) {
$contents = ob_get_contents();
$fp = fopen( $filename, 'w' );
if ( ! $fp ) {
ob_end_clean();
return false;
}
fwrite( $fp, $contents );
fclose( $fp );
}
if ( $stream ) {
ob_end_clean();
}
return $result;
}
```
| Uses | Description |
| --- | --- |
| [wp\_is\_stream()](../../functions/wp_is_stream) wp-includes/functions.php | Tests if a given path is a stream URL |
| [wp\_mkdir\_p()](../../functions/wp_mkdir_p) wp-includes/functions.php | Recursive directory creation based on full path. |
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor\_GD::make\_image()](../wp_image_editor_gd/make_image) wp-includes/class-wp-image-editor-gd.php | Either calls editor’s save function or handles file as a stream. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Image_Editor::get_size(): int[] WP\_Image\_Editor::get\_size(): int[]
=====================================
Gets dimensions of image.
int[] Dimensions of the image.
* `width`intThe image width.
* `height`intThe image height.
File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
public function get_size() {
return $this->size;
}
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::get\_suffix()](get_suffix) wp-includes/class-wp-image-editor.php | Builds and returns proper suffix for file based on height and width. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress WP_Widget_Text::form( array $instance ) WP\_Widget\_Text::form( array $instance )
=========================================
Outputs the Text widget settings form.
* [WP\_Widget\_Text::render\_control\_template\_scripts()](../wp_widget_text/render_control_template_scripts)
* [\_WP\_Editors::editor()](../_wp_editors/editor)
`$instance` array Required Current settings. File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function form( $instance ) {
$instance = wp_parse_args(
(array) $instance,
array(
'title' => '',
'text' => '',
)
);
?>
<?php if ( ! $this->is_legacy_instance( $instance ) ) : ?>
<?php
if ( user_can_richedit() ) {
add_filter( 'the_editor_content', 'format_for_editor', 10, 2 );
$default_editor = 'tinymce';
} else {
$default_editor = 'html';
}
/** This filter is documented in wp-includes/class-wp-editor.php */
$text = apply_filters( 'the_editor_content', $instance['text'], $default_editor );
// Reset filter addition.
if ( user_can_richedit() ) {
remove_filter( 'the_editor_content', 'format_for_editor' );
}
// Prevent premature closing of textarea in case format_for_editor() didn't apply or the_editor_content filter did a wrong thing.
$escaped_text = preg_replace( '#</textarea#i', '</textarea', $text );
?>
<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" class="title sync-input" type="hidden" value="<?php echo esc_attr( $instance['title'] ); ?>">
<textarea id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>" class="text sync-input" hidden><?php echo $escaped_text; ?></textarea>
<input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" class="filter sync-input" type="hidden" value="on">
<input id="<?php echo $this->get_field_id( 'visual' ); ?>" name="<?php echo $this->get_field_name( 'visual' ); ?>" class="visual sync-input" type="hidden" value="on">
<?php else : ?>
<input id="<?php echo $this->get_field_id( 'visual' ); ?>" name="<?php echo $this->get_field_name( 'visual' ); ?>" class="visual" type="hidden" value="">
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<div class="notice inline notice-info notice-alt">
<?php if ( ! isset( $instance['visual'] ) ) : ?>
<p><?php _e( 'This widget may contain code that may work better in the “Custom HTML” widget. How about trying that widget instead?' ); ?></p>
<?php else : ?>
<p><?php _e( 'This widget may have contained code that may work better in the “Custom HTML” widget. If you have not yet, how about trying that widget instead?' ); ?></p>
<?php endif; ?>
</div>
<p>
<label for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Content:' ); ?></label>
<textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>"><?php echo esc_textarea( $instance['text'] ); ?></textarea>
</p>
<p>
<input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" type="checkbox"<?php checked( ! empty( $instance['filter'] ) ); ?> /> <label for="<?php echo $this->get_field_id( 'filter' ); ?>"><?php _e( 'Automatically add paragraphs' ); ?></label>
</p>
<?php
endif;
}
```
[apply\_filters( 'the\_editor\_content', string $content, string $default\_editor )](../../hooks/the_editor_content)
Filters the default editor content.
| Uses | Description |
| --- | --- |
| [WP\_Widget\_Text::is\_legacy\_instance()](is_legacy_instance) wp-includes/widgets/class-wp-widget-text.php | Determines whether a given instance is legacy and should bypass using TinyMCE. |
| [esc\_textarea()](../../functions/esc_textarea) wp-includes/formatting.php | Escaping for textarea values. |
| [checked()](../../functions/checked) wp-includes/general-template.php | Outputs the HTML checked attribute. |
| [user\_can\_richedit()](../../functions/user_can_richedit) wp-includes/general-template.php | Determines whether the user can access the visual editor. |
| [remove\_filter()](../../functions/remove_filter) wp-includes/plugin.php | Removes a callback function from a filter hook. |
| [\_e()](../../functions/_e) wp-includes/l10n.php | Displays translated text. |
| [esc\_attr()](../../functions/esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [wp\_parse\_args()](../../functions/wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [add\_filter()](../../functions/add_filter) wp-includes/plugin.php | Adds a callback function to a filter hook. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [4.8.1](https://developer.wordpress.org/reference/since/4.8.1/) | Restored original form to be displayed when in legacy mode. |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Form only contains hidden inputs which are synced with JS template. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress WP_Widget_Text::update( array $new_instance, array $old_instance ): array WP\_Widget\_Text::update( array $new\_instance, array $old\_instance ): array
=============================================================================
Handles updating settings for the current Text widget instance.
`$new_instance` array Required New settings for this instance as input by the user via [WP\_Widget::form()](../wp_widget/form). `$old_instance` array Required Old settings for this instance. array Settings to save or bool false to cancel saving.
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function update( $new_instance, $old_instance ) {
$new_instance = wp_parse_args(
$new_instance,
array(
'title' => '',
'text' => '',
'filter' => false, // For back-compat.
'visual' => null, // Must be explicitly defined.
)
);
$instance = $old_instance;
$instance['title'] = sanitize_text_field( $new_instance['title'] );
if ( current_user_can( 'unfiltered_html' ) ) {
$instance['text'] = $new_instance['text'];
} else {
$instance['text'] = wp_kses_post( $new_instance['text'] );
}
$instance['filter'] = ! empty( $new_instance['filter'] );
// Upgrade 4.8.0 format.
if ( isset( $old_instance['filter'] ) && 'content' === $old_instance['filter'] ) {
$instance['visual'] = true;
}
if ( 'content' === $new_instance['filter'] ) {
$instance['visual'] = true;
}
if ( isset( $new_instance['visual'] ) ) {
$instance['visual'] = ! empty( $new_instance['visual'] );
}
// Filter is always true in visual mode.
if ( ! empty( $instance['visual'] ) ) {
$instance['filter'] = true;
}
return $instance;
}
```
| Uses | Description |
| --- | --- |
| [wp\_kses\_post()](../../functions/wp_kses_post) wp-includes/kses.php | Sanitizes content for allowed HTML tags for post content. |
| [sanitize\_text\_field()](../../functions/sanitize_text_field) wp-includes/formatting.php | Sanitizes a string from user input or from the database. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [wp\_parse\_args()](../../functions/wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress WP_Widget_Text::enqueue_admin_scripts() WP\_Widget\_Text::enqueue\_admin\_scripts()
===========================================
Loads the required scripts and styles for the widget control.
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function enqueue_admin_scripts() {
wp_enqueue_editor();
wp_enqueue_media();
wp_enqueue_script( 'text-widgets' );
wp_add_inline_script( 'text-widgets', 'wp.textWidgets.init();', 'after' );
}
```
| Uses | Description |
| --- | --- |
| [wp\_enqueue\_editor()](../../functions/wp_enqueue_editor) wp-includes/general-template.php | Outputs the editor scripts, stylesheets, and default settings. |
| [wp\_add\_inline\_script()](../../functions/wp_add_inline_script) wp-includes/functions.wp-scripts.php | Adds extra code to a registered script. |
| [wp\_enqueue\_script()](../../functions/wp_enqueue_script) wp-includes/functions.wp-scripts.php | Enqueue a script. |
| [wp\_enqueue\_media()](../../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress WP_Widget_Text::is_legacy_instance( array $instance ): bool WP\_Widget\_Text::is\_legacy\_instance( array $instance ): bool
===============================================================
Determines whether a given instance is legacy and should bypass using TinyMCE.
`$instance` array Required Instance data.
* `text`stringContent.
* `filter`bool|stringWhether autop or content filters should apply.
* `legacy`boolWhether widget is in legacy mode.
bool Whether Text widget instance contains legacy data.
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function is_legacy_instance( $instance ) {
// Legacy mode when not in visual mode.
if ( isset( $instance['visual'] ) ) {
return ! $instance['visual'];
}
// Or, the widget has been added/updated in 4.8.0 then filter prop is 'content' and it is no longer legacy.
if ( isset( $instance['filter'] ) && 'content' === $instance['filter'] ) {
return false;
}
// If the text is empty, then nothing is preventing migration to TinyMCE.
if ( empty( $instance['text'] ) ) {
return false;
}
$wpautop = ! empty( $instance['filter'] );
$has_line_breaks = ( false !== strpos( trim( $instance['text'] ), "\n" ) );
// If auto-paragraphs are not enabled and there are line breaks, then ensure legacy mode.
if ( ! $wpautop && $has_line_breaks ) {
return true;
}
// If an HTML comment is present, assume legacy mode.
if ( false !== strpos( $instance['text'], '<!--' ) ) {
return true;
}
// In the rare case that DOMDocument is not available we cannot reliably sniff content and so we assume legacy.
if ( ! class_exists( 'DOMDocument' ) ) {
// @codeCoverageIgnoreStart
return true;
// @codeCoverageIgnoreEnd
}
$doc = new DOMDocument();
// Suppress warnings generated by loadHTML.
$errors = libxml_use_internal_errors( true );
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
@$doc->loadHTML(
sprintf(
'<!DOCTYPE html><html><head><meta charset="%s"></head><body>%s</body></html>',
esc_attr( get_bloginfo( 'charset' ) ),
$instance['text']
)
);
libxml_use_internal_errors( $errors );
$body = $doc->getElementsByTagName( 'body' )->item( 0 );
// See $allowedposttags.
$safe_elements_attributes = array(
'strong' => array(),
'em' => array(),
'b' => array(),
'i' => array(),
'u' => array(),
's' => array(),
'ul' => array(),
'ol' => array(),
'li' => array(),
'hr' => array(),
'abbr' => array(),
'acronym' => array(),
'code' => array(),
'dfn' => array(),
'a' => array(
'href' => true,
),
'img' => array(
'src' => true,
'alt' => true,
),
);
$safe_empty_elements = array( 'img', 'hr', 'iframe' );
foreach ( $body->getElementsByTagName( '*' ) as $element ) {
/** @var DOMElement $element */
$tag_name = strtolower( $element->nodeName );
// If the element is not safe, then the instance is legacy.
if ( ! isset( $safe_elements_attributes[ $tag_name ] ) ) {
return true;
}
// If the element is not safely empty and it has empty contents, then legacy mode.
if ( ! in_array( $tag_name, $safe_empty_elements, true ) && '' === trim( $element->textContent ) ) {
return true;
}
// If an attribute is not recognized as safe, then the instance is legacy.
foreach ( $element->attributes as $attribute ) {
/** @var DOMAttr $attribute */
$attribute_name = strtolower( $attribute->nodeName );
if ( ! isset( $safe_elements_attributes[ $tag_name ][ $attribute_name ] ) ) {
return true;
}
}
}
// Otherwise, the text contains no elements/attributes that TinyMCE could drop, and therefore the widget does not need legacy mode.
return false;
}
```
| Uses | Description |
| --- | --- |
| [esc\_attr()](../../functions/esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [get\_bloginfo()](../../functions/get_bloginfo) wp-includes/general-template.php | Retrieves information about the current site. |
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Text::form()](form) wp-includes/widgets/class-wp-widget-text.php | Outputs the Text widget settings form. |
| Version | Description |
| --- | --- |
| [4.8.1](https://developer.wordpress.org/reference/since/4.8.1/) | Introduced. |
wordpress WP_Widget_Text::render_control_template_scripts() WP\_Widget\_Text::render\_control\_template\_scripts()
======================================================
Render form template scripts.
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public static function render_control_template_scripts() {
$dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
?>
<script type="text/html" id="tmpl-widget-text-control-fields">
<# var elementIdPrefix = 'el' + String( Math.random() ).replace( /\D/g, '' ) + '_' #>
<p>
<label for="{{ elementIdPrefix }}title"><?php esc_html_e( 'Title:' ); ?></label>
<input id="{{ elementIdPrefix }}title" type="text" class="widefat title">
</p>
<?php if ( ! in_array( 'text_widget_custom_html', $dismissed_pointers, true ) ) : ?>
<div hidden class="wp-pointer custom-html-widget-pointer wp-pointer-top">
<div class="wp-pointer-content">
<h3><?php _e( 'New Custom HTML Widget' ); ?></h3>
<?php if ( is_customize_preview() ) : ?>
<p><?php _e( 'Did you know there is a “Custom HTML” widget now? You can find it by pressing the “<a class="add-widget" href="#">Add a Widget</a>” button and searching for “HTML”. Check it out to add some custom code to your site!' ); ?></p>
<?php else : ?>
<p><?php _e( 'Did you know there is a “Custom HTML” widget now? You can find it by scanning the list of available widgets on this screen. Check it out to add some custom code to your site!' ); ?></p>
<?php endif; ?>
<div class="wp-pointer-buttons">
<a class="close" href="#"><?php _e( 'Dismiss' ); ?></a>
</div>
</div>
<div class="wp-pointer-arrow">
<div class="wp-pointer-arrow-inner"></div>
</div>
</div>
<?php endif; ?>
<?php if ( ! in_array( 'text_widget_paste_html', $dismissed_pointers, true ) ) : ?>
<div hidden class="wp-pointer paste-html-pointer wp-pointer-top">
<div class="wp-pointer-content">
<h3><?php _e( 'Did you just paste HTML?' ); ?></h3>
<p><?php _e( 'Hey there, looks like you just pasted HTML into the “Visual” tab of the Text widget. You may want to paste your code into the “Text” tab instead. Alternately, try out the new “Custom HTML” widget!' ); ?></p>
<div class="wp-pointer-buttons">
<a class="close" href="#"><?php _e( 'Dismiss' ); ?></a>
</div>
</div>
<div class="wp-pointer-arrow">
<div class="wp-pointer-arrow-inner"></div>
</div>
</div>
<?php endif; ?>
<p>
<label for="{{ elementIdPrefix }}text" class="screen-reader-text"><?php esc_html_e( 'Content:' ); ?></label>
<textarea id="{{ elementIdPrefix }}text" class="widefat text wp-editor-area" style="height: 200px" rows="16" cols="20"></textarea>
</p>
</script>
<?php
}
```
| Uses | Description |
| --- | --- |
| [is\_customize\_preview()](../../functions/is_customize_preview) wp-includes/theme.php | Whether the site is being previewed in the Customizer. |
| [esc\_html\_e()](../../functions/esc_html_e) wp-includes/l10n.php | Displays translated text that has been escaped for safe use in HTML output. |
| [get\_user\_meta()](../../functions/get_user_meta) wp-includes/user.php | Retrieves user meta field for a user. |
| [\_e()](../../functions/_e) wp-includes/l10n.php | Displays translated text. |
| [get\_current\_user\_id()](../../functions/get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The method is now static. |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress WP_Widget_Text::_register_one( int $number = -1 ) WP\_Widget\_Text::\_register\_one( int $number = -1 )
=====================================================
Add hooks for enqueueing assets when registering all widget instances of this widget class.
`$number` int Optional The unique order number of this widget instance compared to other instances of the same class. Default: `-1`
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function _register_one( $number = -1 ) {
parent::_register_one( $number );
if ( $this->registered ) {
return;
}
$this->registered = true;
wp_add_inline_script( 'text-widgets', sprintf( 'wp.textWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) );
if ( $this->is_preview() ) {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) );
}
// Note that the widgets component in the customizer will also do
// the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts().
add_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) );
// Note that the widgets component in the customizer will also do
// the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts().
add_action( 'admin_footer-widgets.php', array( 'WP_Widget_Text', 'render_control_template_scripts' ) );
}
```
| Uses | Description |
| --- | --- |
| [wp\_add\_inline\_script()](../../functions/wp_add_inline_script) wp-includes/functions.wp-scripts.php | Adds extra code to a registered script. |
| [WP\_Widget::\_register\_one()](../wp_widget/_register_one) wp-includes/class-wp-widget.php | Registers an instance of the widget class. |
| [wp\_json\_encode()](../../functions/wp_json_encode) wp-includes/functions.php | Encodes a variable into JSON, with some sanity checks. |
| [add\_action()](../../functions/add_action) wp-includes/plugin.php | Adds a callback function to an action hook. |
wordpress WP_Widget_Text::_filter_gallery_shortcode_attrs( array $attrs ): array WP\_Widget\_Text::\_filter\_gallery\_shortcode\_attrs( array $attrs ): array
============================================================================
Filters gallery shortcode attributes.
Prevents all of a site’s attachments from being shown in a gallery displayed on a non-singular template where a $post context is not available.
`$attrs` array Required Attributes. array Attributes.
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function _filter_gallery_shortcode_attrs( $attrs ) {
if ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) {
$attrs['id'] = -1;
}
return $attrs;
}
```
| Uses | Description |
| --- | --- |
| [is\_singular()](../../functions/is_singular) wp-includes/query.php | Determines whether the query is for an existing single post of any post type (post, attachment, page, custom post types). |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress WP_Widget_Text::__construct() WP\_Widget\_Text::\_\_construct()
=================================
Sets up a new Text widget instance.
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function __construct() {
$widget_ops = array(
'classname' => 'widget_text',
'description' => __( 'Arbitrary text.' ),
'customize_selective_refresh' => true,
'show_instance_in_rest' => true,
);
$control_ops = array(
'width' => 400,
'height' => 350,
);
parent::__construct( 'text', __( 'Text' ), $widget_ops, $control_ops );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Widget::\_\_construct()](../wp_widget/__construct) wp-includes/class-wp-widget.php | PHP5 constructor. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress WP_Widget_Text::widget( array $args, array $instance ) WP\_Widget\_Text::widget( array $args, array $instance )
========================================================
Outputs the content for the current Text widget instance.
`$args` array Required Display arguments including `'before_title'`, `'after_title'`, `'before_widget'`, and `'after_widget'`. `$instance` array Required Settings for the current Text widget instance. File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function widget( $args, $instance ) {
global $post;
$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
$text = ! empty( $instance['text'] ) ? $instance['text'] : '';
$is_visual_text_widget = ( ! empty( $instance['visual'] ) && ! empty( $instance['filter'] ) );
// In 4.8.0 only, visual Text widgets get filter=content, without visual prop; upgrade instance props just-in-time.
if ( ! $is_visual_text_widget ) {
$is_visual_text_widget = ( isset( $instance['filter'] ) && 'content' === $instance['filter'] );
}
if ( $is_visual_text_widget ) {
$instance['filter'] = true;
$instance['visual'] = true;
}
/*
* Suspend legacy plugin-supplied do_shortcode() for 'widget_text' filter for the visual Text widget to prevent
* shortcodes being processed twice. Now do_shortcode() is added to the 'widget_text_content' filter in core itself
* and it applies after wpautop() to prevent corrupting HTML output added by the shortcode. When do_shortcode() is
* added to 'widget_text_content' then do_shortcode() will be manually called when in legacy mode as well.
*/
$widget_text_do_shortcode_priority = has_filter( 'widget_text', 'do_shortcode' );
$should_suspend_legacy_shortcode_support = ( $is_visual_text_widget && false !== $widget_text_do_shortcode_priority );
if ( $should_suspend_legacy_shortcode_support ) {
remove_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
}
// Override global $post so filters (and shortcodes) apply in a consistent context.
$original_post = $post;
if ( is_singular() ) {
// Make sure post is always the queried object on singular queries (not from another sub-query that failed to clean up the global $post).
$post = get_queried_object();
} else {
// Nullify the $post global during widget rendering to prevent shortcodes from running with the unexpected context on archive queries.
$post = null;
}
// Prevent dumping out all attachments from the media library.
add_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
/**
* Filters the content of the Text widget.
*
* @since 2.3.0
* @since 4.4.0 Added the `$widget` parameter.
* @since 4.8.1 The `$widget` param may now be a `WP_Widget_Custom_HTML` object in addition to a `WP_Widget_Text` object.
*
* @param string $text The widget content.
* @param array $instance Array of settings for the current widget.
* @param WP_Widget_Text|WP_Widget_Custom_HTML $widget Current text or HTML widget instance.
*/
$text = apply_filters( 'widget_text', $text, $instance, $this );
if ( $is_visual_text_widget ) {
/**
* Filters the content of the Text widget to apply changes expected from the visual (TinyMCE) editor.
*
* By default a subset of the_content filters are applied, including wpautop and wptexturize.
*
* @since 4.8.0
*
* @param string $text The widget content.
* @param array $instance Array of settings for the current widget.
* @param WP_Widget_Text $widget Current Text widget instance.
*/
$text = apply_filters( 'widget_text_content', $text, $instance, $this );
} else {
// Now in legacy mode, add paragraphs and line breaks when checkbox is checked.
if ( ! empty( $instance['filter'] ) ) {
$text = wpautop( $text );
}
/*
* Manually do shortcodes on the content when the core-added filter is present. It is added by default
* in core by adding do_shortcode() to the 'widget_text_content' filter to apply after wpautop().
* Since the legacy Text widget runs wpautop() after 'widget_text' filters are applied, the widget in
* legacy mode here manually applies do_shortcode() on the content unless the default
* core filter for 'widget_text_content' has been removed, or if do_shortcode() has already
* been applied via a plugin adding do_shortcode() to 'widget_text' filters.
*/
if ( has_filter( 'widget_text_content', 'do_shortcode' ) && ! $widget_text_do_shortcode_priority ) {
if ( ! empty( $instance['filter'] ) ) {
$text = shortcode_unautop( $text );
}
$text = do_shortcode( $text );
}
}
// Restore post global.
$post = $original_post;
remove_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
// Undo suspension of legacy plugin-supplied shortcode handling.
if ( $should_suspend_legacy_shortcode_support ) {
add_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
}
echo $args['before_widget'];
if ( ! empty( $title ) ) {
echo $args['before_title'] . $title . $args['after_title'];
}
$text = preg_replace_callback( '#<(video|iframe|object|embed)\s[^>]*>#i', array( $this, 'inject_video_max_width_style' ), $text );
// Adds 'noopener' relationship, without duplicating values, to all HTML A elements that have a target.
$text = wp_targeted_link_rel( $text );
?>
<div class="textwidget"><?php echo $text; ?></div>
<?php
echo $args['after_widget'];
}
```
[apply\_filters( 'widget\_text', string $text, array $instance, WP\_Widget\_Text|WP\_Widget\_Custom\_HTML $widget )](../../hooks/widget_text)
Filters the content of the Text widget.
[apply\_filters( 'widget\_text\_content', string $text, array $instance, WP\_Widget\_Text $widget )](../../hooks/widget_text_content)
Filters the content of the Text widget to apply changes expected from the visual (TinyMCE) editor.
[apply\_filters( 'widget\_title', string $title, array $instance, mixed $id\_base )](../../hooks/widget_title)
Filters the widget title.
| Uses | Description |
| --- | --- |
| [wp\_targeted\_link\_rel()](../../functions/wp_targeted_link_rel) wp-includes/formatting.php | Adds `rel="noopener"` to all HTML A elements that have a target. |
| [wpautop()](../../functions/wpautop) wp-includes/formatting.php | Replaces double line breaks with paragraph elements. |
| [shortcode\_unautop()](../../functions/shortcode_unautop) wp-includes/formatting.php | Don’t auto-p wrap shortcodes that stand alone. |
| [is\_singular()](../../functions/is_singular) wp-includes/query.php | Determines whether the query is for an existing single post of any post type (post, attachment, page, custom post types). |
| [get\_queried\_object()](../../functions/get_queried_object) wp-includes/query.php | Retrieves the currently queried object. |
| [do\_shortcode()](../../functions/do_shortcode) wp-includes/shortcodes.php | Searches content for shortcodes and filter shortcodes through their hooks. |
| [has\_filter()](../../functions/has_filter) wp-includes/plugin.php | Checks if any filter has been registered for a hook. |
| [remove\_filter()](../../functions/remove_filter) wp-includes/plugin.php | Removes a callback function from a filter hook. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [add\_filter()](../../functions/add_filter) wp-includes/plugin.php | Adds a callback function to a filter hook. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress WP_Widget_Text::enqueue_preview_scripts() WP\_Widget\_Text::enqueue\_preview\_scripts()
=============================================
Enqueue preview scripts.
These scripts normally are enqueued just-in-time when a playlist shortcode is used.
However, in the customizer, a playlist shortcode may be used in a text widget and dynamically added via selective refresh, so it is important to unconditionally enqueue them.
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function enqueue_preview_scripts() {
require_once dirname( __DIR__ ) . '/media.php';
wp_playlist_scripts( 'audio' );
wp_playlist_scripts( 'video' );
}
```
| Uses | Description |
| --- | --- |
| [wp\_playlist\_scripts()](../../functions/wp_playlist_scripts) wp-includes/media.php | Outputs and enqueues default scripts and styles for playlists. |
| Version | Description |
| --- | --- |
| [4.9.3](https://developer.wordpress.org/reference/since/4.9.3/) | Introduced. |
wordpress WP_Widget_Text::inject_video_max_width_style( array $matches ): string WP\_Widget\_Text::inject\_video\_max\_width\_style( array $matches ): string
============================================================================
Inject max-width and remove height for videos too constrained to fit inside sidebars on frontend.
* [WP\_Widget\_Media\_Video::inject\_video\_max\_width\_style()](../wp_widget_media_video/inject_video_max_width_style)
`$matches` array Required Pattern matches from preg\_replace\_callback. string HTML Output.
File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
public function inject_video_max_width_style( $matches ) {
$html = $matches[0];
$html = preg_replace( '/\sheight="\d+"/', '', $html );
$html = preg_replace( '/\swidth="\d+"/', '', $html );
$html = preg_replace( '/(?<=width:)\s*\d+px(?=;?)/', '100%', $html );
return $html;
}
```
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress WP_REST_Users_Controller::delete_current_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Users\_Controller::delete\_current\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
====================================================================================================================
Checks if a given request has access to delete the current user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has access to delete the item, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function delete_current_item_permissions_check( $request ) {
$request['id'] = get_current_user_id();
return $this->delete_item_permissions_check( $request );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::delete\_item\_permissions\_check()](delete_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Checks if a given request has access delete a user. |
| [get\_current\_user\_id()](../../functions/get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::get_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Users\_Controller::get\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
==================================================================================================
Retrieves a single user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function get_item( $request ) {
$user = $this->get_user( $request['id'] );
if ( is_wp_error( $user ) ) {
return $user;
}
$user = $this->prepare_item_for_response( $user, $request );
$response = rest_ensure_response( $user );
return $response;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_user()](get_user) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Get the user, if the ID is valid. |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user output for response. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::check_user_password( string $value, WP_REST_Request $request, string $param ): string|WP_Error WP\_REST\_Users\_Controller::check\_user\_password( string $value, WP\_REST\_Request $request, string $param ): string|WP\_Error
================================================================================================================================
Check a user password for the REST API.
Performs a couple of checks like [edit\_user()](../../functions/edit_user) in wp-admin/includes/user.php.
`$value` string Required The password submitted in the request. `$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. `$param` string Required The parameter name. string|[WP\_Error](../wp_error) The sanitized password, if valid, otherwise an error.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function check_user_password( $value, $request, $param ) {
$password = (string) $value;
if ( empty( $password ) ) {
return new WP_Error(
'rest_user_invalid_password',
__( 'Passwords cannot be empty.' ),
array( 'status' => 400 )
);
}
if ( false !== strpos( $password, '\\' ) ) {
return new WP_Error(
'rest_user_invalid_password',
sprintf(
/* translators: %s: The '\' character. */
__( 'Passwords cannot contain the "%s" character.' ),
'\\'
),
array( 'status' => 400 )
);
}
return $password;
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::check_username( string $value, WP_REST_Request $request, string $param ): string|WP_Error WP\_REST\_Users\_Controller::check\_username( string $value, WP\_REST\_Request $request, string $param ): string|WP\_Error
==========================================================================================================================
Check a username for the REST API.
Performs a couple of checks like [edit\_user()](../../functions/edit_user) in wp-admin/includes/user.php.
`$value` string Required The username submitted in the request. `$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. `$param` string Required The parameter name. string|[WP\_Error](../wp_error) The sanitized username, if valid, otherwise an error.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function check_username( $value, $request, $param ) {
$username = (string) $value;
if ( ! validate_username( $username ) ) {
return new WP_Error(
'rest_user_invalid_username',
__( 'This username is invalid because it uses illegal characters. Please enter a valid username.' ),
array( 'status' => 400 )
);
}
/** This filter is documented in wp-includes/user.php */
$illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
if ( in_array( strtolower( $username ), array_map( 'strtolower', $illegal_logins ), true ) ) {
return new WP_Error(
'rest_user_invalid_username',
__( 'Sorry, that username is not allowed.' ),
array( 'status' => 400 )
);
}
return $username;
}
```
[apply\_filters( 'illegal\_user\_logins', array $usernames )](../../hooks/illegal_user_logins)
Filters the list of disallowed usernames.
| Uses | Description |
| --- | --- |
| [validate\_username()](../../functions/validate_username) wp-includes/user.php | Checks whether a username is valid. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::prepare_item_for_response( WP_User $item, WP_REST_Request $request ): WP_REST_Response WP\_REST\_Users\_Controller::prepare\_item\_for\_response( WP\_User $item, WP\_REST\_Request $request ): WP\_REST\_Response
===========================================================================================================================
Prepares a single user output for response.
`$item` [WP\_User](../wp_user) Required User object. `$request` [WP\_REST\_Request](../wp_rest_request) Required Request object. [WP\_REST\_Response](../wp_rest_response) Response object.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function prepare_item_for_response( $item, $request ) {
// Restores the more descriptive, specific name for use within this method.
$user = $item;
$data = array();
$fields = $this->get_fields_for_response( $request );
if ( in_array( 'id', $fields, true ) ) {
$data['id'] = $user->ID;
}
if ( in_array( 'username', $fields, true ) ) {
$data['username'] = $user->user_login;
}
if ( in_array( 'name', $fields, true ) ) {
$data['name'] = $user->display_name;
}
if ( in_array( 'first_name', $fields, true ) ) {
$data['first_name'] = $user->first_name;
}
if ( in_array( 'last_name', $fields, true ) ) {
$data['last_name'] = $user->last_name;
}
if ( in_array( 'email', $fields, true ) ) {
$data['email'] = $user->user_email;
}
if ( in_array( 'url', $fields, true ) ) {
$data['url'] = $user->user_url;
}
if ( in_array( 'description', $fields, true ) ) {
$data['description'] = $user->description;
}
if ( in_array( 'link', $fields, true ) ) {
$data['link'] = get_author_posts_url( $user->ID, $user->user_nicename );
}
if ( in_array( 'locale', $fields, true ) ) {
$data['locale'] = get_user_locale( $user );
}
if ( in_array( 'nickname', $fields, true ) ) {
$data['nickname'] = $user->nickname;
}
if ( in_array( 'slug', $fields, true ) ) {
$data['slug'] = $user->user_nicename;
}
if ( in_array( 'roles', $fields, true ) ) {
// Defensively call array_values() to ensure an array is returned.
$data['roles'] = array_values( $user->roles );
}
if ( in_array( 'registered_date', $fields, true ) ) {
$data['registered_date'] = gmdate( 'c', strtotime( $user->user_registered ) );
}
if ( in_array( 'capabilities', $fields, true ) ) {
$data['capabilities'] = (object) $user->allcaps;
}
if ( in_array( 'extra_capabilities', $fields, true ) ) {
$data['extra_capabilities'] = (object) $user->caps;
}
if ( in_array( 'avatar_urls', $fields, true ) ) {
$data['avatar_urls'] = rest_get_avatar_urls( $user );
}
if ( in_array( 'meta', $fields, true ) ) {
$data['meta'] = $this->meta->get_value( $user->ID, $request );
}
$context = ! empty( $request['context'] ) ? $request['context'] : 'embed';
$data = $this->add_additional_fields_to_object( $data, $request );
$data = $this->filter_response_by_context( $data, $context );
// Wrap the data in a response object.
$response = rest_ensure_response( $data );
if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) {
$response->add_links( $this->prepare_links( $user ) );
}
/**
* Filters user data returned from the REST API.
*
* @since 4.7.0
*
* @param WP_REST_Response $response The response object.
* @param WP_User $user User object used to create response.
* @param WP_REST_Request $request Request object.
*/
return apply_filters( 'rest_prepare_user', $response, $user, $request );
}
```
[apply\_filters( 'rest\_prepare\_user', WP\_REST\_Response $response, WP\_User $user, WP\_REST\_Request $request )](../../hooks/rest_prepare_user)
Filters user data returned from the REST API.
| Uses | Description |
| --- | --- |
| [rest\_is\_field\_included()](../../functions/rest_is_field_included) wp-includes/rest-api.php | Given an array of fields to include in a response, some of which may be `nested.fields`, determine whether the provided field should be included in the response body. |
| [rest\_get\_avatar\_urls()](../../functions/rest_get_avatar_urls) wp-includes/rest-api.php | Retrieves the avatar urls in various sizes. |
| [get\_user\_locale()](../../functions/get_user_locale) wp-includes/l10n.php | Retrieves the locale of a user. |
| [WP\_REST\_Users\_Controller::prepare\_links()](prepare_links) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares links for the user request. |
| [get\_author\_posts\_url()](../../functions/get_author_posts_url) wp-includes/author-template.php | Retrieves the URL to the author page for the user with the ID provided. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::delete\_item()](delete_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Deletes a single user. |
| [WP\_REST\_Users\_Controller::get\_item()](get_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves a single user. |
| [WP\_REST\_Users\_Controller::get\_current\_item()](get_current_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves the current user. |
| [WP\_REST\_Users\_Controller::create\_item()](create_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Creates a single user. |
| [WP\_REST\_Users\_Controller::update\_item()](update_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates a single user. |
| [WP\_REST\_Users\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves all users. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::prepare_links( WP_User $user ): array WP\_REST\_Users\_Controller::prepare\_links( WP\_User $user ): array
====================================================================
Prepares links for the user request.
`$user` [WP\_User](../wp_user) Required User object. array Links for the given user.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
protected function prepare_links( $user ) {
$links = array(
'self' => array(
'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user->ID ) ),
),
'collection' => array(
'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
),
);
return $links;
}
```
| Uses | Description |
| --- | --- |
| [rest\_url()](../../functions/rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user output for response. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::get_items( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Users\_Controller::get\_items( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
===================================================================================================
Retrieves all users.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function get_items( $request ) {
// Retrieve the list of registered collection query parameters.
$registered = $this->get_collection_params();
/*
* This array defines mappings between public API query parameters whose
* values are accepted as-passed, and their internal WP_Query parameter
* name equivalents (some are the same). Only values which are also
* present in $registered will be set.
*/
$parameter_mappings = array(
'exclude' => 'exclude',
'include' => 'include',
'order' => 'order',
'per_page' => 'number',
'search' => 'search',
'roles' => 'role__in',
'capabilities' => 'capability__in',
'slug' => 'nicename__in',
);
$prepared_args = array();
/*
* For each known parameter which is both registered and present in the request,
* set the parameter's value on the query $prepared_args.
*/
foreach ( $parameter_mappings as $api_param => $wp_param ) {
if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {
$prepared_args[ $wp_param ] = $request[ $api_param ];
}
}
if ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) {
$prepared_args['offset'] = $request['offset'];
} else {
$prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number'];
}
if ( isset( $registered['orderby'] ) ) {
$orderby_possibles = array(
'id' => 'ID',
'include' => 'include',
'name' => 'display_name',
'registered_date' => 'registered',
'slug' => 'user_nicename',
'include_slugs' => 'nicename__in',
'email' => 'user_email',
'url' => 'user_url',
);
$prepared_args['orderby'] = $orderby_possibles[ $request['orderby'] ];
}
if ( isset( $registered['who'] ) && ! empty( $request['who'] ) && 'authors' === $request['who'] ) {
$prepared_args['who'] = 'authors';
} elseif ( ! current_user_can( 'list_users' ) ) {
$prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' );
}
if ( ! empty( $request['has_published_posts'] ) ) {
$prepared_args['has_published_posts'] = ( true === $request['has_published_posts'] )
? get_post_types( array( 'show_in_rest' => true ), 'names' )
: (array) $request['has_published_posts'];
}
if ( ! empty( $prepared_args['search'] ) ) {
$prepared_args['search'] = '*' . $prepared_args['search'] . '*';
}
/**
* Filters WP_User_Query arguments when querying users via the REST API.
*
* @link https://developer.wordpress.org/reference/classes/wp_user_query/
*
* @since 4.7.0
*
* @param array $prepared_args Array of arguments for WP_User_Query.
* @param WP_REST_Request $request The REST API request.
*/
$prepared_args = apply_filters( 'rest_user_query', $prepared_args, $request );
$query = new WP_User_Query( $prepared_args );
$users = array();
foreach ( $query->results as $user ) {
$data = $this->prepare_item_for_response( $user, $request );
$users[] = $this->prepare_response_for_collection( $data );
}
$response = rest_ensure_response( $users );
// Store pagination values for headers then unset for count query.
$per_page = (int) $prepared_args['number'];
$page = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );
$prepared_args['fields'] = 'ID';
$total_users = $query->get_total();
if ( $total_users < 1 ) {
// Out-of-bounds, run the query again without LIMIT for total count.
unset( $prepared_args['number'], $prepared_args['offset'] );
$count_query = new WP_User_Query( $prepared_args );
$total_users = $count_query->get_total();
}
$response->header( 'X-WP-Total', (int) $total_users );
$max_pages = ceil( $total_users / $per_page );
$response->header( 'X-WP-TotalPages', (int) $max_pages );
$base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
if ( $page > 1 ) {
$prev_page = $page - 1;
if ( $prev_page > $max_pages ) {
$prev_page = $max_pages;
}
$prev_link = add_query_arg( 'page', $prev_page, $base );
$response->link_header( 'prev', $prev_link );
}
if ( $max_pages > $page ) {
$next_page = $page + 1;
$next_link = add_query_arg( 'page', $next_page, $base );
$response->link_header( 'next', $next_link );
}
return $response;
}
```
[apply\_filters( 'rest\_user\_query', array $prepared\_args, WP\_REST\_Request $request )](../../hooks/rest_user_query)
Filters [WP\_User\_Query](../wp_user_query) arguments when querying users via the REST API.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_collection\_params()](get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves the query params for collections. |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user output for response. |
| [urlencode\_deep()](../../functions/urlencode_deep) wp-includes/formatting.php | Navigates through an array, object, or scalar, and encodes the values to be used in a URL. |
| [WP\_User\_Query::\_\_construct()](../wp_user_query/__construct) wp-includes/class-wp-user-query.php | PHP5 constructor. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [rest\_url()](../../functions/rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [add\_query\_arg()](../../functions/add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post\_types()](../../functions/get_post_types) wp-includes/post.php | Gets a list of all registered post type objects. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
| programming_docs |
wordpress WP_REST_Users_Controller::get_current_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Users\_Controller::get\_current\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
===========================================================================================================
Retrieves the current user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function get_current_item( $request ) {
$current_user_id = get_current_user_id();
if ( empty( $current_user_id ) ) {
return new WP_Error(
'rest_not_logged_in',
__( 'You are not currently logged in.' ),
array( 'status' => 401 )
);
}
$user = wp_get_current_user();
$response = $this->prepare_item_for_response( $user, $request );
$response = rest_ensure_response( $response );
return $response;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user output for response. |
| [wp\_get\_current\_user()](../../functions/wp_get_current_user) wp-includes/pluggable.php | Retrieves the current user object. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_current\_user\_id()](../../functions/get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::create_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Users\_Controller::create\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
=====================================================================================================
Creates a single user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function create_item( $request ) {
if ( ! empty( $request['id'] ) ) {
return new WP_Error(
'rest_user_exists',
__( 'Cannot create existing user.' ),
array( 'status' => 400 )
);
}
$schema = $this->get_item_schema();
if ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) {
$check_permission = $this->check_role_update( $request['id'], $request['roles'] );
if ( is_wp_error( $check_permission ) ) {
return $check_permission;
}
}
$user = $this->prepare_item_for_database( $request );
if ( is_multisite() ) {
$ret = wpmu_validate_user_signup( $user->user_login, $user->user_email );
if ( is_wp_error( $ret['errors'] ) && $ret['errors']->has_errors() ) {
$error = new WP_Error(
'rest_invalid_param',
__( 'Invalid user parameter(s).' ),
array( 'status' => 400 )
);
foreach ( $ret['errors']->errors as $code => $messages ) {
foreach ( $messages as $message ) {
$error->add( $code, $message );
}
$error_data = $error->get_error_data( $code );
if ( $error_data ) {
$error->add_data( $error_data, $code );
}
}
return $error;
}
}
if ( is_multisite() ) {
$user_id = wpmu_create_user( $user->user_login, $user->user_pass, $user->user_email );
if ( ! $user_id ) {
return new WP_Error(
'rest_user_create',
__( 'Error creating new user.' ),
array( 'status' => 500 )
);
}
$user->ID = $user_id;
$user_id = wp_update_user( wp_slash( (array) $user ) );
if ( is_wp_error( $user_id ) ) {
return $user_id;
}
$result = add_user_to_blog( get_site()->id, $user_id, '' );
if ( is_wp_error( $result ) ) {
return $result;
}
} else {
$user_id = wp_insert_user( wp_slash( (array) $user ) );
if ( is_wp_error( $user_id ) ) {
return $user_id;
}
}
$user = get_user_by( 'id', $user_id );
/**
* Fires immediately after a user is created or updated via the REST API.
*
* @since 4.7.0
*
* @param WP_User $user Inserted or updated user object.
* @param WP_REST_Request $request Request object.
* @param bool $creating True when creating a user, false when updating.
*/
do_action( 'rest_insert_user', $user, $request, true );
if ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) {
array_map( array( $user, 'add_role' ), $request['roles'] );
}
if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {
$meta_update = $this->meta->update_value( $request['meta'], $user_id );
if ( is_wp_error( $meta_update ) ) {
return $meta_update;
}
}
$user = get_user_by( 'id', $user_id );
$fields_update = $this->update_additional_fields_for_object( $user, $request );
if ( is_wp_error( $fields_update ) ) {
return $fields_update;
}
$request->set_param( 'context', 'edit' );
/**
* Fires after a user is completely created or updated via the REST API.
*
* @since 5.0.0
*
* @param WP_User $user Inserted or updated user object.
* @param WP_REST_Request $request Request object.
* @param bool $creating True when creating a user, false when updating.
*/
do_action( 'rest_after_insert_user', $user, $request, true );
$response = $this->prepare_item_for_response( $user, $request );
$response = rest_ensure_response( $response );
$response->set_status( 201 );
$response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user_id ) ) );
return $response;
}
```
[do\_action( 'rest\_after\_insert\_user', WP\_User $user, WP\_REST\_Request $request, bool $creating )](../../hooks/rest_after_insert_user)
Fires after a user is completely created or updated via the REST API.
[do\_action( 'rest\_insert\_user', WP\_User $user, WP\_REST\_Request $request, bool $creating )](../../hooks/rest_insert_user)
Fires immediately after a user is created or updated via the REST API.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_item\_schema()](get_item_schema) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves the user’s schema, conforming to JSON Schema. |
| [WP\_REST\_Users\_Controller::check\_role\_update()](check_role_update) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Determines if the current user is allowed to make the desired roles change. |
| [add\_user\_to\_blog()](../../functions/add_user_to_blog) wp-includes/ms-functions.php | Adds a user to a blog, along with specifying the user’s role. |
| [wpmu\_validate\_user\_signup()](../../functions/wpmu_validate_user_signup) wp-includes/ms-functions.php | Sanitizes and validates data required for a user sign-up. |
| [wpmu\_create\_user()](../../functions/wpmu_create_user) wp-includes/ms-functions.php | Creates a user. |
| [wp\_insert\_user()](../../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| [wp\_update\_user()](../../functions/wp_update_user) wp-includes/user.php | Updates a user in the database. |
| [get\_user\_by()](../../functions/get_user_by) wp-includes/pluggable.php | Retrieves user info by a given field. |
| [get\_site()](../../functions/get_site) wp-includes/ms-site.php | Retrieves site data given a site ID or site object. |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user output for response. |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_database()](prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user for creation or update. |
| [wp\_slash()](../../functions/wp_slash) wp-includes/formatting.php | Adds slashes to a string or recursively adds slashes to strings within an array. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_multisite()](../../functions/is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [do\_action()](../../functions/do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [rest\_url()](../../functions/rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::update_current_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Users\_Controller::update\_current\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
==============================================================================================================
Updates the current user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function update_current_item( $request ) {
$request['id'] = get_current_user_id();
return $this->update_item( $request );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::update\_item()](update_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates a single user. |
| [get\_current\_user\_id()](../../functions/get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::update_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Users\_Controller::update\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
=====================================================================================================
Updates a single user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function update_item( $request ) {
$user = $this->get_user( $request['id'] );
if ( is_wp_error( $user ) ) {
return $user;
}
$id = $user->ID;
if ( ! $user ) {
return new WP_Error(
'rest_user_invalid_id',
__( 'Invalid user ID.' ),
array( 'status' => 404 )
);
}
$owner_id = false;
if ( is_string( $request['email'] ) ) {
$owner_id = email_exists( $request['email'] );
}
if ( $owner_id && $owner_id !== $id ) {
return new WP_Error(
'rest_user_invalid_email',
__( 'Invalid email address.' ),
array( 'status' => 400 )
);
}
if ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) {
return new WP_Error(
'rest_user_invalid_argument',
__( 'Username is not editable.' ),
array( 'status' => 400 )
);
}
if ( ! empty( $request['slug'] ) && $request['slug'] !== $user->user_nicename && get_user_by( 'slug', $request['slug'] ) ) {
return new WP_Error(
'rest_user_invalid_slug',
__( 'Invalid slug.' ),
array( 'status' => 400 )
);
}
if ( ! empty( $request['roles'] ) ) {
$check_permission = $this->check_role_update( $id, $request['roles'] );
if ( is_wp_error( $check_permission ) ) {
return $check_permission;
}
}
$user = $this->prepare_item_for_database( $request );
// Ensure we're operating on the same user we already checked.
$user->ID = $id;
$user_id = wp_update_user( wp_slash( (array) $user ) );
if ( is_wp_error( $user_id ) ) {
return $user_id;
}
$user = get_user_by( 'id', $user_id );
/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */
do_action( 'rest_insert_user', $user, $request, false );
if ( ! empty( $request['roles'] ) ) {
array_map( array( $user, 'add_role' ), $request['roles'] );
}
$schema = $this->get_item_schema();
if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {
$meta_update = $this->meta->update_value( $request['meta'], $id );
if ( is_wp_error( $meta_update ) ) {
return $meta_update;
}
}
$user = get_user_by( 'id', $user_id );
$fields_update = $this->update_additional_fields_for_object( $user, $request );
if ( is_wp_error( $fields_update ) ) {
return $fields_update;
}
$request->set_param( 'context', 'edit' );
/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */
do_action( 'rest_after_insert_user', $user, $request, false );
$response = $this->prepare_item_for_response( $user, $request );
$response = rest_ensure_response( $response );
return $response;
}
```
[do\_action( 'rest\_after\_insert\_user', WP\_User $user, WP\_REST\_Request $request, bool $creating )](../../hooks/rest_after_insert_user)
Fires after a user is completely created or updated via the REST API.
[do\_action( 'rest\_insert\_user', WP\_User $user, WP\_REST\_Request $request, bool $creating )](../../hooks/rest_insert_user)
Fires immediately after a user is created or updated via the REST API.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_user()](get_user) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Get the user, if the ID is valid. |
| [WP\_REST\_Users\_Controller::get\_item\_schema()](get_item_schema) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves the user’s schema, conforming to JSON Schema. |
| [WP\_REST\_Users\_Controller::check\_role\_update()](check_role_update) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Determines if the current user is allowed to make the desired roles change. |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_database()](prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user for creation or update. |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user output for response. |
| [get\_user\_by()](../../functions/get_user_by) wp-includes/pluggable.php | Retrieves user info by a given field. |
| [wp\_update\_user()](../../functions/wp_update_user) wp-includes/user.php | Updates a user in the database. |
| [email\_exists()](../../functions/email_exists) wp-includes/user.php | Determines whether the given email exists. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_slash()](../../functions/wp_slash) wp-includes/formatting.php | Adds slashes to a string or recursively adds slashes to strings within an array. |
| [do\_action()](../../functions/do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::update\_current\_item()](update_current_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates the current user. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::delete_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Users\_Controller::delete\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
===========================================================================================================
Checks if a given request has access delete a user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has access to delete the item, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function delete_item_permissions_check( $request ) {
$user = $this->get_user( $request['id'] );
if ( is_wp_error( $user ) ) {
return $user;
}
if ( ! current_user_can( 'delete_user', $user->ID ) ) {
return new WP_Error(
'rest_user_cannot_delete',
__( 'Sorry, you are not allowed to delete this user.' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_user()](get_user) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Get the user, if the ID is valid. |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::delete\_current\_item\_permissions\_check()](delete_current_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Checks if a given request has access to delete the current user. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
| programming_docs |
wordpress WP_REST_Users_Controller::delete_current_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Users\_Controller::delete\_current\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
==============================================================================================================
Deletes the current user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function delete_current_item( $request ) {
$request['id'] = get_current_user_id();
return $this->delete_item( $request );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::delete\_item()](delete_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Deletes a single user. |
| [get\_current\_user\_id()](../../functions/get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::prepare_item_for_database( WP_REST_Request $request ): object WP\_REST\_Users\_Controller::prepare\_item\_for\_database( WP\_REST\_Request $request ): object
===============================================================================================
Prepares a single user for creation or update.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Request object. object User object.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
protected function prepare_item_for_database( $request ) {
$prepared_user = new stdClass;
$schema = $this->get_item_schema();
// Required arguments.
if ( isset( $request['email'] ) && ! empty( $schema['properties']['email'] ) ) {
$prepared_user->user_email = $request['email'];
}
if ( isset( $request['username'] ) && ! empty( $schema['properties']['username'] ) ) {
$prepared_user->user_login = $request['username'];
}
if ( isset( $request['password'] ) && ! empty( $schema['properties']['password'] ) ) {
$prepared_user->user_pass = $request['password'];
}
// Optional arguments.
if ( isset( $request['id'] ) ) {
$prepared_user->ID = absint( $request['id'] );
}
if ( isset( $request['name'] ) && ! empty( $schema['properties']['name'] ) ) {
$prepared_user->display_name = $request['name'];
}
if ( isset( $request['first_name'] ) && ! empty( $schema['properties']['first_name'] ) ) {
$prepared_user->first_name = $request['first_name'];
}
if ( isset( $request['last_name'] ) && ! empty( $schema['properties']['last_name'] ) ) {
$prepared_user->last_name = $request['last_name'];
}
if ( isset( $request['nickname'] ) && ! empty( $schema['properties']['nickname'] ) ) {
$prepared_user->nickname = $request['nickname'];
}
if ( isset( $request['slug'] ) && ! empty( $schema['properties']['slug'] ) ) {
$prepared_user->user_nicename = $request['slug'];
}
if ( isset( $request['description'] ) && ! empty( $schema['properties']['description'] ) ) {
$prepared_user->description = $request['description'];
}
if ( isset( $request['url'] ) && ! empty( $schema['properties']['url'] ) ) {
$prepared_user->user_url = $request['url'];
}
if ( isset( $request['locale'] ) && ! empty( $schema['properties']['locale'] ) ) {
$prepared_user->locale = $request['locale'];
}
// Setting roles will be handled outside of this function.
if ( isset( $request['roles'] ) ) {
$prepared_user->role = false;
}
/**
* Filters user data before insertion via the REST API.
*
* @since 4.7.0
*
* @param object $prepared_user User object.
* @param WP_REST_Request $request Request object.
*/
return apply_filters( 'rest_pre_insert_user', $prepared_user, $request );
}
```
[apply\_filters( 'rest\_pre\_insert\_user', object $prepared\_user, WP\_REST\_Request $request )](../../hooks/rest_pre_insert_user)
Filters user data before insertion via the REST API.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_item\_schema()](get_item_schema) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves the user’s schema, conforming to JSON Schema. |
| [absint()](../../functions/absint) wp-includes/functions.php | Converts a value to non-negative integer. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::create\_item()](create_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Creates a single user. |
| [WP\_REST\_Users\_Controller::update\_item()](update_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates a single user. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::get_items_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Users\_Controller::get\_items\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
=========================================================================================================
Permissions check for getting all users.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has read access, otherwise [WP\_Error](../wp_error) object.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function get_items_permissions_check( $request ) {
// Check if roles is specified in GET request and if user can list users.
if ( ! empty( $request['roles'] ) && ! current_user_can( 'list_users' ) ) {
return new WP_Error(
'rest_user_cannot_view',
__( 'Sorry, you are not allowed to filter users by role.' ),
array( 'status' => rest_authorization_required_code() )
);
}
// Check if capabilities is specified in GET request and if user can list users.
if ( ! empty( $request['capabilities'] ) && ! current_user_can( 'list_users' ) ) {
return new WP_Error(
'rest_user_cannot_view',
__( 'Sorry, you are not allowed to filter users by capability.' ),
array( 'status' => rest_authorization_required_code() )
);
}
if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {
return new WP_Error(
'rest_forbidden_context',
__( 'Sorry, you are not allowed to list users.' ),
array( 'status' => rest_authorization_required_code() )
);
}
if ( in_array( $request['orderby'], array( 'email', 'registered_date' ), true ) && ! current_user_can( 'list_users' ) ) {
return new WP_Error(
'rest_forbidden_orderby',
__( 'Sorry, you are not allowed to order users by this parameter.' ),
array( 'status' => rest_authorization_required_code() )
);
}
if ( 'authors' === $request['who'] ) {
$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );
foreach ( $types as $type ) {
if ( post_type_supports( $type->name, 'author' )
&& current_user_can( $type->cap->edit_posts ) ) {
return true;
}
}
return new WP_Error(
'rest_forbidden_who',
__( 'Sorry, you are not allowed to query users by this parameter.' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [post\_type\_supports()](../../functions/post_type_supports) wp-includes/post.php | Checks a post type’s support for a given feature. |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_post\_types()](../../functions/get_post_types) wp-includes/post.php | Gets a list of all registered post type objects. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::check_reassign( int|bool $value, WP_REST_Request $request, string $param ): int|bool|WP_Error WP\_REST\_Users\_Controller::check\_reassign( int|bool $value, WP\_REST\_Request $request, string $param ): int|bool|WP\_Error
==============================================================================================================================
Checks for a valid value for the reassign parameter when deleting users.
The value can be an integer, ‘false’, false, or ”.
`$value` int|bool Required The value passed to the reassign parameter. `$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. `$param` string Required The parameter that is being sanitized. int|bool|[WP\_Error](../wp_error)
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function check_reassign( $value, $request, $param ) {
if ( is_numeric( $value ) ) {
return $value;
}
if ( empty( $value ) || false === $value || 'false' === $value ) {
return false;
}
return new WP_Error(
'rest_invalid_param',
__( 'Invalid user parameter(s).' ),
array( 'status' => 400 )
);
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::update_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Users\_Controller::update\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
===========================================================================================================
Checks if a given request has access to update a user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has access to update the item, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function update_item_permissions_check( $request ) {
$user = $this->get_user( $request['id'] );
if ( is_wp_error( $user ) ) {
return $user;
}
if ( ! empty( $request['roles'] ) ) {
if ( ! current_user_can( 'promote_user', $user->ID ) ) {
return new WP_Error(
'rest_cannot_edit_roles',
__( 'Sorry, you are not allowed to edit roles of this user.' ),
array( 'status' => rest_authorization_required_code() )
);
}
$request_params = array_keys( $request->get_params() );
sort( $request_params );
// If only 'id' and 'roles' are specified (we are only trying to
// edit roles), then only the 'promote_user' cap is required.
if ( array( 'id', 'roles' ) === $request_params ) {
return true;
}
}
if ( ! current_user_can( 'edit_user', $user->ID ) ) {
return new WP_Error(
'rest_cannot_edit',
__( 'Sorry, you are not allowed to edit this user.' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_user()](get_user) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Get the user, if the ID is valid. |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::update\_current\_item\_permissions\_check()](update_current_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Checks if a given request has access to update the current user. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::update_current_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Users\_Controller::update\_current\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
====================================================================================================================
Checks if a given request has access to update the current user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has access to update the item, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function update_current_item_permissions_check( $request ) {
$request['id'] = get_current_user_id();
return $this->update_item_permissions_check( $request );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::update\_item\_permissions\_check()](update_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Checks if a given request has access to update a user. |
| [get\_current\_user\_id()](../../functions/get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::get_user( int $id ): WP_User|WP_Error WP\_REST\_Users\_Controller::get\_user( int $id ): WP\_User|WP\_Error
=====================================================================
Get the user, if the ID is valid.
`$id` int Required Supplied ID. [WP\_User](../wp_user)|[WP\_Error](../wp_error) True if ID is valid, [WP\_Error](../wp_error) otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
protected function get_user( $id ) {
$error = new WP_Error(
'rest_user_invalid_id',
__( 'Invalid user ID.' ),
array( 'status' => 404 )
);
if ( (int) $id <= 0 ) {
return $error;
}
$user = get_userdata( (int) $id );
if ( empty( $user ) || ! $user->exists() ) {
return $error;
}
if ( is_multisite() && ! is_user_member_of_blog( $user->ID ) ) {
return $error;
}
return $user;
}
```
| Uses | Description |
| --- | --- |
| [is\_user\_member\_of\_blog()](../../functions/is_user_member_of_blog) wp-includes/user.php | Finds out whether a user is a member of a given blog. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_userdata()](../../functions/get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| [is\_multisite()](../../functions/is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::delete\_item\_permissions\_check()](delete_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Checks if a given request has access delete a user. |
| [WP\_REST\_Users\_Controller::delete\_item()](delete_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Deletes a single user. |
| [WP\_REST\_Users\_Controller::get\_item()](get_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves a single user. |
| [WP\_REST\_Users\_Controller::update\_item\_permissions\_check()](update_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Checks if a given request has access to update a user. |
| [WP\_REST\_Users\_Controller::update\_item()](update_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates a single user. |
| [WP\_REST\_Users\_Controller::get\_item\_permissions\_check()](get_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Checks if a given request has access to read a user. |
| Version | Description |
| --- | --- |
| [4.7.2](https://developer.wordpress.org/reference/since/4.7.2/) | Introduced. |
wordpress WP_REST_Users_Controller::register_routes() WP\_REST\_Users\_Controller::register\_routes()
===============================================
Registers the routes for users.
* [register\_rest\_route()](../../functions/register_rest_route)
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->rest_base,
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
'args' => $this->get_collection_params(),
),
array(
'methods' => WP_REST_Server::CREATABLE,
'callback' => array( $this, 'create_item' ),
'permission_callback' => array( $this, 'create_item_permissions_check' ),
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/(?P<id>[\d]+)',
array(
'args' => array(
'id' => array(
'description' => __( 'Unique identifier for the user.' ),
'type' => 'integer',
),
),
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item' ),
'permission_callback' => array( $this, 'get_item_permissions_check' ),
'args' => array(
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
),
),
array(
'methods' => WP_REST_Server::EDITABLE,
'callback' => array( $this, 'update_item' ),
'permission_callback' => array( $this, 'update_item_permissions_check' ),
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
),
array(
'methods' => WP_REST_Server::DELETABLE,
'callback' => array( $this, 'delete_item' ),
'permission_callback' => array( $this, 'delete_item_permissions_check' ),
'args' => array(
'force' => array(
'type' => 'boolean',
'default' => false,
'description' => __( 'Required to be true, as users do not support trashing.' ),
),
'reassign' => array(
'type' => 'integer',
'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ),
'required' => true,
'sanitize_callback' => array( $this, 'check_reassign' ),
),
),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/me',
array(
array(
'methods' => WP_REST_Server::READABLE,
'permission_callback' => '__return_true',
'callback' => array( $this, 'get_current_item' ),
'args' => array(
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
),
),
array(
'methods' => WP_REST_Server::EDITABLE,
'callback' => array( $this, 'update_current_item' ),
'permission_callback' => array( $this, 'update_current_item_permissions_check' ),
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
),
array(
'methods' => WP_REST_Server::DELETABLE,
'callback' => array( $this, 'delete_current_item' ),
'permission_callback' => array( $this, 'delete_current_item_permissions_check' ),
'args' => array(
'force' => array(
'type' => 'boolean',
'default' => false,
'description' => __( 'Required to be true, as users do not support trashing.' ),
),
'reassign' => array(
'type' => 'integer',
'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ),
'required' => true,
'sanitize_callback' => array( $this, 'check_reassign' ),
),
),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_collection\_params()](get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves the query params for collections. |
| [register\_rest\_route()](../../functions/register_rest_route) wp-includes/rest-api.php | Registers a REST API route. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
| programming_docs |
wordpress WP_REST_Users_Controller::check_role_update( int $user_id, array $roles ): true|WP_Error WP\_REST\_Users\_Controller::check\_role\_update( int $user\_id, array $roles ): true|WP\_Error
===============================================================================================
Determines if the current user is allowed to make the desired roles change.
`$user_id` int Required User ID. `$roles` array Required New user roles. true|[WP\_Error](../wp_error) True if the current user is allowed to make the role change, otherwise a [WP\_Error](../wp_error) object.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
protected function check_role_update( $user_id, $roles ) {
global $wp_roles;
foreach ( $roles as $role ) {
if ( ! isset( $wp_roles->role_objects[ $role ] ) ) {
return new WP_Error(
'rest_user_invalid_role',
/* translators: %s: Role key. */
sprintf( __( 'The role %s does not exist.' ), $role ),
array( 'status' => 400 )
);
}
$potential_role = $wp_roles->role_objects[ $role ];
/*
* Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
* Multisite super admins can freely edit their blog roles -- they possess all caps.
*/
if ( ! ( is_multisite()
&& current_user_can( 'manage_sites' ) )
&& get_current_user_id() === $user_id
&& ! $potential_role->has_cap( 'edit_users' )
) {
return new WP_Error(
'rest_user_invalid_role',
__( 'Sorry, you are not allowed to give users that role.' ),
array( 'status' => rest_authorization_required_code() )
);
}
// Include user admin functions to get access to get_editable_roles().
require_once ABSPATH . 'wp-admin/includes/user.php';
// The new role must be editable by the logged-in user.
$editable_roles = get_editable_roles();
if ( empty( $editable_roles[ $role ] ) ) {
return new WP_Error(
'rest_user_invalid_role',
__( 'Sorry, you are not allowed to give users that role.' ),
array( 'status' => 403 )
);
}
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [get\_editable\_roles()](../../functions/get_editable_roles) wp-admin/includes/user.php | Fetch a filtered list of user roles that the current user is allowed to edit. |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_multisite()](../../functions/is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [get\_current\_user\_id()](../../functions/get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::create\_item()](create_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Creates a single user. |
| [WP\_REST\_Users\_Controller::update\_item()](update_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates a single user. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::get_collection_params(): array WP\_REST\_Users\_Controller::get\_collection\_params(): array
=============================================================
Retrieves the query params for collections.
array Collection parameters.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function get_collection_params() {
$query_params = parent::get_collection_params();
$query_params['context']['default'] = 'view';
$query_params['exclude'] = array(
'description' => __( 'Ensure result set excludes specific IDs.' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
),
'default' => array(),
);
$query_params['include'] = array(
'description' => __( 'Limit result set to specific IDs.' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
),
'default' => array(),
);
$query_params['offset'] = array(
'description' => __( 'Offset the result set by a specific number of items.' ),
'type' => 'integer',
);
$query_params['order'] = array(
'default' => 'asc',
'description' => __( 'Order sort attribute ascending or descending.' ),
'enum' => array( 'asc', 'desc' ),
'type' => 'string',
);
$query_params['orderby'] = array(
'default' => 'name',
'description' => __( 'Sort collection by user attribute.' ),
'enum' => array(
'id',
'include',
'name',
'registered_date',
'slug',
'include_slugs',
'email',
'url',
),
'type' => 'string',
);
$query_params['slug'] = array(
'description' => __( 'Limit result set to users with one or more specific slugs.' ),
'type' => 'array',
'items' => array(
'type' => 'string',
),
);
$query_params['roles'] = array(
'description' => __( 'Limit result set to users matching at least one specific role provided. Accepts csv list or single role.' ),
'type' => 'array',
'items' => array(
'type' => 'string',
),
);
$query_params['capabilities'] = array(
'description' => __( 'Limit result set to users matching at least one specific capability provided. Accepts csv list or single capability.' ),
'type' => 'array',
'items' => array(
'type' => 'string',
),
);
$query_params['who'] = array(
'description' => __( 'Limit result set to users who are considered authors.' ),
'type' => 'string',
'enum' => array(
'authors',
),
);
$query_params['has_published_posts'] = array(
'description' => __( 'Limit result set to users who have published posts.' ),
'type' => array( 'boolean', 'array' ),
'items' => array(
'type' => 'string',
'enum' => get_post_types( array( 'show_in_rest' => true ), 'names' ),
),
);
/**
* Filters REST API collection parameters for the users controller.
*
* This filter registers the collection parameter, but does not map the
* collection parameter to an internal WP_User_Query parameter. Use the
* `rest_user_query` filter to set WP_User_Query arguments.
*
* @since 4.7.0
*
* @param array $query_params JSON Schema-formatted collection parameters.
*/
return apply_filters( 'rest_user_collection_params', $query_params );
}
```
[apply\_filters( 'rest\_user\_collection\_params', array $query\_params )](../../hooks/rest_user_collection_params)
Filters REST API collection parameters for the users controller.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Controller::get\_collection\_params()](../wp_rest_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-controller.php | Retrieves the query params for the collections. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post\_types()](../../functions/get_post_types) wp-includes/post.php | Gets a list of all registered post type objects. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::register\_routes()](register_routes) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Registers the routes for users. |
| [WP\_REST\_Users\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves all users. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::__construct() WP\_REST\_Users\_Controller::\_\_construct()
============================================
Constructor.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function __construct() {
$this->namespace = 'wp/v2';
$this->rest_base = 'users';
$this->meta = new WP_REST_User_Meta_Fields();
}
```
| Used By | Description |
| --- | --- |
| [create\_initial\_rest\_routes()](../../functions/create_initial_rest_routes) wp-includes/rest-api.php | Registers default REST API routes. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::get_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Users\_Controller::get\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
========================================================================================================
Checks if a given request has access to read a user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has read access for the item, otherwise [WP\_Error](../wp_error) object.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function get_item_permissions_check( $request ) {
$user = $this->get_user( $request['id'] );
if ( is_wp_error( $user ) ) {
return $user;
}
$types = get_post_types( array( 'show_in_rest' => true ), 'names' );
if ( get_current_user_id() === $user->ID ) {
return true;
}
if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {
return new WP_Error(
'rest_user_cannot_view',
__( 'Sorry, you are not allowed to list users.' ),
array( 'status' => rest_authorization_required_code() )
);
} elseif ( ! count_user_posts( $user->ID, $types ) && ! current_user_can( 'edit_user', $user->ID ) && ! current_user_can( 'list_users' ) ) {
return new WP_Error(
'rest_user_cannot_view',
__( 'Sorry, you are not allowed to list users.' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_user()](get_user) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Get the user, if the ID is valid. |
| [count\_user\_posts()](../../functions/count_user_posts) wp-includes/user.php | Gets the number of posts a user has written. |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_current\_user\_id()](../../functions/get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| [get\_post\_types()](../../functions/get_post_types) wp-includes/post.php | Gets a list of all registered post type objects. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::create_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Users\_Controller::create\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
===========================================================================================================
Checks if a given request has access create users.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has access to create items, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function create_item_permissions_check( $request ) {
if ( ! current_user_can( 'create_users' ) ) {
return new WP_Error(
'rest_cannot_create_user',
__( 'Sorry, you are not allowed to create new users.' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::delete_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Users\_Controller::delete\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
=====================================================================================================
Deletes a single user.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function delete_item( $request ) {
// We don't support delete requests in multisite.
if ( is_multisite() ) {
return new WP_Error(
'rest_cannot_delete',
__( 'The user cannot be deleted.' ),
array( 'status' => 501 )
);
}
$user = $this->get_user( $request['id'] );
if ( is_wp_error( $user ) ) {
return $user;
}
$id = $user->ID;
$reassign = false === $request['reassign'] ? null : absint( $request['reassign'] );
$force = isset( $request['force'] ) ? (bool) $request['force'] : false;
// We don't support trashing for users.
if ( ! $force ) {
return new WP_Error(
'rest_trash_not_supported',
/* translators: %s: force=true */
sprintf( __( "Users do not support trashing. Set '%s' to delete." ), 'force=true' ),
array( 'status' => 501 )
);
}
if ( ! empty( $reassign ) ) {
if ( $reassign === $id || ! get_userdata( $reassign ) ) {
return new WP_Error(
'rest_user_invalid_reassign',
__( 'Invalid user ID for reassignment.' ),
array( 'status' => 400 )
);
}
}
$request->set_param( 'context', 'edit' );
$previous = $this->prepare_item_for_response( $user, $request );
// Include user admin functions to get access to wp_delete_user().
require_once ABSPATH . 'wp-admin/includes/user.php';
$result = wp_delete_user( $id, $reassign );
if ( ! $result ) {
return new WP_Error(
'rest_cannot_delete',
__( 'The user cannot be deleted.' ),
array( 'status' => 500 )
);
}
$response = new WP_REST_Response();
$response->set_data(
array(
'deleted' => true,
'previous' => $previous->get_data(),
)
);
/**
* Fires immediately after a user is deleted via the REST API.
*
* @since 4.7.0
*
* @param WP_User $user The user data.
* @param WP_REST_Response $response The response returned from the API.
* @param WP_REST_Request $request The request sent to the API.
*/
do_action( 'rest_delete_user', $user, $response, $request );
return $response;
}
```
[do\_action( 'rest\_delete\_user', WP\_User $user, WP\_REST\_Response $response, WP\_REST\_Request $request )](../../hooks/rest_delete_user)
Fires immediately after a user is deleted via the REST API.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_user()](get_user) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Get the user, if the ID is valid. |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user output for response. |
| [wp\_delete\_user()](../../functions/wp_delete_user) wp-admin/includes/user.php | Remove user and optionally reassign posts and links to another user. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_userdata()](../../functions/get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| [is\_multisite()](../../functions/is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [absint()](../../functions/absint) wp-includes/functions.php | Converts a value to non-negative integer. |
| [do\_action()](../../functions/do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::delete\_current\_item()](delete_current_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Deletes the current user. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Users_Controller::get_item_schema(): array WP\_REST\_Users\_Controller::get\_item\_schema(): array
=======================================================
Retrieves the user’s schema, conforming to JSON Schema.
array Item schema data.
File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
public function get_item_schema() {
if ( $this->schema ) {
return $this->add_additional_fields_schema( $this->schema );
}
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'user',
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Unique identifier for the user.' ),
'type' => 'integer',
'context' => array( 'embed', 'view', 'edit' ),
'readonly' => true,
),
'username' => array(
'description' => __( 'Login name for the user.' ),
'type' => 'string',
'context' => array( 'edit' ),
'required' => true,
'arg_options' => array(
'sanitize_callback' => array( $this, 'check_username' ),
),
),
'name' => array(
'description' => __( 'Display name for the user.' ),
'type' => 'string',
'context' => array( 'embed', 'view', 'edit' ),
'arg_options' => array(
'sanitize_callback' => 'sanitize_text_field',
),
),
'first_name' => array(
'description' => __( 'First name for the user.' ),
'type' => 'string',
'context' => array( 'edit' ),
'arg_options' => array(
'sanitize_callback' => 'sanitize_text_field',
),
),
'last_name' => array(
'description' => __( 'Last name for the user.' ),
'type' => 'string',
'context' => array( 'edit' ),
'arg_options' => array(
'sanitize_callback' => 'sanitize_text_field',
),
),
'email' => array(
'description' => __( 'The email address for the user.' ),
'type' => 'string',
'format' => 'email',
'context' => array( 'edit' ),
'required' => true,
),
'url' => array(
'description' => __( 'URL of the user.' ),
'type' => 'string',
'format' => 'uri',
'context' => array( 'embed', 'view', 'edit' ),
),
'description' => array(
'description' => __( 'Description of the user.' ),
'type' => 'string',
'context' => array( 'embed', 'view', 'edit' ),
),
'link' => array(
'description' => __( 'Author URL of the user.' ),
'type' => 'string',
'format' => 'uri',
'context' => array( 'embed', 'view', 'edit' ),
'readonly' => true,
),
'locale' => array(
'description' => __( 'Locale for the user.' ),
'type' => 'string',
'enum' => array_merge( array( '', 'en_US' ), get_available_languages() ),
'context' => array( 'edit' ),
),
'nickname' => array(
'description' => __( 'The nickname for the user.' ),
'type' => 'string',
'context' => array( 'edit' ),
'arg_options' => array(
'sanitize_callback' => 'sanitize_text_field',
),
),
'slug' => array(
'description' => __( 'An alphanumeric identifier for the user.' ),
'type' => 'string',
'context' => array( 'embed', 'view', 'edit' ),
'arg_options' => array(
'sanitize_callback' => array( $this, 'sanitize_slug' ),
),
),
'registered_date' => array(
'description' => __( 'Registration date for the user.' ),
'type' => 'string',
'format' => 'date-time',
'context' => array( 'edit' ),
'readonly' => true,
),
'roles' => array(
'description' => __( 'Roles assigned to the user.' ),
'type' => 'array',
'items' => array(
'type' => 'string',
),
'context' => array( 'edit' ),
),
'password' => array(
'description' => __( 'Password for the user (never included).' ),
'type' => 'string',
'context' => array(), // Password is never displayed.
'required' => true,
'arg_options' => array(
'sanitize_callback' => array( $this, 'check_user_password' ),
),
),
'capabilities' => array(
'description' => __( 'All capabilities assigned to the user.' ),
'type' => 'object',
'context' => array( 'edit' ),
'readonly' => true,
),
'extra_capabilities' => array(
'description' => __( 'Any extra capabilities assigned to the user.' ),
'type' => 'object',
'context' => array( 'edit' ),
'readonly' => true,
),
),
);
if ( get_option( 'show_avatars' ) ) {
$avatar_properties = array();
$avatar_sizes = rest_get_avatar_sizes();
foreach ( $avatar_sizes as $size ) {
$avatar_properties[ $size ] = array(
/* translators: %d: Avatar image size in pixels. */
'description' => sprintf( __( 'Avatar URL with image size of %d pixels.' ), $size ),
'type' => 'string',
'format' => 'uri',
'context' => array( 'embed', 'view', 'edit' ),
);
}
$schema['properties']['avatar_urls'] = array(
'description' => __( 'Avatar URLs for the user.' ),
'type' => 'object',
'context' => array( 'embed', 'view', 'edit' ),
'readonly' => true,
'properties' => $avatar_properties,
);
}
$schema['properties']['meta'] = $this->meta->get_field_schema();
$this->schema = $schema;
return $this->add_additional_fields_schema( $this->schema );
}
```
| Uses | Description |
| --- | --- |
| [rest\_get\_avatar\_sizes()](../../functions/rest_get_avatar_sizes) wp-includes/rest-api.php | Retrieves the pixel sizes for avatars. |
| [get\_available\_languages()](../../functions/get_available_languages) wp-includes/l10n.php | Gets all available languages based on the presence of \*.mo files in a given directory. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_option()](../../functions/get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_database()](prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user for creation or update. |
| [WP\_REST\_Users\_Controller::create\_item()](create_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Creates a single user. |
| [WP\_REST\_Users\_Controller::update\_item()](update_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates a single user. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
| programming_docs |
wordpress WP_REST_Revisions_Controller::get_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Revisions\_Controller::get\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
======================================================================================================
Retrieves one revision from the collection.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function get_item( $request ) {
$parent = $this->get_parent( $request['parent'] );
if ( is_wp_error( $parent ) ) {
return $parent;
}
$revision = $this->get_revision( $request['id'] );
if ( is_wp_error( $revision ) ) {
return $revision;
}
$response = $this->prepare_item_for_response( $revision, $request );
return rest_ensure_response( $response );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_revision()](get_revision) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Get the revision, if the ID is valid. |
| [WP\_REST\_Revisions\_Controller::get\_parent()](get_parent) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Get the parent post, if the ID is valid. |
| [WP\_REST\_Revisions\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Prepares the revision for the REST response. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::prepare_item_for_response( WP_Post $item, WP_REST_Request $request ): WP_REST_Response WP\_REST\_Revisions\_Controller::prepare\_item\_for\_response( WP\_Post $item, WP\_REST\_Request $request ): WP\_REST\_Response
===============================================================================================================================
Prepares the revision for the REST response.
`$item` [WP\_Post](../wp_post) Required Post revision object. `$request` [WP\_REST\_Request](../wp_rest_request) Required Request object. [WP\_REST\_Response](../wp_rest_response) Response object.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function prepare_item_for_response( $item, $request ) {
// Restores the more descriptive, specific name for use within this method.
$post = $item;
$GLOBALS['post'] = $post;
setup_postdata( $post );
$fields = $this->get_fields_for_response( $request );
$data = array();
if ( in_array( 'author', $fields, true ) ) {
$data['author'] = (int) $post->post_author;
}
if ( in_array( 'date', $fields, true ) ) {
$data['date'] = $this->prepare_date_response( $post->post_date_gmt, $post->post_date );
}
if ( in_array( 'date_gmt', $fields, true ) ) {
$data['date_gmt'] = $this->prepare_date_response( $post->post_date_gmt );
}
if ( in_array( 'id', $fields, true ) ) {
$data['id'] = $post->ID;
}
if ( in_array( 'modified', $fields, true ) ) {
$data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified );
}
if ( in_array( 'modified_gmt', $fields, true ) ) {
$data['modified_gmt'] = $this->prepare_date_response( $post->post_modified_gmt );
}
if ( in_array( 'parent', $fields, true ) ) {
$data['parent'] = (int) $post->post_parent;
}
if ( in_array( 'slug', $fields, true ) ) {
$data['slug'] = $post->post_name;
}
if ( in_array( 'guid', $fields, true ) ) {
$data['guid'] = array(
/** This filter is documented in wp-includes/post-template.php */
'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),
'raw' => $post->guid,
);
}
if ( in_array( 'title', $fields, true ) ) {
$data['title'] = array(
'raw' => $post->post_title,
'rendered' => get_the_title( $post->ID ),
);
}
if ( in_array( 'content', $fields, true ) ) {
$data['content'] = array(
'raw' => $post->post_content,
/** This filter is documented in wp-includes/post-template.php */
'rendered' => apply_filters( 'the_content', $post->post_content ),
);
}
if ( in_array( 'excerpt', $fields, true ) ) {
$data['excerpt'] = array(
'raw' => $post->post_excerpt,
'rendered' => $this->prepare_excerpt_response( $post->post_excerpt, $post ),
);
}
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
$data = $this->add_additional_fields_to_object( $data, $request );
$data = $this->filter_response_by_context( $data, $context );
$response = rest_ensure_response( $data );
if ( ! empty( $data['parent'] ) ) {
$response->add_link( 'parent', rest_url( rest_get_route_for_post( $data['parent'] ) ) );
}
/**
* Filters a revision returned from the REST API.
*
* Allows modification of the revision right before it is returned.
*
* @since 4.7.0
*
* @param WP_REST_Response $response The response object.
* @param WP_Post $post The original revision object.
* @param WP_REST_Request $request Request used to generate the response.
*/
return apply_filters( 'rest_prepare_revision', $response, $post, $request );
}
```
[apply\_filters( 'get\_the\_guid', string $post\_guid, int $post\_id )](../../hooks/get_the_guid)
Filters the Global Unique Identifier (guid) of the post.
[apply\_filters( 'rest\_prepare\_revision', WP\_REST\_Response $response, WP\_Post $post, WP\_REST\_Request $request )](../../hooks/rest_prepare_revision)
Filters a revision returned from the REST API.
[apply\_filters( 'the\_content', string $content )](../../hooks/the_content)
Filters the post content.
| Uses | Description |
| --- | --- |
| [rest\_get\_route\_for\_post()](../../functions/rest_get_route_for_post) wp-includes/rest-api.php | Gets the REST API route for a post. |
| [WP\_REST\_Revisions\_Controller::prepare\_date\_response()](prepare_date_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks the post\_date\_gmt or modified\_gmt and prepare any post or modified date for single post output. |
| [WP\_REST\_Revisions\_Controller::prepare\_excerpt\_response()](prepare_excerpt_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks the post excerpt and prepare it for single post output. |
| [setup\_postdata()](../../functions/setup_postdata) wp-includes/query.php | Set up global post data. |
| [get\_the\_title()](../../functions/get_the_title) wp-includes/post-template.php | Retrieves the post title. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [rest\_url()](../../functions/rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_item()](get_item) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Retrieves one revision from the collection. |
| [WP\_REST\_Revisions\_Controller::delete\_item()](delete_item) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Deletes a single revision. |
| [WP\_REST\_Revisions\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Gets a collection of revisions. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::prepare_excerpt_response( string $excerpt, WP_Post $post ): string WP\_REST\_Revisions\_Controller::prepare\_excerpt\_response( string $excerpt, WP\_Post $post ): string
======================================================================================================
Checks the post excerpt and prepare it for single post output.
`$excerpt` string Required The post excerpt. `$post` [WP\_Post](../wp_post) Required Post revision object. string Prepared excerpt or empty string.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
protected function prepare_excerpt_response( $excerpt, $post ) {
/** This filter is documented in wp-includes/post-template.php */
$excerpt = apply_filters( 'the_excerpt', $excerpt, $post );
if ( empty( $excerpt ) ) {
return '';
}
return $excerpt;
}
```
[apply\_filters( 'the\_excerpt', string $post\_excerpt )](../../hooks/the_excerpt)
Filters the displayed post excerpt.
| Uses | Description |
| --- | --- |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Prepares the revision for the REST response. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::get_items( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Revisions\_Controller::get\_items( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
=======================================================================================================
Gets a collection of revisions.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function get_items( $request ) {
$parent = $this->get_parent( $request['parent'] );
if ( is_wp_error( $parent ) ) {
return $parent;
}
// Ensure a search string is set in case the orderby is set to 'relevance'.
if ( ! empty( $request['orderby'] ) && 'relevance' === $request['orderby'] && empty( $request['search'] ) ) {
return new WP_Error(
'rest_no_search_term_defined',
__( 'You need to define a search term to order by relevance.' ),
array( 'status' => 400 )
);
}
// Ensure an include parameter is set in case the orderby is set to 'include'.
if ( ! empty( $request['orderby'] ) && 'include' === $request['orderby'] && empty( $request['include'] ) ) {
return new WP_Error(
'rest_orderby_include_missing_include',
__( 'You need to define an include parameter to order by include.' ),
array( 'status' => 400 )
);
}
if ( wp_revisions_enabled( $parent ) ) {
$registered = $this->get_collection_params();
$args = array(
'post_parent' => $parent->ID,
'post_type' => 'revision',
'post_status' => 'inherit',
'posts_per_page' => -1,
'orderby' => 'date ID',
'order' => 'DESC',
'suppress_filters' => true,
);
$parameter_mappings = array(
'exclude' => 'post__not_in',
'include' => 'post__in',
'offset' => 'offset',
'order' => 'order',
'orderby' => 'orderby',
'page' => 'paged',
'per_page' => 'posts_per_page',
'search' => 's',
);
foreach ( $parameter_mappings as $api_param => $wp_param ) {
if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {
$args[ $wp_param ] = $request[ $api_param ];
}
}
// For backward-compatibility, 'date' needs to resolve to 'date ID'.
if ( isset( $args['orderby'] ) && 'date' === $args['orderby'] ) {
$args['orderby'] = 'date ID';
}
/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
$args = apply_filters( 'rest_revision_query', $args, $request );
$query_args = $this->prepare_items_query( $args, $request );
$revisions_query = new WP_Query();
$revisions = $revisions_query->query( $query_args );
$offset = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0;
$page = (int) $query_args['paged'];
$total_revisions = $revisions_query->found_posts;
if ( $total_revisions < 1 ) {
// Out-of-bounds, run the query again without LIMIT for total count.
unset( $query_args['paged'], $query_args['offset'] );
$count_query = new WP_Query();
$count_query->query( $query_args );
$total_revisions = $count_query->found_posts;
}
if ( $revisions_query->query_vars['posts_per_page'] > 0 ) {
$max_pages = ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );
} else {
$max_pages = $total_revisions > 0 ? 1 : 0;
}
if ( $total_revisions > 0 ) {
if ( $offset >= $total_revisions ) {
return new WP_Error(
'rest_revision_invalid_offset_number',
__( 'The offset number requested is larger than or equal to the number of available revisions.' ),
array( 'status' => 400 )
);
} elseif ( ! $offset && $page > $max_pages ) {
return new WP_Error(
'rest_revision_invalid_page_number',
__( 'The page number requested is larger than the number of pages available.' ),
array( 'status' => 400 )
);
}
}
} else {
$revisions = array();
$total_revisions = 0;
$max_pages = 0;
$page = (int) $request['page'];
}
$response = array();
foreach ( $revisions as $revision ) {
$data = $this->prepare_item_for_response( $revision, $request );
$response[] = $this->prepare_response_for_collection( $data );
}
$response = rest_ensure_response( $response );
$response->header( 'X-WP-Total', (int) $total_revisions );
$response->header( 'X-WP-TotalPages', (int) $max_pages );
$request_params = $request->get_query_params();
$base_path = rest_url( sprintf( '%s/%s/%d/%s', $this->namespace, $this->parent_base, $request['parent'], $this->rest_base ) );
$base = add_query_arg( urlencode_deep( $request_params ), $base_path );
if ( $page > 1 ) {
$prev_page = $page - 1;
if ( $prev_page > $max_pages ) {
$prev_page = $max_pages;
}
$prev_link = add_query_arg( 'page', $prev_page, $base );
$response->link_header( 'prev', $prev_link );
}
if ( $max_pages > $page ) {
$next_page = $page + 1;
$next_link = add_query_arg( 'page', $next_page, $base );
$response->link_header( 'next', $next_link );
}
return $response;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::prepare\_items\_query()](prepare_items_query) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Determines the allowed query\_vars for a get\_items() response and prepares them for [WP\_Query](../wp_query). |
| [WP\_REST\_Revisions\_Controller::get\_parent()](get_parent) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Get the parent post, if the ID is valid. |
| [WP\_REST\_Revisions\_Controller::get\_collection\_params()](get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Retrieves the query params for collections. |
| [WP\_REST\_Revisions\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Prepares the revision for the REST response. |
| [urlencode\_deep()](../../functions/urlencode_deep) wp-includes/formatting.php | Navigates through an array, object, or scalar, and encodes the values to be used in a URL. |
| [WP\_Query::\_\_construct()](../wp_query/__construct) wp-includes/class-wp-query.php | Constructor. |
| [wp\_revisions\_enabled()](../../functions/wp_revisions_enabled) wp-includes/revision.php | Determines whether revisions are enabled for a given post. |
| [rest\_ensure\_response()](../../functions/rest_ensure_response) wp-includes/rest-api.php | Ensures a REST response is a response object (for consistency). |
| [rest\_url()](../../functions/rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [add\_query\_arg()](../../functions/add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::get_revision( int $id ): WP_Post|WP_Error WP\_REST\_Revisions\_Controller::get\_revision( int $id ): WP\_Post|WP\_Error
=============================================================================
Get the revision, if the ID is valid.
`$id` int Required Supplied ID. [WP\_Post](../wp_post)|[WP\_Error](../wp_error) Revision post object if ID is valid, [WP\_Error](../wp_error) otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
protected function get_revision( $id ) {
$error = new WP_Error(
'rest_post_invalid_id',
__( 'Invalid revision ID.' ),
array( 'status' => 404 )
);
if ( (int) $id <= 0 ) {
return $error;
}
$revision = get_post( (int) $id );
if ( empty( $revision ) || empty( $revision->ID ) || 'revision' !== $revision->post_type ) {
return $error;
}
return $revision;
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_post()](../../functions/get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_item()](get_item) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Retrieves one revision from the collection. |
| [WP\_REST\_Revisions\_Controller::delete\_item\_permissions\_check()](delete_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks if a given request has access to delete a revision. |
| [WP\_REST\_Revisions\_Controller::delete\_item()](delete_item) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Deletes a single revision. |
| Version | Description |
| --- | --- |
| [4.7.2](https://developer.wordpress.org/reference/since/4.7.2/) | Introduced. |
| programming_docs |
wordpress WP_REST_Revisions_Controller::prepare_date_response( string $date_gmt, string|null $date = null ): string|null WP\_REST\_Revisions\_Controller::prepare\_date\_response( string $date\_gmt, string|null $date = null ): string|null
====================================================================================================================
Checks the post\_date\_gmt or modified\_gmt and prepare any post or modified date for single post output.
`$date_gmt` string Required GMT publication time. `$date` string|null Optional Local publication time. Default: `null`
string|null ISO8601/RFC3339 formatted datetime, otherwise null.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
protected function prepare_date_response( $date_gmt, $date = null ) {
if ( '0000-00-00 00:00:00' === $date_gmt ) {
return null;
}
if ( isset( $date ) ) {
return mysql_to_rfc3339( $date );
}
return mysql_to_rfc3339( $date_gmt );
}
```
| Uses | Description |
| --- | --- |
| [mysql\_to\_rfc3339()](../../functions/mysql_to_rfc3339) wp-includes/functions.php | Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601 (Y-m-d\TH:i:s). |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Prepares the revision for the REST response. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::prepare_items_query( array $prepared_args = array(), WP_REST_Request $request = null ): array WP\_REST\_Revisions\_Controller::prepare\_items\_query( array $prepared\_args = array(), WP\_REST\_Request $request = null ): array
===================================================================================================================================
Determines the allowed query\_vars for a get\_items() response and prepares them for [WP\_Query](../wp_query).
`$prepared_args` array Optional Prepared [WP\_Query](../wp_query) arguments. Default: `array()`
`$request` [WP\_REST\_Request](../wp_rest_request) Optional Full details about the request. Default: `null`
array Items query arguments.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
protected function prepare_items_query( $prepared_args = array(), $request = null ) {
$query_args = array();
foreach ( $prepared_args as $key => $value ) {
/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
$query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}
// Map to proper WP_Query orderby param.
if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) {
$orderby_mappings = array(
'id' => 'ID',
'include' => 'post__in',
'slug' => 'post_name',
'include_slugs' => 'post_name__in',
);
if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) {
$query_args['orderby'] = $orderby_mappings[ $request['orderby'] ];
}
}
return $query_args;
}
```
[apply\_filters( "rest\_query\_var-{$key}", string $value )](../../hooks/rest_query_var-key)
Filters the query\_vars used in get\_items() for the constructed query.
| Uses | Description |
| --- | --- |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Gets a collection of revisions. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::delete_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Revisions\_Controller::delete\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
===============================================================================================================
Checks if a given request has access to delete a revision.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has access to delete the item, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function delete_item_permissions_check( $request ) {
$parent = $this->get_parent( $request['parent'] );
if ( is_wp_error( $parent ) ) {
return $parent;
}
$parent_post_type = get_post_type_object( $parent->post_type );
if ( ! current_user_can( 'delete_post', $parent->ID ) ) {
return new WP_Error(
'rest_cannot_delete',
__( 'Sorry, you are not allowed to delete revisions of this post.' ),
array( 'status' => rest_authorization_required_code() )
);
}
$revision = $this->get_revision( $request['id'] );
if ( is_wp_error( $revision ) ) {
return $revision;
}
$response = $this->get_items_permissions_check( $request );
if ( ! $response || is_wp_error( $response ) ) {
return $response;
}
if ( ! current_user_can( 'delete_post', $revision->ID ) ) {
return new WP_Error(
'rest_cannot_delete',
__( 'Sorry, you are not allowed to delete this revision.' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_revision()](get_revision) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Get the revision, if the ID is valid. |
| [WP\_REST\_Revisions\_Controller::get\_parent()](get_parent) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Get the parent post, if the ID is valid. |
| [WP\_REST\_Revisions\_Controller::get\_items\_permissions\_check()](get_items_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks if a given request has access to get revisions. |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_post\_type\_object()](../../functions/get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::get_parent( int $parent ): WP_Post|WP_Error WP\_REST\_Revisions\_Controller::get\_parent( int $parent ): WP\_Post|WP\_Error
===============================================================================
Get the parent post, if the ID is valid.
`$parent` int Required Supplied ID. [WP\_Post](../wp_post)|[WP\_Error](../wp_error) Post object if ID is valid, [WP\_Error](../wp_error) otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
protected function get_parent( $parent ) {
$error = new WP_Error(
'rest_post_invalid_parent',
__( 'Invalid post parent ID.' ),
array( 'status' => 404 )
);
if ( (int) $parent <= 0 ) {
return $error;
}
$parent = get_post( (int) $parent );
if ( empty( $parent ) || empty( $parent->ID ) || $this->parent_post_type !== $parent->post_type ) {
return $error;
}
return $parent;
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_post()](../../functions/get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_item()](get_item) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Retrieves one revision from the collection. |
| [WP\_REST\_Revisions\_Controller::delete\_item\_permissions\_check()](delete_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks if a given request has access to delete a revision. |
| [WP\_REST\_Revisions\_Controller::get\_items\_permissions\_check()](get_items_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks if a given request has access to get revisions. |
| [WP\_REST\_Revisions\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Gets a collection of revisions. |
| Version | Description |
| --- | --- |
| [4.7.2](https://developer.wordpress.org/reference/since/4.7.2/) | Introduced. |
wordpress WP_REST_Revisions_Controller::get_items_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Revisions\_Controller::get\_items\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
=============================================================================================================
Checks if a given request has access to get revisions.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has read access, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function get_items_permissions_check( $request ) {
$parent = $this->get_parent( $request['parent'] );
if ( is_wp_error( $parent ) ) {
return $parent;
}
if ( ! current_user_can( 'edit_post', $parent->ID ) ) {
return new WP_Error(
'rest_cannot_read',
__( 'Sorry, you are not allowed to view revisions of this post.' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_parent()](get_parent) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Get the parent post, if the ID is valid. |
| [rest\_authorization\_required\_code()](../../functions/rest_authorization_required_code) wp-includes/rest-api.php | Returns a contextual HTTP error code for authorization failure. |
| [current\_user\_can()](../../functions/current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_item\_permissions\_check()](get_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks if a given request has access to get a specific revision. |
| [WP\_REST\_Revisions\_Controller::delete\_item\_permissions\_check()](delete_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks if a given request has access to delete a revision. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::register_routes() WP\_REST\_Revisions\_Controller::register\_routes()
===================================================
Registers the routes for revisions based on post types supporting revisions.
* [register\_rest\_route()](../../functions/register_rest_route)
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->parent_base . '/(?P<parent>[\d]+)/' . $this->rest_base,
array(
'args' => array(
'parent' => array(
'description' => __( 'The ID for the parent of the revision.' ),
'type' => 'integer',
),
),
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
'args' => $this->get_collection_params(),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
register_rest_route(
$this->namespace,
'/' . $this->parent_base . '/(?P<parent>[\d]+)/' . $this->rest_base . '/(?P<id>[\d]+)',
array(
'args' => array(
'parent' => array(
'description' => __( 'The ID for the parent of the revision.' ),
'type' => 'integer',
),
'id' => array(
'description' => __( 'Unique identifier for the revision.' ),
'type' => 'integer',
),
),
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item' ),
'permission_callback' => array( $this, 'get_item_permissions_check' ),
'args' => array(
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
),
),
array(
'methods' => WP_REST_Server::DELETABLE,
'callback' => array( $this, 'delete_item' ),
'permission_callback' => array( $this, 'delete_item_permissions_check' ),
'args' => array(
'force' => array(
'type' => 'boolean',
'default' => false,
'description' => __( 'Required to be true, as revisions do not support trashing.' ),
),
),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_collection\_params()](get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Retrieves the query params for collections. |
| [register\_rest\_route()](../../functions/register_rest_route) wp-includes/rest-api.php | Registers a REST API route. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::get_collection_params(): array WP\_REST\_Revisions\_Controller::get\_collection\_params(): array
=================================================================
Retrieves the query params for collections.
array Collection parameters.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function get_collection_params() {
$query_params = parent::get_collection_params();
$query_params['context']['default'] = 'view';
unset( $query_params['per_page']['default'] );
$query_params['exclude'] = array(
'description' => __( 'Ensure result set excludes specific IDs.' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
),
'default' => array(),
);
$query_params['include'] = array(
'description' => __( 'Limit result set to specific IDs.' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
),
'default' => array(),
);
$query_params['offset'] = array(
'description' => __( 'Offset the result set by a specific number of items.' ),
'type' => 'integer',
);
$query_params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
);
$query_params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
'date',
'id',
'include',
'relevance',
'slug',
'include_slugs',
'title',
),
);
return $query_params;
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Controller::get\_collection\_params()](../wp_rest_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-controller.php | Retrieves the query params for the collections. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::register\_routes()](register_routes) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Registers the routes for revisions based on post types supporting revisions. |
| [WP\_REST\_Revisions\_Controller::get\_items()](get_items) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Gets a collection of revisions. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::__construct( string $parent_post_type ) WP\_REST\_Revisions\_Controller::\_\_construct( string $parent\_post\_type )
============================================================================
Constructor.
`$parent_post_type` string Required Post type of the parent. File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function __construct( $parent_post_type ) {
$this->parent_post_type = $parent_post_type;
$this->rest_base = 'revisions';
$post_type_object = get_post_type_object( $parent_post_type );
$this->parent_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;
$this->namespace = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2';
$this->parent_controller = $post_type_object->get_rest_controller();
if ( ! $this->parent_controller ) {
$this->parent_controller = new WP_REST_Posts_Controller( $parent_post_type );
}
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::\_\_construct()](../wp_rest_posts_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Constructor. |
| [get\_post\_type\_object()](../../functions/get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Autosaves\_Controller::\_\_construct()](../wp_rest_autosaves_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php | Constructor. |
| [create\_initial\_rest\_routes()](../../functions/create_initial_rest_routes) wp-includes/rest-api.php | Registers default REST API routes. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
| programming_docs |
wordpress WP_REST_Revisions_Controller::get_item_permissions_check( WP_REST_Request $request ): true|WP_Error WP\_REST\_Revisions\_Controller::get\_item\_permissions\_check( WP\_REST\_Request $request ): true|WP\_Error
============================================================================================================
Checks if a given request has access to get a specific revision.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. true|[WP\_Error](../wp_error) True if the request has read access for the item, [WP\_Error](../wp_error) object otherwise.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function get_item_permissions_check( $request ) {
return $this->get_items_permissions_check( $request );
}
```
| Uses | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_items\_permissions\_check()](get_items_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks if a given request has access to get revisions. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::delete_item( WP_REST_Request $request ): WP_REST_Response|WP_Error WP\_REST\_Revisions\_Controller::delete\_item( WP\_REST\_Request $request ): WP\_REST\_Response|WP\_Error
=========================================================================================================
Deletes a single revision.
`$request` [WP\_REST\_Request](../wp_rest_request) Required Full details about the request. [WP\_REST\_Response](../wp_rest_response)|[WP\_Error](../wp_error) Response object on success, or [WP\_Error](../wp_error) object on failure.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function delete_item( $request ) {
$revision = $this->get_revision( $request['id'] );
if ( is_wp_error( $revision ) ) {
return $revision;
}
$force = isset( $request['force'] ) ? (bool) $request['force'] : false;
// We don't support trashing for revisions.
if ( ! $force ) {
return new WP_Error(
'rest_trash_not_supported',
/* translators: %s: force=true */
sprintf( __( "Revisions do not support trashing. Set '%s' to delete." ), 'force=true' ),
array( 'status' => 501 )
);
}
$previous = $this->prepare_item_for_response( $revision, $request );
$result = wp_delete_post( $request['id'], true );
/**
* Fires after a revision is deleted via the REST API.
*
* @since 4.7.0
*
* @param WP_Post|false|null $result The revision object (if it was deleted or moved to the Trash successfully)
* or false or null (failure). If the revision was moved to the Trash, $result represents
* its new state; if it was deleted, $result represents its state before deletion.
* @param WP_REST_Request $request The request sent to the API.
*/
do_action( 'rest_delete_revision', $result, $request );
if ( ! $result ) {
return new WP_Error(
'rest_cannot_delete',
__( 'The post cannot be deleted.' ),
array( 'status' => 500 )
);
}
$response = new WP_REST_Response();
$response->set_data(
array(
'deleted' => true,
'previous' => $previous->get_data(),
)
);
return $response;
}
```
[do\_action( 'rest\_delete\_revision', WP\_Post|false|null $result, WP\_REST\_Request $request )](../../hooks/rest_delete_revision)
Fires after a revision is deleted via the REST API.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::get\_revision()](get_revision) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Get the revision, if the ID is valid. |
| [WP\_REST\_Revisions\_Controller::prepare\_item\_for\_response()](prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Prepares the revision for the REST response. |
| [wp\_delete\_post()](../../functions/wp_delete_post) wp-includes/post.php | Trashes or deletes a post or page. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [do\_action()](../../functions/do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [is\_wp\_error()](../../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_REST_Revisions_Controller::get_item_schema(): array WP\_REST\_Revisions\_Controller::get\_item\_schema(): array
===========================================================
Retrieves the revision’s schema, conforming to JSON Schema.
array Item schema data.
File: `wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php/)
```
public function get_item_schema() {
if ( $this->schema ) {
return $this->add_additional_fields_schema( $this->schema );
}
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => "{$this->parent_post_type}-revision",
'type' => 'object',
// Base properties for every Revision.
'properties' => array(
'author' => array(
'description' => __( 'The ID for the author of the revision.' ),
'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ),
),
'date' => array(
'description' => __( "The date the revision was published, in the site's timezone." ),
'type' => 'string',
'format' => 'date-time',
'context' => array( 'view', 'edit', 'embed' ),
),
'date_gmt' => array(
'description' => __( 'The date the revision was published, as GMT.' ),
'type' => 'string',
'format' => 'date-time',
'context' => array( 'view', 'edit' ),
),
'guid' => array(
'description' => __( 'GUID for the revision, as it exists in the database.' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'id' => array(
'description' => __( 'Unique identifier for the revision.' ),
'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ),
),
'modified' => array(
'description' => __( "The date the revision was last modified, in the site's timezone." ),
'type' => 'string',
'format' => 'date-time',
'context' => array( 'view', 'edit' ),
),
'modified_gmt' => array(
'description' => __( 'The date the revision was last modified, as GMT.' ),
'type' => 'string',
'format' => 'date-time',
'context' => array( 'view', 'edit' ),
),
'parent' => array(
'description' => __( 'The ID for the parent of the revision.' ),
'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ),
),
'slug' => array(
'description' => __( 'An alphanumeric identifier for the revision unique to its type.' ),
'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ),
),
),
);
$parent_schema = $this->parent_controller->get_item_schema();
if ( ! empty( $parent_schema['properties']['title'] ) ) {
$schema['properties']['title'] = $parent_schema['properties']['title'];
}
if ( ! empty( $parent_schema['properties']['content'] ) ) {
$schema['properties']['content'] = $parent_schema['properties']['content'];
}
if ( ! empty( $parent_schema['properties']['excerpt'] ) ) {
$schema['properties']['excerpt'] = $parent_schema['properties']['excerpt'];
}
if ( ! empty( $parent_schema['properties']['guid'] ) ) {
$schema['properties']['guid'] = $parent_schema['properties']['guid'];
}
$this->schema = $schema;
return $this->add_additional_fields_schema( $this->schema );
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress WP_Recovery_Mode_Key_Service::generate_and_store_recovery_mode_key( string $token ): string WP\_Recovery\_Mode\_Key\_Service::generate\_and\_store\_recovery\_mode\_key( string $token ): string
====================================================================================================
Creates a recovery mode key.
`$token` string Required A token generated by [generate\_recovery\_mode\_token()](../../functions/generate_recovery_mode_token). string Recovery mode key.
File: `wp-includes/class-wp-recovery-mode-key-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-key-service.php/)
```
public function generate_and_store_recovery_mode_key( $token ) {
global $wp_hasher;
$key = wp_generate_password( 22, false );
if ( empty( $wp_hasher ) ) {
require_once ABSPATH . WPINC . '/class-phpass.php';
$wp_hasher = new PasswordHash( 8, true );
}
$hashed = $wp_hasher->HashPassword( $key );
$records = $this->get_keys();
$records[ $token ] = array(
'hashed_key' => $hashed,
'created_at' => time(),
);
$this->update_keys( $records );
/**
* Fires when a recovery mode key is generated.
*
* @since 5.2.0
*
* @param string $token The recovery data token.
* @param string $key The recovery mode key.
*/
do_action( 'generate_recovery_mode_key', $token, $key );
return $key;
}
```
[do\_action( 'generate\_recovery\_mode\_key', string $token, string $key )](../../hooks/generate_recovery_mode_key)
Fires when a recovery mode key is generated.
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Key\_Service::get\_keys()](get_keys) wp-includes/class-wp-recovery-mode-key-service.php | Gets the recovery key records. |
| [WP\_Recovery\_Mode\_Key\_Service::update\_keys()](update_keys) wp-includes/class-wp-recovery-mode-key-service.php | Updates the recovery key records. |
| [wp\_generate\_password()](../../functions/wp_generate_password) wp-includes/pluggable.php | Generates a random password drawn from the defined set of characters. |
| [do\_action()](../../functions/do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode_Key_Service::validate_recovery_mode_key( string $token, string $key, int $ttl ): true|WP_Error WP\_Recovery\_Mode\_Key\_Service::validate\_recovery\_mode\_key( string $token, string $key, int $ttl ): true|WP\_Error
=======================================================================================================================
Verifies if the recovery mode key is correct.
Recovery mode keys can only be used once; the key will be consumed in the process.
`$token` string Required The token used when generating the given key. `$key` string Required The unhashed key. `$ttl` int Required Time in seconds for the key to be valid for. true|[WP\_Error](../wp_error) True on success, error object on failure.
File: `wp-includes/class-wp-recovery-mode-key-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-key-service.php/)
```
public function validate_recovery_mode_key( $token, $key, $ttl ) {
$records = $this->get_keys();
if ( ! isset( $records[ $token ] ) ) {
return new WP_Error( 'token_not_found', __( 'Recovery Mode not initialized.' ) );
}
$record = $records[ $token ];
$this->remove_key( $token );
if ( ! is_array( $record ) || ! isset( $record['hashed_key'], $record['created_at'] ) ) {
return new WP_Error( 'invalid_recovery_key_format', __( 'Invalid recovery key format.' ) );
}
if ( ! wp_check_password( $key, $record['hashed_key'] ) ) {
return new WP_Error( 'hash_mismatch', __( 'Invalid recovery key.' ) );
}
if ( time() > $record['created_at'] + $ttl ) {
return new WP_Error( 'key_expired', __( 'Recovery key expired.' ) );
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Key\_Service::get\_keys()](get_keys) wp-includes/class-wp-recovery-mode-key-service.php | Gets the recovery key records. |
| [WP\_Recovery\_Mode\_Key\_Service::remove\_key()](remove_key) wp-includes/class-wp-recovery-mode-key-service.php | Removes a used recovery key. |
| [wp\_check\_password()](../../functions/wp_check_password) wp-includes/pluggable.php | Checks the plaintext password against the encrypted Password. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [WP\_Error::\_\_construct()](../wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode_Key_Service::get_keys(): array WP\_Recovery\_Mode\_Key\_Service::get\_keys(): array
====================================================
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Gets the recovery key records.
array Associative array of $token => $data pairs, where $data has keys `'hashed_key'` and `'created_at'`.
File: `wp-includes/class-wp-recovery-mode-key-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-key-service.php/)
```
private function get_keys() {
return (array) get_option( $this->option_name, array() );
}
```
| Uses | Description |
| --- | --- |
| [get\_option()](../../functions/get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Key\_Service::generate\_and\_store\_recovery\_mode\_key()](generate_and_store_recovery_mode_key) wp-includes/class-wp-recovery-mode-key-service.php | Creates a recovery mode key. |
| [WP\_Recovery\_Mode\_Key\_Service::validate\_recovery\_mode\_key()](validate_recovery_mode_key) wp-includes/class-wp-recovery-mode-key-service.php | Verifies if the recovery mode key is correct. |
| [WP\_Recovery\_Mode\_Key\_Service::clean\_expired\_keys()](clean_expired_keys) wp-includes/class-wp-recovery-mode-key-service.php | Removes expired recovery mode keys. |
| [WP\_Recovery\_Mode\_Key\_Service::remove\_key()](remove_key) wp-includes/class-wp-recovery-mode-key-service.php | Removes a used recovery key. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode_Key_Service::update_keys( array $keys ): bool WP\_Recovery\_Mode\_Key\_Service::update\_keys( array $keys ): bool
===================================================================
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Updates the recovery key records.
`$keys` array Required Associative array of $token => $data pairs, where $data has keys `'hashed_key'` and `'created_at'`. bool True on success, false on failure.
File: `wp-includes/class-wp-recovery-mode-key-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-key-service.php/)
```
private function update_keys( array $keys ) {
return update_option( $this->option_name, $keys );
}
```
| Uses | Description |
| --- | --- |
| [update\_option()](../../functions/update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Key\_Service::generate\_and\_store\_recovery\_mode\_key()](generate_and_store_recovery_mode_key) wp-includes/class-wp-recovery-mode-key-service.php | Creates a recovery mode key. |
| [WP\_Recovery\_Mode\_Key\_Service::clean\_expired\_keys()](clean_expired_keys) wp-includes/class-wp-recovery-mode-key-service.php | Removes expired recovery mode keys. |
| [WP\_Recovery\_Mode\_Key\_Service::remove\_key()](remove_key) wp-includes/class-wp-recovery-mode-key-service.php | Removes a used recovery key. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode_Key_Service::remove_key( string $token ) WP\_Recovery\_Mode\_Key\_Service::remove\_key( string $token )
==============================================================
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Removes a used recovery key.
`$token` string Required The token used when generating a recovery mode key. File: `wp-includes/class-wp-recovery-mode-key-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-key-service.php/)
```
private function remove_key( $token ) {
$records = $this->get_keys();
if ( ! isset( $records[ $token ] ) ) {
return;
}
unset( $records[ $token ] );
$this->update_keys( $records );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Key\_Service::get\_keys()](get_keys) wp-includes/class-wp-recovery-mode-key-service.php | Gets the recovery key records. |
| [WP\_Recovery\_Mode\_Key\_Service::update\_keys()](update_keys) wp-includes/class-wp-recovery-mode-key-service.php | Updates the recovery key records. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Key\_Service::validate\_recovery\_mode\_key()](validate_recovery_mode_key) wp-includes/class-wp-recovery-mode-key-service.php | Verifies if the recovery mode key is correct. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Recovery_Mode_Key_Service::clean_expired_keys( int $ttl ) WP\_Recovery\_Mode\_Key\_Service::clean\_expired\_keys( int $ttl )
==================================================================
Removes expired recovery mode keys.
`$ttl` int Required Time in seconds for the keys to be valid for. File: `wp-includes/class-wp-recovery-mode-key-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-key-service.php/)
```
public function clean_expired_keys( $ttl ) {
$records = $this->get_keys();
foreach ( $records as $key => $record ) {
if ( ! isset( $record['created_at'] ) || time() > $record['created_at'] + $ttl ) {
unset( $records[ $key ] );
}
}
$this->update_keys( $records );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Key\_Service::get\_keys()](get_keys) wp-includes/class-wp-recovery-mode-key-service.php | Gets the recovery key records. |
| [WP\_Recovery\_Mode\_Key\_Service::update\_keys()](update_keys) wp-includes/class-wp-recovery-mode-key-service.php | Updates the recovery key records. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
| programming_docs |
wordpress WP_Recovery_Mode_Key_Service::generate_recovery_mode_token(): string WP\_Recovery\_Mode\_Key\_Service::generate\_recovery\_mode\_token(): string
===========================================================================
Creates a recovery mode token.
string A random string to identify its associated key in storage.
File: `wp-includes/class-wp-recovery-mode-key-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-key-service.php/)
```
public function generate_recovery_mode_token() {
return wp_generate_password( 22, false );
}
```
| Uses | Description |
| --- | --- |
| [wp\_generate\_password()](../../functions/wp_generate_password) wp-includes/pluggable.php | Generates a random password drawn from the defined set of characters. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress WP_Widget_Media_Gallery::get_instance_schema(): array WP\_Widget\_Media\_Gallery::get\_instance\_schema(): array
==========================================================
Get schema for properties of a widget instance (item).
* [WP\_REST\_Controller::get\_item\_schema()](../wp_rest_controller/get_item_schema)
* [WP\_REST\_Controller::get\_additional\_fields()](../wp_rest_controller/get_additional_fields)
array Schema for properties.
File: `wp-includes/widgets/class-wp-widget-media-gallery.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-media-gallery.php/)
```
public function get_instance_schema() {
$schema = array(
'title' => array(
'type' => 'string',
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'description' => __( 'Title for the widget' ),
'should_preview_update' => false,
),
'ids' => array(
'type' => 'array',
'items' => array(
'type' => 'integer',
),
'default' => array(),
'sanitize_callback' => 'wp_parse_id_list',
),
'columns' => array(
'type' => 'integer',
'default' => 3,
'minimum' => 1,
'maximum' => 9,
),
'size' => array(
'type' => 'string',
'enum' => array_merge( get_intermediate_image_sizes(), array( 'full', 'custom' ) ),
'default' => 'thumbnail',
),
'link_type' => array(
'type' => 'string',
'enum' => array( 'post', 'file', 'none' ),
'default' => 'post',
'media_prop' => 'link',
'should_preview_update' => false,
),
'orderby_random' => array(
'type' => 'boolean',
'default' => false,
'media_prop' => '_orderbyRandom',
'should_preview_update' => false,
),
);
/** This filter is documented in wp-includes/widgets/class-wp-widget-media.php */
$schema = apply_filters( "widget_{$this->id_base}_instance_schema", $schema, $this );
return $schema;
}
```
[apply\_filters( "widget\_{$this->id\_base}\_instance\_schema", array $schema, WP\_Widget\_Media $widget )](../../hooks/widget_this-id_base_instance_schema)
Filters the media widget instance schema to add additional properties.
| Uses | Description |
| --- | --- |
| [get\_intermediate\_image\_sizes()](../../functions/get_intermediate_image_sizes) wp-includes/media.php | Gets the available intermediate image size names. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](../../functions/apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Media\_Gallery::render\_media()](render_media) wp-includes/widgets/class-wp-widget-media-gallery.php | Render the media on the frontend. |
| [WP\_Widget\_Media\_Gallery::enqueue\_admin\_scripts()](enqueue_admin_scripts) wp-includes/widgets/class-wp-widget-media-gallery.php | Loads the required media files for the media manager and scripts for media widgets. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress WP_Widget_Media_Gallery::has_content( array $instance ): bool WP\_Widget\_Media\_Gallery::has\_content( array $instance ): bool
=================================================================
Whether the widget has content to show.
`$instance` array Required Widget instance props. bool Whether widget has content.
File: `wp-includes/widgets/class-wp-widget-media-gallery.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-media-gallery.php/)
```
protected function has_content( $instance ) {
if ( ! empty( $instance['ids'] ) ) {
$attachments = wp_parse_id_list( $instance['ids'] );
foreach ( $attachments as $attachment ) {
if ( 'attachment' !== get_post_type( $attachment ) ) {
return false;
}
}
return true;
}
return false;
}
```
| Uses | Description |
| --- | --- |
| [wp\_parse\_id\_list()](../../functions/wp_parse_id_list) wp-includes/functions.php | Cleans up an array, comma- or space-separated list of IDs. |
| [get\_post\_type()](../../functions/get_post_type) wp-includes/post.php | Retrieves the post type of the current post or of a given post. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress WP_Widget_Media_Gallery::enqueue_admin_scripts() WP\_Widget\_Media\_Gallery::enqueue\_admin\_scripts()
=====================================================
Loads the required media files for the media manager and scripts for media widgets.
File: `wp-includes/widgets/class-wp-widget-media-gallery.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-media-gallery.php/)
```
public function enqueue_admin_scripts() {
parent::enqueue_admin_scripts();
$handle = 'media-gallery-widget';
wp_enqueue_script( $handle );
$exported_schema = array();
foreach ( $this->get_instance_schema() as $field => $field_schema ) {
$exported_schema[ $field ] = wp_array_slice_assoc( $field_schema, array( 'type', 'default', 'enum', 'minimum', 'format', 'media_prop', 'should_preview_update', 'items' ) );
}
wp_add_inline_script(
$handle,
sprintf(
'wp.mediaWidgets.modelConstructors[ %s ].prototype.schema = %s;',
wp_json_encode( $this->id_base ),
wp_json_encode( $exported_schema )
)
);
wp_add_inline_script(
$handle,
sprintf(
'
wp.mediaWidgets.controlConstructors[ %1$s ].prototype.mime_type = %2$s;
_.extend( wp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n, %3$s );
',
wp_json_encode( $this->id_base ),
wp_json_encode( $this->widget_options['mime_type'] ),
wp_json_encode( $this->l10n )
)
);
}
```
| Uses | Description |
| --- | --- |
| [WP\_Widget\_Media\_Gallery::get\_instance\_schema()](get_instance_schema) wp-includes/widgets/class-wp-widget-media-gallery.php | Get schema for properties of a widget instance (item). |
| [WP\_Widget\_Media::enqueue\_admin\_scripts()](../wp_widget_media/enqueue_admin_scripts) wp-includes/widgets/class-wp-widget-media.php | Loads the required scripts and styles for the widget control. |
| [wp\_add\_inline\_script()](../../functions/wp_add_inline_script) wp-includes/functions.wp-scripts.php | Adds extra code to a registered script. |
| [wp\_enqueue\_script()](../../functions/wp_enqueue_script) wp-includes/functions.wp-scripts.php | Enqueue a script. |
| [wp\_array\_slice\_assoc()](../../functions/wp_array_slice_assoc) wp-includes/functions.php | Extracts a slice of an array, given a list of keys. |
| [wp\_json\_encode()](../../functions/wp_json_encode) wp-includes/functions.php | Encodes a variable into JSON, with some sanity checks. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress WP_Widget_Media_Gallery::render_media( array $instance ) WP\_Widget\_Media\_Gallery::render\_media( array $instance )
============================================================
Render the media on the frontend.
`$instance` array Required Widget instance props. File: `wp-includes/widgets/class-wp-widget-media-gallery.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-media-gallery.php/)
```
public function render_media( $instance ) {
$instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );
$shortcode_atts = array_merge(
$instance,
array(
'link' => $instance['link_type'],
)
);
// @codeCoverageIgnoreStart
if ( $instance['orderby_random'] ) {
$shortcode_atts['orderby'] = 'rand';
}
// @codeCoverageIgnoreEnd
echo gallery_shortcode( $shortcode_atts );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Widget\_Media\_Gallery::get\_instance\_schema()](get_instance_schema) wp-includes/widgets/class-wp-widget-media-gallery.php | Get schema for properties of a widget instance (item). |
| [wp\_list\_pluck()](../../functions/wp_list_pluck) wp-includes/functions.php | Plucks a certain field out of each object or array in an array. |
| [gallery\_shortcode()](../../functions/gallery_shortcode) wp-includes/media.php | Builds the Gallery shortcode output. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress WP_Widget_Media_Gallery::render_control_template_scripts() WP\_Widget\_Media\_Gallery::render\_control\_template\_scripts()
================================================================
Render form template scripts.
File: `wp-includes/widgets/class-wp-widget-media-gallery.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-media-gallery.php/)
```
public function render_control_template_scripts() {
parent::render_control_template_scripts();
?>
<script type="text/html" id="tmpl-wp-media-widget-gallery-preview">
<#
var ids = _.filter( data.ids, function( id ) {
return ( id in data.attachments );
} );
#>
<# if ( ids.length ) { #>
<ul class="gallery media-widget-gallery-preview" role="list">
<# _.each( ids, function( id, index ) { #>
<# var attachment = data.attachments[ id ]; #>
<# if ( index < 6 ) { #>
<li class="gallery-item">
<div class="gallery-icon">
<img alt="{{ attachment.alt }}"
<# if ( index === 5 && data.ids.length > 6 ) { #> aria-hidden="true" <# } #>
<# if ( attachment.sizes.thumbnail ) { #>
src="{{ attachment.sizes.thumbnail.url }}" width="{{ attachment.sizes.thumbnail.width }}" height="{{ attachment.sizes.thumbnail.height }}"
<# } else { #>
src="{{ attachment.url }}"
<# } #>
<# if ( ! attachment.alt && attachment.filename ) { #>
aria-label="
<?php
echo esc_attr(
sprintf(
/* translators: %s: The image file name. */
__( 'The current image has no alternative text. The file name is: %s' ),
'{{ attachment.filename }}'
)
);
?>
"
<# } #>
/>
<# if ( index === 5 && data.ids.length > 6 ) { #>
<div class="gallery-icon-placeholder">
<p class="gallery-icon-placeholder-text" aria-label="
<?php
printf(
/* translators: %s: The amount of additional, not visible images in the gallery widget preview. */
__( 'Additional images added to this gallery: %s' ),
'{{ data.ids.length - 5 }}'
);
?>
">+{{ data.ids.length - 5 }}</p>
</div>
<# } #>
</div>
</li>
<# } #>
<# } ); #>
</ul>
<# } else { #>
<div class="attachment-media-view">
<button type="button" class="placeholder button-add-media"><?php echo esc_html( $this->l10n['add_media'] ); ?></button>
</div>
<# } #>
</script>
<?php
}
```
| Uses | Description |
| --- | --- |
| [WP\_Widget\_Media::render\_control\_template\_scripts()](../wp_widget_media/render_control_template_scripts) wp-includes/widgets/class-wp-widget-media.php | Render form template scripts. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [esc\_attr()](../../functions/esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [esc\_html()](../../functions/esc_html) wp-includes/formatting.php | Escaping for HTML blocks. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress WP_Widget_Media_Gallery::__construct() WP\_Widget\_Media\_Gallery::\_\_construct()
===========================================
Constructor.
File: `wp-includes/widgets/class-wp-widget-media-gallery.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-media-gallery.php/)
```
public function __construct() {
parent::__construct(
'media_gallery',
__( 'Gallery' ),
array(
'description' => __( 'Displays an image gallery.' ),
'mime_type' => 'image',
)
);
$this->l10n = array_merge(
$this->l10n,
array(
'no_media_selected' => __( 'No images selected' ),
'add_media' => _x( 'Add Images', 'label for button in the gallery widget; should not be longer than ~13 characters long' ),
'replace_media' => '',
'edit_media' => _x( 'Edit Gallery', 'label for button in the gallery widget; should not be longer than ~13 characters long' ),
)
);
}
```
| Uses | Description |
| --- | --- |
| [WP\_Widget\_Media::\_\_construct()](../wp_widget_media/__construct) wp-includes/widgets/class-wp-widget-media.php | Constructor. |
| [\_\_()](../../functions/__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_x()](../../functions/_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( "bulk_actions-{$this->screen->id}", array $actions ) apply\_filters( "bulk\_actions-{$this->screen->id}", array $actions )
=====================================================================
Filters the items in the bulk actions menu of the list table.
The dynamic portion of the hook name, `$this->screen->id`, refers to the ID of the current screen.
`$actions` array An array of the available bulk actions. * This hook allows you to remove items from the bulk actions dropdown on any specified admin screen.
* Bulk actions are a simple associative array.
* The filter hook follows the format ‘`bulk_actions-screenid`‘, where screenid is the id of the admin screen that you want to affect.
* As of version 4.7, custom bulk actions can be added using this filter. You can add functionality to custom bulk actions using ‘`handle_bulk_actions-screenid`‘, where screenid is the id of the admin screen that you want to affect.
File: `wp-admin/includes/class-wp-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-list-table.php/)
```
$this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [WP\_List\_Table::bulk\_actions()](../classes/wp_list_table/bulk_actions) wp-admin/includes/class-wp-list-table.php | Displays the bulk actions dropdown. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | A bulk action can now contain an array of options in order to create an optgroup. |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( "pre_delete_site_option_{$option}", string $option, int $network_id ) do\_action( "pre\_delete\_site\_option\_{$option}", string $option, int $network\_id )
======================================================================================
Fires immediately before a specific network option is deleted.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$option` string Option name. `$network_id` int ID of the network. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( "pre_delete_site_option_{$option}", $option, $network_id );
```
| Used By | Description |
| --- | --- |
| [delete\_network\_option()](../functions/delete_network_option) wp-includes/option.php | Removes a network option by name. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | The `$network_id` parameter was added. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$option` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'secure_auth_cookie', bool $secure, int $user_id ) apply\_filters( 'secure\_auth\_cookie', bool $secure, int $user\_id )
=====================================================================
Filters whether the auth cookie should only be sent over HTTPS.
`$secure` bool Whether the cookie should only be sent over HTTPS. `$user_id` int User ID. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$secure = apply_filters( 'secure_auth_cookie', $secure, $user_id );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_auth\_cookie()](../functions/wp_set_auth_cookie) wp-includes/pluggable.php | Sets the authentication cookies based on user ID. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'edit_post', int $post_ID, WP_Post $post ) do\_action( 'edit\_post', int $post\_ID, WP\_Post $post )
=========================================================
Fires once an existing post has been updated.
`$post_ID` int Post ID. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'edit_post', $post_ID, $post );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::trash\_changeset\_post()](../classes/wp_customize_manager/trash_changeset_post) wp-includes/class-wp-customize-manager.php | Trashes or deletes a changeset post. |
| [wp\_publish\_post()](../functions/wp_publish_post) wp-includes/post.php | Publishes a post by transitioning the post status. |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| [wp\_update\_comment\_count\_now()](../functions/wp_update_comment_count_now) wp-includes/comment.php | Updates the comment count for the post. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'post_row_actions', string[] $actions, WP_Post $post ) apply\_filters( 'post\_row\_actions', string[] $actions, WP\_Post $post )
=========================================================================
Filters the array of row action links on the Posts list table.
The filter is evaluated only for non-hierarchical post types.
`$actions` string[] An array of row action links. Defaults are `'Edit'`, 'Quick Edit', `'Restore'`, `'Trash'`, 'Delete Permanently', `'Preview'`, and `'View'`. `$post` [WP\_Post](../classes/wp_post) The post object. File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
$actions = apply_filters( 'post_row_actions', $actions, $post );
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::handle\_row\_actions()](../classes/wp_posts_list_table/handle_row_actions) wp-admin/includes/class-wp-posts-list-table.php | Generates and displays row action links. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_trusted_keys', string[] $trusted_keys ) apply\_filters( 'wp\_trusted\_keys', string[] $trusted\_keys )
==============================================================
Filters the valid signing keys used to verify the contents of files.
`$trusted_keys` string[] The trusted keys that may sign packages. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
return apply_filters( 'wp_trusted_keys', $trusted_keys );
```
| Used By | Description |
| --- | --- |
| [wp\_trusted\_keys()](../functions/wp_trusted_keys) wp-admin/includes/file.php | Retrieves the list of signing keys trusted by WordPress. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'wp_redirect_status', int $status, string $location ) apply\_filters( 'wp\_redirect\_status', int $status, string $location )
=======================================================================
Filters the redirect HTTP response status code to use.
`$status` int The HTTP response status code to use. `$location` string The path or URL to redirect to. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$status = apply_filters( 'wp_redirect_status', $status, $location );
```
| Used By | Description |
| --- | --- |
| [wp\_redirect()](../functions/wp_redirect) wp-includes/pluggable.php | Redirects to another page. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'comment_reply_link', string $link, array $args, WP_Comment $comment, WP_Post $post ) apply\_filters( 'comment\_reply\_link', string $link, array $args, WP\_Comment $comment, WP\_Post $post )
=========================================================================================================
Filters the comment reply link.
`$link` string The HTML markup for the comment reply link. `$args` array An array of arguments overriding the defaults. `$comment` [WP\_Comment](../classes/wp_comment) The object of the comment being replied. `$post` [WP\_Post](../classes/wp_post) The [WP\_Post](../classes/wp_post) object. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'comment_reply_link', $args['before'] . $link . $args['after'], $args, $comment, $post );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_reply\_link()](../functions/get_comment_reply_link) wp-includes/comment-template.php | Retrieves HTML content for reply to comment link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'http_allowed_safe_ports', array $allowed_ports, string $host, string $url ) apply\_filters( 'http\_allowed\_safe\_ports', array $allowed\_ports, string $host, string $url )
================================================================================================
Controls the list of ports considered safe in HTTP API.
Allows to change and allow external requests for the HTTP request.
`$allowed_ports` array Array of integers for valid ports. `$host` string Host name of the requested URL. `$url` string Requested URL. File: `wp-includes/http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/http.php/)
```
$allowed_ports = apply_filters( 'http_allowed_safe_ports', array( 80, 443, 8080 ), $host, $url );
```
| Used By | Description |
| --- | --- |
| [wp\_http\_validate\_url()](../functions/wp_http_validate_url) wp-includes/http.php | Validate a URL for safe use in the HTTP API. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters_deprecated( 'whitelist_options', array $allowed_options ) apply\_filters\_deprecated( 'whitelist\_options', array $allowed\_options )
===========================================================================
This hook has been deprecated. Use [‘allowed\_options’](allowed_options) instead.
Filters the allowed options list.
`$allowed_options` array The allowed options list. File: `wp-admin/options.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/options.php/)
```
$allowed_options = apply_filters_deprecated(
'whitelist_options',
array( $allowed_options ),
'5.5.0',
'allowed_options',
__( 'Please consider writing more inclusive code.' )
);
```
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Use ['allowed\_options'](allowed_options) instead. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( "customize_validate_{$this->id}", WP_Error $validity, mixed $value, WP_Customize_Setting $setting ) apply\_filters( "customize\_validate\_{$this->id}", WP\_Error $validity, mixed $value, WP\_Customize\_Setting $setting )
========================================================================================================================
Validates a Customize setting value.
Plugins should amend the `$validity` object via its `WP_Error::add()` method.
The dynamic portion of the hook name, `$this->ID`, refers to the setting ID.
`$validity` [WP\_Error](../classes/wp_error) Filtered from `true` to `WP_Error` when invalid. `$value` mixed Value of the setting. `$setting` [WP\_Customize\_Setting](../classes/wp_customize_setting) [WP\_Customize\_Setting](../classes/wp_customize_setting) instance. File: `wp-includes/class-wp-customize-setting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-setting.php/)
```
$validity = apply_filters( "customize_validate_{$this->id}", $validity, $value, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Setting::validate()](../classes/wp_customize_setting/validate) wp-includes/class-wp-customize-setting.php | Validates an input. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'load_script_translations', string $translations, string $file, string $handle, string $domain ) apply\_filters( 'load\_script\_translations', string $translations, string $file, string $handle, string $domain )
==================================================================================================================
Filters script translations for the given file, script handle and text domain.
`$translations` string JSON-encoded translation data. `$file` string Path to the translation file that was loaded. `$handle` string Name of the script to register a translation domain to. `$domain` string The text domain. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
return apply_filters( 'load_script_translations', $translations, $file, $handle, $domain );
```
| Used By | Description |
| --- | --- |
| [load\_script\_translations()](../functions/load_script_translations) wp-includes/l10n.php | Loads the translation data for the given script handle and text domain. |
| Version | Description |
| --- | --- |
| [5.0.2](https://developer.wordpress.org/reference/since/5.0.2/) | Introduced. |
wordpress apply_filters( 'wp_is_large_user_count', bool $is_large_user_count, int $count, int|null $network_id ) apply\_filters( 'wp\_is\_large\_user\_count', bool $is\_large\_user\_count, int $count, int|null $network\_id )
===============================================================================================================
Filters whether the site is considered large, based on its number of users.
`$is_large_user_count` bool Whether the site has a large number of users. `$count` int The total number of users. `$network_id` int|null ID of the network. `null` represents the current network. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'wp_is_large_user_count', $count > 10000, $count, $network_id );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_large\_user\_count()](../functions/wp_is_large_user_count) wp-includes/user.php | Determines whether the site has a large number of users. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress do_action( 'check_ajax_referer', string $action, false|int $result ) do\_action( 'check\_ajax\_referer', string $action, false|int $result )
=======================================================================
Fires once the Ajax request has been validated or not.
`$action` string The Ajax nonce action. `$result` false|int False if the nonce is invalid, 1 if the nonce is valid and generated between 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'check_ajax_referer', $action, $result );
```
| Used By | Description |
| --- | --- |
| [check\_ajax\_referer()](../functions/check_ajax_referer) wp-includes/pluggable.php | Verifies the Ajax request to prevent processing requests external of the blog. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_auth_check_same_domain', bool $same_domain ) apply\_filters( 'wp\_auth\_check\_same\_domain', bool $same\_domain )
=====================================================================
Filters whether the authentication check originated at the same domain.
`$same_domain` bool Whether the authentication check originated at the same domain. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$same_domain = apply_filters( 'wp_auth_check_same_domain', $same_domain );
```
| Used By | Description |
| --- | --- |
| [wp\_auth\_check\_html()](../functions/wp_auth_check_html) wp-includes/functions.php | Outputs the HTML that shows the wp-login dialog when the user is no longer logged in. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'plugin_row_meta', string[] $plugin_meta, string $plugin_file, array $plugin_data, string $status ) apply\_filters( 'plugin\_row\_meta', string[] $plugin\_meta, string $plugin\_file, array $plugin\_data, string $status )
========================================================================================================================
Filters the array of row meta for each plugin in the Plugins list table.
`$plugin_meta` string[] An array of the plugin's metadata, including the version, author, author URI, and plugin URI. `$plugin_file` string Path to the plugin file relative to the plugins directory. `$plugin_data` array An array of plugin data.
* `id`stringPlugin ID, e.g. `w.org/plugins/[plugin-name]`.
* `slug`stringPlugin slug.
* `plugin`stringPlugin basename.
* `new_version`stringNew plugin version.
* `url`stringPlugin URL.
* `package`stringPlugin update package URL.
* `icons`string[]An array of plugin icon URLs.
* `banners`string[]An array of plugin banner URLs.
* `banners_rtl`string[]An array of plugin RTL banner URLs.
* `requires`stringThe version of WordPress which the plugin requires.
* `tested`stringThe version of WordPress the plugin is tested against.
* `requires_php`stringThe version of PHP which the plugin requires.
* `upgrade_notice`stringThe upgrade notice for the new plugin version.
* `update-supported`boolWhether the plugin supports updates.
* `Name`stringThe human-readable name of the plugin.
* `PluginURI`stringPlugin URI.
* `Version`stringPlugin version.
* `Description`stringPlugin description.
* `Author`stringPlugin author.
* `AuthorURI`stringPlugin author URI.
* `TextDomain`stringPlugin textdomain.
* `DomainPath`stringRelative path to the plugin's .mo file(s).
* `Network`boolWhether the plugin can only be activated network-wide.
* `RequiresWP`stringThe version of WordPress which the plugin requires.
* `RequiresPHP`stringThe version of PHP which the plugin requires.
* `UpdateURI`stringID of the plugin for update purposes, should be a URI.
* `Title`stringThe human-readable title of the plugin.
* `AuthorName`stringPlugin author's name.
* `update`boolWhether there's an available update. Default null.
`$status` string Status filter currently applied to the plugin list. Possible values are: `'all'`, `'active'`, `'inactive'`, `'recently_activated'`, `'upgrade'`, `'mustuse'`, `'dropins'`, `'search'`, `'paused'`, `'auto-update-enabled'`, `'auto-update-disabled'`. The `plugin_row_meta` filter hook is used to add additional links below each plugin on the Plugins page.
File: `wp-admin/includes/class-wp-plugins-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-plugins-list-table.php/)
```
$plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugins\_List\_Table::single\_row()](../classes/wp_plugins_list_table/single_row) wp-admin/includes/class-wp-plugins-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'the_time', string $get_the_time, string $format ) apply\_filters( 'the\_time', string $get\_the\_time, string $format )
=====================================================================
Filters the time a post was written for display.
`$get_the_time` string The formatted time. `$format` string Format to use for retrieving the time the post was written. Accepts `'G'`, `'U'`, or PHP date format. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
echo apply_filters( 'the_time', get_the_time( $format ), $format );
```
| Used By | Description |
| --- | --- |
| [the\_time()](../functions/the_time) wp-includes/general-template.php | Displays the time at which the post was written. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress apply_filters( 'wp_prepare_revision_for_js', array $revisions_data, WP_Post $revision, WP_Post $post ) apply\_filters( 'wp\_prepare\_revision\_for\_js', array $revisions\_data, WP\_Post $revision, WP\_Post $post )
==============================================================================================================
Filters the array of revisions used on the revisions screen.
`$revisions_data` array The bootstrapped data for the revisions screen.
* `id`intRevision ID.
* `title`stringTitle for the revision's parent [WP\_Post](../classes/wp_post) object.
* `author`intRevision post author ID.
* `date`stringDate the revision was modified.
* `dateShort`stringShort-form version of the date the revision was modified.
* `timeAgo`stringGMT-aware amount of time ago the revision was modified.
* `autosave`boolWhether the revision is an autosave.
* `current`boolWhether the revision is both not an autosave and the post modified date matches the revision modified date (GMT-aware).
* `restoreUrl`bool|falseURL if the revision can be restored, false otherwise.
`$revision` [WP\_Post](../classes/wp_post) The revision's [WP\_Post](../classes/wp_post) object. `$post` [WP\_Post](../classes/wp_post) The revision's parent [WP\_Post](../classes/wp_post) object. File: `wp-admin/includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/revision.php/)
```
$revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_prepare\_revisions\_for\_js()](../functions/wp_prepare_revisions_for_js) wp-admin/includes/revision.php | Prepare revisions for JavaScript. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( '_get_page_link', string $link, int $post_id ) apply\_filters( '\_get\_page\_link', string $link, int $post\_id )
==================================================================
Filters the permalink for a non-page\_on\_front page.
`$link` string The page's permalink. `$post_id` int The ID of the page. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( '_get_page_link', $link, $post->ID );
```
| Used By | Description |
| --- | --- |
| [\_get\_page\_link()](../functions/_get_page_link) wp-includes/link-template.php | Retrieves the page permalink. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( "option_{$option}", mixed $value, string $option ) apply\_filters( "option\_{$option}", mixed $value, string $option )
===================================================================
Filters the value of an existing option.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$value` mixed Value of the option. If stored serialized, it will be unserialized prior to being returned. `$option` string Option name. This hook allows you to filter any option after database lookup.
File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
return apply_filters( "option_{$option}", maybe_unserialize( $value ), $option );
```
| Used By | Description |
| --- | --- |
| [get\_option()](../functions/get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$option` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'register_setting', string $option_group, string $option_name, array $args ) do\_action( 'register\_setting', string $option\_group, string $option\_name, array $args )
===========================================================================================
Fires immediately before the setting is registered but after its filters are in place.
`$option_group` string Setting group. `$option_name` string Setting name. `$args` array Array of setting registration arguments. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'register_setting', $option_group, $option_name, $args );
```
| Used By | Description |
| --- | --- |
| [register\_setting()](../functions/register_setting) wp-includes/option.php | Registers a setting and its data. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'widget_archives_dropdown_args', array $args, array $instance ) apply\_filters( 'widget\_archives\_dropdown\_args', array $args, array $instance )
==================================================================================
Filters the arguments for the Archives widget drop-down.
* [wp\_get\_archives()](../functions/wp_get_archives)
`$args` array An array of Archives widget drop-down arguments. `$instance` array Settings for the current Archives widget instance. File: `wp-includes/widgets/class-wp-widget-archives.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-archives.php/)
```
$dropdown_args = apply_filters(
'widget_archives_dropdown_args',
array(
'type' => 'monthly',
'format' => 'option',
'show_post_count' => $count,
),
$instance
);
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Archives::widget()](../classes/wp_widget_archives/widget) wp-includes/widgets/class-wp-widget-archives.php | Outputs the content for the current Archives widget instance. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'rest_exposed_cors_headers', string[] $expose_headers ) apply\_filters( 'rest\_exposed\_cors\_headers', string[] $expose\_headers )
===========================================================================
Filters the list of response headers that are exposed to REST API CORS requests.
`$expose_headers` string[] The list of response headers to expose. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
$expose_headers = apply_filters( 'rest_exposed_cors_headers', $expose_headers );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::serve\_request()](../classes/wp_rest_server/serve_request) wp-includes/rest-api/class-wp-rest-server.php | Handles serving a REST API request. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'themes_api', false|object|array $override, string $action, object $args ) apply\_filters( 'themes\_api', false|object|array $override, string $action, object $args )
===========================================================================================
Filters whether to override the WordPress.org Themes API.
Returning a non-false value will effectively short-circuit the WordPress.org API request.
If `$action` is ‘query\_themes’, ‘theme\_information’, or ‘feature\_list’, an object MUST be passed. If `$action` is ‘hot\_tags’, an array should be passed.
`$override` false|object|array Whether to override the WordPress.org Themes API. Default false. `$action` string Requested action. Likely values are `'theme_information'`, `'feature_list'`, or `'query_themes'`. `$args` object Arguments used to query for installer pages from the Themes API. File: `wp-admin/includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
```
$res = apply_filters( 'themes_api', false, $action, $args );
```
| Used By | Description |
| --- | --- |
| [themes\_api()](../functions/themes_api) wp-admin/includes/theme.php | Retrieves theme installer pages from the WordPress.org Themes API. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'widget_categories_dropdown_args', array $cat_args, array $instance ) apply\_filters( 'widget\_categories\_dropdown\_args', array $cat\_args, array $instance )
=========================================================================================
Filters the arguments for the Categories widget drop-down.
* [wp\_dropdown\_categories()](../functions/wp_dropdown_categories)
`$cat_args` array An array of Categories widget drop-down arguments. `$instance` array Array of settings for the current widget. File: `wp-includes/widgets/class-wp-widget-categories.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-categories.php/)
```
wp_dropdown_categories( apply_filters( 'widget_categories_dropdown_args', $cat_args, $instance ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Categories::widget()](../classes/wp_widget_categories/widget) wp-includes/widgets/class-wp-widget-categories.php | Outputs the content for the current Categories widget instance. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'privacy_policy_url', string $url, int $policy_page_id ) apply\_filters( 'privacy\_policy\_url', string $url, int $policy\_page\_id )
============================================================================
Filters the URL of the privacy policy page.
`$url` string The URL to the privacy policy page. Empty string if it doesn't exist. `$policy_page_id` int The ID of privacy policy page. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'privacy_policy_url', $url, $policy_page_id );
```
| Used By | Description |
| --- | --- |
| [get\_privacy\_policy\_url()](../functions/get_privacy_policy_url) wp-includes/link-template.php | Retrieves the URL to the privacy policy page. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( "update_{$meta_type}_metadata_cache", mixed $check, int[] $object_ids ) apply\_filters( "update\_{$meta\_type}\_metadata\_cache", mixed $check, int[] $object\_ids )
============================================================================================
Short-circuits updating the metadata cache of a specific type.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
* `update_post_metadata_cache`
* `update_comment_metadata_cache`
* `update_term_metadata_cache`
* `update_user_metadata_cache`
`$check` mixed Whether to allow updating the meta cache of the given type. `$object_ids` int[] Array of object IDs to update the meta cache for. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
$check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids );
```
| Used By | Description |
| --- | --- |
| [update\_meta\_cache()](../functions/update_meta_cache) wp-includes/meta.php | Updates the metadata cache for the specified objects. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'unspam_comment', string $comment_id, WP_Comment $comment ) do\_action( 'unspam\_comment', string $comment\_id, WP\_Comment $comment )
==========================================================================
Fires immediately before a comment is unmarked as Spam.
`$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The comment to be unmarked as spam. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'unspam_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_unspam\_comment()](../functions/wp_unspam_comment) wp-includes/comment.php | Removes a comment from the Spam. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$comment` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters_deprecated( 'wp_get_default_privacy_policy_content', string $content, string[] $strings, bool $description, bool $blocks ) apply\_filters\_deprecated( 'wp\_get\_default\_privacy\_policy\_content', string $content, string[] $strings, bool $description, bool $blocks )
===============================================================================================================================================
This hook has been deprecated. Use [wp\_add\_privacy\_policy\_content()](../functions/wp_add_privacy_policy_content) instead.
Filters the default content suggested for inclusion in a privacy policy.
`$content` string The default policy content. `$strings` string[] An array of privacy policy content strings. `$description` bool Whether policy descriptions should be included. `$blocks` bool Whether the content should be formatted for the block editor. File: `wp-admin/includes/class-wp-privacy-policy-content.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-privacy-policy-content.php/)
```
return apply_filters_deprecated(
'wp_get_default_privacy_policy_content',
array( $content, $strings, $description, $blocks ),
'5.7.0',
'wp_add_privacy_policy_content()'
);
```
| Used By | Description |
| --- | --- |
| [WP\_Privacy\_Policy\_Content::get\_default\_content()](../classes/wp_privacy_policy_content/get_default_content) wp-admin/includes/class-wp-privacy-policy-content.php | Return the default suggested privacy policy content. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Use [wp\_add\_privacy\_policy\_content()](../functions/wp_add_privacy_policy_content) instead. |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Added the `$strings`, `$description`, and `$blocks` parameters. |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress do_action( 'comment_form', int $post_id ) do\_action( 'comment\_form', int $post\_id )
============================================
Fires at the bottom of the comment form, inside the closing form tag.
`$post_id` int The post ID. comment\_form is a template hook triggered at the bottom of a form rendered by [comment\_form()](../functions/comment_form) right before the closing </form>.
Functions hooked to this action receive the post ID as a parameter.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
do_action( 'comment_form', $post_id );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_mail_content_type', string $content_type ) apply\_filters( 'wp\_mail\_content\_type', string $content\_type )
==================================================================
Filters the [wp\_mail()](../functions/wp_mail) content type.
`$content_type` string Default [wp\_mail()](../functions/wp_mail) content type. * The default content type for email sent through the [wp\_mail()](../functions/wp_mail) function is ‘`text/plain`‘ which does not allow using HTML. However, you can use the `wp_mail_content_type` filter to change the default content type of the email.
* In general, content type is going to be ‘`text/plain`‘ as the default, or ‘`text/html`‘ for HTML email; but other MIME types are possible.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$content_type = apply_filters( 'wp_mail_content_type', $content_type );
```
| Used By | Description |
| --- | --- |
| [wp\_staticize\_emoji\_for\_email()](../functions/wp_staticize_emoji_for_email) wp-includes/formatting.php | Converts emoji in emails into static images. |
| [wp\_mail()](../functions/wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'customize_render_partials_after', WP_Customize_Selective_Refresh $refresh, array $partials ) do\_action( 'customize\_render\_partials\_after', WP\_Customize\_Selective\_Refresh $refresh, array $partials )
===============================================================================================================
Fires immediately after partials are rendered.
Plugins may do things like call [wp\_footer()](../functions/wp_footer) to scrape scripts output and return them via the [‘customize\_render\_partials\_response’](customize_render_partials_response) filter.
`$refresh` [WP\_Customize\_Selective\_Refresh](../classes/wp_customize_selective_refresh) Selective refresh component. `$partials` array Placements' context data for the partials rendered in the request.
The array is keyed by partial ID, with each item being an array of the placements' context data. File: `wp-includes/customize/class-wp-customize-selective-refresh.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-selective-refresh.php/)
```
do_action( 'customize_render_partials_after', $this, $partials );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Selective\_Refresh::handle\_render\_partials\_request()](../classes/wp_customize_selective_refresh/handle_render_partials_request) wp-includes/customize/class-wp-customize-selective-refresh.php | Handles the Ajax request to return the rendered partials for the requested placements. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'user_contactmethods', string[] $methods, WP_User|null $user ) apply\_filters( 'user\_contactmethods', string[] $methods, WP\_User|null $user )
================================================================================
Filters the user contact methods.
`$methods` string[] Array of contact method labels keyed by contact method. `$user` [WP\_User](../classes/wp_user)|null [WP\_User](../classes/wp_user) object or null if none was provided. Customize the contact information fields available to your WordPress users. Edits the available contact methods on a user’s profile page. Contact methods can be both added and removed.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'user_contactmethods', $methods, $user );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_user\_contact\_methods()](../functions/wp_get_user_contact_methods) wp-includes/user.php | Sets up the user contact methods. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_admin_bar_show_site_icons', bool $show_site_icons ) apply\_filters( 'wp\_admin\_bar\_show\_site\_icons', bool $show\_site\_icons )
==============================================================================
Filters whether to show the site icons in toolbar.
Returning false to this hook is the recommended way to hide site icons in the toolbar.
A truthy return may have negative performance impact on large multisites.
`$show_site_icons` bool Whether site icons should be shown in the toolbar. Default true. File: `wp-includes/admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
```
$show_site_icons = apply_filters( 'wp_admin_bar_show_site_icons', true );
```
| Used By | Description |
| --- | --- |
| [wp\_admin\_bar\_my\_sites\_menu()](../functions/wp_admin_bar_my_sites_menu) wp-includes/admin-bar.php | Adds the “My Sites/[Site Name]” menu and all submenus. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'oembed_providers', array[] $providers ) apply\_filters( 'oembed\_providers', array[] $providers )
=========================================================
Filters the list of sanctioned oEmbed providers.
Since WordPress 4.4, oEmbed discovery is enabled for all users and allows embedding of sanitized iframes. The providers in this list are sanctioned, meaning they are trusted and allowed to embed any content, such as iframes, videos, JavaScript, and arbitrary HTML.
Supported providers:
| Provider | Flavor | Since |
| --- | --- | --- |
| Dailymotion | dailymotion.com | 2.9.0 |
| Flickr | flickr.com | 2.9.0 |
| Scribd | scribd.com | 2.9.0 |
| Vimeo | vimeo.com | 2.9.0 |
| WordPress.tv | wordpress.tv | 2.9.0 |
| YouTube | youtube.com/watch | 2.9.0 |
| Crowdsignal | polldaddy.com | 3.0.0 |
| SmugMug | smugmug.com | 3.0.0 |
| YouTube | youtu.be | 3.0.0 |
| Twitter | twitter.com | 3.4.0 |
| Slideshare | slideshare.net | 3.5.0 |
| SoundCloud | soundcloud.com | 3.5.0 |
| Dailymotion | dai.ly | 3.6.0 |
| Flickr | flic.kr | 3.6.0 |
| Spotify | spotify.com | 3.6.0 |
| Imgur | imgur.com | 3.9.0 |
| Animoto | animoto.com | 4.0.0 |
| Animoto | video214.com | 4.0.0 |
| Issuu | issuu.com | 4.0.0 |
| Mixcloud | mixcloud.com | 4.0.0 |
| Crowdsignal | poll.fm | 4.0.0 |
| TED | ted.com | 4.0.0 |
| YouTube | youtube.com/playlist | 4.0.0 |
| Tumblr | tumblr.com | 4.2.0 |
| Kickstarter | kickstarter.com | 4.2.0 |
| Kickstarter | kck.st | 4.2.0 |
| Cloudup | cloudup.com | 4.3.0 |
| ReverbNation | reverbnation.com | 4.4.0 |
| VideoPress | videopress.com | 4.4.0 |
| Reddit | reddit.com | 4.4.0 |
| Speaker Deck | speakerdeck.com | 4.4.0 |
| Twitter | twitter.com/timelines | 4.5.0 |
| Twitter | twitter.com/moments | 4.5.0 |
| Twitter | twitter.com/user | 4.7.0 |
| Twitter | twitter.com/likes | 4.7.0 |
| Twitter | twitter.com/lists | 4.7.0 |
| Screencast | screencast.com | 4.8.0 |
| Amazon | amazon.com (com.mx, com.br, ca) | 4.9.0 |
| Amazon | amazon.de (fr, it, es, in, nl, ru, co.uk) | 4.9.0 |
| Amazon | amazon.co.jp (com.au) | 4.9.0 |
| Amazon | amazon.cn | 4.9.0 |
| Amazon | a.co | 4.9.0 |
| Amazon | amzn.to (eu, in, asia) | 4.9.0 |
| Amazon | z.cn | 4.9.0 |
| Someecards | someecards.com | 4.9.0 |
| Someecards | some.ly | 4.9.0 |
| Crowdsignal | survey.fm | 5.1.0 |
| TikTok | tiktok.com | 5.4.0 |
| Pinterest | pinterest.com | 5.9.0 |
| WolframCloud | wolframcloud.com | 5.9.0 |
| Pocket Casts | pocketcasts.com | 6.1.0 |
No longer supported providers:
| Provider | Flavor | Since | Removed |
| --- | --- | --- | --- |
| Qik | qik.com | 2.9.0 | 3.9.0 |
| Viddler | viddler.com | 2.9.0 | 4.0.0 |
| Revision3 | revision3.com | 2.9.0 | 4.2.0 |
| Blip | blip.tv | 2.9.0 | 4.4.0 |
| Rdio | rdio.com | 3.6.0 | 4.4.1 |
| Rdio | rd.io | 3.6.0 | 4.4.1 |
| Vine | vine.co | 4.1.0 | 4.9.0 |
| Photobucket | photobucket.com | 2.9.0 | 5.1.0 |
| Funny or Die | funnyordie.com | 3.0.0 | 5.1.0 |
| CollegeHumor | collegehumor.com | 4.0.0 | 5.3.1 |
| Hulu | hulu.com | 2.9.0 | 5.5.0 |
| Instagram | instagram.com | 3.5.0 | 5.5.2 |
| Instagram | instagr.am | 3.5.0 | 5.5.2 |
| Instagram TV | instagram.com | 5.1.0 | 5.5.2 |
| Instagram TV | instagr.am | 5.1.0 | 5.5.2 |
| Facebook | facebook.com | 4.7.0 | 5.5.2 |
| Meetup.com | meetup.com | 3.9.0 | 6.0.1 |
| Meetup.com | meetu.ps | 3.9.0 | 6.0.1 |
* [wp\_oembed\_add\_provider()](../functions/wp_oembed_add_provider)
`$providers` array[] An array of arrays containing data about popular oEmbed providers. File: `wp-includes/class-wp-oembed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed.php/)
```
$this->providers = apply_filters( 'oembed_providers', $providers );
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed::\_\_construct()](../classes/wp_oembed/__construct) wp-includes/class-wp-oembed.php | Constructor. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_list_categories', string $output, array|string $args ) apply\_filters( 'wp\_list\_categories', string $output, array|string $args )
============================================================================
Filters the HTML output of a taxonomy list.
`$output` string HTML output. `$args` array|string An array or query string of taxonomy-listing arguments. See [wp\_list\_categories()](../functions/wp_list_categories) for information on accepted arguments. More Arguments from wp\_list\_categories( ... $args ) Array or string of arguments. See [WP\_Term\_Query::\_\_construct()](../classes/wp_term_query/__construct) for information on accepted arguments. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$html = apply_filters( 'wp_list_categories', $output, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_list\_categories()](../functions/wp_list_categories) wp-includes/category-template.php | Displays or retrieves the HTML list of categories. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_personal_data_email_to', string $request_email, WP_User_Request $request ) apply\_filters( 'wp\_privacy\_personal\_data\_email\_to', string $request\_email, WP\_User\_Request $request )
==============================================================================================================
Filters the recipient of the personal data export email notification.
Should be used with great caution to avoid sending the data export link to wrong emails.
`$request_email` string The email address of the notification recipient. `$request` [WP\_User\_Request](../classes/wp_user_request) The request that is initiating the notification. File: `wp-admin/includes/privacy-tools.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/privacy-tools.php/)
```
$request_email = apply_filters( 'wp_privacy_personal_data_email_to', $request->email, $request );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_send\_personal\_data\_export\_email()](../functions/wp_privacy_send_personal_data_export_email) wp-admin/includes/privacy-tools.php | Send an email to the user with a link to the personal data export file |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress do_action( 'populate_options' ) do\_action( 'populate\_options' )
=================================
Fires before creating WordPress options and populating their default values.
File: `wp-admin/includes/schema.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/schema.php/)
```
do_action( 'populate_options' );
```
| Used By | Description |
| --- | --- |
| [populate\_options()](../functions/populate_options) wp-admin/includes/schema.php | Create WordPress options and set the default values. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_nav_menu', string|null $output, stdClass $args ) apply\_filters( 'pre\_wp\_nav\_menu', string|null $output, stdClass $args )
===========================================================================
Filters whether to short-circuit the [wp\_nav\_menu()](../functions/wp_nav_menu) output.
Returning a non-null value from the filter will short-circuit [wp\_nav\_menu()](../functions/wp_nav_menu) , echoing that value if $args->echo is true, returning that value otherwise.
* [wp\_nav\_menu()](../functions/wp_nav_menu)
`$output` string|null Nav menu output to short-circuit with. Default null. `$args` stdClass An object containing [wp\_nav\_menu()](../functions/wp_nav_menu) arguments. More Arguments from wp\_nav\_menu( ... $args ) Array of nav menu arguments.
* `menu`int|string|[WP\_Term](../classes/wp_term)Desired menu. Accepts a menu ID, slug, name, or object.
* `menu_class`stringCSS class to use for the ul element which forms the menu.
Default `'menu'`.
* `menu_id`stringThe ID that is applied to the ul element which forms the menu.
Default is the menu slug, incremented.
* `container`stringWhether to wrap the ul, and what to wrap it with.
Default `'div'`.
* `container_class`stringClass that is applied to the container.
Default 'menu-{menu slug}-container'.
* `container_id`stringThe ID that is applied to the container.
* `container_aria_label`stringThe aria-label attribute that is applied to the container when it's a nav element.
* `fallback_cb`callable|falseIf the menu doesn't exist, a callback function will fire.
Default is `'wp_page_menu'`. Set to false for no fallback.
* `before`stringText before the link markup.
* `after`stringText after the link markup.
* `link_before`stringText before the link text.
* `link_after`stringText after the link text.
* `echo`boolWhether to echo the menu or return it. Default true.
* `depth`intHow many levels of the hierarchy are to be included.
0 means all. Default 0.
Default 0.
* `walker`objectInstance of a custom walker class.
* `theme_location`stringTheme location to be used. Must be registered with [register\_nav\_menu()](../functions/register_nav_menu) in order to be selectable by the user.
* `items_wrap`stringHow the list items should be wrapped. Uses printf() format with numbered placeholders. Default is a ul with an id and class.
* `item_spacing`stringWhether to preserve whitespace within the menu's HTML.
Accepts `'preserve'` or `'discard'`. Default `'preserve'`.
File: `wp-includes/nav-menu-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu-template.php/)
```
$nav_menu = apply_filters( 'pre_wp_nav_menu', null, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_nav\_menu()](../functions/wp_nav_menu) wp-includes/nav-menu-template.php | Displays a navigation menu. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'quick_edit_dropdown_pages_args', array $dropdown_args, bool $bulk ) apply\_filters( 'quick\_edit\_dropdown\_pages\_args', array $dropdown\_args, bool $bulk )
=========================================================================================
Filters the arguments used to generate the Quick Edit page-parent drop-down.
* [wp\_dropdown\_pages()](../functions/wp_dropdown_pages)
`$dropdown_args` array An array of arguments passed to [wp\_dropdown\_pages()](../functions/wp_dropdown_pages) . More Arguments from wp\_dropdown\_pages( ... $args ) Array or string of arguments to retrieve pages.
* `child_of`intPage ID to return child and grandchild pages of. Note: The value of `$hierarchical` has no bearing on whether `$child_of` returns hierarchical results. Default 0, or no restriction.
* `sort_order`stringHow to sort retrieved pages. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `sort_column`stringWhat columns to sort pages by, comma-separated. Accepts `'post_author'`, `'post_date'`, `'post_title'`, `'post_name'`, `'post_modified'`, `'menu_order'`, `'post_modified_gmt'`, `'post_parent'`, `'ID'`, `'rand'`, `'comment*count'`.
`'post*'` can be omitted for any values that start with it.
Default `'post_title'`.
* `hierarchical`boolWhether to return pages hierarchically. If false in conjunction with `$child_of` also being false, both arguments will be disregarded.
Default true.
* `exclude`int[]Array of page IDs to exclude.
* `include`int[]Array of page IDs to include. Cannot be used with `$child_of`, `$parent`, `$exclude`, `$meta_key`, `$meta_value`, or `$hierarchical`.
* `meta_key`stringOnly include pages with this meta key.
* `meta_value`stringOnly include pages with this meta value. Requires `$meta_key`.
* `authors`stringA comma-separated list of author IDs.
* `parent`intPage ID to return direct children of. Default -1, or no restriction.
* `exclude_tree`string|int[]Comma-separated string or array of page IDs to exclude.
* `number`intThe number of pages to return. Default 0, or all pages.
* `offset`intThe number of pages to skip before returning. Requires `$number`.
Default 0.
* `post_type`stringThe post type to query. Default `'page'`.
* `post_status`string|arrayA comma-separated list or array of post statuses to include.
Default `'publish'`.
`$bulk` bool A flag to denote if it's a bulk action. File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args, $bulk );
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::inline\_edit()](../classes/wp_posts_list_table/inline_edit) wp-admin/includes/class-wp-posts-list-table.php | Outputs the hidden row displayed when inline editing |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The `$bulk` parameter was added. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'deprecated_argument_trigger_error', bool $trigger ) apply\_filters( 'deprecated\_argument\_trigger\_error', bool $trigger )
=======================================================================
Filters whether to trigger an error for deprecated arguments.
`$trigger` bool Whether to trigger the error for deprecated arguments. Default true. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
```
| Used By | Description |
| --- | --- |
| [\_deprecated\_argument()](../functions/_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_get_nav_menus', WP_Term[] $menus, array $args ) apply\_filters( 'wp\_get\_nav\_menus', WP\_Term[] $menus, array $args )
=======================================================================
Filters the navigation menu objects being returned.
* [get\_terms()](../functions/get_terms)
`$menus` [WP\_Term](../classes/wp_term)[] An array of menu objects. `$args` array An array of arguments used to retrieve menu objects. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
return apply_filters( 'wp_get_nav_menus', get_terms( $args ), $args );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_nav\_menus()](../functions/wp_get_nav_menus) wp-includes/nav-menu.php | Returns all navigation menu objects. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'wp_unregister_sidebar_widget', int|string $id ) do\_action( 'wp\_unregister\_sidebar\_widget', int|string $id )
===============================================================
Fires just before a widget is removed from a sidebar.
`$id` int|string The widget ID. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
do_action( 'wp_unregister_sidebar_widget', $id );
```
| Used By | Description |
| --- | --- |
| [wp\_unregister\_sidebar\_widget()](../functions/wp_unregister_sidebar_widget) wp-includes/widgets.php | Remove widget from sidebar. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'install_theme_overwrite_comparison', string $table, WP_Theme $current_theme_data, array $new_theme_data ) apply\_filters( 'install\_theme\_overwrite\_comparison', string $table, WP\_Theme $current\_theme\_data, array $new\_theme\_data )
==================================================================================================================================
Filters the compare table output for overwriting a theme package on upload.
`$table` string The output table with Name, Version, Author, RequiresWP, and RequiresPHP info. `$current_theme_data` [WP\_Theme](../classes/wp_theme) Active theme data. `$new_theme_data` array Array with uploaded theme data. File: `wp-admin/includes/class-theme-installer-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-theme-installer-skin.php/)
```
echo apply_filters( 'install_theme_overwrite_comparison', $table, $current_theme_data, $new_theme_data );
```
| Used By | Description |
| --- | --- |
| [Theme\_Installer\_Skin::do\_overwrite()](../classes/theme_installer_skin/do_overwrite) wp-admin/includes/class-theme-installer-skin.php | Check if the theme can be overwritten and output the HTML for overwriting a theme on upload. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters_ref_array( 'comment_feed_orderby', string $corderby, WP_Query $query ) apply\_filters\_ref\_array( 'comment\_feed\_orderby', string $corderby, WP\_Query $query )
==========================================================================================
Filters the ORDER BY clause of the comments feed query before sending.
`$corderby` string The ORDER BY clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'auth_cookie_bad_username', string[] $cookie_elements ) do\_action( 'auth\_cookie\_bad\_username', string[] $cookie\_elements )
=======================================================================
Fires if a bad username is entered in the user authentication process.
`$cookie_elements` string[] Authentication cookie components. None of the components should be assumed to be valid as they come directly from a client-provided cookie value.
* `username`stringUser's username.
* `expiration`stringThe time the cookie expires as a UNIX timestamp.
* `token`stringUser's session token used.
* `hmac`stringThe security hash for the cookie.
* `scheme`stringThe cookie scheme to use.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'auth_cookie_bad_username', $cookie_elements );
```
| Used By | Description |
| --- | --- |
| [wp\_validate\_auth\_cookie()](../functions/wp_validate_auth_cookie) wp-includes/pluggable.php | Validates authentication cookie. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'heartbeat_settings', array $settings ) apply\_filters( 'heartbeat\_settings', array $settings )
========================================================
Filters the Heartbeat settings.
`$settings` array Heartbeat settings array. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
apply_filters( 'heartbeat_settings', array() )
```
| Used By | Description |
| --- | --- |
| [wp\_default\_scripts()](../functions/wp_default_scripts) wp-includes/script-loader.php | Registers all WordPress scripts. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'wp_password_change_notification_email', array $wp_password_change_notification_email, WP_User $user, string $blogname ) apply\_filters( 'wp\_password\_change\_notification\_email', array $wp\_password\_change\_notification\_email, WP\_User $user, string $blogname )
=================================================================================================================================================
Filters the contents of the password change notification email sent to the site admin.
`$wp_password_change_notification_email` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe intended recipient - site admin email address.
* `subject`stringThe subject of the email.
* `message`stringThe body of the email.
* `headers`stringThe headers of the email.
`$user` [WP\_User](../classes/wp_user) User object for user whose password was changed. `$blogname` string The site title. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$wp_password_change_notification_email = apply_filters( 'wp_password_change_notification_email', $wp_password_change_notification_email, $user, $blogname );
```
| Used By | Description |
| --- | --- |
| [wp\_password\_change\_notification()](../functions/wp_password_change_notification) wp-includes/pluggable.php | Notifies the blog admin of a user changing password, normally via email. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'pre_get_site_by_path', null|false|WP_Site $site, string $domain, string $path, int|null $segments, string[] $paths ) apply\_filters( 'pre\_get\_site\_by\_path', null|false|WP\_Site $site, string $domain, string $path, int|null $segments, string[] $paths )
==========================================================================================================================================
Determines a site by its domain and path.
This allows one to short-circuit the default logic, perhaps by replacing it with a routine that is more optimal for your setup.
Return null to avoid the short-circuit. Return false if no site can be found at the requested domain and path. Otherwise, return a site object.
`$site` null|false|[WP\_Site](../classes/wp_site) Site value to return by path. Default null to continue retrieving the site. `$domain` string The requested domain. `$path` string The requested path, in full. `$segments` int|null The suggested number of paths to consult.
Default null, meaning the entire path was to be consulted. `$paths` string[] The paths to search for, based on $path and $segments. File: `wp-includes/ms-load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-load.php/)
```
$pre = apply_filters( 'pre_get_site_by_path', null, $domain, $path, $segments, $paths );
```
| Used By | Description |
| --- | --- |
| [get\_site\_by\_path()](../functions/get_site_by_path) wp-includes/ms-load.php | Retrieves the closest matching site object by its domain and path. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'pre_get_blogs_of_user', null|object[] $sites, int $user_id, bool $all ) apply\_filters( 'pre\_get\_blogs\_of\_user', null|object[] $sites, int $user\_id, bool $all )
=============================================================================================
Filters the list of a user’s sites before it is populated.
Returning a non-null value from the filter will effectively short circuit [get\_blogs\_of\_user()](../functions/get_blogs_of_user) , returning that value instead.
`$sites` null|object[] An array of site objects of which the user is a member. `$user_id` int User ID. `$all` bool Whether the returned array should contain all sites, including those marked `'deleted'`, `'archived'`, or `'spam'`. Default false. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$sites = apply_filters( 'pre_get_blogs_of_user', null, $user_id, $all );
```
| Used By | Description |
| --- | --- |
| [get\_blogs\_of\_user()](../functions/get_blogs_of_user) wp-includes/user.php | Gets the sites a user belongs to. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'wp_insert_post_data', array $data, array $postarr, array $unsanitized_postarr, bool $update ) apply\_filters( 'wp\_insert\_post\_data', array $data, array $postarr, array $unsanitized\_postarr, bool $update )
==================================================================================================================
Filters slashed post data just before it is inserted into the database.
`$data` array An array of slashed, sanitized, and processed post data. `$postarr` array An array of sanitized (and slashed) but otherwise unmodified post data. `$unsanitized_postarr` array An array of slashed yet \*unsanitized\* and unprocessed post data as originally passed to [wp\_insert\_post()](../functions/wp_insert_post) . `$update` bool Whether this is an existing post being updated. You must pass the value 2 for the `$accepted_args` argument in `add_filter()` if you want to access `$postarr`.
Some have problems to get the post ID inside wp\_insert\_post\_data:
If you have access to $postarr, you can easily retrieve the post ID with
```
$my_post_id = $postarr['ID'];
```
The defaults for the parameter $data are:
`'post_author',
'post_date',
'post_date_gmt',
'post_content',
'post_content_filtered',
'post_title',
'post_excerpt',
'post_status',
'post_type',
'comment_status',
'ping_status',
'post_password',
'post_name',
'to_ping',
'pinged',
'post_modified',
'post_modified_gmt',
'post_parent',
'menu_order',
'guid'`
The defaults for the parameter $postarr are:
`'post_status' - Default is 'draft'.
'post_type' - Default is 'post'.
'post_author' - Default is current user ID ($user_ID). The ID of the user who added the post.
'ping_status' - Default is the value in 'default_ping_status' option.
Whether the attachment can accept pings.
'post_parent' - Default is 0. Set this for the post it belongs to, if any.
'menu_order' - Default is 0. The order it is displayed.
'to_ping' - Whether to ping.
'pinged' - Default is empty string.
'post_password' - Default is empty string. The password to access the attachment.
'guid' - Global Unique ID for referencing the attachment.
'post_content_filtered' - Post content filtered.
'post_excerpt' - Post excerpt.`
The post $postarr looks like:
`'post_status',
'post_type',
'post_author',
'ping_status',
'post_parent',
'menu_order',
'to_ping',
'pinged',
'post_password',
'guid',
'post_content_filtered',
'post_excerpt',
'import_id',
'post_content',
'post_title',
'ID',
'post_date',
'post_date_gmt',
'comment_status',
'post_name',
'post_modified',
'post_modified_gmt',
'post_mime_type',
'comment_count',
'ancestors',
'post_category',
'tags_input',
'filter'`
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr, $update );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | The `$update` parameter was added. |
| [5.4.1](https://developer.wordpress.org/reference/since/5.4.1/) | The `$unsanitized_postarr` parameter was added. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'wp_video_extensions', string[] $extensions ) apply\_filters( 'wp\_video\_extensions', string[] $extensions )
===============================================================
Filters the list of supported video formats.
`$extensions` string[] An array of supported video formats. Defaults are `'mp4'`, `'m4v'`, `'webm'`, `'ogv'`, `'flv'`. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'flv' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_video\_extensions()](../functions/wp_get_video_extensions) wp-includes/media.php | Returns a filtered list of supported video formats. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'print_head_scripts', bool $print ) apply\_filters( 'print\_head\_scripts', bool $print )
=====================================================
Filters whether to print the head scripts.
`$print` bool Whether to print the head scripts. Default true. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
if ( apply_filters( 'print_head_scripts', true ) ) {
```
| Used By | Description |
| --- | --- |
| [print\_head\_scripts()](../functions/print_head_scripts) wp-includes/script-loader.php | Prints the script queue in the HTML head on admin pages. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'user_register', int $user_id, array $userdata ) do\_action( 'user\_register', int $user\_id, array $userdata )
==============================================================
Fires immediately after a new user is registered.
`$user_id` int User ID. `$userdata` array The raw array of data passed to [wp\_insert\_user()](../functions/wp_insert_user) . More Arguments from wp\_insert\_user( ... $userdata ) An array, object, or [WP\_User](../classes/wp_user) object of user data arguments.
* `ID`intUser ID. If supplied, the user will be updated.
* `user_pass`stringThe plain-text user password.
* `user_login`stringThe user's login username.
* `user_nicename`stringThe URL-friendly user name.
* `user_url`stringThe user URL.
* `user_email`stringThe user email address.
* `display_name`stringThe user's display name.
Default is the user's username.
* `nickname`stringThe user's nickname.
Default is the user's username.
* `first_name`stringThe user's first name. For new users, will be used to build the first part of the user's display name if `$display_name` is not specified.
* `last_name`stringThe user's last name. For new users, will be used to build the second part of the user's display name if `$display_name` is not specified.
* `description`stringThe user's biographical description.
* `rich_editing`stringWhether to enable the rich-editor for the user.
Accepts `'true'` or `'false'` as a string literal, not boolean. Default `'true'`.
* `syntax_highlighting`stringWhether to enable the rich code editor for the user.
Accepts `'true'` or `'false'` as a string literal, not boolean. Default `'true'`.
* `comment_shortcuts`stringWhether to enable comment moderation keyboard shortcuts for the user. Accepts `'true'` or `'false'` as a string literal, not boolean. Default `'false'`.
* `admin_color`stringAdmin color scheme for the user. Default `'fresh'`.
* `use_ssl`boolWhether the user should always access the admin over https. Default false.
* `user_registered`stringDate the user registered in UTC. Format is 'Y-m-d H:i:s'.
* `user_activation_key`stringPassword reset key. Default empty.
* `spam`boolMultisite only. Whether the user is marked as spam.
Default false.
* `show_admin_bar_front`stringWhether to display the Admin Bar for the user on the site's front end. Accepts `'true'` or `'false'` as a string literal, not boolean. Default `'true'`.
* `role`stringUser's role.
* `locale`stringUser's locale. Default empty.
* `meta_input`arrayArray of custom user meta values keyed by meta key.
Default empty.
This action hook allows you to access data for a new user immediately **after** they are added to the database. The user id is passed to hook as an argument.
Not all user meta data has been stored in the database when this action is triggered. For example, nickname is in the database but first\_name and last\_name are not (as of v3.9.1). The password has already been encrypted when this action is triggered.
Typically, this hook is used for saving additional user meta passed by custom registration forms.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'user_register', $user_id, $userdata );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | The `$userdata` parameter was added. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'register_sidebar_defaults', array $defaults ) apply\_filters( 'register\_sidebar\_defaults', array $defaults )
================================================================
Filters the sidebar default arguments.
* [register\_sidebar()](../functions/register_sidebar)
`$defaults` array The default sidebar arguments. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
$sidebar = wp_parse_args( $args, apply_filters( 'register_sidebar_defaults', $defaults ) );
```
| Used By | Description |
| --- | --- |
| [register\_sidebar()](../functions/register_sidebar) wp-includes/widgets.php | Builds the definition for a single sidebar and returns the ID. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters_ref_array( 'networks_clauses', string[] $clauses, WP_Network_Query $query ) apply\_filters\_ref\_array( 'networks\_clauses', string[] $clauses, WP\_Network\_Query $query )
===============================================================================================
Filters the network query clauses.
`$clauses` string[] An associative array of network query clauses. `$query` [WP\_Network\_Query](../classes/wp_network_query) Current instance of [WP\_Network\_Query](../classes/wp_network_query) (passed by reference). File: `wp-includes/class-wp-network-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-network-query.php/)
```
$clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $pieces ), &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Network\_Query::get\_network\_ids()](../classes/wp_network_query/get_network_ids) wp-includes/class-wp-network-query.php | Used internally to get a list of network IDs matching the query vars. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'block_type_metadata_settings', array $settings, array $metadata ) apply\_filters( 'block\_type\_metadata\_settings', array $settings, array $metadata )
=====================================================================================
Filters the settings determined from the block type metadata.
`$settings` array Array of determined settings for registering a block type. `$metadata` array Metadata provided for registering a block type. File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
$settings = apply_filters(
'block_type_metadata_settings',
array_merge(
$settings,
$args
),
$metadata
);
```
| Used By | Description |
| --- | --- |
| [register\_block\_type\_from\_metadata()](../functions/register_block_type_from_metadata) wp-includes/blocks.php | Registers a block type from the metadata stored in the `block.json` file. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'post_link', string $permalink, WP_Post $post, bool $leavename ) apply\_filters( 'post\_link', string $permalink, WP\_Post $post, bool $leavename )
==================================================================================
Filters the permalink for a post.
Only applies to posts with post\_type of ‘post’.
`$permalink` string The post's permalink. `$post` [WP\_Post](../classes/wp_post) The post in question. `$leavename` bool Whether to keep the post name. `post_link` is a filter applied to the permalink URL for a post prior to returning the processed url by the function [get\_permalink()](../functions/get_permalink) .
This filter only applies to posts with post\_type of ‘post’. For that filter which applies to custom post type look <post_type_link>.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'post_link', $permalink, $post, $leavename );
```
| Used By | Description |
| --- | --- |
| [get\_permalink()](../functions/get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( "rest_insert_{$this->post_type}", WP_Post $post, WP_REST_Request $request, bool $creating ) do\_action( "rest\_insert\_{$this->post\_type}", WP\_Post $post, WP\_REST\_Request $request, bool $creating )
=============================================================================================================
Fires after a single post is created or updated via the REST API.
The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
Possible hook names include:
* `rest_insert_post`
* `rest_insert_page`
* `rest_insert_attachment`
`$post` [WP\_Post](../classes/wp_post) Inserted or updated post object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating a post, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php/)
```
do_action( "rest_insert_{$this->post_type}", $post, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::create\_item()](../classes/wp_rest_posts_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Creates a single post. |
| [WP\_REST\_Posts\_Controller::update\_item()](../classes/wp_rest_posts_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Updates a single post. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters_ref_array( 'post_limits_request', string $limits, WP_Query $query ) apply\_filters\_ref\_array( 'post\_limits\_request', string $limits, WP\_Query $query )
=======================================================================================
Filters the LIMIT clause of the query.
For use by caching plugins.
`$limits` string The LIMIT clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'wp_ajax_crop_image_pre_save', string $context, int $attachment_id, string $cropped ) do\_action( 'wp\_ajax\_crop\_image\_pre\_save', string $context, int $attachment\_id, string $cropped )
=======================================================================================================
Fires before a cropped image is saved.
Allows to add filters to modify the way a cropped image is saved.
`$context` string The Customizer control requesting the cropped image. `$attachment_id` int The attachment ID of the original image. `$cropped` string Path to the cropped image file. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_crop\_image()](../functions/wp_ajax_crop_image) wp-admin/includes/ajax-actions.php | Ajax handler for cropping an image. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'wpmu_blogs_columns', string[] $sites_columns ) apply\_filters( 'wpmu\_blogs\_columns', string[] $sites\_columns )
==================================================================
Filters the displayed site columns in Sites list table.
`$sites_columns` string[] An array of displayed site columns. Default `'cb'`, `'blogname'`, `'lastupdated'`, `'registered'`, `'users'`. File: `wp-admin/includes/class-wp-ms-sites-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-sites-list-table.php/)
```
return apply_filters( 'wpmu_blogs_columns', $sites_columns );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Sites\_List\_Table::get\_columns()](../classes/wp_ms_sites_list_table/get_columns) wp-admin/includes/class-wp-ms-sites-list-table.php | |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'secure_logged_in_cookie', bool $secure_logged_in_cookie, int $user_id, bool $secure ) apply\_filters( 'secure\_logged\_in\_cookie', bool $secure\_logged\_in\_cookie, int $user\_id, bool $secure )
=============================================================================================================
Filters whether the logged in cookie should only be sent over HTTPS.
`$secure_logged_in_cookie` bool Whether the logged in cookie should only be sent over HTTPS. `$user_id` int User ID. `$secure` bool Whether the auth cookie should only be sent over HTTPS. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$secure_logged_in_cookie = apply_filters( 'secure_logged_in_cookie', $secure_logged_in_cookie, $user_id, $secure );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_auth\_cookie()](../functions/wp_set_auth_cookie) wp-includes/pluggable.php | Sets the authentication cookies based on user ID. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'theme_root_uri', string $theme_root_uri, string $siteurl, string $stylesheet_or_template ) apply\_filters( 'theme\_root\_uri', string $theme\_root\_uri, string $siteurl, string $stylesheet\_or\_template )
=================================================================================================================
Filters the URI for themes directory.
`$theme_root_uri` string The URI for themes directory. `$siteurl` string WordPress web address which is set in General Options. `$stylesheet_or_template` string The stylesheet or template name of the theme. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'theme_root_uri', $theme_root_uri, get_option( 'siteurl' ), $stylesheet_or_template );
```
| Used By | Description |
| --- | --- |
| [get\_theme\_root\_uri()](../functions/get_theme_root_uri) wp-includes/theme.php | Retrieves URI for themes directory. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'comment_text', string $comment_text, WP_Comment|null $comment, array $args ) apply\_filters( 'comment\_text', string $comment\_text, WP\_Comment|null $comment, array $args )
================================================================================================
Filters the text of a comment to be displayed.
* [Walker\_Comment::comment()](../classes/walker_comment/comment)
`$comment_text` string Text of the current comment. `$comment` [WP\_Comment](../classes/wp_comment)|null The comment object. Null if not found. `$args` array An array of arguments. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
echo apply_filters( 'comment_text', $comment_text, $comment, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_comments_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Prepares a single comment output for response. |
| [comment\_text()](../functions/comment_text) wp-includes/comment-template.php | Displays the text of the current comment. |
| [check\_comment()](../functions/check_comment) wp-includes/comment.php | Checks whether a comment passes internal checks to be allowed to add. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'rest_get_max_batch_size', int $max_size ) apply\_filters( 'rest\_get\_max\_batch\_size', int $max\_size )
===============================================================
Filters the maximum number of REST API requests that can be included in a batch.
`$max_size` int The maximum size. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
return apply_filters( 'rest_get_max_batch_size', 25 );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::get\_max\_batch\_size()](../classes/wp_rest_server/get_max_batch_size) wp-includes/rest-api/class-wp-rest-server.php | Gets the maximum number of requests that can be included in a batch. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'send_network_admin_email_change_email', bool $send, string $old_email, string $new_email, int $network_id ) apply\_filters( 'send\_network\_admin\_email\_change\_email', bool $send, string $old\_email, string $new\_email, int $network\_id )
====================================================================================================================================
Filters whether to send the network admin email change notification email.
`$send` bool Whether to send the email notification. `$old_email` string The old network admin email address. `$new_email` string The new network admin email address. `$network_id` int ID of the network. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$send = apply_filters( 'send_network_admin_email_change_email', $send, $old_email, $new_email, $network_id );
```
| Used By | Description |
| --- | --- |
| [wp\_network\_admin\_email\_change\_notification()](../functions/wp_network_admin_email_change_notification) wp-includes/ms-functions.php | Sends an email to the old network admin email address when the network admin email address changes. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress do_action( 'block_editor_meta_box_hidden_fields', WP_Post $post ) do\_action( 'block\_editor\_meta\_box\_hidden\_fields', WP\_Post $post )
========================================================================
Adds hidden input fields to the meta box save form.
Hook into this action to print `<input type="hidden" ... />` fields, which will be POSTed back to the server when meta boxes are saved.
`$post` [WP\_Post](../classes/wp_post) The post that is being edited. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
do_action( 'block_editor_meta_box_hidden_fields', $post );
```
| Used By | Description |
| --- | --- |
| [the\_block\_editor\_meta\_box\_post\_form\_hidden\_fields()](../functions/the_block_editor_meta_box_post_form_hidden_fields) wp-admin/includes/post.php | Renders the hidden form required for the meta boxes form. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'wp_video_embed_handler', callable $handler ) apply\_filters( 'wp\_video\_embed\_handler', callable $handler )
================================================================
Filters the video embed handler callback.
`$handler` callable Video embed handler callback function. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
wp_embed_register_handler( 'video', '#^https?://.+?\.(' . implode( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_load\_embeds()](../functions/wp_maybe_load_embeds) wp-includes/embed.php | Determines if default embed handlers should be loaded. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'themes_api_result', array|stdClass|WP_Error $res, string $action, stdClass $args ) apply\_filters( 'themes\_api\_result', array|stdClass|WP\_Error $res, string $action, stdClass $args )
======================================================================================================
Filters the returned WordPress.org Themes API response.
`$res` array|stdClass|[WP\_Error](../classes/wp_error) WordPress.org Themes API response. `$action` string Requested action. Likely values are `'theme_information'`, `'feature_list'`, or `'query_themes'`. `$args` stdClass Arguments used to query for installer pages from the WordPress.org Themes API. File: `wp-admin/includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
```
return apply_filters( 'themes_api_result', $res, $action, $args );
```
| Used By | Description |
| --- | --- |
| [themes\_api()](../functions/themes_api) wp-admin/includes/theme.php | Retrieves theme installer pages from the WordPress.org Themes API. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_refresh_nonces', array $response, array $data, string $screen_id ) apply\_filters( 'wp\_refresh\_nonces', array $response, array $data, string $screen\_id )
=========================================================================================
Filters the nonces to send to the New/Edit Post screen.
`$response` array The Heartbeat response. `$data` array The $\_POST data sent. `$screen_id` string The screen ID. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$response = apply_filters( 'wp_refresh_nonces', $response, $data, $screen_id );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_heartbeat()](../functions/wp_ajax_heartbeat) wp-admin/includes/ajax-actions.php | Ajax handler for the Heartbeat API. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_personal_data_email_content', string $email_text, int $request_id, array $email_data ) apply\_filters( 'wp\_privacy\_personal\_data\_email\_content', string $email\_text, int $request\_id, array $email\_data )
==========================================================================================================================
Filters the text of the email sent with a personal data export file.
The following strings have a special meaning and will get replaced dynamically:
`$email_text` string Text in the email. `$request_id` int The request ID for this personal data export. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `expiration`intThe time in seconds until the export file expires.
* `expiration_date`stringThe localized date and time when the export file expires.
* `message_recipient`stringThe address that the email will be sent to. Defaults to the value of `$request->email`, but can be changed by the `wp_privacy_personal_data_email_to` filter.
* `export_file_url`stringThe export file URL.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail
File: `wp-admin/includes/privacy-tools.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/privacy-tools.php/)
```
$content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id, $email_data );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_send\_personal\_data\_export\_email()](../functions/wp_privacy_send_personal_data_export_email) wp-admin/includes/privacy-tools.php | Send an email to the user with a link to the personal data export file |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced the `$email_data` array. |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress do_action( 'admin_notices' ) do\_action( 'admin\_notices' )
==============================
Prints admin screen notices.
In order to display a notice, echo a div with the class `notice` *and* one of the following classes:
\* `notice-error` – will display the message with a white background and a **red** left border.
\* `notice-warning`– will display the message with a white background and a **yellow/orange** left border.
\* `notice-success` – will display the message with a white background and a **green** left border.
\* `notice-info` – will display the message with a white background a **blue** left border.
\* optionally use `is-dismissible` to add a closing icon to your message via JavaScript. Its behavior, however, applies only on the current screen. It will not prevent a message from re-appearing once the page re-loads, or another page is loaded.
**Don’t use `update-nag` as a class name!**
It is not suitable for regular admin notices, as it will apply different layout styling to the message. Additionally it will trigger the message to be moved above the page title (`<h1>`), thus semantically prioritizing it above other notices which is not likely to be appropriate in a plugin or theme context.
The inner content of the div is the message, and it’s a good idea to wrap the message in a paragraph tag `<p>` for the correct amount of padding in the output.
```
function sample_admin_notice__success() {
?>
<div class="notice notice-success is-dismissible">
<p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
</div>
<?php
}
add_action( 'admin_notices', 'sample_admin_notice__success' );
```
```
function sample_admin_notice__error() {
$class = 'notice notice-error';
$message = __( 'Irks! An error has occurred.', 'sample-text-domain' );
printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
}
add_action( 'admin_notices', 'sample_admin_notice__error' );
```
File: `wp-admin/admin-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-header.php/)
```
do_action( 'admin_notices' );
```
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_prepare_post_type', array $_post_type, WP_Post_Type $post_type ) apply\_filters( 'xmlrpc\_prepare\_post\_type', array $\_post\_type, WP\_Post\_Type $post\_type )
================================================================================================
Filters XML-RPC-prepared date for the given post type.
`$_post_type` array An array of post type data. `$post_type` [WP\_Post\_Type](../classes/wp_post_type) Post type object. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
return apply_filters( 'xmlrpc_prepare_post_type', $_post_type, $post_type );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_prepare\_post\_type()](../classes/wp_xmlrpc_server/_prepare_post_type) wp-includes/class-wp-xmlrpc-server.php | Prepares post data for return in an XML-RPC object. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Converted the `$post_type` parameter to accept a [WP\_Post\_Type](../classes/wp_post_type) object. |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'clean_object_term_cache', array $object_ids, string $object_type ) do\_action( 'clean\_object\_term\_cache', array $object\_ids, string $object\_type )
====================================================================================
Fires after the object term cache has been cleaned.
`$object_ids` array An array of object IDs. `$object_type` string Object type. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'clean_object_term_cache', $object_ids, $object_type );
```
| Used By | Description |
| --- | --- |
| [clean\_object\_term\_cache()](../functions/clean_object_term_cache) wp-includes/taxonomy.php | Removes the taxonomy relationship to terms from the cache. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'make_spam_user', int $user_id ) do\_action( 'make\_spam\_user', int $user\_id )
===============================================
Fires after the user is marked as a SPAM user.
`$user_id` int ID of the user marked as SPAM. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'make_spam_user', $user_id );
```
| Used By | Description |
| --- | --- |
| [update\_user\_status()](../functions/update_user_status) wp-includes/ms-deprecated.php | Update the status of a user in the database. |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'quick_edit_dropdown_authors_args', array $users_opt, bool $bulk ) apply\_filters( 'quick\_edit\_dropdown\_authors\_args', array $users\_opt, bool $bulk )
=======================================================================================
Filters the arguments used to generate the Quick Edit authors drop-down.
* [wp\_dropdown\_users()](../functions/wp_dropdown_users)
`$users_opt` array An array of arguments passed to [wp\_dropdown\_users()](../functions/wp_dropdown_users) . More Arguments from wp\_dropdown\_users( ... $args ) Array or string of Query parameters.
* `blog_id`intThe site ID. Default is the current site.
* `role`string|string[]An array or a comma-separated list of role names that users must match to be included in results. Note that this is an inclusive list: users must match \*each\* role.
* `role__in`string[]An array of role names. Matched users must have at least one of these roles.
* `role__not_in`string[]An array of role names to exclude. Users matching one or more of these roles will not be included in results.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
* `capability`string|string[]An array or a comma-separated list of capability names that users must match to be included in results. Note that this is an inclusive list: users must match \*each\* capability.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `capability__in`string[]An array of capability names. Matched users must have at least one of these capabilities.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `capability__not_in`string[]An array of capability names to exclude. Users matching one or more of these capabilities will not be included in results.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `include`int[]An array of user IDs to include.
* `exclude`int[]An array of user IDs to exclude.
* `search`stringSearch keyword. Searches for possible string matches on columns.
When `$search_columns` is left empty, it tries to determine which column to search in based on search string.
* `search_columns`string[]Array of column names to be searched. Accepts `'ID'`, `'user_login'`, `'user_email'`, `'user_url'`, `'user_nicename'`, `'display_name'`.
* `orderby`string|arrayField(s) to sort the retrieved users by. May be a single value, an array of values, or a multi-dimensional array with fields as keys and orders (`'ASC'` or `'DESC'`) as values. Accepted values are:
+ `'ID'`
+ `'display_name'` (or `'name'`)
+ `'include'`
+ `'user_login'` (or `'login'`)
+ `'login__in'`
+ `'user_nicename'` (or `'nicename'`),
+ `'nicename__in'`
+ 'user\_email (or `'email'`)
+ `'user_url'` (or `'url'`),
+ `'user_registered'` (or `'registered'`)
+ `'post_count'`
+ `'meta_value'`,
+ `'meta_value_num'`
+ The value of `$meta_key`
+ An array key of `$meta_query` To use `'meta_value'` or `'meta_value_num'`, `$meta_key` must be also be defined. Default `'user_login'`.
* `order`stringDesignates ascending or descending order of users. Order values passed as part of an `$orderby` array take precedence over this parameter. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `offset`intNumber of users to offset in retrieved results. Can be used in conjunction with pagination. Default 0.
* `number`intNumber of users to limit the query for. Can be used in conjunction with pagination. Value -1 (all) is supported, but should be used with caution on larger sites.
Default -1 (all users).
* `paged`intWhen used with number, defines the page of results to return.
Default 1.
* `count_total`boolWhether to count the total number of users found. If pagination is not needed, setting this to false can improve performance.
Default true.
* `fields`string|string[]Which fields to return. Single or all fields (string), or array of fields. Accepts:
+ `'ID'`
+ `'display_name'`
+ `'user_login'`
+ `'user_nicename'`
+ `'user_email'`
+ `'user_url'`
+ `'user_registered'`
+ `'user_pass'`
+ `'user_activation_key'`
+ `'user_status'`
+ `'spam'` (only available on multisite installs)
+ `'deleted'` (only available on multisite installs)
+ `'all'` for all fields and loads user meta.
+ `'all_with_meta'` Deprecated. Use `'all'`. Default `'all'`.
* `who`stringType of users to query. Accepts `'authors'`.
Default empty (all users).
* `has_published_posts`bool|string[]Pass an array of post types to filter results to users who have published posts in those post types. `true` is an alias for all public post types.
* `nicename`stringThe user nicename.
* `nicename__in`string[]An array of nicenames to include. Users matching one of these nicenames will be included in results.
* `nicename__not_in`string[]An array of nicenames to exclude. Users matching one of these nicenames will not be included in results.
* `login`stringThe user login.
* `login__in`string[]An array of logins to include. Users matching one of these logins will be included in results.
* `login__not_in`string[]An array of logins to exclude. Users matching one of these logins will not be included in results.
`$bulk` bool A flag to denote if it's a bulk action. File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
$users_opt = apply_filters( 'quick_edit_dropdown_authors_args', $users_opt, $bulk );
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::inline\_edit()](../classes/wp_posts_list_table/inline_edit) wp-admin/includes/class-wp-posts-list-table.php | Outputs the hidden row displayed when inline editing |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'dynamic_sidebar_after', int|string $index, bool $has_widgets ) do\_action( 'dynamic\_sidebar\_after', int|string $index, bool $has\_widgets )
==============================================================================
Fires after widgets are rendered in a dynamic sidebar.
Note: The action also fires for empty sidebars, and on both the front end and back end, including the Inactive Widgets sidebar on the Widgets screen.
`$index` int|string Index, name, or ID of the dynamic sidebar. `$has_widgets` bool Whether the sidebar is populated with widgets.
Default true. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
do_action( 'dynamic_sidebar_after', $index, true );
```
| Used By | Description |
| --- | --- |
| [dynamic\_sidebar()](../functions/dynamic_sidebar) wp-includes/widgets.php | Display dynamic sidebar. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress do_action( 'deleted_plugin', string $plugin_file, bool $deleted ) do\_action( 'deleted\_plugin', string $plugin\_file, bool $deleted )
====================================================================
Fires immediately after a plugin deletion attempt.
`$plugin_file` string Path to the plugin file relative to the plugins directory. `$deleted` bool Whether the plugin deletion was successful. File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
do_action( 'deleted_plugin', $plugin_file, $deleted );
```
| Used By | Description |
| --- | --- |
| [delete\_plugins()](../functions/delete_plugins) wp-admin/includes/plugin.php | Removes directory and files of a plugin for a list of plugins. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( "term_links-{$taxonomy}", string[] $links ) apply\_filters( "term\_links-{$taxonomy}", string[] $links )
============================================================
Filters the term links for a given taxonomy.
The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `term_links-category`
* `term_links-post_tag`
* `term_links-post_format`
`$links` string[] An array of term links. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$term_links = apply_filters( "term_links-{$taxonomy}", $links ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [get\_the\_term\_list()](../functions/get_the_term_list) wp-includes/category-template.php | Retrieves a post’s terms as a list with specified format. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( "{$type}_template", string $template, string $type, string[] $templates ) apply\_filters( "{$type}\_template", string $template, string $type, string[] $templates )
==========================================================================================
Filters the path of the queried template by type.
The dynamic portion of the hook name, `$type`, refers to the filename — minus the file extension and any non-alphanumeric characters delimiting words — of the file to load.
This hook also applies to various types of files loaded as part of the Template Hierarchy.
Possible hook names include:
* `404_template`
* `archive_template`
* `attachment_template`
* `author_template`
* `category_template`
* `date_template`
* `embed_template`
* `frontpage_template`
* `home_template`
* `index_template`
* `page_template`
* `paged_template`
* `privacypolicy_template`
* `search_template`
* `single_template`
* `singular_template`
* `tag_template`
* `taxonomy_template`
`$template` string Path to the template. See [locate\_template()](../functions/locate_template) . More Arguments from locate\_template( ... $args ) Additional arguments passed to the template.
`$type` string Sanitized filename without extension. `$templates` string[] A list of template candidates, in descending order of priority. If you need more granular control over the template selection and loading system of WordPress, consider using <template_include> instead.
File: `wp-includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/template.php/)
```
return apply_filters( "{$type}_template", $template, $type, $templates );
```
| Used By | Description |
| --- | --- |
| [get\_query\_template()](../functions/get_query_template) wp-includes/template.php | Retrieves path to a template. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | The `$type` and `$templates` parameters were added. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'widget_types_to_hide_from_legacy_widget_block', string[] $widgets ) apply\_filters( 'widget\_types\_to\_hide\_from\_legacy\_widget\_block', string[] $widgets )
===========================================================================================
Filters the list of widget-type IDs that should \*\*not\*\* be offered by the Legacy Widget block.
Returning an empty array will make all widgets available.
`$widgets` string[] An array of excluded widget-type IDs. File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
$editor_settings['widgetTypesToHideFromLegacyWidgetBlock'] = apply_filters(
'widget_types_to_hide_from_legacy_widget_block',
array(
'pages',
'calendar',
'archives',
'media_audio',
'media_image',
'media_gallery',
'media_video',
'search',
'text',
'categories',
'recent-posts',
'recent-comments',
'rss',
'tag_cloud',
'custom_html',
'block',
)
);
```
| Used By | Description |
| --- | --- |
| [get\_legacy\_widget\_block\_editor\_settings()](../functions/get_legacy_widget_block_editor_settings) wp-includes/block-editor.php | Returns the block editor settings needed to use the Legacy Widget block which is not registered by default. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( "customize_sanitize_js_{$this->id}", mixed $value, WP_Customize_Setting $setting ) apply\_filters( "customize\_sanitize\_js\_{$this->id}", mixed $value, WP\_Customize\_Setting $setting )
=======================================================================================================
Filters a Customize setting value for use in JavaScript.
The dynamic portion of the hook name, `$this->id`, refers to the setting ID.
`$value` mixed The setting value. `$setting` [WP\_Customize\_Setting](../classes/wp_customize_setting) [WP\_Customize\_Setting](../classes/wp_customize_setting) instance. File: `wp-includes/class-wp-customize-setting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-setting.php/)
```
$value = apply_filters( "customize_sanitize_js_{$this->id}", $this->value(), $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Setting::js\_value()](../classes/wp_customize_setting/js_value) wp-includes/class-wp-customize-setting.php | Sanitize the setting’s value for use in JavaScript. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( "expiration_of_site_transient_{$transient}", int $expiration, mixed $value, string $transient ) apply\_filters( "expiration\_of\_site\_transient\_{$transient}", int $expiration, mixed $value, string $transient )
===================================================================================================================
Filters the expiration for a site transient before its value is set.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$expiration` int Time until expiration in seconds. Use 0 for no expiration. `$value` mixed New value of site transient. `$transient` string Transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$expiration = apply_filters( "expiration_of_site_transient_{$transient}", $expiration, $value, $transient );
```
| Used By | Description |
| --- | --- |
| [set\_site\_transient()](../functions/set_site_transient) wp-includes/option.php | Sets/updates the value of a site transient. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'feed_link', string $output, string $feed ) apply\_filters( 'feed\_link', string $output, string $feed )
============================================================
Filters the feed type permalink.
`$output` string The feed permalink. `$feed` string The feed type. Possible values include `'rss2'`, `'atom'`, or an empty string for the default feed type. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'feed_link', $output, $feed );
```
| Used By | Description |
| --- | --- |
| [get\_feed\_link()](../functions/get_feed_link) wp-includes/link-template.php | Retrieves the permalink for the feed type. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'login_head' ) do\_action( 'login\_head' )
===========================
Fires in the login page header after scripts are enqueued.
This filter can be used to add anything to the <head> section on the login page.
You can customise the login form using `login_head` fairly easily.
Add the following code to functions.php in your theme:
```
// custom login for theme
function childtheme_custom_login() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/customlogin.css" />';
}
add_action('login_head', 'childtheme_custom_login');
```
This has the effect of adding a reference to a stylesheet to your login form.
You will then need to add a stylesheet called `customlogin.css` to your theme directory.
For testing purposes, this should start you off:
```
html {
background-color: #f00;
}
```
This should produce a login background.
Here we replace the standard WordPress logo with our logo, taken from our theme (this uses [get\_stylesheet\_directory\_uri](../functions/get_stylesheet_directory_uri) to work with child themes):
```
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_stylesheet_directory_uri().'/images/login.png) !important;
height: 120px !important; width: 410px !important; margin-left: -40px;}
</style>';
}
add_action('login_head', 'my_custom_login_logo');
```
To set the URL of the login icon’s link, see <login_headerurl>
File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
do_action( 'login_head' );
```
| Used By | Description |
| --- | --- |
| [login\_header()](../functions/login_header) wp-login.php | Output the login page header. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_dropdown_users_args', array $query_args, array $parsed_args ) apply\_filters( 'wp\_dropdown\_users\_args', array $query\_args, array $parsed\_args )
======================================================================================
Filters the query arguments for the list of users in the dropdown.
`$query_args` array The query arguments for [get\_users()](../functions/get_users) . More Arguments from get\_users( ... $args ) Array or string of Query parameters.
* `blog_id`intThe site ID. Default is the current site.
* `role`string|string[]An array or a comma-separated list of role names that users must match to be included in results. Note that this is an inclusive list: users must match \*each\* role.
* `role__in`string[]An array of role names. Matched users must have at least one of these roles.
* `role__not_in`string[]An array of role names to exclude. Users matching one or more of these roles will not be included in results.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
* `capability`string|string[]An array or a comma-separated list of capability names that users must match to be included in results. Note that this is an inclusive list: users must match \*each\* capability.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `capability__in`string[]An array of capability names. Matched users must have at least one of these capabilities.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `capability__not_in`string[]An array of capability names to exclude. Users matching one or more of these capabilities will not be included in results.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `include`int[]An array of user IDs to include.
* `exclude`int[]An array of user IDs to exclude.
* `search`stringSearch keyword. Searches for possible string matches on columns.
When `$search_columns` is left empty, it tries to determine which column to search in based on search string.
* `search_columns`string[]Array of column names to be searched. Accepts `'ID'`, `'user_login'`, `'user_email'`, `'user_url'`, `'user_nicename'`, `'display_name'`.
* `orderby`string|arrayField(s) to sort the retrieved users by. May be a single value, an array of values, or a multi-dimensional array with fields as keys and orders (`'ASC'` or `'DESC'`) as values. Accepted values are:
+ `'ID'`
+ `'display_name'` (or `'name'`)
+ `'include'`
+ `'user_login'` (or `'login'`)
+ `'login__in'`
+ `'user_nicename'` (or `'nicename'`),
+ `'nicename__in'`
+ 'user\_email (or `'email'`)
+ `'user_url'` (or `'url'`),
+ `'user_registered'` (or `'registered'`)
+ `'post_count'`
+ `'meta_value'`,
+ `'meta_value_num'`
+ The value of `$meta_key`
+ An array key of `$meta_query` To use `'meta_value'` or `'meta_value_num'`, `$meta_key` must be also be defined. Default `'user_login'`.
* `order`stringDesignates ascending or descending order of users. Order values passed as part of an `$orderby` array take precedence over this parameter. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `offset`intNumber of users to offset in retrieved results. Can be used in conjunction with pagination. Default 0.
* `number`intNumber of users to limit the query for. Can be used in conjunction with pagination. Value -1 (all) is supported, but should be used with caution on larger sites.
Default -1 (all users).
* `paged`intWhen used with number, defines the page of results to return.
Default 1.
* `count_total`boolWhether to count the total number of users found. If pagination is not needed, setting this to false can improve performance.
Default true.
* `fields`string|string[]Which fields to return. Single or all fields (string), or array of fields. Accepts:
+ `'ID'`
+ `'display_name'`
+ `'user_login'`
+ `'user_nicename'`
+ `'user_email'`
+ `'user_url'`
+ `'user_registered'`
+ `'user_pass'`
+ `'user_activation_key'`
+ `'user_status'`
+ `'spam'` (only available on multisite installs)
+ `'deleted'` (only available on multisite installs)
+ `'all'` for all fields and loads user meta.
+ `'all_with_meta'` Deprecated. Use `'all'`. Default `'all'`.
* `who`stringType of users to query. Accepts `'authors'`.
Default empty (all users).
* `has_published_posts`bool|string[]Pass an array of post types to filter results to users who have published posts in those post types. `true` is an alias for all public post types.
* `nicename`stringThe user nicename.
* `nicename__in`string[]An array of nicenames to include. Users matching one of these nicenames will be included in results.
* `nicename__not_in`string[]An array of nicenames to exclude. Users matching one of these nicenames will not be included in results.
* `login`stringThe user login.
* `login__in`string[]An array of logins to include. Users matching one of these logins will be included in results.
* `login__not_in`string[]An array of logins to exclude. Users matching one of these logins will not be included in results.
`$parsed_args` array The arguments passed to [wp\_dropdown\_users()](../functions/wp_dropdown_users) combined with the defaults. More Arguments from wp\_dropdown\_users( ... $args ) Array or string of Query parameters.
* `blog_id`intThe site ID. Default is the current site.
* `role`string|string[]An array or a comma-separated list of role names that users must match to be included in results. Note that this is an inclusive list: users must match \*each\* role.
* `role__in`string[]An array of role names. Matched users must have at least one of these roles.
* `role__not_in`string[]An array of role names to exclude. Users matching one or more of these roles will not be included in results.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
* `capability`string|string[]An array or a comma-separated list of capability names that users must match to be included in results. Note that this is an inclusive list: users must match \*each\* capability.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `capability__in`string[]An array of capability names. Matched users must have at least one of these capabilities.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `capability__not_in`string[]An array of capability names to exclude. Users matching one or more of these capabilities will not be included in results.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `include`int[]An array of user IDs to include.
* `exclude`int[]An array of user IDs to exclude.
* `search`stringSearch keyword. Searches for possible string matches on columns.
When `$search_columns` is left empty, it tries to determine which column to search in based on search string.
* `search_columns`string[]Array of column names to be searched. Accepts `'ID'`, `'user_login'`, `'user_email'`, `'user_url'`, `'user_nicename'`, `'display_name'`.
* `orderby`string|arrayField(s) to sort the retrieved users by. May be a single value, an array of values, or a multi-dimensional array with fields as keys and orders (`'ASC'` or `'DESC'`) as values. Accepted values are:
+ `'ID'`
+ `'display_name'` (or `'name'`)
+ `'include'`
+ `'user_login'` (or `'login'`)
+ `'login__in'`
+ `'user_nicename'` (or `'nicename'`),
+ `'nicename__in'`
+ 'user\_email (or `'email'`)
+ `'user_url'` (or `'url'`),
+ `'user_registered'` (or `'registered'`)
+ `'post_count'`
+ `'meta_value'`,
+ `'meta_value_num'`
+ The value of `$meta_key`
+ An array key of `$meta_query` To use `'meta_value'` or `'meta_value_num'`, `$meta_key` must be also be defined. Default `'user_login'`.
* `order`stringDesignates ascending or descending order of users. Order values passed as part of an `$orderby` array take precedence over this parameter. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `offset`intNumber of users to offset in retrieved results. Can be used in conjunction with pagination. Default 0.
* `number`intNumber of users to limit the query for. Can be used in conjunction with pagination. Value -1 (all) is supported, but should be used with caution on larger sites.
Default -1 (all users).
* `paged`intWhen used with number, defines the page of results to return.
Default 1.
* `count_total`boolWhether to count the total number of users found. If pagination is not needed, setting this to false can improve performance.
Default true.
* `fields`string|string[]Which fields to return. Single or all fields (string), or array of fields. Accepts:
+ `'ID'`
+ `'display_name'`
+ `'user_login'`
+ `'user_nicename'`
+ `'user_email'`
+ `'user_url'`
+ `'user_registered'`
+ `'user_pass'`
+ `'user_activation_key'`
+ `'user_status'`
+ `'spam'` (only available on multisite installs)
+ `'deleted'` (only available on multisite installs)
+ `'all'` for all fields and loads user meta.
+ `'all_with_meta'` Deprecated. Use `'all'`. Default `'all'`.
* `who`stringType of users to query. Accepts `'authors'`.
Default empty (all users).
* `has_published_posts`bool|string[]Pass an array of post types to filter results to users who have published posts in those post types. `true` is an alias for all public post types.
* `nicename`stringThe user nicename.
* `nicename__in`string[]An array of nicenames to include. Users matching one of these nicenames will be included in results.
* `nicename__not_in`string[]An array of nicenames to exclude. Users matching one of these nicenames will not be included in results.
* `login`stringThe user login.
* `login__in`string[]An array of logins to include. Users matching one of these logins will be included in results.
* `login__not_in`string[]An array of logins to exclude. Users matching one of these logins will not be included in results.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $parsed_args );
```
| Used By | Description |
| --- | --- |
| [wp\_dropdown\_users()](../functions/wp_dropdown_users) wp-includes/user.php | Creates dropdown HTML content of users. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'xmlrpc_call_success_wp_newComment', int $comment_ID, array $args ) do\_action( 'xmlrpc\_call\_success\_wp\_newComment', int $comment\_ID, array $args )
====================================================================================
Fires after a new comment has been successfully created via XML-RPC.
`$comment_ID` int ID of the new comment. `$args` array An array of new comment arguments. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'xmlrpc_call_success_wp_newComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_newComment()](../classes/wp_xmlrpc_server/wp_newcomment) wp-includes/class-wp-xmlrpc-server.php | Create new comment. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'widget_categories_args', array $cat_args, array $instance ) apply\_filters( 'widget\_categories\_args', array $cat\_args, array $instance )
===============================================================================
Filters the arguments for the Categories widget.
`$cat_args` array An array of Categories widget options. `$instance` array Array of settings for the current widget. This filter is used by the default “WordPress Widget: Categories” before it passes arguments to the [wp\_list\_categories()](../functions/wp_list_categories) function.
File: `wp-includes/widgets/class-wp-widget-categories.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-categories.php/)
```
wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Categories::widget()](../classes/wp_widget_categories/widget) wp-includes/widgets/class-wp-widget-categories.php | Outputs the content for the current Categories widget instance. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( "auth_{$object_type}_meta_{$meta_key}", bool $allowed, string $meta_key, int $object_id, int $user_id, string $cap, string[] $caps ) apply\_filters( "auth\_{$object\_type}\_meta\_{$meta\_key}", bool $allowed, string $meta\_key, int $object\_id, int $user\_id, string $cap, string[] $caps )
============================================================================================================================================================
Filters whether the user is allowed to edit a specific meta key of a specific object type.
Return true to have the mapped meta caps from `edit_{$object_type}` apply.
The dynamic portion of the hook name, `$object_type` refers to the object type being filtered.
The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to [map\_meta\_cap()](../functions/map_meta_cap) .
`$allowed` bool Whether the user can add the object meta. Default false. `$meta_key` string The meta key. `$object_id` int Object ID. `$user_id` int User ID. `$cap` string Capability name. `$caps` string[] Array of the user's capabilities. File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
$allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );
```
| Used By | Description |
| --- | --- |
| [map\_meta\_cap()](../functions/map_meta_cap) wp-includes/capabilities.php | Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'editable_roles', array[] $all_roles ) apply\_filters( 'editable\_roles', array[] $all\_roles )
========================================================
Filters the list of editable roles.
`$all_roles` array[] Array of arrays containing role information. `editable_roles` is a filter applied by the function [get\_editable\_roles()](../functions/get_editable_roles) to the list of roles that one user can assign to others (a user must have the [edit\_users](https://wordpress.org/support/article/roles-and-capabilities/#edit_users) capability to change another user’s role). This list is displayed in the bulk operations (if the user has the [list\_users](https://wordpress.org/support/article/roles-and-capabilities/#list_users) and [promote\_users](https://wordpress.org/support/article/roles-and-capabilities/#promote_users)) of the [Users Screen](https://wordpress.org/support/article/users-screen/), and on the [profile screen](https://wordpress.org/support/article/users-your-profile-screen/).
File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
$editable_roles = apply_filters( 'editable_roles', $all_roles );
```
| Used By | Description |
| --- | --- |
| [get\_editable\_roles()](../functions/get_editable_roles) wp-admin/includes/user.php | Fetch a filtered list of user roles that the current user is allowed to edit. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( "get_{$adjacent}_post_where", string $where, bool $in_same_term, int[]|string $excluded_terms, string $taxonomy, WP_Post $post ) apply\_filters( "get\_{$adjacent}\_post\_where", string $where, bool $in\_same\_term, int[]|string $excluded\_terms, string $taxonomy, WP\_Post $post )
=======================================================================================================================================================
Filters the WHERE clause in the SQL for an adjacent post query.
The dynamic portion of the hook name, `$adjacent`, refers to the type of adjacency, ‘next’ or ‘previous’.
Possible hook names include:
* `get_next_post_where`
* `get_previous_post_where`
`$where` string The `WHERE` clause in the SQL. `$in_same_term` bool Whether post should be in a same taxonomy term. `$excluded_terms` int[]|string Array of excluded term IDs. Empty string if none were provided. `$taxonomy` string Taxonomy. Used to identify the term used when `$in_same_term` is true. `$post` [WP\_Post](../classes/wp_post) [WP\_Post](../classes/wp_post) object. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms, $taxonomy, $post );
```
| Used By | Description |
| --- | --- |
| [get\_adjacent\_post()](../functions/get_adjacent_post) wp-includes/link-template.php | Retrieves the adjacent post. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$taxonomy` and `$post` parameters. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'render_block_data', array $parsed_block, array $source_block, WP_Block|null $parent_block ) apply\_filters( 'render\_block\_data', array $parsed\_block, array $source\_block, WP\_Block|null $parent\_block )
==================================================================================================================
Filters the block being rendered in [render\_block()](../functions/render_block) , before it’s processed.
`$parsed_block` array The block being rendered. `$source_block` array An un-modified copy of $parsed\_block, as it appeared in the source content. `$parent_block` [WP\_Block](../classes/wp_block)|null If this is a nested block, a reference to the parent block. File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
$parsed_block = apply_filters( 'render_block_data', $parsed_block, $source_block, $parent_block );
```
| Used By | Description |
| --- | --- |
| [WP\_Block::render()](../classes/wp_block/render) wp-includes/class-wp-block.php | Generates the render output for the block. |
| [render\_block()](../functions/render_block) wp-includes/blocks.php | Renders a single block into a HTML string. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | The `$parent_block` parameter was added. |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'wp_list_comments_args', array $parsed_args ) apply\_filters( 'wp\_list\_comments\_args', array $parsed\_args )
=================================================================
Filters the arguments used in retrieving the comment list.
* [wp\_list\_comments()](../functions/wp_list_comments)
`$parsed_args` array An array of arguments for displaying comments. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args );
```
| Used By | Description |
| --- | --- |
| [wp\_list\_comments()](../functions/wp_list_comments) wp-includes/comment-template.php | Displays a list of comments. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress do_action( 'set_auth_cookie', string $auth_cookie, int $expire, int $expiration, int $user_id, string $scheme, string $token ) do\_action( 'set\_auth\_cookie', string $auth\_cookie, int $expire, int $expiration, int $user\_id, string $scheme, string $token )
===================================================================================================================================
Fires immediately before the authentication cookie is set.
`$auth_cookie` string Authentication cookie value. `$expire` int The time the login grace period expires as a UNIX timestamp.
Default is 12 hours past the cookie's expiration time. `$expiration` int The time when the authentication cookie expires as a UNIX timestamp.
Default is 14 days from now. `$user_id` int User ID. `$scheme` string Authentication scheme. Values include `'auth'` or `'secure_auth'`. `$token` string User's session token to use for this cookie. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme, $token );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_auth\_cookie()](../functions/wp_set_auth_cookie) wp-includes/pluggable.php | Sets the authentication cookies based on user ID. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `$token` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'mod_rewrite_rules', string $rules ) apply\_filters( 'mod\_rewrite\_rules', string $rules )
======================================================
Filters the list of rewrite rules formatted for output to an .htaccess file.
`$rules` string mod\_rewrite Rewrite rules formatted for .htaccess. File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
$rules = apply_filters( 'mod_rewrite_rules', $rules );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::mod\_rewrite\_rules()](../classes/wp_rewrite/mod_rewrite_rules) wp-includes/class-wp-rewrite.php | Retrieves mod\_rewrite-formatted rewrite rules to write to .htaccess. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'registered_post_type', string $post_type, WP_Post_Type $post_type_object ) do\_action( 'registered\_post\_type', string $post\_type, WP\_Post\_Type $post\_type\_object )
==============================================================================================
Fires after a post type is registered.
`$post_type` string Post type. `$post_type_object` [WP\_Post\_Type](../classes/wp_post_type) Arguments used to register the post type. We can register a custom post type with the register\_post\_type function. This should not be hooked before init. So, the good option is to call it with an init hook.
Post types can support any number of built-in core features such as meta boxes, custom fields, post thumbnails, post statuses, comments, and more. See the $supports the argument for a complete list of supported features.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'registered_post_type', $post_type, $post_type_object );
```
| Used By | Description |
| --- | --- |
| [register\_post\_type()](../functions/register_post_type) wp-includes/post.php | Registers a post type. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Converted the `$post_type` parameter to accept a `WP_Post_Type` object. |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'rest_endpoints_description', array $data ) apply\_filters( 'rest\_endpoints\_description', array $data )
=============================================================
Filters the publicly-visible data for a single REST API route.
`$data` array Publicly-visible data for the route. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
$available[ $route ] = apply_filters( 'rest_endpoints_description', $data );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::get\_data\_for\_routes()](../classes/wp_rest_server/get_data_for_routes) wp-includes/rest-api/class-wp-rest-server.php | Retrieves the publicly-visible data for routes. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_rest_server_class', string $class_name ) apply\_filters( 'wp\_rest\_server\_class', string $class\_name )
================================================================
Filters the REST Server Class.
This filter allows you to adjust the server class used by the REST API, using a different class to handle requests.
`$class_name` string The name of the server class. Default '[WP\_REST\_Server](../classes/wp_rest_server)'. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
$wp_rest_server_class = apply_filters( 'wp_rest_server_class', 'WP_REST_Server' );
```
| Used By | Description |
| --- | --- |
| [rest\_get\_server()](../functions/rest_get_server) wp-includes/rest-api.php | Retrieves the current REST server instance. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'block_editor_settings_all', array $editor_settings, WP_Block_Editor_Context $block_editor_context ) apply\_filters( 'block\_editor\_settings\_all', array $editor\_settings, WP\_Block\_Editor\_Context $block\_editor\_context )
=============================================================================================================================
Filters the settings to pass to the block editor for all editor type.
`$editor_settings` array Default editor settings. `$block_editor_context` [WP\_Block\_Editor\_Context](../classes/wp_block_editor_context) The current block editor context. File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
$editor_settings = apply_filters( 'block_editor_settings_all', $editor_settings, $block_editor_context );
```
| Used By | Description |
| --- | --- |
| [get\_block\_editor\_settings()](../functions/get_block_editor_settings) wp-includes/block-editor.php | Returns the contextualized block editor settings for a selected editor context. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'wp_die_json_handler', callable $callback ) apply\_filters( 'wp\_die\_json\_handler', callable $callback )
==============================================================
Filters the callback for killing WordPress execution for JSON requests.
`$callback` callable Callback function name. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$callback = apply_filters( 'wp_die_json_handler', '_json_wp_die_handler' );
```
| Used By | Description |
| --- | --- |
| [wp\_die()](../functions/wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'get_block_template', WP_Block_Template|null $block_template, string $id, array $template_type ) apply\_filters( 'get\_block\_template', WP\_Block\_Template|null $block\_template, string $id, array $template\_type )
======================================================================================================================
Filters the queried block template object after it’s been fetched.
`$block_template` [WP\_Block\_Template](../classes/wp_block_template)|null The found block template, or null if there isn't one. `$id` string Template unique identifier (example: theme\_slug//template\_slug). `$template_type` array Template type: `'wp_template'` or '`wp_template_part'`. File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
return apply_filters( 'get_block_template', $block_template, $id, $template_type );
```
| Used By | Description |
| --- | --- |
| [get\_block\_template()](../functions/get_block_template) wp-includes/block-template-utils.php | Retrieves a single unified template object using its id. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'the_category', string $thelist, string $separator, string $parents ) apply\_filters( 'the\_category', string $thelist, string $separator, string $parents )
======================================================================================
Filters the category or list of categories.
`$thelist` string List of categories for the current post. `$separator` string Separator used between the categories. `$parents` string How to display the category parents. Accepts `'multiple'`, `'single'`, or empty. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
return apply_filters( 'the_category', $thelist, $separator, $parents );
```
| Used By | Description |
| --- | --- |
| [Walker\_Category\_Checklist::start\_el()](../classes/walker_category_checklist/start_el) wp-admin/includes/class-walker-category-checklist.php | Start the element output. |
| [wp\_popular\_terms\_checklist()](../functions/wp_popular_terms_checklist) wp-admin/includes/template.php | Retrieves a list of the most popular terms from the specified taxonomy. |
| [wp\_link\_category\_checklist()](../functions/wp_link_category_checklist) wp-admin/includes/template.php | Outputs a link category checklist element. |
| [get\_the\_category\_list()](../functions/get_the_category_list) wp-includes/category-template.php | Retrieves category list for a post in either HTML list or custom format. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
| programming_docs |
wordpress apply_filters_ref_array( 'posts_results', WP_Post[] $posts, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_results', WP\_Post[] $posts, WP\_Query $query )
===================================================================================
Filters the raw post results array, prior to status checks.
`$posts` [WP\_Post](../classes/wp_post)[] Array of post objects. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). The input of this filter is an array of posts, created by any(?) [WP\_Query](../classes/wp_query) looking for posts.
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$this->posts = apply_filters_ref_array( 'posts_results', array( $this->posts, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'search_feed_link', string $link, string $feed, string $type ) apply\_filters( 'search\_feed\_link', string $link, string $feed, string $type )
================================================================================
Filters the search feed link.
`$link` string Search feed link. `$feed` string Feed type. Possible values include `'rss2'`, `'atom'`. `$type` string The search type. One of `'posts'` or `'comments'`. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'search_feed_link', $link, $feed, 'posts' );
```
| Used By | Description |
| --- | --- |
| [get\_search\_comments\_feed\_link()](../functions/get_search_comments_feed_link) wp-includes/link-template.php | Retrieves the permalink for the search results comments feed. |
| [get\_search\_feed\_link()](../functions/get_search_feed_link) wp-includes/link-template.php | Retrieves the permalink for the search results feed. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'doing_it_wrong_run', string $function, string $message, string $version ) do\_action( 'doing\_it\_wrong\_run', string $function, string $message, string $version )
=========================================================================================
Fires when the given function is being used incorrectly.
`$function` string The function that was called. `$message` string A message explaining what has been done incorrectly. `$version` string The version of WordPress where the message was added. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
do_action( 'doing_it_wrong_run', $function, $message, $version );
```
| Used By | Description |
| --- | --- |
| [\_doing\_it\_wrong()](../functions/_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'do_parse_request', bool $bool, WP $wp, array|string $extra_query_vars ) apply\_filters( 'do\_parse\_request', bool $bool, WP $wp, array|string $extra\_query\_vars )
============================================================================================
Filters whether to parse the request.
`$bool` bool Whether or not to parse the request. Default true. `$wp` WP Current WordPress environment instance. `$extra_query_vars` array|string Extra passed query variables. File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) {
```
| Used By | Description |
| --- | --- |
| [WP::parse\_request()](../classes/wp/parse_request) wp-includes/class-wp.php | Parses the request to find the correct WordPress query. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress do_action( "update_site_option_{$option}", string $option, mixed $value, mixed $old_value, int $network_id ) do\_action( "update\_site\_option\_{$option}", string $option, mixed $value, mixed $old\_value, int $network\_id )
==================================================================================================================
Fires after the value of a specific network option has been successfully updated.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$option` string Name of the network option. `$value` mixed Current value of the network option. `$old_value` mixed Old value of the network option. `$network_id` int ID of the network. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( "update_site_option_{$option}", $option, $value, $old_value, $network_id );
```
| Used By | Description |
| --- | --- |
| [update\_network\_option()](../functions/update_network_option) wp-includes/option.php | Updates the value of a network option that was already added. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | The `$network_id` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'pre_insert_term', string|WP_Error $term, string $taxonomy, array|string $args ) apply\_filters( 'pre\_insert\_term', string|WP\_Error $term, string $taxonomy, array|string $args )
===================================================================================================
Filters a term before it is sanitized and inserted into the database.
`$term` string|[WP\_Error](../classes/wp_error) The term name to add, or a [WP\_Error](../classes/wp_error) object if there's an error. `$taxonomy` string Taxonomy slug. `$args` array|string Array or query string of arguments passed to [wp\_insert\_term()](../functions/wp_insert_term) . More Arguments from wp\_insert\_term( ... $args ) Array or query string of arguments for inserting a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$term = apply_filters( 'pre_insert_term', $term, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_insert_post_parent', int $post_parent, int $post_ID, array $new_postarr, array $postarr ) apply\_filters( 'wp\_insert\_post\_parent', int $post\_parent, int $post\_ID, array $new\_postarr, array $postarr )
===================================================================================================================
Filters the post parent — used to check for and prevent hierarchy loops.
`$post_parent` int Post parent ID. `$post_ID` int Post ID. `$new_postarr` array Array of parsed post data. `$postarr` array Array of sanitized, but otherwise unmodified post data. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, $new_postarr, $postarr );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_kses_allowed_html', array[] $html, string $context ) apply\_filters( 'wp\_kses\_allowed\_html', array[] $html, string $context )
===========================================================================
Filters the HTML tags that are allowed for a given context.
HTML tags and attribute names are case-insensitive in HTML but must be added to the KSES allow list in lowercase. An item added to the allow list in upper or mixed case will not recognized as permitted by KSES.
`$html` array[] Allowed HTML tags. `$context` string Context name. File: `wp-includes/kses.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/kses.php/)
```
return apply_filters( 'wp_kses_allowed_html', $html, $context );
```
| Used By | Description |
| --- | --- |
| [wp\_kses\_allowed\_html()](../functions/wp_kses_allowed_html) wp-includes/kses.php | Returns an array of allowed HTML tags and attributes for a given context. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress do_action( 'wp_footer' ) do\_action( 'wp\_footer' )
==========================
Prints scripts or data before the closing body tag on the front end.
The `wp_footer` action is triggered near the tag of the [user’s template](https://developer.wordpress.org/themes/basics/template-files/) by the [wp\_footer()](../functions/wp_footer) function. Although this is theme-dependent, it is one of the most essential theme hooks, so it is fairly widely supported.
This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
This hook is theme-dependent which means that it is up to the author of each WordPress theme to include it. It may not be available on all themes, so you should take this into account when using it.
When included, the default output for this function is the admin panel which will be shown in the top of the theme. It should be kept in the footer for every theme because most of the plugin bind their script files or functions to this hook.
This hook is an action which means that it primarily acts as an event trigger, instead of a content filter. This is a semantic difference, but it will help you to remember what this hook does
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'wp_footer' );
```
| Used By | Description |
| --- | --- |
| [wp\_footer()](../functions/wp_footer) wp-includes/general-template.php | Fires the wp\_footer action. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'user_request_confirmed_email_headers', string|array $headers, string $subject, string $content, int $request_id, array $email_data ) apply\_filters( 'user\_request\_confirmed\_email\_headers', string|array $headers, string $subject, string $content, int $request\_id, array $email\_data )
===========================================================================================================================================================
Filters the headers of the user request confirmation email.
`$headers` string|array The email headers. `$subject` string The email subject. `$content` string The email content. `$request_id` int The request ID. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `user_email`stringThe email address confirming a request
* `description`stringDescription of the action being performed so the user knows what the email is for.
* `manage_url`stringThe link to click manage privacy requests of this type.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail.
* `admin_email`stringThe administrator email receiving the mail.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$headers = apply_filters( 'user_request_confirmed_email_headers', $headers, $subject, $content, $request_id, $email_data );
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_request\_confirmation\_notification()](../functions/_wp_privacy_send_request_confirmation_notification) wp-includes/user.php | Notifies the site administrator via email when a request is confirmed. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress do_action( "registered_taxonomy_{$taxonomy}", string $taxonomy, array|string $object_type, array $args ) do\_action( "registered\_taxonomy\_{$taxonomy}", string $taxonomy, array|string $object\_type, array $args )
============================================================================================================
Fires after a specific taxonomy is registered.
The dynamic portion of the filter name, `$taxonomy`, refers to the taxonomy key.
Possible hook names include:
* `registered_taxonomy_category`
* `registered_taxonomy_post_tag`
`$taxonomy` string Taxonomy slug. `$object_type` array|string Object type or array of object types. `$args` array Array of taxonomy registration arguments. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( "registered_taxonomy_{$taxonomy}", $taxonomy, $object_type, (array) $taxonomy_object );
```
| Used By | Description |
| --- | --- |
| [register\_taxonomy()](../functions/register_taxonomy) wp-includes/taxonomy.php | Creates or modifies a taxonomy object. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'login_headertext', string $login_header_text ) apply\_filters( 'login\_headertext', string $login\_header\_text )
==================================================================
Filters the link text of the header logo above the login form.
`$login_header_text` string The login header logo link text. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
$login_header_text = apply_filters( 'login_headertext', $login_header_text );
```
| Used By | Description |
| --- | --- |
| [login\_header()](../functions/login_header) wp-login.php | Output the login page header. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'can_edit_network', bool $result, int $network_id ) apply\_filters( 'can\_edit\_network', bool $result, int $network\_id )
======================================================================
Filters whether this network can be edited from this page.
`$result` bool Whether the network can be edited from this page. `$network_id` int The network ID to check. File: `wp-admin/includes/ms.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ms.php/)
```
return apply_filters( 'can_edit_network', $result, $network_id );
```
| Used By | Description |
| --- | --- |
| [can\_edit\_network()](../functions/can_edit_network) wp-admin/includes/ms.php | Whether or not we can edit this network from this page. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action_ref_array( 'pre_user_query', WP_User_Query $query ) do\_action\_ref\_array( 'pre\_user\_query', WP\_User\_Query $query )
====================================================================
Fires after the [WP\_User\_Query](../classes/wp_user_query) has been parsed, and before the query is executed.
The passed [WP\_User\_Query](../classes/wp_user_query) object contains SQL parts formed from parsing the given query.
`$query` [WP\_User\_Query](../classes/wp_user_query) Current instance of [WP\_User\_Query](../classes/wp_user_query) (passed by reference). File: `wp-includes/class-wp-user-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-user-query.php/)
```
do_action_ref_array( 'pre_user_query', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_User\_Query::prepare\_query()](../classes/wp_user_query/prepare_query) wp-includes/class-wp-user-query.php | Prepares the query variables. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'register_setting_args', array $args, array $defaults, string $option_group, string $option_name ) apply\_filters( 'register\_setting\_args', array $args, array $defaults, string $option\_group, string $option\_name )
======================================================================================================================
Filters the registration arguments when registering a setting.
`$args` array Array of setting registration arguments. `$defaults` array Array of default arguments. `$option_group` string Setting group. `$option_name` string Setting name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$args = apply_filters( 'register_setting_args', $args, $defaults, $option_group, $option_name );
```
| Used By | Description |
| --- | --- |
| [register\_setting()](../functions/register_setting) wp-includes/option.php | Registers a setting and its data. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'translations_api_result', array|WP_Error $res, string $type, object $args ) apply\_filters( 'translations\_api\_result', array|WP\_Error $res, string $type, object $args )
===============================================================================================
Filters the Translation Installation API response results.
`$res` array|[WP\_Error](../classes/wp_error) Response as an associative array or [WP\_Error](../classes/wp_error). `$type` string The type of translations being requested. `$args` object Translation API arguments. File: `wp-admin/includes/translation-install.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/translation-install.php/)
```
return apply_filters( 'translations_api_result', $res, $type, $args );
```
| Used By | Description |
| --- | --- |
| [translations\_api()](../functions/translations_api) wp-admin/includes/translation-install.php | Retrieve translations from WordPress Translation API. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'embed_maybe_make_link', string $output, string $url ) apply\_filters( 'embed\_maybe\_make\_link', string $output, string $url )
=========================================================================
Filters the returned, maybe-linked embed URL.
`$output` string The linked or original URL. `$url` string The original URL. File: `wp-includes/class-wp-embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-embed.php/)
```
return apply_filters( 'embed_maybe_make_link', $output, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_Embed::maybe\_make\_link()](../classes/wp_embed/maybe_make_link) wp-includes/class-wp-embed.php | Conditionally makes a hyperlink based on an internal class variable. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_date', string $date, string $format, int $timestamp, DateTimeZone $timezone ) apply\_filters( 'wp\_date', string $date, string $format, int $timestamp, DateTimeZone $timezone )
==================================================================================================
Filters the date formatted based on the locale.
`$date` string Formatted date string. `$format` string Format to display the date. `$timestamp` int Unix timestamp. `$timezone` DateTimeZone Timezone. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$date = apply_filters( 'wp_date', $date, $format, $timestamp, $timezone );
```
| Used By | Description |
| --- | --- |
| [wp\_date()](../functions/wp_date) wp-includes/functions.php | Retrieves the date, in localized format. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'get_the_modified_date', string|int|false $the_time, string $format, WP_Post|null $post ) apply\_filters( 'get\_the\_modified\_date', string|int|false $the\_time, string $format, WP\_Post|null $post )
==============================================================================================================
Filters the date a post was last modified.
`$the_time` string|int|false The formatted date or false if no post is found. `$format` string PHP date format. `$post` [WP\_Post](../classes/wp_post)|null [WP\_Post](../classes/wp_post) object or null if no post is found. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'get_the_modified_date', $the_time, $format, $post );
```
| Used By | Description |
| --- | --- |
| [get\_the\_modified\_date()](../functions/get_the_modified_date) wp-includes/general-template.php | Retrieves the date on which the post was last modified. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$post` parameter. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'upgrader_clear_destination', true|WP_Error $removed, string $local_destination, string $remote_destination, array $hook_extra ) apply\_filters( 'upgrader\_clear\_destination', true|WP\_Error $removed, string $local\_destination, string $remote\_destination, array $hook\_extra )
======================================================================================================================================================
Filters whether the upgrader cleared the destination.
`$removed` true|[WP\_Error](../classes/wp_error) Whether the destination was cleared.
True upon success, [WP\_Error](../classes/wp_error) on failure. `$local_destination` string The local package destination. `$remote_destination` string The remote package destination. `$hook_extra` array Extra arguments passed to hooked filters. File: `wp-admin/includes/class-wp-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-upgrader.php/)
```
$removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
```
| Used By | Description |
| --- | --- |
| [WP\_Upgrader::install\_package()](../classes/wp_upgrader/install_package) wp-admin/includes/class-wp-upgrader.php | Install a package. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'auth_cookie_bad_session_token', string[] $cookie_elements ) do\_action( 'auth\_cookie\_bad\_session\_token', string[] $cookie\_elements )
=============================================================================
Fires if a bad session token is encountered.
`$cookie_elements` string[] Authentication cookie components. None of the components should be assumed to be valid as they come directly from a client-provided cookie value.
* `username`stringUser's username.
* `expiration`stringThe time the cookie expires as a UNIX timestamp.
* `token`stringUser's session token used.
* `hmac`stringThe security hash for the cookie.
* `scheme`stringThe cookie scheme to use.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'auth_cookie_bad_session_token', $cookie_elements );
```
| Used By | Description |
| --- | --- |
| [wp\_validate\_auth\_cookie()](../functions/wp_validate_auth_cookie) wp-includes/pluggable.php | Validates authentication cookie. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress do_action( 'auth_cookie_bad_hash', string[] $cookie_elements ) do\_action( 'auth\_cookie\_bad\_hash', string[] $cookie\_elements )
===================================================================
Fires if a bad authentication cookie hash is encountered.
`$cookie_elements` string[] Authentication cookie components. None of the components should be assumed to be valid as they come directly from a client-provided cookie value.
* `username`stringUser's username.
* `expiration`stringThe time the cookie expires as a UNIX timestamp.
* `token`stringUser's session token used.
* `hmac`stringThe security hash for the cookie.
* `scheme`stringThe cookie scheme to use.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'auth_cookie_bad_hash', $cookie_elements );
```
| Used By | Description |
| --- | --- |
| [wp\_validate\_auth\_cookie()](../functions/wp_validate_auth_cookie) wp-includes/pluggable.php | Validates authentication cookie. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'pre_comment_user_agent', string $comment_agent ) apply\_filters( 'pre\_comment\_user\_agent', string $comment\_agent )
=====================================================================
Filters the comment author’s browser user agent before it is set.
`$comment_agent` string The comment author's browser user agent. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$commentdata['comment_agent'] = apply_filters( 'pre_comment_user_agent', ( isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : '' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_filter\_comment()](../functions/wp_filter_comment) wp-includes/comment.php | Filters and sanitizes comment data. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'delete_link', int $link_id ) do\_action( 'delete\_link', int $link\_id )
===========================================
Fires before a link is deleted.
`$link_id` int ID of the link to delete. File: `wp-admin/includes/bookmark.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/bookmark.php/)
```
do_action( 'delete_link', $link_id );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_link()](../functions/wp_delete_link) wp-admin/includes/bookmark.php | Deletes a specified link from the database. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_anonymize_data', string $anonymous, string $type, string $data ) apply\_filters( 'wp\_privacy\_anonymize\_data', string $anonymous, string $type, string $data )
===============================================================================================
Filters the anonymous data for each type.
`$anonymous` string Anonymized data. `$type` string Type of the data. `$data` string Original data. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'wp_privacy_anonymize_data', $anonymous, $type, $data );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_anonymize\_data()](../functions/wp_privacy_anonymize_data) wp-includes/functions.php | Returns uniform “anonymous” data by type. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters_deprecated( "auth_{$object_type}_{$object_subtype}_meta_{$meta_key}", bool $allowed, string $meta_key, int $object_id, int $user_id, string $cap, string[] $caps ) apply\_filters\_deprecated( "auth\_{$object\_type}\_{$object\_subtype}\_meta\_{$meta\_key}", bool $allowed, string $meta\_key, int $object\_id, int $user\_id, string $cap, string[] $caps )
============================================================================================================================================================================================
This hook has been deprecated. Use [‘auth\_{$object\_type](../functions/%e2%80%98auth_object_type)meta{$meta\_key}for{$object\_subtype}’} instead.
Filters whether the user is allowed to edit meta for specific object types/subtypes.
Return true to have the mapped meta caps from `edit_{$object_type}` apply.
The dynamic portion of the hook name, `$object_type` refers to the object type being filtered.
The dynamic portion of the hook name, `$object_subtype` refers to the object subtype being filtered.
The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to [map\_meta\_cap()](../functions/map_meta_cap) .
`$allowed` bool Whether the user can add the object meta. Default false. `$meta_key` string The meta key. `$object_id` int Object ID. `$user_id` int User ID. `$cap` string Capability name. `$caps` string[] Array of the user's capabilities. File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
$allowed = apply_filters_deprecated(
"auth_{$object_type}_{$object_subtype}_meta_{$meta_key}",
array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ),
'4.9.8',
"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}"
);
```
| Used By | Description |
| --- | --- |
| [map\_meta\_cap()](../functions/map_meta_cap) wp-includes/capabilities.php | Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked. |
| Version | Description |
| --- | --- |
| [4.9.8](https://developer.wordpress.org/reference/since/4.9.8/) | Use ['auth\_{$object\_type](../functions/auth_object_type)\*meta\*{$meta\_key}\*for\*{$object\_subtype}'} instead. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Renamed from `auth_post_{$post_type}_meta_{$meta_key}` to `auth_{$object_type}_{$object_subtype}_meta_{$meta_key}`. |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( "wp_{$post->post_type}_revisions_to_keep", int $num, WP_Post $post ) apply\_filters( "wp\_{$post->post\_type}\_revisions\_to\_keep", int $num, WP\_Post $post )
==========================================================================================
Filters the number of revisions to save for the given post by its post type.
Overrides both the value of WP\_POST\_REVISIONS and the [‘wp\_revisions\_to\_keep’](wp_revisions_to_keep) filter.
The dynamic portion of the hook name, `$post->post_type`, refers to the post type slug.
Possible hook names include:
* `wp_post_revisions_to_keep`
* `wp_page_revisions_to_keep`
`$num` int Number of revisions to store. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/revision.php/)
```
$num = apply_filters( "wp_{$post->post_type}_revisions_to_keep", $num, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_revisions\_to\_keep()](../functions/wp_revisions_to_keep) wp-includes/revision.php | Determines how many revisions to retain for a given post. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'heartbeat_received', array $response, array $data, string $screen_id ) apply\_filters( 'heartbeat\_received', array $response, array $data, string $screen\_id )
=========================================================================================
Filters the Heartbeat response received.
`$response` array The Heartbeat response. `$data` array The $\_POST data sent. `$screen_id` string The screen ID. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$response = apply_filters( 'heartbeat_received', $response, $data, $screen_id );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_heartbeat()](../functions/wp_ajax_heartbeat) wp-admin/includes/ajax-actions.php | Ajax handler for the Heartbeat API. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( "{$field}_pre", mixed $value ) apply\_filters( "{$field}\_pre", mixed $value )
===============================================
Filters the value of a specific post field before saving.
The dynamic portion of the hook name, `$field`, refers to the post field name.
`$value` mixed Value of the post field. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$value = apply_filters( "{$field}_pre", $value );
```
| Used By | Description |
| --- | --- |
| [sanitize\_post\_field()](../functions/sanitize_post_field) wp-includes/post.php | Sanitizes a post field based on context. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'terms_to_edit', string $terms_to_edit, string $taxonomy ) apply\_filters( 'terms\_to\_edit', string $terms\_to\_edit, string $taxonomy )
==============================================================================
Filters the comma-separated list of terms available to edit.
* [get\_terms\_to\_edit()](../functions/get_terms_to_edit)
`$terms_to_edit` string A comma-separated list of term names. `$taxonomy` string The taxonomy name for which to retrieve terms. * This filter is used to modify the CSV of terms that is used to show active terms in the taxonomy sidebars on the edit post screen.
* This is primarily of use if you need to visually modify the appearance of an active term (such as prefixing an asterisk) without changing its behavior. Note that the returned CSV is filtered using JavaScript and is rendered in plain text, so wrapping terms in HTML will not work (any HTML will be rendered as text).
File: `wp-admin/includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/taxonomy.php/)
```
$terms_to_edit = apply_filters( 'terms_to_edit', $terms_to_edit, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [get\_terms\_to\_edit()](../functions/get_terms_to_edit) wp-admin/includes/taxonomy.php | Gets comma-separated list of terms available to edit for the given post ID. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'feed_links_extra_show_post_type_archive_feed', bool $show ) apply\_filters( 'feed\_links\_extra\_show\_post\_type\_archive\_feed', bool $show )
===================================================================================
Filters whether to display the post type archive feed link.
`$show` bool Whether to display the post type archive feed link. Default true. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$show_post_type_archive_feed = apply_filters( 'feed_links_extra_show_post_type_archive_feed', true );
```
| Used By | Description |
| --- | --- |
| [feed\_links\_extra()](../functions/feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'post_date_column_status', string $status, WP_Post $post, string $column_name, string $mode ) apply\_filters( 'post\_date\_column\_status', string $status, WP\_Post $post, string $column\_name, string $mode )
==================================================================================================================
Filters the status text of the post.
`$status` string The status text. `$post` [WP\_Post](../classes/wp_post) Post object. `$column_name` string The column name. `$mode` string The list display mode (`'excerpt'` or `'list'`). File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
$status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode );
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::column\_date()](../classes/wp_posts_list_table/column_date) wp-admin/includes/class-wp-posts-list-table.php | Handles the post date column output. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( 'comment_form_logged_in', string $args_logged_in, array $commenter, string $user_identity ) apply\_filters( 'comment\_form\_logged\_in', string $args\_logged\_in, array $commenter, string $user\_identity )
=================================================================================================================
Filters the ‘logged in’ message for the comment form for display.
`$args_logged_in` string The HTML for the 'logged in as [user]' message, the Edit profile link, and the Log out link. `$commenter` array An array containing the comment author's username, email, and URL. `$user_identity` string If the commenter is a registered user, the display name, blank otherwise. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters_deprecated( 'wp_save_image_file', bool|null $override, string $filename, resource|GdImage $image, string $mime_type, int $post_id ) apply\_filters\_deprecated( 'wp\_save\_image\_file', bool|null $override, string $filename, resource|GdImage $image, string $mime\_type, int $post\_id )
========================================================================================================================================================
This hook has been deprecated. Use [‘wp\_save\_image\_editor\_file’](wp_save_image_editor_file) instead.
Filters whether to skip saving the image file.
Returning a non-null value will short-circuit the save method, returning that value instead.
`$override` bool|null Value to return instead of saving. Default null. `$filename` string Name of the file to be saved. `$image` resource|GdImage Image resource or GdImage instance. `$mime_type` string The mime type of the image. `$post_id` int Attachment post ID. File: `wp-admin/includes/image-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image-edit.php/)
```
$saved = apply_filters_deprecated(
'wp_save_image_file',
array( null, $filename, $image, $mime_type, $post_id ),
'3.5.0',
'wp_save_image_editor_file'
);
```
| Used By | Description |
| --- | --- |
| [wp\_save\_image\_file()](../functions/wp_save_image_file) wp-admin/includes/image-edit.php | Saves image to file. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Use ['wp\_save\_image\_editor\_file'](wp_save_image_editor_file) instead. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'pre_get_shortlink', false|string $return, int $id, string $context, bool $allow_slugs ) apply\_filters( 'pre\_get\_shortlink', false|string $return, int $id, string $context, bool $allow\_slugs )
===========================================================================================================
Filters whether to preempt generating a shortlink for the given post.
Returning a value other than false from the filter will short-circuit the shortlink generation process, returning that value instead.
`$return` false|string Short-circuit return value. Either false or a URL string. `$id` int Post ID, or 0 for the current post. `$context` string The context for the link. One of `'post'` or `'query'`, `$allow_slugs` bool Whether to allow post slugs in the shortlink. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$shortlink = apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_shortlink()](../functions/wp_get_shortlink) wp-includes/link-template.php | Returns a shortlink for a post, page, attachment, or site. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'prepend_attachment', string $p ) apply\_filters( 'prepend\_attachment', string $p )
==================================================
Filters the attachment markup to be prepended to the post content.
* [prepend\_attachment()](../functions/prepend_attachment)
`$p` string The attachment HTML output. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$p = apply_filters( 'prepend_attachment', $p );
```
| Used By | Description |
| --- | --- |
| [prepend\_attachment()](../functions/prepend_attachment) wp-includes/post-template.php | Wraps attachment in paragraph tag before content. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'pings_open', bool $open, int $post_id ) apply\_filters( 'pings\_open', bool $open, int $post\_id )
==========================================================
Filters whether the current post is open for pings.
`$open` bool Whether the current post is open for pings. `$post_id` int The post ID. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'pings_open', $open, $post_id );
```
| Used By | Description |
| --- | --- |
| [pings\_open()](../functions/pings_open) wp-includes/comment-template.php | Determines whether the current post is open for pings. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'trashed_post_comments', int $post_id, array $statuses ) do\_action( 'trashed\_post\_comments', int $post\_id, array $statuses )
=======================================================================
Fires after comments are sent to the Trash.
`$post_id` int Post ID. `$statuses` array Array of comment statuses. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'trashed_post_comments', $post_id, $statuses );
```
| Used By | Description |
| --- | --- |
| [wp\_trash\_post\_comments()](../functions/wp_trash_post_comments) wp-includes/post.php | Moves comments for a post to the Trash. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_wp_deletePage', int $page_id, array $args ) do\_action( 'xmlrpc\_call\_success\_wp\_deletePage', int $page\_id, array $args )
=================================================================================
Fires after a page has been successfully deleted via XML-RPC.
`$page_id` int ID of the deleted page. `$args` array An array of arguments to delete the page. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'xmlrpc_call_success_wp_deletePage', $page_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_deletePage()](../classes/wp_xmlrpc_server/wp_deletepage) wp-includes/class-wp-xmlrpc-server.php | Delete page. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters_ref_array( 'comment_feed_limits', string $climits, WP_Query $query ) apply\_filters\_ref\_array( 'comment\_feed\_limits', string $climits, WP\_Query $query )
========================================================================================
Filters the LIMIT clause of the comments feed query before sending.
`$climits` string The JOIN clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option( 'posts_per_rss' ), &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'get_sample_permalink_html', string $return, int $post_id, string $new_title, string $new_slug, WP_Post $post ) apply\_filters( 'get\_sample\_permalink\_html', string $return, int $post\_id, string $new\_title, string $new\_slug, WP\_Post $post )
======================================================================================================================================
Filters the sample permalink HTML markup.
`$return` string Sample permalink HTML markup. `$post_id` int Post ID. `$new_title` string New sample permalink title. `$new_slug` string New sample permalink slug. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$return = apply_filters( 'get_sample_permalink_html', $return, $post->ID, $new_title, $new_slug, $post );
```
| Used By | Description |
| --- | --- |
| [get\_sample\_permalink\_html()](../functions/get_sample_permalink_html) wp-admin/includes/post.php | Returns the HTML of the sample permalink slug editor. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added `$post` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'wp_update_application_password', int $user_id, array $item, array $update ) do\_action( 'wp\_update\_application\_password', int $user\_id, array $item, array $update )
============================================================================================
Fires when an application password is updated.
`$user_id` int The user ID. `$item` array The updated app password details. `$update` array The information to update. File: `wp-includes/class-wp-application-passwords.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-application-passwords.php/)
```
do_action( 'wp_update_application_password', $user_id, $item, $update );
```
| Used By | Description |
| --- | --- |
| [WP\_Application\_Passwords::update\_application\_password()](../classes/wp_application_passwords/update_application_password) wp-includes/class-wp-application-passwords.php | Updates an application password. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action_deprecated( 'dbx_post_advanced', WP_Post $post ) do\_action\_deprecated( 'dbx\_post\_advanced', WP\_Post $post )
===============================================================
This hook has been deprecated. Use [‘add\_meta\_boxes’](add_meta_boxes) instead.
Fires in the middle of built-in meta box registration.
`$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' );
```
| Used By | Description |
| --- | --- |
| [register\_and\_do\_post\_meta\_boxes()](../functions/register_and_do_post_meta_boxes) wp-admin/includes/meta-boxes.php | Registers the default post meta boxes, and runs the `do_meta_boxes` actions. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Use ['add\_meta\_boxes'](add_meta_boxes) instead. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_image_src', array|false $image, int $attachment_id, string|int[] $size, bool $icon ) apply\_filters( 'wp\_get\_attachment\_image\_src', array|false $image, int $attachment\_id, string|int[] $size, bool $icon )
============================================================================================================================
Filters the attachment image source result.
`$image` array|false Array of image data, or boolean false if no image is available.
* stringImage source URL.
* `1`intImage width in pixels.
* `2`intImage height in pixels.
* `3`boolWhether the image is a resized image.
`$attachment_id` int Image attachment ID. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). `$icon` bool Whether the image should be treated as an icon. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_get_attachment_image_src', $image, $attachment_id, $size, $icon );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_image\_src()](../functions/wp_get_attachment_image_src) wp-includes/media.php | Retrieves an image to represent an attachment. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'pre_get_space_used', int|false $space_used ) apply\_filters( 'pre\_get\_space\_used', int|false $space\_used )
=================================================================
Filters the amount of storage space used by the current site, in megabytes.
`$space_used` int|false The amount of used space, in megabytes. Default false. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$space_used = apply_filters( 'pre_get_space_used', false );
```
| Used By | Description |
| --- | --- |
| [get\_space\_used()](../functions/get_space_used) wp-includes/ms-functions.php | Returns the space used by the current site. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'robots_txt', string $output, bool $public ) apply\_filters( 'robots\_txt', string $output, bool $public )
=============================================================
Filters the robots.txt output.
`$output` string The robots.txt output. `$public` bool Whether the site is considered "public". File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
echo apply_filters( 'robots_txt', $output, $public );
```
| Used By | Description |
| --- | --- |
| [do\_robots()](../functions/do_robots) wp-includes/functions.php | Displays the default robots.txt file content. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'rest_route_for_taxonomy_items', string $route, WP_Taxonomy $taxonomy ) apply\_filters( 'rest\_route\_for\_taxonomy\_items', string $route, WP\_Taxonomy $taxonomy )
============================================================================================
Filters the REST API route for a taxonomy.
`$route` string The route path. `$taxonomy` [WP\_Taxonomy](../classes/wp_taxonomy) The taxonomy object. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
return apply_filters( 'rest_route_for_taxonomy_items', $route, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [rest\_get\_route\_for\_taxonomy\_items()](../functions/rest_get_route_for_taxonomy_items) wp-includes/rest-api.php | Gets the REST API route for a taxonomy. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'wp_get_missing_image_subsizes', array[] $missing_sizes, array $image_meta, int $attachment_id ) apply\_filters( 'wp\_get\_missing\_image\_subsizes', array[] $missing\_sizes, array $image\_meta, int $attachment\_id )
=======================================================================================================================
Filters the array of missing image sub-sizes for an uploaded image.
`$missing_sizes` array[] Associative array of arrays of image sub-size information for missing image sizes, keyed by image size name. `$image_meta` array The image meta data. `$attachment_id` int The image attachment post ID. File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
return apply_filters( 'wp_get_missing_image_subsizes', $missing_sizes, $image_meta, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_missing\_image\_subsizes()](../functions/wp_get_missing_image_subsizes) wp-admin/includes/image.php | Compare the existing image sub-sizes (as saved in the attachment meta) to the currently registered image sub-sizes, and return the difference. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_index_entry', array $sitemap_entry, string $object_type, string $object_subtype, int $page ) apply\_filters( 'wp\_sitemaps\_index\_entry', array $sitemap\_entry, string $object\_type, string $object\_subtype, int $page )
===============================================================================================================================
Filters the sitemap entry for the sitemap index.
`$sitemap_entry` array Sitemap entry for the post. `$object_type` string Object empty name. `$object_subtype` string Object subtype name.
Empty string if the object type does not support subtypes. `$page` int Page number of results. File: `wp-includes/sitemaps/class-wp-sitemaps-provider.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/class-wp-sitemaps-provider.php/)
```
$sitemap_entry = apply_filters( 'wp_sitemaps_index_entry', $sitemap_entry, $this->object_type, $type['name'], $page );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Provider::get\_sitemap\_entries()](../classes/wp_sitemaps_provider/get_sitemap_entries) wp-includes/sitemaps/class-wp-sitemaps-provider.php | Lists sitemap pages exposed by this provider. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'get_site', WP_Site $_site ) apply\_filters( 'get\_site', WP\_Site $\_site )
===============================================
Fires after a site is retrieved.
`$_site` [WP\_Site](../classes/wp_site) Site data. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
$_site = apply_filters( 'get_site', $_site );
```
| Used By | Description |
| --- | --- |
| [get\_site()](../functions/get_site) wp-includes/ms-site.php | Retrieves site data given a site ID or site object. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_groupby_request', string $groupby, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_groupby\_request', string $groupby, WP\_Query $query )
==========================================================================================
Filters the GROUP BY clause of the query.
For use by caching plugins.
`$groupby` string The GROUP BY clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'admin_post_thumbnail_size', string|int[] $size, int $thumbnail_id, WP_Post $post ) apply\_filters( 'admin\_post\_thumbnail\_size', string|int[] $size, int $thumbnail\_id, WP\_Post $post )
========================================================================================================
Filters the size used to display the post thumbnail image in the ‘Featured image’ meta box.
Note: When a theme adds ‘post-thumbnail’ support, a special ‘post-thumbnail’ image size is registered, which differs from the ‘thumbnail’ image size managed via the Settings > Media screen.
`$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). `$thumbnail_id` int Post thumbnail attachment ID. `$post` [WP\_Post](../classes/wp_post) The post object associated with the thumbnail. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$size = apply_filters( 'admin_post_thumbnail_size', $size, $thumbnail_id, $post );
```
| Used By | Description |
| --- | --- |
| [\_wp\_post\_thumbnail\_html()](../functions/_wp_post_thumbnail_html) wp-admin/includes/post.php | Returns HTML for the post thumbnail meta box. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'plupload_default_params', array $params ) apply\_filters( 'plupload\_default\_params', array $params )
============================================================
Filters the Plupload default parameters.
`$params` array Default Plupload parameters array. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$params = apply_filters( 'plupload_default_params', $params );
```
| Used By | Description |
| --- | --- |
| [wp\_plupload\_default\_settings()](../functions/wp_plupload_default_settings) wp-includes/media.php | Prints default Plupload arguments. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'install_plugins_nonmenu_tabs', string[] $nonmenu_tabs ) apply\_filters( 'install\_plugins\_nonmenu\_tabs', string[] $nonmenu\_tabs )
============================================================================
Filters tabs not associated with a menu item on the Add Plugins screen.
`$nonmenu_tabs` string[] The tabs that don't have a menu item on the Add Plugins screen. File: `wp-admin/includes/class-wp-plugin-install-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-plugin-install-list-table.php/)
```
$nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugin\_Install\_List\_Table::prepare\_items()](../classes/wp_plugin_install_list_table/prepare_items) wp-admin/includes/class-wp-plugin-install-list-table.php | |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'current_screen', WP_Screen $current_screen ) do\_action( 'current\_screen', WP\_Screen $current\_screen )
============================================================
Fires after the current screen has been set.
`$current_screen` [WP\_Screen](../classes/wp_screen) Current [WP\_Screen](../classes/wp_screen) object. current\_screen is an admin hook triggered after the necessary elements to identify a screen are set up. This hook provides a [WP\_Screen](../classes/wp_screen) object as a parameter.
The following is a sample of the [WP\_Screen](../classes/wp_screen) object passed as parameter to a function hooked to current\_screen and called in a custom post type editing screen.
```
WP_Screen Object {
["action"] => string(0) ""
["base"] => string(4) "post"
["columns":"WP_Screen":private] => int(0)
["id"] => string(12) "someposttype"
["in_admin":protected] => string(4) "site"
["is_network"] => bool(false)
["is_user"] => bool(false)
["parent_base"] => NULL
["parent_file"] => NULL
["post_type"] => string(12) "someposttype"
["taxonomy"] => string(0) ""
["_help_tabs":"WP_Screen":private] => array(0) { }
["_help_sidebar":"WP_Screen":private] => string(0) ""
["_options":"WP_Screen":private] => array(0) { }
["_show_screen_options":"WP_Screen":private] => NULL
["_screen_settings":"WP_Screen":private] => NULL
}
```
and a sample of the object returned in a taxonomy list screen
```
WP_Screen Object {
["action"] => string(0) ""
["base"] => string(9) "edit-tags"
["columns":"WP_Screen":private] => int(0)
["id"] => string(10) "edit-mytax"
["in_admin":protected] => string(4) "site"
["is_network"] => bool(false)
["is_user"] => bool(false)
["parent_base"] => NULL
["parent_file"] => NULL
["post_type"] => string(12) "someposttype"
["taxonomy"] => string(5) "mytax"
["_help_tabs":"WP_Screen":private] => array(0) { }
["_help_sidebar":"WP_Screen":private] => string(0) ""
["_options":"WP_Screen":private] => array(0) { }
["_show_screen_options":"WP_Screen":private] => NULL
["_screen_settings":"WP_Screen":private] => NULL
}
```
File: `wp-admin/includes/class-wp-screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-screen.php/)
```
do_action( 'current_screen', $current_screen );
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::set\_current\_screen()](../classes/wp_screen/set_current_screen) wp-admin/includes/class-wp-screen.php | Makes the screen object the current screen. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( "{$taxonomy}_{$field}_rss", mixed $value ) apply\_filters( "{$taxonomy}\_{$field}\_rss", mixed $value )
============================================================
Filters the taxonomy field for use in RSS.
The dynamic portions of the hook name, `$taxonomy`, and `$field`, refer to the taxonomy slug and field name, respectively.
`$value` mixed Value of the taxonomy field. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$value = apply_filters( "{$taxonomy}_{$field}_rss", $value );
```
| Used By | Description |
| --- | --- |
| [sanitize\_term\_field()](../functions/sanitize_term_field) wp-includes/taxonomy.php | Sanitizes the field value in the term based on the context. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( "created_{$taxonomy}", int $term_id, int $tt_id, array $args ) do\_action( "created\_{$taxonomy}", int $term\_id, int $tt\_id, array $args )
=============================================================================
Fires after a new term in a specific taxonomy is created, and after the term cache has been cleaned.
The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `created_category`
* `created_post_tag`
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$args` array Arguments passed to [wp\_insert\_term()](../functions/wp_insert_term) . More Arguments from wp\_insert\_term( ... $args ) Array or query string of arguments for inserting a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( "created_{$taxonomy}", $term_id, $tt_id, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'media_library_show_video_playlist', bool|null $show ) apply\_filters( 'media\_library\_show\_video\_playlist', bool|null $show )
==========================================================================
Allows showing or hiding the “Create Video Playlist” button in the media library.
By default, the "Create Video Playlist" button will always be shown in the media library. If this filter returns `null`, a query will be run to determine whether the media library contains any video items. This was the default behavior prior to version 4.8.0, but this query is expensive for large media libraries.
`$show` bool|null Whether to show the button, or `null` to decide based on whether any video files exist in the media library. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$show_video_playlist = apply_filters( 'media_library_show_video_playlist', true );
```
| Used By | Description |
| --- | --- |
| [wp\_enqueue\_media()](../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | The filter's default value is `true` rather than `null`. |
| [4.7.4](https://developer.wordpress.org/reference/since/4.7.4/) | Introduced. |
wordpress apply_filters( 'cancel_comment_reply_link', string $formatted_link, string $link, string $text ) apply\_filters( 'cancel\_comment\_reply\_link', string $formatted\_link, string $link, string $text )
=====================================================================================================
Filters the cancel comment reply link HTML.
`$formatted_link` string The HTML-formatted cancel comment reply link. `$link` string Cancel comment reply link URL. `$text` string Cancel comment reply link text. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'cancel_comment_reply_link', $formatted_link, $link, $text );
```
| Used By | Description |
| --- | --- |
| [get\_cancel\_comment\_reply\_link()](../functions/get_cancel_comment_reply_link) wp-includes/comment-template.php | Retrieves HTML content for cancel comment reply link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'comment_id_fields', string $result, int $post_id, int $reply_to_id ) apply\_filters( 'comment\_id\_fields', string $result, int $post\_id, int $reply\_to\_id )
==========================================================================================
Filters the returned comment ID fields.
`$result` string The HTML-formatted hidden ID field comment elements. `$post_id` int The post ID. `$reply_to_id` int The ID of the comment being replied to. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'comment_id_fields', $result, $post_id, $reply_to_id );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_id\_fields()](../functions/get_comment_id_fields) wp-includes/comment-template.php | Retrieves hidden input HTML for replying to comments. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'async_update_translation', bool $update, object $language_update ) apply\_filters( 'async\_update\_translation', bool $update, object $language\_update )
======================================================================================
Filters whether to asynchronously update translation for core, a plugin, or a theme.
`$update` bool Whether to update. `$language_update` object The update offer. File: `wp-admin/includes/class-language-pack-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-language-pack-upgrader.php/)
```
$update = apply_filters( 'async_update_translation', $update, $language_update );
```
| Used By | Description |
| --- | --- |
| [Language\_Pack\_Upgrader::async\_upgrade()](../classes/language_pack_upgrader/async_upgrade) wp-admin/includes/class-language-pack-upgrader.php | Asynchronously upgrades language packs after other upgrades have been made. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_thumb_url', string $thumbnail_url, int $post_id ) apply\_filters( 'wp\_get\_attachment\_thumb\_url', string $thumbnail\_url, int $post\_id )
==========================================================================================
Filters the attachment thumbnail URL.
`$thumbnail_url` string URL for the attachment thumbnail. `$post_id` int Attachment ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'wp_get_attachment_thumb_url', $thumbnail_url, $post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_thumb\_url()](../functions/wp_get_attachment_thumb_url) wp-includes/post.php | Retrieves URL for an attachment thumbnail. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( "pre_{$field}", mixed $value ) apply\_filters( "pre\_{$field}", mixed $value )
===============================================
Filters the value of a specific post field before saving.
The dynamic portion of the hook name, `$field`, refers to the post field name.
`$value` mixed Value of the post field. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$value = apply_filters( "pre_{$field}", $value );
```
| Used By | Description |
| --- | --- |
| [sanitize\_user\_field()](../functions/sanitize_user_field) wp-includes/user.php | Sanitizes user field based on context. |
| [sanitize\_post\_field()](../functions/sanitize_post_field) wp-includes/post.php | Sanitizes a post field based on context. |
| [sanitize\_bookmark\_field()](../functions/sanitize_bookmark_field) wp-includes/bookmark.php | Sanitizes a bookmark field. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'postmeta_form_keys', array|null $keys, WP_Post $post ) apply\_filters( 'postmeta\_form\_keys', array|null $keys, WP\_Post $post )
==========================================================================
Filters values for the meta key dropdown in the Custom Fields meta box.
Returning a non-null value will effectively short-circuit and avoid a potentially expensive query against postmeta.
`$keys` array|null Pre-defined meta keys to be used in place of a postmeta query. Default null. `$post` [WP\_Post](../classes/wp_post) The current post object. File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
$keys = apply_filters( 'postmeta_form_keys', null, $post );
```
| Used By | Description |
| --- | --- |
| [meta\_form()](../functions/meta_form) wp-admin/includes/template.php | Prints the form in the Custom Fields meta box. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_editor_settings', array $settings, string $editor_id ) apply\_filters( 'wp\_editor\_settings', array $settings, string $editor\_id )
=============================================================================
Filters the [wp\_editor()](../functions/wp_editor) settings.
* [\_WP\_Editors::parse\_settings()](../classes/_wp_editors/parse_settings)
`$settings` array Array of editor arguments. `$editor_id` string Unique editor identifier, e.g. `'content'`. Accepts `'classic-block'` when called from block editor's Classic block. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$settings = apply_filters( 'wp_editor_settings', $settings, $editor_id );
```
| Used By | Description |
| --- | --- |
| [wp\_tinymce\_inline\_scripts()](../functions/wp_tinymce_inline_scripts) wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| [\_WP\_Editors::parse\_settings()](../classes/_wp_editors/parse_settings) wp-includes/class-wp-editor.php | Parse default arguments for the editor instance. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress do_action( 'wp_authenticate_application_password_errors', WP_Error $error, WP_User $user, array $item, string $password ) do\_action( 'wp\_authenticate\_application\_password\_errors', WP\_Error $error, WP\_User $user, array $item, string $password )
================================================================================================================================
Fires when an application password has been successfully checked as valid.
This allows for plugins to add additional constraints to prevent an application password from being used.
`$error` [WP\_Error](../classes/wp_error) The error object. `$user` [WP\_User](../classes/wp_user) The user authenticating. `$item` array The details about the application password. `$password` string The raw supplied password. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'wp_authenticate_application_password_errors', $error, $user, $item, $password );
```
| Used By | Description |
| --- | --- |
| [wp\_authenticate\_application\_password()](../functions/wp_authenticate_application_password) wp-includes/user.php | Authenticates the user using an application password. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'media_library_infinite_scrolling', bool $infinite ) apply\_filters( 'media\_library\_infinite\_scrolling', bool $infinite )
=======================================================================
Filters whether the Media Library grid has infinite scrolling. Default `false`.
`$infinite` bool Whether the Media Library grid has infinite scrolling. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$infinite_scrolling = apply_filters( 'media_library_infinite_scrolling', false );
```
| Used By | Description |
| --- | --- |
| [wp\_enqueue\_media()](../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'is_email', string|false $is_email, string $email, string $context ) apply\_filters( 'is\_email', string|false $is\_email, string $email, string $context )
======================================================================================
Filters whether an email address is valid.
This filter is evaluated under several different contexts, such as ’email\_too\_short’, ’email\_no\_at’, ‘local\_invalid\_chars’, ‘domain\_period\_sequence’, ‘domain\_period\_limits’, ‘domain\_no\_periods’, ‘sub\_hyphen\_limits’, ‘sub\_invalid\_chars’, or no specific context.
`$is_email` string|false The email address if successfully passed the [is\_email()](../functions/is_email) checks, false otherwise. `$email` string The email address being checked. `$context` string Context under which the email was tested. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'is_email', false, $email, 'email_too_short' );
```
| Used By | Description |
| --- | --- |
| [is\_email()](../functions/is_email) wp-includes/formatting.php | Verifies that an email is valid. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'pre_comment_author_name', string $author_cookie ) apply\_filters( 'pre\_comment\_author\_name', string $author\_cookie )
======================================================================
Filters the comment author’s name cookie before it is set.
When this filter hook is evaluated in [wp\_filter\_comment()](../functions/wp_filter_comment) , the comment author’s name string is passed.
`$author_cookie` string The comment author name cookie. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$comment_author = apply_filters( 'pre_comment_author_name', $_COOKIE[ 'comment_author_' . COOKIEHASH ] );
```
| Used By | Description |
| --- | --- |
| [wp\_filter\_comment()](../functions/wp_filter_comment) wp-includes/comment.php | Filters and sanitizes comment data. |
| [sanitize\_comment\_cookies()](../functions/sanitize_comment_cookies) wp-includes/comment.php | Sanitizes the cookies sent to the user already. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'end_fetch_post_thumbnail_html', int $post_id, int $post_thumbnail_id, string|int[] $size ) do\_action( 'end\_fetch\_post\_thumbnail\_html', int $post\_id, int $post\_thumbnail\_id, string|int[] $size )
==============================================================================================================
Fires after fetching the post thumbnail HTML.
`$post_id` int The post ID. `$post_thumbnail_id` int The post thumbnail ID. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). File: `wp-includes/post-thumbnail-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-thumbnail-template.php/)
```
do_action( 'end_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
```
| Used By | Description |
| --- | --- |
| [get\_the\_post\_thumbnail()](../functions/get_the_post_thumbnail) wp-includes/post-thumbnail-template.php | Retrieves the post thumbnail. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'get_terms_defaults', array $defaults, string[] $taxonomies ) apply\_filters( 'get\_terms\_defaults', array $defaults, string[] $taxonomies )
===============================================================================
Filters the terms query default arguments.
Use [‘get\_terms\_args’](get_terms_args) to filter the passed arguments.
`$defaults` array An array of default [get\_terms()](../functions/get_terms) arguments. More Arguments from get\_terms( ... $args ) Array or query string of term query parameters.
* `taxonomy`string|string[]Taxonomy name, or array of taxonomy names, to which results should be limited.
* `object_ids`int|int[]Object ID, or array of object IDs. Results will be limited to terms associated with these objects.
* `orderby`stringField(s) to order terms by. Accepts:
+ Term fields (`'name'`, `'slug'`, `'term_group'`, `'term_id'`, `'id'`, `'description'`, `'parent'`, `'term_order'`). Unless `$object_ids` is not empty, `'term_order'` is treated the same as `'term_id'`.
+ `'count'` to use the number of objects associated with the term.
+ `'include'` to match the `'order'` of the `$include` param.
+ `'slug__in'` to match the `'order'` of the `$slug` param.
+ `'meta_value'`
+ `'meta_value_num'`.
+ The value of `$meta_key`.
+ The array keys of `$meta_query`.
+ `'none'` to omit the ORDER BY clause. Default `'name'`.
* `order`stringWhether to order terms in ascending or descending order.
Accepts `'ASC'` (ascending) or `'DESC'` (descending).
Default `'ASC'`.
* `hide_empty`bool|intWhether to hide terms not assigned to any posts. Accepts `1|true` or `0|false`. Default `1|true`.
* `include`int[]|stringArray or comma/space-separated string of term IDs to include.
Default empty array.
* `exclude`int[]|stringArray or comma/space-separated string of term IDs to exclude.
If `$include` is non-empty, `$exclude` is ignored.
Default empty array.
* `exclude_tree`int[]|stringArray or comma/space-separated string of term IDs to exclude along with all of their descendant terms. If `$include` is non-empty, `$exclude_tree` is ignored. Default empty array.
* `number`int|stringMaximum number of terms to return. Accepts ``''`|0` (all) or any positive number. Default ``''`|0` (all). Note that `$number` may not return accurate results when coupled with `$object_ids`.
See #41796 for details.
* `offset`intThe number by which to offset the terms query.
* `fields`stringTerm fields to query for. Accepts:
+ `'all'` Returns an array of complete term objects (`WP_Term[]`).
+ `'all_with_object_id'` Returns an array of term objects with the `'object_id'` param (`WP_Term[]`). Works only when the `$object_ids` parameter is populated.
+ `'ids'` Returns an array of term IDs (`int[]`).
+ `'tt_ids'` Returns an array of term taxonomy IDs (`int[]`).
+ `'names'` Returns an array of term names (`string[]`).
+ `'slugs'` Returns an array of term slugs (`string[]`).
+ `'count'` Returns the number of matching terms (`int`).
+ `'id=>parent'` Returns an associative array of parent term IDs, keyed by term ID (`int[]`).
+ `'id=>name'` Returns an associative array of term names, keyed by term ID (`string[]`).
+ `'id=>slug'` Returns an associative array of term slugs, keyed by term ID (`string[]`). Default `'all'`.
* `count`boolWhether to return a term count. If true, will take precedence over `$fields`. Default false.
* `name`string|string[]Name or array of names to return term(s) for.
* `slug`string|string[]Slug or array of slugs to return term(s) for.
* `term_taxonomy_id`int|int[]Term taxonomy ID, or array of term taxonomy IDs, to match when querying terms.
* `hierarchical`boolWhether to include terms that have non-empty descendants (even if `$hide_empty` is set to true). Default true.
* `search`stringSearch criteria to match terms. Will be SQL-formatted with wildcards before and after.
* `name__like`stringRetrieve terms with criteria by which a term is LIKE `$name__like`.
* `description__like`stringRetrieve terms where the description is LIKE `$description__like`.
* `pad_counts`boolWhether to pad the quantity of a term's children in the quantity of each term's "count" object variable. Default false.
* `get`stringWhether to return terms regardless of ancestry or whether the terms are empty. Accepts `'all'` or `''` (disabled). Default `''`.
* `child_of`intTerm ID to retrieve child terms of. If multiple taxonomies are passed, `$child_of` is ignored. Default 0.
* `parent`intParent term ID to retrieve direct-child terms of.
* `childless`boolTrue to limit results to terms that have no children.
This parameter has no effect on non-hierarchical taxonomies.
Default false.
* `cache_domain`stringUnique cache key to be produced when this query is stored in an object cache. Default `'core'`.
* `update_term_meta_cache`boolWhether to prime meta caches for matched terms. Default true.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
`$taxonomies` string[] An array of taxonomy names. File: `wp-includes/class-wp-term-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-term-query.php/)
```
$this->query_var_defaults = apply_filters( 'get_terms_defaults', $this->query_var_defaults, $taxonomies );
```
| Used By | Description |
| --- | --- |
| [WP\_Term\_Query::parse\_query()](../classes/wp_term_query/parse_query) wp-includes/class-wp-term-query.php | Parse arguments passed to the term query with default query parameters. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'import_upload_size_limit', int $max_upload_size ) apply\_filters( 'import\_upload\_size\_limit', int $max\_upload\_size )
=======================================================================
Filters the maximum allowed upload size for import files.
* [wp\_max\_upload\_size()](../functions/wp_max_upload_size)
`$max_upload_size` int Allowed upload size. Default 1 MB. File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
```
| Used By | Description |
| --- | --- |
| [wp\_import\_upload\_form()](../functions/wp_import_upload_form) wp-admin/includes/template.php | Outputs the form used by the importers to accept the data to be imported. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'tag_row_actions', string[] $actions, WP_Term $tag ) apply\_filters( 'tag\_row\_actions', string[] $actions, WP\_Term $tag )
=======================================================================
Filters the action links displayed for each term in the Tags list table.
`$actions` string[] An array of action links to be displayed. Default `'Edit'`, 'Quick Edit', `'Delete'`, and `'View'`. `$tag` [WP\_Term](../classes/wp_term) Term object. File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
$actions = apply_filters( 'tag_row_actions', $actions, $tag );
```
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::handle\_row\_actions()](../classes/wp_terms_list_table/handle_row_actions) wp-admin/includes/class-wp-terms-list-table.php | Generates and displays row action links. |
| Version | Description |
| --- | --- |
| [5.4.2](https://developer.wordpress.org/reference/since/5.4.2/) | Restored (un-deprecated). |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Deprecated in favor of ['{$taxonomy](../functions/taxonomy)\_row\_actions'} filter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'deprecated_file_included', string $file, string $replacement, string $version, string $message ) do\_action( 'deprecated\_file\_included', string $file, string $replacement, string $version, string $message )
===============================================================================================================
Fires when a deprecated file is called.
`$file` string The file that was called. `$replacement` string The file that should have been included based on ABSPATH. `$version` string The version of WordPress that deprecated the file. `$message` string A message regarding the change. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
do_action( 'deprecated_file_included', $file, $replacement, $version, $message );
```
| Used By | Description |
| --- | --- |
| [\_deprecated\_file()](../functions/_deprecated_file) wp-includes/functions.php | Marks a file as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'install_plugins_tabs', string[] $tabs ) apply\_filters( 'install\_plugins\_tabs', string[] $tabs )
==========================================================
Filters the tabs shown on the Add Plugins screen.
`$tabs` string[] The tabs shown on the Add Plugins screen. Defaults include `'featured'`, `'popular'`, `'recommended'`, `'favorites'`, and `'upload'`. File: `wp-admin/includes/class-wp-plugin-install-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-plugin-install-list-table.php/)
```
$tabs = apply_filters( 'install_plugins_tabs', $tabs );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugin\_Install\_List\_Table::prepare\_items()](../classes/wp_plugin_install_list_table/prepare_items) wp-admin/includes/class-wp-plugin-install-list-table.php | |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'pre_render_block', string|null $pre_render, array $parsed_block, WP_Block|null $parent_block ) apply\_filters( 'pre\_render\_block', string|null $pre\_render, array $parsed\_block, WP\_Block|null $parent\_block )
=====================================================================================================================
Allows [render\_block()](../functions/render_block) to be short-circuited, by returning a non-null value.
`$pre_render` string|null The pre-rendered content. Default null. `$parsed_block` array The block being rendered. `$parent_block` [WP\_Block](../classes/wp_block)|null If this is a nested block, a reference to the parent block. File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
$pre_render = apply_filters( 'pre_render_block', null, $parsed_block, $parent_block );
```
| Used By | Description |
| --- | --- |
| [WP\_Block::render()](../classes/wp_block/render) wp-includes/class-wp-block.php | Generates the render output for the block. |
| [render\_block()](../functions/render_block) wp-includes/blocks.php | Renders a single block into a HTML string. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | The `$parent_block` parameter was added. |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'mce_external_plugins', array $external_plugins, string $editor_id ) apply\_filters( 'mce\_external\_plugins', array $external\_plugins, string $editor\_id )
========================================================================================
Filters the list of TinyMCE external plugins.
The filter takes an associative array of external plugins for TinyMCE in the form ‘plugin\_name’ => ‘url’.
The url should be absolute, and should include the js filename to be loaded. For example: ‘myplugin’ => ‘<http://mysite.com/wp-content/plugins/myfolder/mce_plugin.js>‘.
If the external plugin adds a button, it should be added with one of the ‘mce\_buttons’ filters.
`$external_plugins` array An array of external TinyMCE plugins. `$editor_id` string Unique editor identifier, e.g. `'content'`. Accepts `'classic-block'` when called from block editor's Classic block. This filter may be useful for loading any of the TinyMCE core plugins, many of which are not included by default in WordPress, as well as any custom TinyMCE plugins you may want to create.
**Plugin Version Compatibility:**
TinyMCE plugins must be compatible with the version of TinyMCE included in WordPress.
It may also be helpful to check when the particular plugin was introduced. For example, the visualblocks plugin was introduced in TinyMCE version 3.5b1.
WordPress 3.9 had a major update with TinyMCE 4.0.
If you find that your plugin script is not getting added, make sure you are adding your plugin ‘id’ => scripturl with the ‘mce\_external\_plugins’ filter, but not the ‘tiny\_mce\_plugins’ filter, or else the script file will not be registered.
File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mce_external_plugins = apply_filters( 'mce_external_plugins', array(), $editor_id );
```
| Used By | Description |
| --- | --- |
| [wp\_tinymce\_inline\_scripts()](../functions/wp_tinymce_inline_scripts) wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | The `$editor_id` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_users_entry', array $sitemap_entry, WP_User $user ) apply\_filters( 'wp\_sitemaps\_users\_entry', array $sitemap\_entry, WP\_User $user )
=====================================================================================
Filters the sitemap entry for an individual user.
`$sitemap_entry` array Sitemap entry for the user. `$user` [WP\_User](../classes/wp_user) User object. File: `wp-includes/sitemaps/providers/class-wp-sitemaps-users.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/providers/class-wp-sitemaps-users.php/)
```
$sitemap_entry = apply_filters( 'wp_sitemaps_users_entry', $sitemap_entry, $user );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Users::get\_url\_list()](../classes/wp_sitemaps_users/get_url_list) wp-includes/sitemaps/providers/class-wp-sitemaps-users.php | Gets a URL list for a user sitemap. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'nonce_life', int $lifespan, string|int $action ) apply\_filters( 'nonce\_life', int $lifespan, string|int $action )
==================================================================
Filters the lifespan of nonces in seconds.
`$lifespan` int Lifespan of nonces in seconds. Default 86,400 seconds, or one day. `$action` string|int The nonce action, or -1 if none was provided. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS, $action );
```
| Used By | Description |
| --- | --- |
| [wp\_nonce\_tick()](../functions/wp_nonce_tick) wp-includes/pluggable.php | Returns the time-dependent variable for nonce creation. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Added `$action` argument to allow for more targeted filters. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'default_excerpt', string $post_excerpt, WP_Post $post ) apply\_filters( 'default\_excerpt', string $post\_excerpt, WP\_Post $post )
===========================================================================
Filters the default post excerpt initially used in the “Write Post” form.
`$post_excerpt` string Default post excerpt. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );
```
| Used By | Description |
| --- | --- |
| [get\_default\_post\_to\_edit()](../functions/get_default_post_to_edit) wp-admin/includes/post.php | Returns default post information to use when populating the “Write Post” form. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'iis7_supports_permalinks', bool $supports_permalinks ) apply\_filters( 'iis7\_supports\_permalinks', bool $supports\_permalinks )
==========================================================================
Filters whether IIS 7+ supports pretty permalinks.
`$supports_permalinks` bool Whether IIS7 supports permalinks. Default false. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'iis7_supports_permalinks', $supports_permalinks );
```
| Used By | Description |
| --- | --- |
| [iis7\_supports\_permalinks()](../functions/iis7_supports_permalinks) wp-includes/functions.php | Checks if IIS 7+ supports pretty permalinks. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'is_email_address_unsafe', bool $is_email_address_unsafe, string $user_email ) apply\_filters( 'is\_email\_address\_unsafe', bool $is\_email\_address\_unsafe, string $user\_email )
=====================================================================================================
Filters whether an email address is unsafe.
`$is_email_address_unsafe` bool Whether the email address is "unsafe". Default false. `$user_email` string User email address. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
return apply_filters( 'is_email_address_unsafe', $is_email_address_unsafe, $user_email );
```
| Used By | Description |
| --- | --- |
| [is\_email\_address\_unsafe()](../functions/is_email_address_unsafe) wp-includes/ms-functions.php | Checks an email address against a list of banned domains. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'comment_email', string $comment_author_email, WP_Comment $comment ) apply\_filters( 'comment\_email', string $comment\_author\_email, WP\_Comment $comment )
========================================================================================
Filters the comment author’s email for display.
Care should be taken to protect the email address and assure that email harvesters do not capture your commenter’s email address.
`$comment_author_email` string The comment author's email address. `$comment` [WP\_Comment](../classes/wp_comment) The comment object. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
```
| Used By | Description |
| --- | --- |
| [WP\_Comments\_List\_Table::column\_author()](../classes/wp_comments_list_table/column_author) wp-admin/includes/class-wp-comments-list-table.php | |
| [get\_comment\_author\_email\_link()](../functions/get_comment_author_email_link) wp-includes/comment-template.php | Returns the HTML email link to the author of the current comment. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$comment` parameter was added. |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_join_request', string $join, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_join\_request', string $join, WP\_Query $query )
====================================================================================
Filters the JOIN clause of the query.
For use by caching plugins.
`$join` string The JOIN clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( "edited_{$taxonomy}", int $term_id, int $tt_id, array $args ) do\_action( "edited\_{$taxonomy}", int $term\_id, int $tt\_id, array $args )
============================================================================
Fires after a term for a specific taxonomy has been updated, and the term cache has been cleaned.
The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `edited_category`
* `edited_post_tag`
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
The `edit_$taxonomy` action is used to hook into code **after** a custom taxonomy term is updated in the database.
A plugin (or theme) can register an action hook from the example below.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( "edited_{$taxonomy}", $term_id, $tt_id, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'editor_max_image_size', int[] $max_image_size, string|int[] $size, string $context ) apply\_filters( 'editor\_max\_image\_size', int[] $max\_image\_size, string|int[] $size, string $context )
==========================================================================================================
Filters the maximum image size dimensions for the editor.
`$max_image_size` int[] An array of width and height values.
* intThe maximum width in pixels.
* `1`intThe maximum height in pixels.
`$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). `$context` string The context the image is being resized for.
Possible values are `'display'` (like in a theme) or `'edit'` (like inserting into an editor). File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size, $context );
```
| Used By | Description |
| --- | --- |
| [image\_constrain\_size\_for\_editor()](../functions/image_constrain_size_for_editor) wp-includes/media.php | Scales down the default size of an image. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters_ref_array( 'found_posts_query', string $found_posts_query, WP_Query $query ) apply\_filters\_ref\_array( 'found\_posts\_query', string $found\_posts\_query, WP\_Query $query )
==================================================================================================
Filters the query to run for retrieving the found posts.
`$found_posts_query` string The query to run to find the found posts. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$found_posts_query = apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::set\_found\_posts()](../classes/wp_query/set_found_posts) wp-includes/class-wp-query.php | Set up the amount of found posts and the number of pages (if limit clause was used) for the current query. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'customize_control_active', bool $active, WP_Customize_Control $control ) apply\_filters( 'customize\_control\_active', bool $active, WP\_Customize\_Control $control )
=============================================================================================
Filters response of [WP\_Customize\_Control::active()](../classes/wp_customize_control/active).
`$active` bool Whether the Customizer control is active. `$control` [WP\_Customize\_Control](../classes/wp_customize_control) [WP\_Customize\_Control](../classes/wp_customize_control) instance. File: `wp-includes/class-wp-customize-control.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-control.php/)
```
$active = apply_filters( 'customize_control_active', $active, $control );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Control::active()](../classes/wp_customize_control/active) wp-includes/class-wp-customize-control.php | Check whether control is active to current Customizer preview. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'get_comment_time', string|int $date, string $format, bool $gmt, bool $translate, WP_Comment $comment ) apply\_filters( 'get\_comment\_time', string|int $date, string $format, bool $gmt, bool $translate, WP\_Comment $comment )
==========================================================================================================================
Filters the returned comment time.
`$date` string|int The comment time, formatted as a date string or Unix timestamp. `$format` string PHP date format. `$gmt` bool Whether the GMT date is in use. `$translate` bool Whether the time is translated. `$comment` [WP\_Comment](../classes/wp_comment) The comment object. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'get_comment_time', $date, $format, $gmt, $translate, $comment );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_time()](../functions/get_comment_time) wp-includes/comment-template.php | Retrieves the comment time of the current comment. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'pingback_post', int $comment_ID ) do\_action( 'pingback\_post', int $comment\_ID )
================================================
Fires after a post pingback has been sent.
`$comment_ID` int Comment ID. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'pingback_post', $comment_ID );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::pingback\_ping()](../classes/wp_xmlrpc_server/pingback_ping) wp-includes/class-wp-xmlrpc-server.php | Retrieves a pingback and registers it. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress do_action( 'signup_blogform', WP_Error $errors ) do\_action( 'signup\_blogform', WP\_Error $errors )
===================================================
Fires after the site sign-up form.
`$errors` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object possibly containing `'blogname'` or `'blog_title'` errors. File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
do_action( 'signup_blogform', $errors );
```
| Used By | Description |
| --- | --- |
| [show\_blog\_form()](../functions/show_blog_form) wp-signup.php | Generates and displays the Sign-up and Create Site forms. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'lang_codes', string[] $lang_codes, string $code ) apply\_filters( 'lang\_codes', string[] $lang\_codes, string $code )
====================================================================
Filters the language codes.
`$lang_codes` string[] Array of key/value pairs of language codes where key is the short version. `$code` string A two-letter designation of the language. File: `wp-admin/includes/ms.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ms.php/)
```
$lang_codes = apply_filters( 'lang_codes', $lang_codes, $code );
```
| Used By | Description |
| --- | --- |
| [format\_code\_lang()](../functions/format_code_lang) wp-admin/includes/ms.php | Returns the language for a language code. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'signup_get_available_languages', string[] $languages ) apply\_filters( 'signup\_get\_available\_languages', string[] $languages )
==========================================================================
Filters the list of available languages for front-end site sign-ups.
Passing an empty array to this hook will disable output of the setting on the sign-up form, and the default language will be used when creating the site.
Languages not already installed will be stripped.
`$languages` string[] Array of available language codes. Language codes are formed by stripping the .mo extension from the language file names. File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
$languages = (array) apply_filters( 'signup_get_available_languages', get_available_languages() );
```
| Used By | Description |
| --- | --- |
| [signup\_get\_available\_languages()](../functions/signup_get_available_languages) wp-signup.php | Retrieves languages available during the site/user sign-up process. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'the_content', string $content ) apply\_filters( 'the\_content', string $content )
=================================================
Filters the post content.
`$content` string Content of the current post. This filter is used to filter the content of a post after it is retrieved from the database and before it is printed to the screen.
When using this filter it’s important to check if you’re filtering the content in the main query with the conditionals [is\_main\_query()](../functions/is_main_query) and [in\_the\_loop()](../functions/in_the_loop) . The main post query can be thought of as the primary post loop that displays the main content for a post, page or archive. Without these conditionals you could unintentionally be filtering the content for custom loops in sidebars, footers, or elsewhere.
```
add_filter( 'the_content', 'filter_the_content_in_the_main_loop', 1 );
function filter_the_content_in_the_main_loop( $content ) {
// Check if we're inside the main loop in a single Post.
if ( is_singular() && in_the_loop() && is_main_query() ) {
return $content . esc_html__( 'I’m filtering the content inside the main loop', 'wporg');
}
return $content;
}
```
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$content = apply_filters( 'the_content', $content );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_revisions_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Prepares the revision for the REST response. |
| [WP\_REST\_Attachments\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_attachments_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Prepares a single attachment output for response. |
| [WP\_REST\_Posts\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_posts_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Prepares a single post output for response. |
| [wp\_trim\_excerpt()](../functions/wp_trim_excerpt) wp-includes/formatting.php | Generates an excerpt from the content, if needed. |
| [get\_the\_content\_feed()](../functions/get_the_content_feed) wp-includes/feed.php | Retrieves the post content for feeds. |
| [the\_content()](../functions/the_content) wp-includes/post-template.php | Displays the post content. |
| [do\_trackbacks()](../functions/do_trackbacks) wp-includes/comment.php | Performs trackbacks. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'comment_text_rss', string $comment_text ) apply\_filters( 'comment\_text\_rss', string $comment\_text )
=============================================================
Filters the current comment content for use in a feed.
`$comment_text` string The content of the current comment. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
$comment_text = apply_filters( 'comment_text_rss', $comment_text );
```
| Used By | Description |
| --- | --- |
| [comment\_text\_rss()](../functions/comment_text_rss) wp-includes/feed.php | Displays the current comment content for use in the feeds. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'heartbeat_nopriv_received', array $response, array $data, string $screen_id ) apply\_filters( 'heartbeat\_nopriv\_received', array $response, array $data, string $screen\_id )
=================================================================================================
Filters Heartbeat Ajax response in no-privilege environments.
`$response` array The no-priv Heartbeat response. `$data` array The $\_POST data sent. `$screen_id` string The screen ID. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_nopriv\_heartbeat()](../functions/wp_ajax_nopriv_heartbeat) wp-admin/includes/ajax-actions.php | Ajax handler for the Heartbeat API in the no-privilege context. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'user_erasure_fulfillment_email_subject', string $subject, string $sitename, array $email_data ) apply\_filters( 'user\_erasure\_fulfillment\_email\_subject', string $subject, string $sitename, array $email\_data )
=====================================================================================================================
Filters the subject of the email sent when an erasure request is completed.
`$subject` string The email subject. `$sitename` string The name of the site. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `message_recipient`stringThe address that the email will be sent to. Defaults to the value of `$request->email`, but can be changed by the `user_erasure_fulfillment_email_to` filter.
* `privacy_policy_url`stringPrivacy policy URL.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$subject = apply_filters( 'user_erasure_fulfillment_email_subject', $subject, $email_data['sitename'], $email_data );
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_erasure\_fulfillment\_notification()](../functions/_wp_privacy_send_erasure_fulfillment_notification) wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( "expiration_of_transient_{$transient}", int $expiration, mixed $value, string $transient ) apply\_filters( "expiration\_of\_transient\_{$transient}", int $expiration, mixed $value, string $transient )
=============================================================================================================
Filters the expiration for a transient before its value is set.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$expiration` int Time until expiration in seconds. Use 0 for no expiration. `$value` mixed New value of transient. `$transient` string Transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$expiration = apply_filters( "expiration_of_transient_{$transient}", $expiration, $value, $transient );
```
| Used By | Description |
| --- | --- |
| [set\_transient()](../functions/set_transient) wp-includes/option.php | Sets/updates the value of a transient. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( "default_{$meta_type}_metadata", mixed $value, int $object_id, string $meta_key, bool $single, string $meta_type ) apply\_filters( "default\_{$meta\_type}\_metadata", mixed $value, int $object\_id, string $meta\_key, bool $single, string $meta\_type )
========================================================================================================================================
Filters the default metadata value for a specified meta key and object.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Possible filter names include:
* `default_post_metadata`
* `default_comment_metadata`
* `default_term_metadata`
* `default_user_metadata`
`$value` mixed The value to return, either a single metadata value or an array of values depending on the value of `$single`. `$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$single` bool Whether to return only the first value of the specified `$meta_key`. `$meta_type` string Type of object metadata is for. Accepts `'post'`, `'comment'`, `'term'`, `'user'`, or any other object type with an associated meta table. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
$value = apply_filters( "default_{$meta_type}_metadata", $value, $object_id, $meta_key, $single, $meta_type );
```
| Used By | Description |
| --- | --- |
| [get\_metadata\_default()](../functions/get_metadata_default) wp-includes/meta.php | Retrieves default metadata value for the specified meta key and object. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( "rest_pre_insert_{$this->post_type}", stdClass $prepared_post, WP_REST_Request $request ) apply\_filters( "rest\_pre\_insert\_{$this->post\_type}", stdClass $prepared\_post, WP\_REST\_Request $request )
================================================================================================================
Filters a post before it is inserted via the REST API.
The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
Possible hook names include:
* `rest_pre_insert_post`
* `rest_pre_insert_page`
* `rest_pre_insert_attachment`
`$prepared_post` stdClass An object representing a single post prepared for inserting or updating the database. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php/)
```
return apply_filters( "rest_pre_insert_{$this->post_type}", $prepared_post, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::prepare\_item\_for\_database()](../classes/wp_rest_posts_controller/prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Prepares a single post for create or update. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'comments_list_table_query_args', array $args ) apply\_filters( 'comments\_list\_table\_query\_args', array $args )
===================================================================
Filters the arguments for the comment query in the comments list table.
`$args` array An array of [get\_comments()](../functions/get_comments) arguments. More Arguments from get\_comments( ... $args ) Array or query string of comment query parameters.
* `author_email`stringComment author email address.
* `author_url`stringComment author URL.
* `author__in`int[]Array of author IDs to include comments for.
* `author__not_in`int[]Array of author IDs to exclude comments for.
* `comment__in`int[]Array of comment IDs to include.
* `comment__not_in`int[]Array of comment IDs to exclude.
* `count`boolWhether to return a comment count (true) or array of comment objects (false). Default false.
* `date_query`arrayDate query clauses to limit comments by. See [WP\_Date\_Query](../classes/wp_date_query).
Default null.
* `fields`stringComment fields to return. Accepts `'ids'` for comment IDs only or empty for all fields.
* `include_unapproved`arrayArray of IDs or email addresses of users whose unapproved comments will be returned by the query regardless of `$status`.
* `karma`intKarma score to retrieve matching comments for.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
* `number`intMaximum number of comments to retrieve.
Default empty (no limit).
* `paged`intWhen used with `$number`, defines the page of results to return.
When used with `$offset`, `$offset` takes precedence. Default 1.
* `offset`intNumber of comments to offset the query. Used to build LIMIT clause. Default 0.
* `no_found_rows`boolWhether to disable the `SQL_CALC_FOUND_ROWS` query.
Default: true.
* `orderby`string|arrayComment status or array of statuses. To use `'meta_value'` or `'meta_value_num'`, `$meta_key` must also be defined.
To sort by a specific `$meta_query` clause, use that clause's array key. Accepts:
+ `'comment_agent'`
+ `'comment_approved'`
+ `'comment_author'`
+ `'comment_author_email'`
+ `'comment_author_IP'`
+ `'comment_author_url'`
+ `'comment_content'`
+ `'comment_date'`
+ `'comment_date_gmt'`
+ `'comment_ID'`
+ `'comment_karma'`
+ `'comment_parent'`
+ `'comment_post_ID'`
+ `'comment_type'`
+ `'user_id'`
+ `'comment__in'`
+ `'meta_value'`
+ `'meta_value_num'`
+ The value of `$meta_key`
+ The array keys of `$meta_query`
+ false, an empty array, or `'none'` to disable `ORDER BY` clause. Default: `'comment_date_gmt'`.
* `order`stringHow to order retrieved comments. Accepts `'ASC'`, `'DESC'`.
Default: `'DESC'`.
* `parent`intParent ID of comment to retrieve children of.
* `parent__in`int[]Array of parent IDs of comments to retrieve children for.
* `parent__not_in`int[]Array of parent IDs of comments \*not\* to retrieve children for.
* `post_author__in`int[]Array of author IDs to retrieve comments for.
* `post_author__not_in`int[]Array of author IDs \*not\* to retrieve comments for.
* `post_id`intLimit results to those affiliated with a given post ID.
Default 0.
* `post__in`int[]Array of post IDs to include affiliated comments for.
* `post__not_in`int[]Array of post IDs to exclude affiliated comments for.
* `post_author`intPost author ID to limit results by.
* `post_status`string|string[]Post status or array of post statuses to retrieve affiliated comments for. Pass `'any'` to match any value.
* `post_type`string|string[]Post type or array of post types to retrieve affiliated comments for. Pass `'any'` to match any value.
* `post_name`stringPost name to retrieve affiliated comments for.
* `post_parent`intPost parent ID to retrieve affiliated comments for.
* `search`stringSearch term(s) to retrieve matching comments for.
* `status`string|arrayComment statuses to limit results by. Accepts an array or space/comma-separated list of `'hold'` (`comment_status=0`), `'approve'` (`comment_status=1`), `'all'`, or a custom comment status. Default `'all'`.
* `type`string|string[]Include comments of a given type, or array of types.
Accepts `'comment'`, `'pings'` (includes `'pingback'` and `'trackback'`), or any custom type string.
* `type__in`string[]Include comments from a given array of comment types.
* `type__not_in`string[]Exclude comments from a given array of comment types.
* `user_id`intInclude comments for a specific user ID.
* `hierarchical`bool|stringWhether to include comment descendants in the results.
+ `'threaded'` returns a tree, with each comment's children stored in a `children` property on the `WP_Comment` object.
+ `'flat'` returns a flat array of found comments plus their children.
+ Boolean `false` leaves out descendants. The parameter is ignored (forced to `false`) when `$fields` is `'ids'` or `'counts'`. Accepts `'threaded'`, `'flat'`, or false. Default: false.
* `cache_domain`stringUnique cache key to be produced when this query is stored in an object cache. Default is `'core'`.
* `update_comment_meta_cache`boolWhether to prime the metadata cache for found comments.
Default true.
* `update_comment_post_cache`boolWhether to prime the cache for comment posts.
Default false.
File: `wp-admin/includes/class-wp-comments-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-comments-list-table.php/)
```
$args = apply_filters( 'comments_list_table_query_args', $args );
```
| Used By | Description |
| --- | --- |
| [WP\_Comments\_List\_Table::prepare\_items()](../classes/wp_comments_list_table/prepare_items) wp-admin/includes/class-wp-comments-list-table.php | |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'admin_url', string $url, string $path, int|null $blog_id, string|null $scheme ) apply\_filters( 'admin\_url', string $url, string $path, int|null $blog\_id, string|null $scheme )
==================================================================================================
Filters the admin area URL.
`$url` string The complete admin area URL including scheme and path. `$path` string Path relative to the admin area URL. Blank string if no path is specified. `$blog_id` int|null Site ID, or null for the current site. `$scheme` string|null The scheme to use. Accepts `'http'`, `'https'`, `'admin'`, or null. Default `'admin'`, which obeys [force\_ssl\_admin()](../functions/force_ssl_admin) and [is\_ssl()](../functions/is_ssl) . File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'admin_url', $url, $path, $blog_id, $scheme );
```
| Used By | Description |
| --- | --- |
| [get\_admin\_url()](../functions/get_admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for a given site. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | The `$scheme` parameter was added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'edit_categories_per_page', int $tags_per_page ) apply\_filters( 'edit\_categories\_per\_page', int $tags\_per\_page )
=====================================================================
Filters the number of terms displayed per page for the Categories list table.
`$tags_per_page` int Number of categories to be displayed. Default 20. File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page );
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::render\_per\_page\_options()](../classes/wp_screen/render_per_page_options) wp-admin/includes/class-wp-screen.php | Renders the items per page option. |
| [WP\_Terms\_List\_Table::prepare\_items()](../classes/wp_terms_list_table/prepare_items) wp-admin/includes/class-wp-terms-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'site_status_should_suggest_persistent_object_cache', bool|null $suggest ) apply\_filters( 'site\_status\_should\_suggest\_persistent\_object\_cache', bool|null $suggest )
================================================================================================
Filters whether to suggest use of a persistent object cache and bypass default threshold checks.
Using this filter allows to override the default logic, effectively short-circuiting the method.
`$suggest` bool|null Boolean to short-circuit, for whether to suggest using a persistent object cache.
Default null. File: `wp-admin/includes/class-wp-site-health.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-site-health.php/)
```
$short_circuit = apply_filters( 'site_status_should_suggest_persistent_object_cache', null );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::should\_suggest\_persistent\_object\_cache()](../classes/wp_site_health/should_suggest_persistent_object_cache) wp-admin/includes/class-wp-site-health.php | Determines whether to suggest using a persistent object cache. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'old_slug_redirect_url', string $link ) apply\_filters( 'old\_slug\_redirect\_url', string $link )
==========================================================
Filters the old slug redirect URL.
`$link` string The redirect URL. File: `wp-includes/query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/query.php/)
```
$link = apply_filters( 'old_slug_redirect_url', $link );
```
| Used By | Description |
| --- | --- |
| [wp\_old\_slug\_redirect()](../functions/wp_old_slug_redirect) wp-includes/query.php | Redirect old slugs to the correct permalink. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'wp_set_comment_status', string $comment_id, string $comment_status ) do\_action( 'wp\_set\_comment\_status', string $comment\_id, string $comment\_status )
======================================================================================
Fires immediately after transitioning a comment’s status from one to another in the database and removing the comment from the object cache, but prior to all status transition hooks.
`$comment_id` string Comment ID as a numeric string. `$comment_status` string Current comment status. Possible values include `'hold'`, `'0'`, `'approve'`, `'1'`, `'spam'`, and `'trash'`. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'wp_set_comment_status', $comment->comment_ID, $comment_status );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_comment\_status()](../functions/wp_set_comment_status) wp-includes/comment.php | Sets the status of a comment. |
| [wp\_delete\_comment()](../functions/wp_delete_comment) wp-includes/comment.php | Trashes or deletes a comment. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'register_sidebar', array $sidebar ) do\_action( 'register\_sidebar', array $sidebar )
=================================================
Fires once a sidebar has been registered.
`$sidebar` array Parsed arguments for the registered sidebar. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
do_action( 'register_sidebar', $sidebar );
```
| Used By | Description |
| --- | --- |
| [register\_sidebar()](../functions/register_sidebar) wp-includes/widgets.php | Builds the definition for a single sidebar and returns the ID. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'allow_password_reset', bool $allow, int $user_id ) apply\_filters( 'allow\_password\_reset', bool $allow, int $user\_id )
======================================================================
Filters whether to allow a password to be reset.
`$allow` bool Whether to allow the password to be reset. Default true. `$user_id` int The ID of the user attempting to reset a password. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$allow = apply_filters( 'allow_password_reset', $allow, $user->ID );
```
| Used By | Description |
| --- | --- |
| [get\_password\_reset\_key()](../functions/get_password_reset_key) wp-includes/user.php | Creates, stores, then returns a password reset key for user. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'delete_option', string $option ) do\_action( 'delete\_option', string $option )
==============================================
Fires immediately before an option is deleted.
`$option` string Name of the option to delete. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'delete_option', $option );
```
| Used By | Description |
| --- | --- |
| [delete\_option()](../functions/delete_option) wp-includes/option.php | Removes option by name. Prevents removal of protected WordPress options. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'user_trailingslashit', string $string, string $type_of_url ) apply\_filters( 'user\_trailingslashit', string $string, string $type\_of\_url )
================================================================================
Filters the trailing-slashed string, depending on whether the site is set to use trailing slashes.
`$string` string URL with or without a trailing slash. `$type_of_url` string The type of URL being considered. Accepts `'single'`, `'single_trackback'`, `'single_feed'`, `'single_paged'`, `'commentpaged'`, `'paged'`, `'home'`, `'feed'`, `'category'`, `'page'`, `'year'`, `'month'`, `'day'`, `'post_type_archive'`. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'user_trailingslashit', $string, $type_of_url );
```
| Used By | Description |
| --- | --- |
| [user\_trailingslashit()](../functions/user_trailingslashit) wp-includes/link-template.php | Retrieves a trailing-slashed string if the site is set for adding trailing slashes. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'update_bulk_plugins_complete_actions', string[] $update_actions, array $plugin_info ) apply\_filters( 'update\_bulk\_plugins\_complete\_actions', string[] $update\_actions, array $plugin\_info )
============================================================================================================
Filters the list of action links available following bulk plugin updates.
`$update_actions` string[] Array of plugin action links. `$plugin_info` array Array of information for the last-updated plugin. File: `wp-admin/includes/class-bulk-plugin-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-bulk-plugin-upgrader-skin.php/)
```
$update_actions = apply_filters( 'update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
```
| Used By | Description |
| --- | --- |
| [Bulk\_Plugin\_Upgrader\_Skin::bulk\_footer()](../classes/bulk_plugin_upgrader_skin/bulk_footer) wp-admin/includes/class-bulk-plugin-upgrader-skin.php | |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'edited_terms', int $term_id, string $taxonomy, array $args ) do\_action( 'edited\_terms', int $term\_id, string $taxonomy, array $args )
===========================================================================
Fires immediately after a term is updated in the database, but before its term-taxonomy relationship is updated.
`$term_id` int Term ID. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
The `edited_terms` action is used to hook into code **after** a term is updated in the database.
A plugin (or theme) can register an action hook from the example below.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'edited_terms', $term_id, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'load-widgets.php' ) do\_action( 'load-widgets.php' )
================================
Fires early when editing the widgets displayed in sidebars.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_delete\_inactive\_widgets()](../functions/wp_ajax_delete_inactive_widgets) wp-admin/includes/ajax-actions.php | Ajax handler for removing inactive widgets. |
| [wp\_ajax\_save\_widget()](../functions/wp_ajax_save_widget) wp-admin/includes/ajax-actions.php | Ajax handler for saving a widget. |
| [WP\_Customize\_Widgets::wp\_ajax\_update\_widget()](../classes/wp_customize_widgets/wp_ajax_update_widget) wp-includes/class-wp-customize-widgets.php | Updates widget settings asynchronously. |
| [WP\_Customize\_Widgets::customize\_controls\_init()](../classes/wp_customize_widgets/customize_controls_init) wp-includes/class-wp-customize-widgets.php | Ensures all widgets get loaded into the Customizer. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'comment_form_top' ) do\_action( 'comment\_form\_top' )
==================================
Fires at the top of the comment form, inside the form tag.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
do_action( 'comment_form_top' );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'pre_user_display_name', string $display_name ) apply\_filters( 'pre\_user\_display\_name', string $display\_name )
===================================================================
Filters a user’s display name before the user is created or updated.
`$display_name` string The user's display name. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$display_name = apply_filters( 'pre_user_display_name', $display_name );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [2.0.3](https://developer.wordpress.org/reference/since/2.0.3/) | Introduced. |
wordpress apply_filters( 'wpmu_signup_blog_notification_email', string $content, string $domain, string $path, string $title, string $user_login, string $user_email, string $key, array $meta ) apply\_filters( 'wpmu\_signup\_blog\_notification\_email', string $content, string $domain, string $path, string $title, string $user\_login, string $user\_email, string $key, array $meta )
=============================================================================================================================================================================================
Filters the message content of the new blog notification email.
Content should be formatted for transmission via [wp\_mail()](../functions/wp_mail) .
`$content` string Content of the notification email. `$domain` string Site domain. `$path` string Site path. `$title` string Site title. `$user_login` string User login name. `$user_email` string User email address. `$key` string Activation key created in [wpmu\_signup\_blog()](../functions/wpmu_signup_blog) . `$meta` array Signup meta data. By default, contains the requested privacy setting and lang\_id. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
apply_filters(
'wpmu_signup_blog_notification_email',
/* translators: New site notification email. 1: Activation URL, 2: New site URL. */
__( "To activate your site, please click the following link:\n\n%1\$s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%2\$s" ),
$domain,
$path,
$title,
$user_login,
$user_email,
$key,
$meta
),
```
| Used By | Description |
| --- | --- |
| [wpmu\_signup\_blog\_notification()](../functions/wpmu_signup_blog_notification) wp-includes/ms-functions.php | Sends a confirmation request email to a user when they sign up for a new site. The new site will not become active until the confirmation link is clicked. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'strict_redirect_guess_404_permalink', bool $strict_guess ) apply\_filters( 'strict\_redirect\_guess\_404\_permalink', bool $strict\_guess )
================================================================================
Filters whether to perform a strict guess for a 404 redirect.
Returning a truthy value from the filter will redirect only exact post\_name matches.
`$strict_guess` bool Whether to perform a strict guess. Default false (loose guess). File: `wp-includes/canonical.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/canonical.php/)
```
$strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false );
```
| Used By | Description |
| --- | --- |
| [redirect\_guess\_404\_permalink()](../functions/redirect_guess_404_permalink) wp-includes/canonical.php | Attempts to guess the correct URL for a 404 request based on query vars. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'category_feed_link', string $link, string $feed ) apply\_filters( 'category\_feed\_link', string $link, string $feed )
====================================================================
Filters the category feed link.
`$link` string The category feed link. `$feed` string Feed type. Possible values include `'rss2'`, `'atom'`. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$link = apply_filters( 'category_feed_link', $link, $feed );
```
| Used By | Description |
| --- | --- |
| [get\_term\_feed\_link()](../functions/get_term_feed_link) wp-includes/link-template.php | Retrieves the feed link for a term. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'default_category_post_types', string[] $post_types ) apply\_filters( 'default\_category\_post\_types', string[] $post\_types )
=========================================================================
Filters post types (in addition to ‘post’) that require a default category.
`$post_types` string[] An array of post type names. Default empty array. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$default_category_post_types = apply_filters( 'default_category_post_types', array() );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_post\_categories()](../functions/wp_set_post_categories) wp-includes/post.php | Sets categories for a post. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'dashboard_secondary_items', string $items ) apply\_filters( 'dashboard\_secondary\_items', string $items )
==============================================================
Filters the number of secondary link items for the ‘WordPress Events and News’ dashboard widget.
`$items` string How many items to show in the secondary feed. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
'items' => apply_filters( 'dashboard_secondary_items', 3 ),
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_primary()](../functions/wp_dashboard_primary) wp-admin/includes/dashboard.php | ‘WordPress Events and News’ dashboard widget. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_element_limit', int $element_limit ) apply\_filters( 'xmlrpc\_element\_limit', int $element\_limit )
===============================================================
Filters the number of elements to parse in an XML-RPC response.
`$element_limit` int Default elements limit. File: `wp-includes/IXR/class-IXR-message.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ixr/class-ixr-message.php/)
```
$element_limit = apply_filters( 'xmlrpc_element_limit', $element_limit );
```
| Used By | Description |
| --- | --- |
| [IXR\_Message::parse()](../classes/ixr_message/parse) wp-includes/IXR/class-IXR-message.php | |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'user_request_key_expiration', int $expiration ) apply\_filters( 'user\_request\_key\_expiration', int $expiration )
===================================================================
Filters the expiration time of confirm keys.
`$expiration` int The expiration time in seconds. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$expiration_duration = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS );
```
| Used By | Description |
| --- | --- |
| [wp\_validate\_user\_request\_key()](../functions/wp_validate_user_request_key) wp-includes/user.php | Validates a user request by comparing the key with the request’s key. |
| [\_wp\_personal\_data\_cleanup\_requests()](../functions/_wp_personal_data_cleanup_requests) wp-admin/includes/privacy-tools.php | Cleans up failed and expired requests before displaying the list table. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters_ref_array( 'comments_pre_query', array|int|null $comment_data, WP_Comment_Query $query ) apply\_filters\_ref\_array( 'comments\_pre\_query', array|int|null $comment\_data, WP\_Comment\_Query $query )
==============================================================================================================
Filters the comments data before the query takes place.
Return a non-null value to bypass WordPress’ default comment queries.
The expected return type from this filter depends on the value passed in the request query vars:
* When `$this->query_vars['count']` is set, the filter should return the comment count as an integer.
* When `'ids' === $this->query_vars['fields']`, the filter should return an array of comment IDs.
* Otherwise the filter should return an array of [WP\_Comment](../classes/wp_comment) objects.
Note that if the filter returns an array of comment data, it will be assigned to the `comments` property of the current [WP\_Comment\_Query](../classes/wp_comment_query) instance.
Filtering functions that require pagination information are encouraged to set the `found_comments` and `max_num_pages` properties of the [WP\_Comment\_Query](../classes/wp_comment_query) object, passed to the filter by reference. If [WP\_Comment\_Query](../classes/wp_comment_query) does not perform a database query, it will not have enough information to generate these values itself.
`$comment_data` array|int|null Return an array of comment data to short-circuit WP's comment query, the comment count as an integer if `$this->query_vars['count']` is set, or null to allow WP to run its normal queries. `$query` [WP\_Comment\_Query](../classes/wp_comment_query) The [WP\_Comment\_Query](../classes/wp_comment_query) instance, passed by reference. File: `wp-includes/class-wp-comment-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-comment-query.php/)
```
$comment_data = apply_filters_ref_array( 'comments_pre_query', array( $comment_data, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Comment\_Query::get\_comments()](../classes/wp_comment_query/get_comments) wp-includes/class-wp-comment-query.php | Get a list of comments matching the query vars. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The returned array of comment data is assigned to the `comments` property of the current [WP\_Comment\_Query](../classes/wp_comment_query) instance. |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'trash_post_comments', int $post_id ) do\_action( 'trash\_post\_comments', int $post\_id )
====================================================
Fires before comments are sent to the Trash.
`$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'trash_post_comments', $post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_trash\_post\_comments()](../functions/wp_trash_post_comments) wp-includes/post.php | Moves comments for a post to the Trash. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'mejs_settings', array $mejs_settings ) apply\_filters( 'mejs\_settings', array $mejs\_settings )
=========================================================
Filters the MediaElement configuration settings.
`$mejs_settings` array MediaElement settings array. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
apply_filters( 'mejs_settings', $mejs_settings )
```
| Used By | Description |
| --- | --- |
| [wp\_default\_scripts()](../functions/wp_default_scripts) wp-includes/script-loader.php | Registers all WordPress scripts. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_additional_user_profile_data', array $additional_user_profile_data, WP_User $user, string[] $reserved_names ) apply\_filters( 'wp\_privacy\_additional\_user\_profile\_data', array $additional\_user\_profile\_data, WP\_User $user, string[] $reserved\_names )
===================================================================================================================================================
Filters the user’s profile data for the privacy exporter.
`$additional_user_profile_data` array An array of name-value pairs of additional user data items. Default empty array.
* `name`stringThe user-facing name of an item name-value pair,e.g. 'IP Address'.
* `value`stringThe user-facing value of an item data pair, e.g. `'50.60.70.0'`.
`$user` [WP\_User](../classes/wp_user) The user whose data is being exported. `$reserved_names` string[] An array of reserved names. Any item in `$additional_user_data` that uses one of these for its `name` will not be included in the export. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$_extra_data = apply_filters( 'wp_privacy_additional_user_profile_data', array(), $user, $reserved_names );
```
| Used By | Description |
| --- | --- |
| [wp\_user\_personal\_data\_exporter()](../functions/wp_user_personal_data_exporter) wp-includes/user.php | Finds and exports personal data associated with an email address from the user and user\_meta table. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress apply_filters( 'dynamic_sidebar_params', array $params ) apply\_filters( 'dynamic\_sidebar\_params', array $params )
===========================================================
Filters the parameters passed to a widget’s display callback.
Note: The filter is evaluated on both the front end and back end, including for the Inactive Widgets sidebar on the Widgets screen.
* [register\_sidebar()](../functions/register_sidebar)
`$params` array * `args`array An array of widget display arguments.
+ `name`stringName of the sidebar the widget is assigned to.
+ `id`stringID of the sidebar the widget is assigned to.
+ `description`stringThe sidebar description.
+ `class`stringCSS class applied to the sidebar container.
+ `before_widget`stringHTML markup to prepend to each widget in the sidebar.
+ `after_widget`stringHTML markup to append to each widget in the sidebar.
+ `before_title`stringHTML markup to prepend to the widget title when displayed.
+ `after_title`stringHTML markup to append to the widget title when displayed.
+ `widget_id`stringID of the widget.
+ `widget_name`stringName of the widget.
+ `widget_args`array An array of multi-widget arguments.
- `number`intNumber increment used for multiples of the same widget. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
$params = apply_filters( 'dynamic_sidebar_params', $params );
```
| Used By | Description |
| --- | --- |
| [wp\_render\_widget()](../functions/wp_render_widget) wp-includes/widgets.php | Calls the render callback of a widget and returns the output. |
| [dynamic\_sidebar()](../functions/dynamic_sidebar) wp-includes/widgets.php | Display dynamic sidebar. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_post_type', WP_REST_Response $response, WP_Post_Type $post_type, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_post\_type', WP\_REST\_Response $response, WP\_Post\_Type $post\_type, WP\_REST\_Request $request )
===================================================================================================================================
Filters a post type returned from the REST API.
Allows modification of the post type data right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$post_type` [WP\_Post\_Type](../classes/wp_post_type) The original post type object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php/)
```
return apply_filters( 'rest_prepare_post_type', $response, $post_type, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Post\_Types\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_post_types_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php | Prepares a post type object for serialization. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'post_comments_feed_link', string $url ) apply\_filters( 'post\_comments\_feed\_link', string $url )
===========================================================
Filters the post comments feed permalink.
`$url` string Post comments feed permalink. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'post_comments_feed_link', $url );
```
| Used By | Description |
| --- | --- |
| [get\_post\_comments\_feed\_link()](../functions/get_post_comments_feed_link) wp-includes/link-template.php | Retrieves the permalink for the post comments feed. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( "pre_transient_{$transient}", mixed $pre_transient, string $transient ) apply\_filters( "pre\_transient\_{$transient}", mixed $pre\_transient, string $transient )
==========================================================================================
Filters the value of an existing transient before it is retrieved.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
Returning a value other than false from the filter will short-circuit retrieval and return that value instead.
`$pre_transient` mixed The default value to return if the transient does not exist.
Any value other than false will short-circuit the retrieval of the transient, and return that value. `$transient` string Transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$pre = apply_filters( "pre_transient_{$transient}", false, $transient );
```
| Used By | Description |
| --- | --- |
| [get\_transient()](../functions/get_transient) wp-includes/option.php | Retrieves the value of a transient. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$transient` parameter was added |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'heartbeat_nopriv_send', array $response, string $screen_id ) apply\_filters( 'heartbeat\_nopriv\_send', array $response, string $screen\_id )
================================================================================
Filters Heartbeat Ajax response in no-privilege environments when no data is passed.
`$response` array The no-priv Heartbeat response. `$screen_id` string The screen ID. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_nopriv\_heartbeat()](../functions/wp_ajax_nopriv_heartbeat) wp-admin/includes/ajax-actions.php | Ajax handler for the Heartbeat API in the no-privilege context. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'rest_user_collection_params', array $query_params ) apply\_filters( 'rest\_user\_collection\_params', array $query\_params )
========================================================================
Filters REST API collection parameters for the users controller.
This filter registers the collection parameter, but does not map the collection parameter to an internal [WP\_User\_Query](../classes/wp_user_query) parameter. Use the `rest_user_query` filter to set [WP\_User\_Query](../classes/wp_user_query) arguments.
`$query_params` array JSON Schema-formatted collection parameters. File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
return apply_filters( 'rest_user_collection_params', $query_params );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_collection\_params()](../classes/wp_rest_users_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Retrieves the query params for collections. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'auto_core_update_send_email', bool $send, string $type, object $core_update, mixed $result ) apply\_filters( 'auto\_core\_update\_send\_email', bool $send, string $type, object $core\_update, mixed $result )
==================================================================================================================
Filters whether to send an email following an automatic background core update.
`$send` bool Whether to send the email. Default true. `$type` string The type of email to send. Can be one of `'success'`, `'fail'`, `'critical'`. `$core_update` object The update offer that was attempted. `$result` mixed The result for the core update. Can be [WP\_Error](../classes/wp_error). File: `wp-admin/includes/class-wp-automatic-updater.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-automatic-updater.php/)
```
if ( 'manual' !== $type && ! apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Automatic\_Updater::send\_email()](../classes/wp_automatic_updater/send_email) wp-admin/includes/class-wp-automatic-updater.php | Sends an email upon the completion or failure of a background core update. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'media_send_to_editor', string $html, int $send_id, array $attachment ) apply\_filters( 'media\_send\_to\_editor', string $html, int $send\_id, array $attachment )
===========================================================================================
Filters the HTML markup for a media item sent to the editor.
* [wp\_get\_attachment\_metadata()](../functions/wp_get_attachment_metadata)
`$html` string HTML markup for a media item sent to the editor. `$send_id` int The first key from the $\_POST[`'send'`] data. `$attachment` array Array of attachment metadata. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$html = apply_filters( 'media_send_to_editor', $html, $send_id, $attachment );
```
| Used By | Description |
| --- | --- |
| [media\_upload\_form\_handler()](../functions/media_upload_form_handler) wp-admin/includes/media.php | Handles form submissions for the legacy media uploader. |
| [wp\_ajax\_send\_attachment\_to\_editor()](../functions/wp_ajax_send_attachment_to_editor) wp-admin/includes/ajax-actions.php | Ajax handler for sending an attachment to the editor. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'wp_enqueue_code_editor', array $settings ) do\_action( 'wp\_enqueue\_code\_editor', array $settings )
==========================================================
Fires when scripts and styles are enqueued for the code editor.
`$settings` array Settings for the enqueued code editor. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'wp_enqueue_code_editor', $settings );
```
| Used By | Description |
| --- | --- |
| [wp\_enqueue\_code\_editor()](../functions/wp_enqueue_code_editor) wp-includes/general-template.php | Enqueues assets needed by the code editor for the given settings. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'show_recent_comments_widget_style', bool $active, string $id_base ) apply\_filters( 'show\_recent\_comments\_widget\_style', bool $active, string $id\_base )
=========================================================================================
Filters the Recent Comments default widget styles.
`$active` bool Whether the widget is active. Default true. `$id_base` string The widget ID. File: `wp-includes/widgets/class-wp-widget-recent-comments.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-recent-comments.php/)
```
|| ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Recent\_Comments::recent\_comments\_style()](../classes/wp_widget_recent_comments/recent_comments_style) wp-includes/widgets/class-wp-widget-recent-comments.php | Outputs the default styles for the Recent Comments widget. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'wp_login', string $user_login, WP_User $user ) do\_action( 'wp\_login', string $user\_login, WP\_User $user )
==============================================================
Fires after the user has successfully logged in.
`$user_login` string Username. `$user` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object of the logged-in user. The `wp_login` action hook is triggered when a user logs in by the [wp\_signon()](../functions/wp_signon) function. It is the very last action taken in the function, immediately following the [wp\_set\_auth\_cookie()](../functions/wp_set_auth_cookie) call.
This hook provides access to two parameters: $user->user\_login (string) and $user ( [WP\_User](../classes/wp_user) ). To pass them into your function you will need to add a priority (default is 10) and request 2 arguments from the [add\_action()](../functions/add_action) call:
```
<?php
function your_function( $user_login, $user ) {
// your code
}
add_action('wp_login', 'your_function', 10, 2);
?>
```
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'wp_login', $user->user_login, $user );
```
| Used By | Description |
| --- | --- |
| [wp\_signon()](../functions/wp_signon) wp-includes/user.php | Authenticates and logs a user in with ‘remember’ capability. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_signature_url', false|string $signature_url, string $url ) apply\_filters( 'wp\_signature\_url', false|string $signature\_url, string $url )
=================================================================================
Filters the URL where the signature for a file is located.
`$signature_url` false|string The URL where signatures can be found for a file, or false if none are known. `$url` string The URL being verified. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$signature_url = apply_filters( 'wp_signature_url', $signature_url, $url );
```
| Used By | Description |
| --- | --- |
| [download\_url()](../functions/download_url) wp-admin/includes/file.php | Downloads a URL to a local temporary file using the WordPress HTTP API. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action( 'stop_previewing_theme', WP_Customize_Manager $manager ) do\_action( 'stop\_previewing\_theme', WP\_Customize\_Manager $manager )
========================================================================
Fires once the Customizer theme preview has stopped.
`$manager` [WP\_Customize\_Manager](../classes/wp_customize_manager) [WP\_Customize\_Manager](../classes/wp_customize_manager) instance. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
do_action( 'stop_previewing_theme', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::stop\_previewing\_theme()](../classes/wp_customize_manager/stop_previewing_theme) wp-includes/class-wp-customize-manager.php | Stops previewing the selected theme. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'create_term', int $term_id, int $tt_id, string $taxonomy, array $args ) do\_action( 'create\_term', int $term\_id, int $tt\_id, string $taxonomy, array $args )
=======================================================================================
Fires immediately after a new term is created, before the term cache is cleaned.
The [‘create\_$taxonomy’](create_taxonomy) hook is also available for targeting a specific taxonomy.
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_insert\_term()](../functions/wp_insert_term) . More Arguments from wp\_insert\_term( ... $args ) Array or query string of arguments for inserting a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'create_term', $term_id, $tt_id, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_unique_post_slug', string $slug, int $post_ID, string $post_status, string $post_type, int $post_parent, string $original_slug ) apply\_filters( 'wp\_unique\_post\_slug', string $slug, int $post\_ID, string $post\_status, string $post\_type, int $post\_parent, string $original\_slug )
============================================================================================================================================================
Filters the unique post slug.
`$slug` string The post slug. `$post_ID` int Post ID. `$post_status` string The post status. `$post_type` string Post type. `$post_parent` int Post parent ID `$original_slug` string The original post slug. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug );
```
| Used By | Description |
| --- | --- |
| [wp\_unique\_post\_slug()](../functions/wp_unique_post_slug) wp-includes/post.php | Computes a unique slug for the post, when given the desired slug and some post details. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters_deprecated( 'user_confirmed_action_email_content', string $content, array $email_data ) apply\_filters\_deprecated( 'user\_confirmed\_action\_email\_content', string $content, array $email\_data )
============================================================================================================
This hook has been deprecated. Use [‘user\_erasure\_fulfillment\_email\_content’](user_erasure_fulfillment_email_content) instead. For user request confirmation email content use [‘user\_request\_confirmed\_email\_content’](user_request_confirmed_email_content) instead.
Filters the body of the data erasure fulfillment notification.
The email is sent to a user when their data erasure request is fulfilled by an administrator.
The following strings have a special meaning and will get replaced dynamically:
`$content` string The email content. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `message_recipient`stringThe address that the email will be sent to. Defaults to the value of `$request->email`, but can be changed by the `user_erasure_fulfillment_email_to` filter.
* `privacy_policy_url`stringPrivacy policy URL.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$content = apply_filters_deprecated(
'user_confirmed_action_email_content',
array( $content, $email_data ),
'5.8.0',
sprintf(
/* translators: 1 & 2: Deprecation replacement options. */
__( '%1$s or %2$s' ),
'user_erasure_fulfillment_email_content',
'user_request_confirmed_email_content'
)
);
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_request\_confirmation\_notification()](../functions/_wp_privacy_send_request_confirmation_notification) wp-includes/user.php | Notifies the site administrator via email when a request is confirmed. |
| [\_wp\_privacy\_send\_erasure\_fulfillment\_notification()](../functions/_wp_privacy_send_erasure_fulfillment_notification) wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Use ['user\_erasure\_fulfillment\_email\_content'](user_erasure_fulfillment_email_content) instead. For user request confirmation email content use ['user\_request\_confirmed\_email\_content'](user_request_confirmed_email_content) instead. |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress do_action( 'comment_post', int $comment_ID, int|string $comment_approved, array $commentdata ) do\_action( 'comment\_post', int $comment\_ID, int|string $comment\_approved, array $commentdata )
==================================================================================================
Fires immediately after a comment is inserted into the database.
`$comment_ID` int The comment ID. `$comment_approved` int|string 1 if the comment is approved, 0 if not, `'spam'` if spam. `$commentdata` array Comment data. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'], $commentdata );
```
| Used By | Description |
| --- | --- |
| [wp\_new\_comment()](../functions/wp_new_comment) wp-includes/comment.php | Adds a new comment to the database. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The `$commentdata` parameter was added. |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'upload_mimes', array $t, int|WP_User|null $user ) apply\_filters( 'upload\_mimes', array $t, int|WP\_User|null $user )
====================================================================
Filters the list of allowed mime types and file extensions.
`$t` array Mime types keyed by the file extension regex corresponding to those types. `$user` int|[WP\_User](../classes/wp_user)|null User ID, User object or null if not provided (indicates current user). File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'upload_mimes', $t, $user );
```
| Used By | Description |
| --- | --- |
| [get\_allowed\_mime\_types()](../functions/get_allowed_mime_types) wp-includes/functions.php | Retrieves the list of allowed mime types and file extensions. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'navigation_widgets_format', string $format ) apply\_filters( 'navigation\_widgets\_format', string $format )
===============================================================
Filters the HTML format of widgets with navigation links.
`$format` string The type of markup to use in widgets with navigation links.
Accepts `'html5'`, `'xhtml'`. File: `wp-includes/widgets/class-wp-nav-menu-widget.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-nav-menu-widget.php/)
```
$format = apply_filters( 'navigation_widgets_format', $format );
```
| Used By | Description |
| --- | --- |
| [WP\_Nav\_Menu\_Widget::widget()](../classes/wp_nav_menu_widget/widget) wp-includes/widgets/class-wp-nav-menu-widget.php | Outputs the content for the current Navigation Menu widget instance. |
| [WP\_Widget\_Tag\_Cloud::widget()](../classes/wp_widget_tag_cloud/widget) wp-includes/widgets/class-wp-widget-tag-cloud.php | Outputs the content for the current Tag Cloud widget instance. |
| [WP\_Widget\_RSS::widget()](../classes/wp_widget_rss/widget) wp-includes/widgets/class-wp-widget-rss.php | Outputs the content for the current RSS widget instance. |
| [WP\_Widget\_Recent\_Comments::widget()](../classes/wp_widget_recent_comments/widget) wp-includes/widgets/class-wp-widget-recent-comments.php | Outputs the content for the current Recent Comments widget instance. |
| [WP\_Widget\_Recent\_Posts::widget()](../classes/wp_widget_recent_posts/widget) wp-includes/widgets/class-wp-widget-recent-posts.php | Outputs the content for the current Recent Posts widget instance. |
| [WP\_Widget\_Categories::widget()](../classes/wp_widget_categories/widget) wp-includes/widgets/class-wp-widget-categories.php | Outputs the content for the current Categories widget instance. |
| [WP\_Widget\_Meta::widget()](../classes/wp_widget_meta/widget) wp-includes/widgets/class-wp-widget-meta.php | Outputs the content for the current Meta widget instance. |
| [WP\_Widget\_Archives::widget()](../classes/wp_widget_archives/widget) wp-includes/widgets/class-wp-widget-archives.php | Outputs the content for the current Archives widget instance. |
| [WP\_Widget\_Pages::widget()](../classes/wp_widget_pages/widget) wp-includes/widgets/class-wp-widget-pages.php | Outputs the content for the current Pages widget instance. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_dropdown_users', string $output ) apply\_filters( 'wp\_dropdown\_users', string $output )
=======================================================
Filters the [wp\_dropdown\_users()](../functions/wp_dropdown_users) HTML output.
`$output` string HTML output generated by [wp\_dropdown\_users()](../functions/wp_dropdown_users) . More Arguments from wp\_dropdown\_users( ... $args ) Array or string of Query parameters.
* `blog_id`intThe site ID. Default is the current site.
* `role`string|string[]An array or a comma-separated list of role names that users must match to be included in results. Note that this is an inclusive list: users must match \*each\* role.
* `role__in`string[]An array of role names. Matched users must have at least one of these roles.
* `role__not_in`string[]An array of role names to exclude. Users matching one or more of these roles will not be included in results.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
* `capability`string|string[]An array or a comma-separated list of capability names that users must match to be included in results. Note that this is an inclusive list: users must match \*each\* capability.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `capability__in`string[]An array of capability names. Matched users must have at least one of these capabilities.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `capability__not_in`string[]An array of capability names to exclude. Users matching one or more of these capabilities will not be included in results.
Does NOT work for capabilities not in the database or filtered via ['map\_meta\_cap'](map_meta_cap).
* `include`int[]An array of user IDs to include.
* `exclude`int[]An array of user IDs to exclude.
* `search`stringSearch keyword. Searches for possible string matches on columns.
When `$search_columns` is left empty, it tries to determine which column to search in based on search string.
* `search_columns`string[]Array of column names to be searched. Accepts `'ID'`, `'user_login'`, `'user_email'`, `'user_url'`, `'user_nicename'`, `'display_name'`.
* `orderby`string|arrayField(s) to sort the retrieved users by. May be a single value, an array of values, or a multi-dimensional array with fields as keys and orders (`'ASC'` or `'DESC'`) as values. Accepted values are:
+ `'ID'`
+ `'display_name'` (or `'name'`)
+ `'include'`
+ `'user_login'` (or `'login'`)
+ `'login__in'`
+ `'user_nicename'` (or `'nicename'`),
+ `'nicename__in'`
+ 'user\_email (or `'email'`)
+ `'user_url'` (or `'url'`),
+ `'user_registered'` (or `'registered'`)
+ `'post_count'`
+ `'meta_value'`,
+ `'meta_value_num'`
+ The value of `$meta_key`
+ An array key of `$meta_query` To use `'meta_value'` or `'meta_value_num'`, `$meta_key` must be also be defined. Default `'user_login'`.
* `order`stringDesignates ascending or descending order of users. Order values passed as part of an `$orderby` array take precedence over this parameter. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `offset`intNumber of users to offset in retrieved results. Can be used in conjunction with pagination. Default 0.
* `number`intNumber of users to limit the query for. Can be used in conjunction with pagination. Value -1 (all) is supported, but should be used with caution on larger sites.
Default -1 (all users).
* `paged`intWhen used with number, defines the page of results to return.
Default 1.
* `count_total`boolWhether to count the total number of users found. If pagination is not needed, setting this to false can improve performance.
Default true.
* `fields`string|string[]Which fields to return. Single or all fields (string), or array of fields. Accepts:
+ `'ID'`
+ `'display_name'`
+ `'user_login'`
+ `'user_nicename'`
+ `'user_email'`
+ `'user_url'`
+ `'user_registered'`
+ `'user_pass'`
+ `'user_activation_key'`
+ `'user_status'`
+ `'spam'` (only available on multisite installs)
+ `'deleted'` (only available on multisite installs)
+ `'all'` for all fields and loads user meta.
+ `'all_with_meta'` Deprecated. Use `'all'`. Default `'all'`.
* `who`stringType of users to query. Accepts `'authors'`.
Default empty (all users).
* `has_published_posts`bool|string[]Pass an array of post types to filter results to users who have published posts in those post types. `true` is an alias for all public post types.
* `nicename`stringThe user nicename.
* `nicename__in`string[]An array of nicenames to include. Users matching one of these nicenames will be included in results.
* `nicename__not_in`string[]An array of nicenames to exclude. Users matching one of these nicenames will not be included in results.
* `login`stringThe user login.
* `login__in`string[]An array of logins to include. Users matching one of these logins will be included in results.
* `login__not_in`string[]An array of logins to exclude. Users matching one of these logins will not be included in results.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$html = apply_filters( 'wp_dropdown_users', $output );
```
| Used By | Description |
| --- | --- |
| [wp\_dropdown\_users()](../functions/wp_dropdown_users) wp-includes/user.php | Creates dropdown HTML content of users. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'admin_print_styles-media-upload-popup' ) do\_action( 'admin\_print\_styles-media-upload-popup' )
=======================================================
Fires when admin styles enqueued for the legacy (pre-3.5.0) media upload popup are printed.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'admin_print_styles-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [wp\_iframe()](../functions/wp_iframe) wp-admin/includes/media.php | Outputs the iframe to display the media upload page. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_http_cookie_value', string $value, string $name ) apply\_filters( 'wp\_http\_cookie\_value', string $value, string $name )
========================================================================
Filters the header-encoded cookie value.
`$value` string The cookie value. `$name` string The cookie name. File: `wp-includes/class-wp-http-cookie.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-cookie.php/)
```
return $this->name . '=' . apply_filters( 'wp_http_cookie_value', $this->value, $this->name );
```
| Used By | Description |
| --- | --- |
| [WP\_Http\_Cookie::getHeaderValue()](../classes/wp_http_cookie/getheadervalue) wp-includes/class-wp-http-cookie.php | Convert cookie name and value back to header string. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'wp_theme_json_data_blocks', WP_Theme_JSON_Data ) apply\_filters( 'wp\_theme\_json\_data\_blocks', WP\_Theme\_JSON\_Data )
========================================================================
Filters the data provided by the blocks for global styles & settings.
Class to access and update the underlying data. File: `wp-includes/class-wp-theme-json-resolver.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme-json-resolver.php/)
```
$theme_json = apply_filters( 'wp_theme_json_data_blocks', new WP_Theme_JSON_Data( $config, 'blocks' ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme\_JSON\_Resolver::get\_block\_data()](../classes/wp_theme_json_resolver/get_block_data) wp-includes/class-wp-theme-json-resolver.php | Gets the styles for blocks from the block.json file. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'the_meta_key', string $html, string $key, string $value ) apply\_filters( 'the\_meta\_key', string $html, string $key, string $value )
============================================================================
Filters the HTML output of the li element in the post custom fields list.
`$html` string The HTML output for the li element. `$key` string Meta key. `$value` string Meta value. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$li_html .= apply_filters( 'the_meta_key', $html, $key, $value );
```
| Used By | Description |
| --- | --- |
| [the\_meta()](../functions/the_meta) wp-includes/post-template.php | Displays a list of post custom fields. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'customize_dynamic_partial_args', false|array $partial_args, string $partial_id ) apply\_filters( 'customize\_dynamic\_partial\_args', false|array $partial\_args, string $partial\_id )
======================================================================================================
Filters a dynamic partial’s constructor arguments.
For a dynamic partial to be registered, this filter must be employed to override the default false value with an array of args to pass to the [WP\_Customize\_Partial](../classes/wp_customize_partial) constructor.
`$partial_args` false|array The arguments to the [WP\_Customize\_Partial](../classes/wp_customize_partial) constructor. `$partial_id` string ID for dynamic partial. File: `wp-includes/customize/class-wp-customize-selective-refresh.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-selective-refresh.php/)
```
$partial_args = apply_filters( 'customize_dynamic_partial_args', $partial_args, $partial_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Selective\_Refresh::add\_dynamic\_partials()](../classes/wp_customize_selective_refresh/add_dynamic_partials) wp-includes/customize/class-wp-customize-selective-refresh.php | Registers dynamically-created partials. |
| [WP\_Customize\_Selective\_Refresh::add\_partial()](../classes/wp_customize_selective_refresh/add_partial) wp-includes/customize/class-wp-customize-selective-refresh.php | Adds a partial. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'xmlrpc_call_success_wp_newCategory', int $cat_id, array $args ) do\_action( 'xmlrpc\_call\_success\_wp\_newCategory', int $cat\_id, array $args )
=================================================================================
Fires after a new category has been successfully created via XML-RPC.
`$cat_id` int ID of the new category. `$args` array An array of new category arguments. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'xmlrpc_call_success_wp_newCategory', $cat_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_newCategory()](../classes/wp_xmlrpc_server/wp_newcategory) wp-includes/class-wp-xmlrpc-server.php | Create new category. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'pre-upload-ui' ) do\_action( 'pre-upload-ui' )
=============================
Fires just before the legacy (pre-3.5.0) upload interface is loaded.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'pre-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [media\_upload\_form()](../functions/media_upload_form) wp-admin/includes/media.php | Outputs the legacy media upload form. |
| [wp\_print\_media\_templates()](../functions/wp_print_media_templates) wp-includes/media-template.php | Prints the templates used in the media manager. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'flush_rewrite_rules_hard', bool $hard ) apply\_filters( 'flush\_rewrite\_rules\_hard', bool $hard )
===========================================================
Filters whether a “hard” rewrite rule flush should be performed when requested.
A "hard" flush updates .htaccess (Apache) or web.config (IIS).
`$hard` bool Whether to flush rewrite rules "hard". Default true. File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
if ( ! $hard || ! apply_filters( 'flush_rewrite_rules_hard', true ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::flush\_rules()](../classes/wp_rewrite/flush_rules) wp-includes/class-wp-rewrite.php | Removes rewrite rules and then recreate rewrite rules. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'add_trashed_suffix_to_trashed_posts', bool $add_trashed_suffix, string $post_name, int $post_ID ) apply\_filters( 'add\_trashed\_suffix\_to\_trashed\_posts', bool $add\_trashed\_suffix, string $post\_name, int $post\_ID )
===========================================================================================================================
Filters whether or not to add a `__trashed` suffix to trashed posts that match the name of the updated post.
`$add_trashed_suffix` bool Whether to attempt to add the suffix. `$post_name` string The name of the post being updated. `$post_ID` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_ID );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress do_action( 'untrash_comment', string $comment_id, WP_Comment $comment ) do\_action( 'untrash\_comment', string $comment\_id, WP\_Comment $comment )
===========================================================================
Fires immediately before a comment is restored from the Trash.
`$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The comment to be untrashed. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'untrash_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_untrash\_comment()](../functions/wp_untrash_comment) wp-includes/comment.php | Removes a comment from the Trash |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$comment` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'comment_form_defaults', array $defaults ) apply\_filters( 'comment\_form\_defaults', array $defaults )
============================================================
Filters the comment form default arguments.
Use [‘comment\_form\_default\_fields’](comment_form_default_fields) to filter the comment fields.
`$defaults` array The default comment form arguments. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'widget_archives_args', array $args, array $instance ) apply\_filters( 'widget\_archives\_args', array $args, array $instance )
========================================================================
Filters the arguments for the Archives widget.
* [wp\_get\_archives()](../functions/wp_get_archives)
`$args` array An array of Archives option arguments. `$instance` array Array of settings for the current widget. File: `wp-includes/widgets/class-wp-widget-archives.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-archives.php/)
```
apply_filters(
'widget_archives_args',
array(
'type' => 'monthly',
'show_post_count' => $count,
),
$instance
)
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Archives::widget()](../classes/wp_widget_archives/widget) wp-includes/widgets/class-wp-widget-archives.php | Outputs the content for the current Archives widget instance. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'get_available_languages', string[] $languages, string $dir ) apply\_filters( 'get\_available\_languages', string[] $languages, string $dir )
===============================================================================
Filters the list of available language codes.
`$languages` string[] An array of available language codes. `$dir` string The directory where the language files were found. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
return apply_filters( 'get_available_languages', $languages, $dir );
```
| Used By | Description |
| --- | --- |
| [get\_available\_languages()](../functions/get_available_languages) wp-includes/l10n.php | Gets all available languages based on the presence of \*.mo files in a given directory. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'comments_number', string $output, int $number ) apply\_filters( 'comments\_number', string $output, int $number )
=================================================================
Filters the comments count for display.
* [\_n()](../functions/_n)
`$output` string A translatable string formatted based on whether the count is equal to 0, 1, or 1+. `$number` int The number of post comments. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'comments_number', $output, $number );
```
| Used By | Description |
| --- | --- |
| [get\_comments\_number\_text()](../functions/get_comments_number_text) wp-includes/comment-template.php | Displays the language string for the number of comments the current post has. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'previous_comments_link_attributes', string $attributes ) apply\_filters( 'previous\_comments\_link\_attributes', string $attributes )
============================================================================
Filters the anchor tag attributes for the previous comments page link.
`$attributes` string Attributes for the anchor tag. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . '</a>';
```
| Used By | Description |
| --- | --- |
| [get\_previous\_comments\_link()](../functions/get_previous_comments_link) wp-includes/link-template.php | Retrieves the link to the previous comments page. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_taxonomies_pre_max_num_pages', int|null $max_num_pages, string $taxonomy ) apply\_filters( 'wp\_sitemaps\_taxonomies\_pre\_max\_num\_pages', int|null $max\_num\_pages, string $taxonomy )
===============================================================================================================
Filters the max number of pages for a taxonomy sitemap before it is generated.
Passing a non-null value will short-circuit the generation, returning that value instead.
`$max_num_pages` int|null The maximum number of pages. Default null. `$taxonomy` string Taxonomy name. File: `wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php/)
```
$max_num_pages = apply_filters( 'wp_sitemaps_taxonomies_pre_max_num_pages', null, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Taxonomies::get\_max\_num\_pages()](../classes/wp_sitemaps_taxonomies/get_max_num_pages) wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php | Gets the max number of pages available for the object type. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'upgrader_source_selection', string $source, string $remote_source, WP_Upgrader $upgrader, array $hook_extra ) apply\_filters( 'upgrader\_source\_selection', string $source, string $remote\_source, WP\_Upgrader $upgrader, array $hook\_extra )
===================================================================================================================================
Filters the source file location for the upgrade package.
`$source` string File source location. `$remote_source` string Remote file source location. `$upgrader` [WP\_Upgrader](../classes/wp_upgrader) [WP\_Upgrader](../classes/wp_upgrader) instance. `$hook_extra` array Extra arguments passed to hooked filters. File: `wp-admin/includes/class-wp-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-upgrader.php/)
```
$source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this, $args['hook_extra'] );
```
| Used By | Description |
| --- | --- |
| [WP\_Upgrader::install\_package()](../classes/wp_upgrader/install_package) wp-admin/includes/class-wp-upgrader.php | Install a package. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The $hook\_extra parameter became available. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'the_widget', string $widget, array $instance, array $args ) do\_action( 'the\_widget', string $widget, array $instance, array $args )
=========================================================================
Fires before rendering the requested widget.
`$widget` string The widget's class name. `$instance` array The current widget instance's settings. `$args` array An array of the widget's sidebar arguments. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
do_action( 'the_widget', $widget, $instance, $args );
```
| Used By | Description |
| --- | --- |
| [the\_widget()](../functions/the_widget) wp-includes/widgets.php | Output an arbitrary widget as a template tag. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'get_shortlink', string $shortlink, int $id, string $context, bool $allow_slugs ) apply\_filters( 'get\_shortlink', string $shortlink, int $id, string $context, bool $allow\_slugs )
===================================================================================================
Filters the shortlink for a post.
`$shortlink` string Shortlink URL. `$id` int Post ID, or 0 for the current post. `$context` string The context for the link. One of `'post'` or `'query'`, `$allow_slugs` bool Whether to allow post slugs in the shortlink. Not used by default. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_shortlink()](../functions/wp_get_shortlink) wp-includes/link-template.php | Returns a shortlink for a post, page, attachment, or site. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_update_php_url', string $update_url ) apply\_filters( 'wp\_update\_php\_url', string $update\_url )
=============================================================
Filters the URL to learn more about updating the PHP version the site is running on.
Providing an empty string is not allowed and will result in the default URL being used. Furthermore the page the URL links to should preferably be localized in the site language.
`$update_url` string URL to learn more about updating PHP. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$update_url = apply_filters( 'wp_update_php_url', $update_url );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_update\_php\_url()](../functions/wp_get_update_php_url) wp-includes/functions.php | Gets the URL to learn more about updating the PHP version the site is running on. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress do_action( 'trash_comment', string $comment_id, WP_Comment $comment ) do\_action( 'trash\_comment', string $comment\_id, WP\_Comment $comment )
=========================================================================
Fires immediately before a comment is sent to the Trash.
`$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The comment to be trashed. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'trash_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_trash\_comment()](../functions/wp_trash_comment) wp-includes/comment.php | Moves a comment to the Trash |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$comment` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'retrieve_password', string $user_login ) do\_action( 'retrieve\_password', string $user\_login )
=======================================================
Fires before a new password is retrieved.
`$user_login` string The user login name. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'retrieve_password', $user->user_login );
```
| Used By | Description |
| --- | --- |
| [get\_password\_reset\_key()](../functions/get_password_reset_key) wp-includes/user.php | Creates, stores, then returns a password reset key for user. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'wp_privacy_personal_data_exporters', array $args ) apply\_filters( 'wp\_privacy\_personal\_data\_exporters', array $args )
=======================================================================
Filters the array of exporter callbacks.
`$args` array An array of callable exporters of personal data. Default empty array.
* `...$0`array Array of personal data exporters.
+ `callback`callableCallable exporter function that accepts an email address and a page and returns an array of name => value pairs of personal data.
+ `exporter_friendly_name`stringTranslated user facing friendly name for the exporter. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
```
| Used By | Description |
| --- | --- |
| [WP\_Privacy\_Data\_Export\_Requests\_List\_Table::column\_email()](../classes/wp_privacy_data_export_requests_list_table/column_email) wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php | Actions column. |
| [WP\_Privacy\_Data\_Export\_Requests\_List\_Table::column\_next\_steps()](../classes/wp_privacy_data_export_requests_list_table/column_next_steps) wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php | Displays the next steps column. |
| [wp\_privacy\_process\_personal\_data\_export\_page()](../functions/wp_privacy_process_personal_data_export_page) wp-admin/includes/privacy-tools.php | Intercept personal data exporter page Ajax responses in order to assemble the personal data export file. |
| [wp\_ajax\_wp\_privacy\_export\_personal\_data()](../functions/wp_ajax_wp_privacy_export_personal_data) wp-admin/includes/ajax-actions.php | Ajax handler for exporting a user’s personal data. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
| programming_docs |
wordpress do_action( 'admin_head-media-upload-popup' ) do\_action( 'admin\_head-media-upload-popup' )
==============================================
Fires when scripts enqueued for the admin header for the legacy (pre-3.5.0) media upload popup are printed.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'admin_head-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [wp\_iframe()](../functions/wp_iframe) wp-admin/includes/media.php | Outputs the iframe to display the media upload page. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'safe_style_css', string[] $attr ) apply\_filters( 'safe\_style\_css', string[] $attr )
====================================================
Filters the list of allowed CSS attributes.
`$attr` string[] Array of allowed CSS attributes. File: `wp-includes/kses.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/kses.php/)
```
$allowed_attr = apply_filters(
'safe_style_css',
array(
'background',
'background-color',
'background-image',
'background-position',
'background-size',
'background-attachment',
'background-blend-mode',
'border',
'border-radius',
'border-width',
'border-color',
'border-style',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-bottom-right-radius',
'border-bottom-left-radius',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-top-left-radius',
'border-top-right-radius',
'border-spacing',
'border-collapse',
'caption-side',
'columns',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-span',
'column-width',
'color',
'filter',
'font',
'font-family',
'font-size',
'font-style',
'font-variant',
'font-weight',
'letter-spacing',
'line-height',
'text-align',
'text-decoration',
'text-indent',
'text-transform',
'height',
'min-height',
'max-height',
'width',
'min-width',
'max-width',
'margin',
'margin-right',
'margin-bottom',
'margin-left',
'margin-top',
'margin-block-start',
'margin-block-end',
'margin-inline-start',
'margin-inline-end',
'padding',
'padding-right',
'padding-bottom',
'padding-left',
'padding-top',
'padding-block-start',
'padding-block-end',
'padding-inline-start',
'padding-inline-end',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'gap',
'column-gap',
'row-gap',
'grid-template-columns',
'grid-auto-columns',
'grid-column-start',
'grid-column-end',
'grid-column-gap',
'grid-template-rows',
'grid-auto-rows',
'grid-row-start',
'grid-row-end',
'grid-row-gap',
'grid-gap',
'justify-content',
'justify-items',
'justify-self',
'align-content',
'align-items',
'align-self',
'clear',
'cursor',
'direction',
'float',
'list-style-type',
'object-fit',
'object-position',
'overflow',
'vertical-align',
// Custom CSS properties.
'--*',
)
);
```
| Used By | Description |
| --- | --- |
| [safecss\_filter\_attr()](../functions/safecss_filter_attr) wp-includes/kses.php | Filters an inline style attribute and removes disallowed rules. |
| Version | Description |
| --- | --- |
| [2.8.1](https://developer.wordpress.org/reference/since/2.8.1/) | Introduced. |
wordpress apply_filters( 'get_term', WP_Term $_term, string $taxonomy ) apply\_filters( 'get\_term', WP\_Term $\_term, string $taxonomy )
=================================================================
Filters a taxonomy term object.
The [‘get\_$taxonomy’](get_taxonomy) hook is also available for targeting a specific taxonomy.
`$_term` [WP\_Term](../classes/wp_term) Term object. `$taxonomy` string The taxonomy slug. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$_term = apply_filters( 'get_term', $_term, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [get\_term()](../functions/get_term) wp-includes/taxonomy.php | Gets all term data from database by term ID. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | `$_term` is now a `WP_Term` object. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'add_user_to_blog', int $user_id, string $role, int $blog_id ) do\_action( 'add\_user\_to\_blog', int $user\_id, string $role, int $blog\_id )
===============================================================================
Fires immediately after a user is added to a site.
`$user_id` int User ID. `$role` string User role. `$blog_id` int Blog ID. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
do_action( 'add_user_to_blog', $user_id, $role, $blog_id );
```
| Used By | Description |
| --- | --- |
| [add\_user\_to\_blog()](../functions/add_user_to_blog) wp-includes/ms-functions.php | Adds a user to a blog, along with specifying the user’s role. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'preview_post_link', string $preview_link, WP_Post $post ) apply\_filters( 'preview\_post\_link', string $preview\_link, WP\_Post $post )
==============================================================================
Filters the URL used for a post preview.
`$preview_link` string URL used for the post preview. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'preview_post_link', $preview_link, $post );
```
| Used By | Description |
| --- | --- |
| [get\_preview\_post\_link()](../functions/get_preview_post_link) wp-includes/link-template.php | Retrieves the URL used for the post preview. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Added the `$post` parameter. |
| [2.0.5](https://developer.wordpress.org/reference/since/2.0.5/) | Introduced. |
wordpress apply_filters( 'use_widgets_block_editor', bool $use_widgets_block_editor ) apply\_filters( 'use\_widgets\_block\_editor', bool $use\_widgets\_block\_editor )
==================================================================================
Filters whether to use the block editor to manage widgets.
`$use_widgets_block_editor` bool Whether to use the block editor to manage widgets. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
return apply_filters(
'use_widgets_block_editor',
get_theme_support( 'widgets-block-editor' )
);
```
| Used By | Description |
| --- | --- |
| [wp\_use\_widgets\_block\_editor()](../functions/wp_use_widgets_block_editor) wp-includes/widgets.php | Whether or not to use the block editor to manage widgets. Defaults to true unless a theme has removed support for widgets-block-editor or a plugin has filtered the return value of this function. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'comment_cookie_lifetime', int $seconds ) apply\_filters( 'comment\_cookie\_lifetime', int $seconds )
===========================================================
Filters the lifetime of the comment cookie in seconds.
`$seconds` int Comment cookie lifetime. Default 30000000. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$comment_cookie_lifetime = time() + apply_filters( 'comment_cookie_lifetime', 30000000 );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_comment\_cookies()](../functions/wp_set_comment_cookies) wp-includes/comment.php | Sets the cookies used to store an unauthenticated commentator’s identity. Typically used to recall previous comments by this commentator that are still held in moderation. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_signature_hosts', string[] $hostnames ) apply\_filters( 'wp\_signature\_hosts', string[] $hostnames )
=============================================================
Filters the list of hosts which should have Signature Verification attempted on.
`$hostnames` string[] List of hostnames. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$signed_hostnames = apply_filters( 'wp_signature_hosts', array( 'wordpress.org', 'downloads.wordpress.org', 's.w.org' ) );
```
| Used By | Description |
| --- | --- |
| [download\_url()](../functions/download_url) wp-admin/includes/file.php | Downloads a URL to a local temporary file using the WordPress HTTP API. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action( "manage_{$this->screen->id}_custom_column_js_template", string $column_name ) do\_action( "manage\_{$this->screen->id}\_custom\_column\_js\_template", string $column\_name )
===============================================================================================
Fires in the JavaScript row template for each custom column in the Application Passwords list table.
Custom columns are registered using the [‘manage\_application-passwords-user\_columns’](manage_application-passwords-user_columns) filter.
`$column_name` string Name of the custom column. File: `wp-admin/includes/class-wp-application-passwords-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-application-passwords-list-table.php/)
```
do_action( "manage_{$this->screen->id}_custom_column_js_template", $column_name );
```
| Used By | Description |
| --- | --- |
| [WP\_Application\_Passwords\_List\_Table::print\_js\_template\_row()](../classes/wp_application_passwords_list_table/print_js_template_row) wp-admin/includes/class-wp-application-passwords-list-table.php | Prints the JavaScript template for the new row item. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'override_load_textdomain', bool $override, string $domain, string $mofile ) apply\_filters( 'override\_load\_textdomain', bool $override, string $domain, string $mofile )
==============================================================================================
Filters whether to override the .mo file loading.
`$override` bool Whether to override the .mo file loading. Default false. `$domain` string Text domain. Unique identifier for retrieving translated strings. `$mofile` string Path to the MO file. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$plugin_override = apply_filters( 'override_load_textdomain', false, $domain, $mofile );
```
| Used By | Description |
| --- | --- |
| [load\_textdomain()](../functions/load_textdomain) wp-includes/l10n.php | Loads a .mo file into the text domain $domain. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'get_search_form', string $form, array $args ) apply\_filters( 'get\_search\_form', string $form, array $args )
================================================================
Filters the HTML output of the search form.
`$form` string The search form HTML output. `$args` array The array of arguments for building the search form.
See [get\_search\_form()](../functions/get_search_form) for information on accepted arguments. More Arguments from get\_search\_form( ... $args ) Array of display arguments.
* `echo`boolWhether to echo or return the form. Default true.
* `aria_label`stringARIA label for the search form. Useful to distinguish multiple search forms on the same page and improve accessibility.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$result = apply_filters( 'get_search_form', $form, $args );
```
| Used By | Description |
| --- | --- |
| [get\_search\_form()](../functions/get_search_form) wp-includes/general-template.php | Displays search form. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$args` parameter was added. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'wp_media_attach_action', string $action, int $attachment_id, int $parent_id ) do\_action( 'wp\_media\_attach\_action', string $action, int $attachment\_id, int $parent\_id )
===============================================================================================
Fires when media is attached or detached from a post.
`$action` string Attach/detach action. Accepts `'attach'` or `'detach'`. `$attachment_id` int The attachment ID. `$parent_id` int Attachment parent ID. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'wp_media_attach_action', $action, $attachment_id, $parent_id );
```
| Used By | Description |
| --- | --- |
| [wp\_media\_attach\_action()](../functions/wp_media_attach_action) wp-admin/includes/media.php | Encapsulates the logic for Attach/Detach actions. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'after_core_auto_updates_settings', array $auto_update_settings ) do\_action( 'after\_core\_auto\_updates\_settings', array $auto\_update\_settings )
===================================================================================
Fires after the major core auto-update settings.
`$auto_update_settings` array Array of core auto-update settings.
* `dev`boolWhether to enable automatic updates for development versions.
* `minor`boolWhether to enable minor automatic core updates.
* `major`boolWhether to enable major automatic core updates.
File: `wp-admin/update-core.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/update-core.php/)
```
do_action( 'after_core_auto_updates_settings', $auto_update_settings );
```
| Used By | Description |
| --- | --- |
| [core\_auto\_updates\_settings()](../functions/core_auto_updates_settings) wp-admin/update-core.php | Display WordPress auto-updates settings. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( "wp_ajax_nopriv_{$_REQUEST[‘action’]}" ) do\_action( "wp\_ajax\_nopriv\_{$\_REQUEST[‘action’]}" )
========================================================
Fires non-authenticated Ajax actions for logged-out users.
The dynamic portion of the hook name, `$_REQUEST['action']`, refers to the name of the Ajax action callback being fired.
File: `wp-admin/admin-ajax.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-ajax.php/)
```
'query-themes',
```
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'send_core_update_notification_email', bool $notify, object $item ) apply\_filters( 'send\_core\_update\_notification\_email', bool $notify, object $item )
=======================================================================================
Filters whether to notify the site administrator of a new core update.
By default, administrators are notified when the update offer received from WordPress.org sets a particular flag. This allows some discretion in if and when to notify.
This filter is only evaluated once per release. If the same email address was already notified of the same new version, WordPress won’t repeatedly email the administrator.
This filter is also used on about.php to check if a plugin has disabled these notifications.
`$notify` bool Whether the site administrator is notified. `$item` object The update offer. File: `wp-admin/includes/class-wp-automatic-updater.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-automatic-updater.php/)
```
if ( ! apply_filters( 'send_core_update_notification_email', $notify, $item ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Automatic\_Updater::send\_core\_update\_notification\_email()](../classes/wp_automatic_updater/send_core_update_notification_email) wp-admin/includes/class-wp-automatic-updater.php | Notifies an administrator of a core update. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'post_class', string[] $classes, string[] $class, int $post_id ) apply\_filters( 'post\_class', string[] $classes, string[] $class, int $post\_id )
==================================================================================
Filters the list of CSS class names for the current post.
`$classes` string[] An array of post class names. `$class` string[] An array of additional class names added to the post. `$post_id` int The post ID. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$classes = apply_filters( 'post_class', $classes, $class, $post->ID );
```
| Used By | Description |
| --- | --- |
| [get\_post\_class()](../functions/get_post_class) wp-includes/post-template.php | Retrieves an array of the class names for the post container element. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_widget', WP_REST_Response|WP_Error $response, array $widget, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_widget', WP\_REST\_Response|WP\_Error $response, array $widget, WP\_REST\_Request $request )
============================================================================================================================
Filters the REST API response for a widget.
`$response` [WP\_REST\_Response](../classes/wp_rest_response)|[WP\_Error](../classes/wp_error) The response object, or [WP\_Error](../classes/wp_error) object on failure. `$widget` array The registered widget data. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php/)
```
return apply_filters( 'rest_prepare_widget', $response, $widget, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widgets\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_widgets_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php | Prepares the widget for the REST response. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'rest_prepare_sidebar', WP_REST_Response $response, array $raw_sidebar, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_sidebar', WP\_REST\_Response $response, array $raw\_sidebar, WP\_REST\_Request $request )
=========================================================================================================================
Filters the REST API response for a sidebar.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$raw_sidebar` array The raw sidebar data. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php/)
```
return apply_filters( 'rest_prepare_sidebar', $response, $raw_sidebar, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Sidebars\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_sidebars_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Prepares a single sidebar output for response. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'network_admin_plugin_action_links', string[] $actions, string $plugin_file, array $plugin_data, string $context ) apply\_filters( 'network\_admin\_plugin\_action\_links', string[] $actions, string $plugin\_file, array $plugin\_data, string $context )
========================================================================================================================================
Filters the action links displayed for each plugin in the Network Admin Plugins list table.
`$actions` string[] An array of plugin action links. By default this can include `'activate'`, `'deactivate'`, and `'delete'`. `$plugin_file` string Path to the plugin file relative to the plugins directory. `$plugin_data` array An array of plugin data. See [get\_plugin\_data()](../functions/get_plugin_data) and the ['plugin\_row\_meta'](plugin_row_meta) filter for the list of possible values. `$context` string The plugin context. By default this can include `'all'`, `'active'`, `'inactive'`, `'recently_activated'`, `'upgrade'`, `'mustuse'`, `'dropins'`, and `'search'`. File: `wp-admin/includes/class-wp-plugins-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-plugins-list-table.php/)
```
$actions = apply_filters( 'network_admin_plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugins\_List\_Table::single\_row()](../classes/wp_plugins_list_table/single_row) wp-admin/includes/class-wp-plugins-list-table.php | |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'wpmu_new_user', int $user_id ) do\_action( 'wpmu\_new\_user', int $user\_id )
==============================================
Fires immediately after a new user is created.
`$user_id` int User ID. This hook will get triggered when either a user self-registers or a Super Admin creates a new user on a Multisite. Use this hook for events that should affect all new users on a Multisite; otherwise, use ‘`<user_register>`‘.
File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
do_action( 'wpmu_new_user', $user_id );
```
| Used By | Description |
| --- | --- |
| [wpmu\_create\_user()](../functions/wpmu_create_user) wp-includes/ms-functions.php | Creates a user. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( 'edit_link', int $link_id ) do\_action( 'edit\_link', int $link\_id )
=========================================
Fires after a link was updated in the database.
`$link_id` int ID of the link that was updated. File: `wp-admin/includes/bookmark.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/bookmark.php/)
```
do_action( 'edit_link', $link_id );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_link()](../functions/wp_insert_link) wp-admin/includes/bookmark.php | Inserts a link into the database, or updates an existing link. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress do_action( 'remove_user_from_blog', int $user_id, int $blog_id, int $reassign ) do\_action( 'remove\_user\_from\_blog', int $user\_id, int $blog\_id, int $reassign )
=====================================================================================
Fires before a user is removed from a site.
`$user_id` int ID of the user being removed. `$blog_id` int ID of the blog the user is being removed from. `$reassign` int ID of the user to whom to reassign posts. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
do_action( 'remove_user_from_blog', $user_id, $blog_id, $reassign );
```
| Used By | Description |
| --- | --- |
| [remove\_user\_from\_blog()](../functions/remove_user_from_blog) wp-includes/ms-functions.php | Removes a user from a blog. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | MU (3.0.0) |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress apply_filters( 'customize_allowed_urls', string[] $allowed_urls ) apply\_filters( 'customize\_allowed\_urls', string[] $allowed\_urls )
=====================================================================
Filters the list of URLs allowed to be clicked and followed in the Customizer preview.
`$allowed_urls` string[] An array of allowed URLs. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
$allowed_urls = array_unique( apply_filters( 'customize_allowed_urls', $allowed_urls ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::get\_allowed\_urls()](../classes/wp_customize_manager/get_allowed_urls) wp-includes/class-wp-customize-manager.php | Gets URLs allowed to be previewed. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'day_link', string $daylink, int $year, int $month, int $day ) apply\_filters( 'day\_link', string $daylink, int $year, int $month, int $day )
===============================================================================
Filters the day archive permalink.
`$daylink` string Permalink for the day archive. `$year` int Year for the archive. `$month` int Month for the archive. `$day` int The day for the archive. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'day_link', $daylink, $year, $month, $day );
```
| Used By | Description |
| --- | --- |
| [get\_day\_link()](../functions/get_day_link) wp-includes/link-template.php | Retrieves the permalink for the day archives with year and month. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action_ref_array( 'set_404', WP_Query $query ) do\_action\_ref\_array( 'set\_404', WP\_Query $query )
======================================================
Fires after a 404 is triggered.
`$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
do_action_ref_array( 'set_404', array( $this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::set\_404()](../classes/wp_query/set_404) wp-includes/class-wp-query.php | Sets the 404 property and saves whether query is feed. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'rest_response_link_curies', array $additional ) apply\_filters( 'rest\_response\_link\_curies', array $additional )
===================================================================
Filters extra CURIEs available on REST API responses.
CURIEs allow a shortened version of URI relations. This allows a more usable form for custom relations than using the full URI. These work similarly to how XML namespaces work.
Registered CURIES need to specify a name and URI template. This will automatically transform URI relations into their shortened version.
The shortened relation follows the format `{name}:{rel}`. `{rel}` in the URI template will be replaced with the `{rel}` part of the shortened relation.
For example, a CURIE with name `example` and URI template `https://w.org/{rel}` would transform a `https://w.org/term` relation into `example:term`.
Well-behaved clients should expand and normalize these back to their full URI relation, however some naive clients may not resolve these correctly, so adding new CURIEs may break backward compatibility.
`$additional` array Additional CURIEs to register with the REST API. File: `wp-includes/rest-api/class-wp-rest-response.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-response.php/)
```
$additional = apply_filters( 'rest_response_link_curies', array() );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Response::get\_curies()](../classes/wp_rest_response/get_curies) wp-includes/rest-api/class-wp-rest-response.php | Retrieves the CURIEs (compact URIs) used for relations. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'auto_core_update_email', array $email, string $type, object $core_update, mixed $result ) apply\_filters( 'auto\_core\_update\_email', array $email, string $type, object $core\_update, mixed $result )
==============================================================================================================
Filters the email sent following an automatic background core update.
`$email` array Array of email arguments that will be passed to [wp\_mail()](../functions/wp_mail) .
* `to`stringThe email recipient. An array of emails can be returned, as handled by [wp\_mail()](../functions/wp_mail) .
* `subject`stringThe email's subject.
* `body`stringThe email message body.
* `headers`stringAny email headers, defaults to no headers.
`$type` string The type of email being sent. Can be one of `'success'`, `'fail'`, `'manual'`, `'critical'`. `$core_update` object The update offer that was attempted. `$result` mixed The result for the core update. Can be [WP\_Error](../classes/wp_error). File: `wp-admin/includes/class-wp-automatic-updater.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-automatic-updater.php/)
```
$email = apply_filters( 'auto_core_update_email', $email, $type, $core_update, $result );
```
| Used By | Description |
| --- | --- |
| [WP\_Automatic\_Updater::send\_email()](../classes/wp_automatic_updater/send_email) wp-admin/includes/class-wp-automatic-updater.php | Sends an email upon the completion or failure of a background core update. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_id3_keys', array $fields, WP_Post $attachment, string $context ) apply\_filters( 'wp\_get\_attachment\_id3\_keys', array $fields, WP\_Post $attachment, string $context )
========================================================================================================
Filters the editable list of keys to look up data from an attachment’s metadata.
`$fields` array Key/value pairs of field keys to labels. `$attachment` [WP\_Post](../classes/wp_post) Attachment object. `$context` string The context. Accepts `'edit'`, `'display'`. Default `'display'`. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_get_attachment_id3_keys', $fields, $attachment, $context );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_id3\_keys()](../functions/wp_get_attachment_id3_keys) wp-includes/media.php | Returns useful keys to use to lookup data from an attachment’s stored metadata. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'login_form_middle', string $content, array $args ) apply\_filters( 'login\_form\_middle', string $content, array $args )
=====================================================================
Filters content to display in the middle of the login form.
The filter evaluates just following the location where the ‘login-password’ field is displayed.
`$content` string Content to display. Default empty. `$args` array Array of login form arguments. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$login_form_middle = apply_filters( 'login_form_middle', '', $args );
```
| Used By | Description |
| --- | --- |
| [wp\_login\_form()](../functions/wp_login_form) wp-includes/general-template.php | Provides a simple login form for use anywhere within WordPress. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', bool $bad_slug, string $slug, string $post_type, int $post_parent ) apply\_filters( 'wp\_unique\_post\_slug\_is\_bad\_hierarchical\_slug', bool $bad\_slug, string $slug, string $post\_type, int $post\_parent )
=============================================================================================================================================
Filters whether the post slug would make a bad hierarchical post slug.
`$bad_slug` bool Whether the post slug would be bad in a hierarchical post context. `$slug` string The post slug. `$post_type` string Post type. `$post_parent` int Post parent ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$is_bad_hierarchical_slug = apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent );
```
| Used By | Description |
| --- | --- |
| [wp\_unique\_post\_slug()](../functions/wp_unique_post_slug) wp-includes/post.php | Computes a unique slug for the post, when given the desired slug and some post details. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'pre_handle_404', bool $preempt, WP_Query $wp_query ) apply\_filters( 'pre\_handle\_404', bool $preempt, WP\_Query $wp\_query )
=========================================================================
Filters whether to short-circuit default header status handling.
Returning a non-false value from the filter will short-circuit the handling and return early.
`$preempt` bool Whether to short-circuit default header status handling. Default false. `$wp_query` [WP\_Query](../classes/wp_query) WordPress Query object. File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
if ( false !== apply_filters( 'pre_handle_404', false, $wp_query ) ) {
```
| Used By | Description |
| --- | --- |
| [WP::handle\_404()](../classes/wp/handle_404) wp-includes/class-wp.php | Set the Headers for 404, if nothing is found for requested URL. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'unzip_file_use_ziparchive', bool $ziparchive ) apply\_filters( 'unzip\_file\_use\_ziparchive', bool $ziparchive )
==================================================================
Filters whether to use ZipArchive to unzip archives.
`$ziparchive` bool Whether to use ZipArchive. Default true. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {
```
| Used By | Description |
| --- | --- |
| [unzip\_file()](../functions/unzip_file) wp-admin/includes/file.php | Unzips a specified ZIP file to a location on the filesystem via the WordPress Filesystem Abstraction. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'emoji_url', string $url ) apply\_filters( 'emoji\_url', string $url )
===========================================
Filters the URL where emoji png images are hosted.
`$url` string The emoji base URL for png images. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
'baseUrl' => apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/14.0.0/72x72/' ),
```
| Used By | Description |
| --- | --- |
| [wp\_staticize\_emoji()](../functions/wp_staticize_emoji) wp-includes/formatting.php | Converts emoji to a static img element. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'recovery_email_debug_info', array $message ) apply\_filters( 'recovery\_email\_debug\_info', array $message )
================================================================
Filters the debug information included in the fatal error protection email.
`$message` array An associative array of debug information. File: `wp-includes/class-wp-recovery-mode-email-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-email-service.php/)
```
$debug = apply_filters( 'recovery_email_debug_info', $this->get_debug( $extension ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Email\_Service::send\_recovery\_mode\_email()](../classes/wp_recovery_mode_email_service/send_recovery_mode_email) wp-includes/class-wp-recovery-mode-email-service.php | Sends the Recovery Mode email to the site admin email address. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress do_action( 'added_existing_user', int $user_id, true|WP_Error $result ) do\_action( 'added\_existing\_user', int $user\_id, true|WP\_Error $result )
============================================================================
Fires immediately after an existing user is added to a site.
`$user_id` int User ID. `$result` true|[WP\_Error](../classes/wp_error) True on success or a [WP\_Error](../classes/wp_error) object if the user doesn't exist or could not be added. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
do_action( 'added_existing_user', $details['user_id'], $result );
```
| Used By | Description |
| --- | --- |
| [add\_existing\_user\_to\_blog()](../functions/add_existing_user_to_blog) wp-includes/ms-functions.php | Adds a user to a blog based on details from [maybe\_add\_existing\_user\_to\_blog()](../functions/maybe_add_existing_user_to_blog) . |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'widget_tag_cloud_args', array $args, array $instance ) apply\_filters( 'widget\_tag\_cloud\_args', array $args, array $instance )
==========================================================================
Filters the taxonomy used in the Tag Cloud widget.
* [wp\_tag\_cloud()](../functions/wp_tag_cloud)
`$args` array Args used for the tag cloud widget. `$instance` array Array of settings for the current widget. By default, the following parameters are available to $args:
* smallest – The smallest tag (lowest count) is shown at size 8
* largest – The largest tag (highest count) is shown at size 22
* unit – Describes ‘pt’ (point) as the font-size unit for the smallest and largest values
* number – Displays at most 45 tags
* format – Displays the tags in flat (separated by whitespace) style
* separator – Displays whitespace between tags
* orderby – Order the tags by name
* order – Sort the tags in ASCENDING fashion
* exclude – Exclude no tags
* include – Include all tags
* link – view
* taxonomy – Use post tags for basis of cloud
* echo – echo the results
File: `wp-includes/widgets/class-wp-widget-tag-cloud.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-tag-cloud.php/)
```
apply_filters(
'widget_tag_cloud_args',
array(
'taxonomy' => $current_taxonomy,
'echo' => false,
'show_count' => $show_count,
),
$instance
)
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Tag\_Cloud::widget()](../classes/wp_widget_tag_cloud/widget) wp-includes/widgets/class-wp-widget-tag-cloud.php | Outputs the content for the current Tag Cloud widget instance. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Added taxonomy drop-down. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'query_vars', string[] $public_query_vars ) apply\_filters( 'query\_vars', string[] $public\_query\_vars )
==============================================================
Filters the query variables allowed before processing.
Allows (publicly allowed) query vars to be added, removed, or changed prior to executing the query. Needed to allow custom rewrite rules using your own arguments to work, or any other custom query variables you want to be publicly available.
`$public_query_vars` string[] The array of allowed query variable names. This filter allows query vars to be added, removed, or changed prior to executing the query.
```
function myplugin_query_vars( $qvars ) {
$qvars[] = 'custom_query_var';
return $qvars;
}
add_filter( 'query_vars', 'myplugin_query_vars' );
```
File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
$this->public_query_vars = apply_filters( 'query_vars', $this->public_query_vars );
```
| Used By | Description |
| --- | --- |
| [WP::parse\_request()](../classes/wp/parse_request) wp-includes/class-wp.php | Parses the request to find the correct WordPress query. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'wp_create_nav_menu', int $term_id, array $menu_data ) do\_action( 'wp\_create\_nav\_menu', int $term\_id, array $menu\_data )
=======================================================================
Fires after a navigation menu is successfully created.
`$term_id` int ID of the new menu. `$menu_data` array An array of menu data. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
do_action( 'wp_create_nav_menu', $_menu['term_id'], $menu_data );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_nav\_menu\_object()](../functions/wp_update_nav_menu_object) wp-includes/nav-menu.php | Saves the properties of a menu or create a new menu with those properties. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'show_post_locked_dialog', bool $display, WP_Post $post, WP_User $user ) apply\_filters( 'show\_post\_locked\_dialog', bool $display, WP\_Post $post, WP\_User $user )
=============================================================================================
Filters whether to show the post locked dialog.
Returning false from the filter will prevent the dialog from being displayed.
`$display` bool Whether to display the dialog. Default true. `$post` [WP\_Post](../classes/wp_post) Post object. `$user` [WP\_User](../classes/wp_user) The user with the lock for the post. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
if ( ! apply_filters( 'show_post_locked_dialog', true, $post, $user ) ) {
```
| Used By | Description |
| --- | --- |
| [\_admin\_notice\_post\_locked()](../functions/_admin_notice_post_locked) wp-admin/includes/post.php | Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress do_action( 'rest_after_insert_attachment', WP_Post $attachment, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_after\_insert\_attachment', WP\_Post $attachment, WP\_REST\_Request $request, bool $creating )
=================================================================================================================
Fires after a single attachment is completely created or updated via the REST API.
`$attachment` [WP\_Post](../classes/wp_post) Inserted or updated attachment object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating an attachment, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php/)
```
do_action( 'rest_after_insert_attachment', $attachment, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Attachments\_Controller::create\_item()](../classes/wp_rest_attachments_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Creates a single attachment. |
| [WP\_REST\_Attachments\_Controller::update\_item()](../classes/wp_rest_attachments_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Updates a single attachment. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'mu_dropdown_languages', string[] $output, string[] $lang_files, string $current ) apply\_filters( 'mu\_dropdown\_languages', string[] $output, string[] $lang\_files, string $current )
=====================================================================================================
Filters the languages available in the dropdown.
`$output` string[] Array of HTML output for the dropdown. `$lang_files` string[] Array of available language files. `$current` string The current language code. File: `wp-admin/includes/ms.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ms.php/)
```
$output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current );
```
| Used By | Description |
| --- | --- |
| [mu\_dropdown\_languages()](../functions/mu_dropdown_languages) wp-admin/includes/ms.php | Generates and displays a drop-down of available languages. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( 'lostpassword_post', WP_Error $errors, WP_User|false $user_data ) do\_action( 'lostpassword\_post', WP\_Error $errors, WP\_User|false $user\_data )
=================================================================================
Fires before errors are returned from a password reset request.
`$errors` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object containing any errors generated by using invalid credentials. `$user_data` [WP\_User](../classes/wp_user)|false [WP\_User](../classes/wp_user) object if found, false if the user does not exist. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'lostpassword_post', $errors, $user_data );
```
| Used By | Description |
| --- | --- |
| [retrieve\_password()](../functions/retrieve_password) wp-includes/user.php | Handles sending a password retrieval email to a user. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Added the `$user_data` parameter. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$errors` parameter. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'init' ) do\_action( 'init' )
====================
Fires after WordPress has finished loading but before any headers are sent.
Most of WP is loaded at this stage, and the user is authenticated. WP continues to load on the [‘init’](init) hook that follows (e.g. widgets), and many plugins instantiate themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
If you wish to plug an action once WP is loaded, use the [‘wp\_loaded’](wp_loaded) hook below.
Use `init` to act on `$_POST` data:
```
add_action( 'init', 'process_post' );
function process_post() {
if( isset( $_POST['unique_hidden_field'] ) ) {
// process $_POST data here
}
}
```
init is useful for intercepting `$_GET` or `$_POST` triggers.
[`load_plugin_textdomain`](../functions/load_plugin_textdomain) calls should be made during `init`, otherwise users cannot hook into it.
If you wish to plug an action once WP is loaded, use the [`wp_loaded`](wp_loaded) hook.
File: `wp-settings.php`. [View all references](https://developer.wordpress.org/reference/files/wp-settings.php/)
```
do_action( 'init' );
```
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'edit_bookmark_link', string $link, int $link_id ) apply\_filters( 'edit\_bookmark\_link', string $link, int $link\_id )
=====================================================================
Filters the bookmark edit link anchor tag.
`$link` string Anchor tag for the edit link. `$link_id` int Bookmark ID. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
```
| Used By | Description |
| --- | --- |
| [edit\_bookmark\_link()](../functions/edit_bookmark_link) wp-includes/link-template.php | Displays the edit bookmark link anchor content. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'theme_templates', string[] $post_templates, WP_Theme $theme, WP_Post|null $post, string $post_type ) apply\_filters( 'theme\_templates', string[] $post\_templates, WP\_Theme $theme, WP\_Post|null $post, string $post\_type )
==========================================================================================================================
Filters list of page templates for a theme.
`$post_templates` string[] Array of template header names keyed by the template file name. `$theme` [WP\_Theme](../classes/wp_theme) The theme object. `$post` [WP\_Post](../classes/wp_post)|null The post being edited, provided for context, or null. `$post_type` string Post type to get the templates for. File: `wp-includes/class-wp-theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme.php/)
```
$post_templates = (array) apply_filters( 'theme_templates', $post_templates, $this, $post, $post_type );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme::get\_page\_templates()](../classes/wp_theme/get_page_templates) wp-includes/class-wp-theme.php | Returns the theme’s post templates for a given post type. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'screen_settings', string $screen_settings, WP_Screen $screen ) apply\_filters( 'screen\_settings', string $screen\_settings, WP\_Screen $screen )
==================================================================================
Filters the screen settings text displayed in the Screen Options tab.
`$screen_settings` string Screen settings. `$screen` [WP\_Screen](../classes/wp_screen) [WP\_Screen](../classes/wp_screen) object. File: `wp-admin/includes/class-wp-screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-screen.php/)
```
$this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::show\_screen\_options()](../classes/wp_screen/show_screen_options) wp-admin/includes/class-wp-screen.php | |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( "{$adjacent}_image_link", string $output, int $attachment_id, string|int[] $size, string $text ) apply\_filters( "{$adjacent}\_image\_link", string $output, int $attachment\_id, string|int[] $size, string $text )
===================================================================================================================
Filters the adjacent image link.
The dynamic portion of the hook name, `$adjacent`, refers to the type of adjacency, either ‘next’, or ‘previous’.
Possible hook names include:
* `next_image_link`
* `previous_image_link`
`$output` string Adjacent image HTML markup. `$attachment_id` int Attachment ID `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). `$text` string Link text. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );
```
| Used By | Description |
| --- | --- |
| [get\_adjacent\_image\_link()](../functions/get_adjacent_image_link) wp-includes/media.php | Gets the next or previous image link that has the same post parent. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'next_comments_link_attributes', string $attributes ) apply\_filters( 'next\_comments\_link\_attributes', string $attributes )
========================================================================
Filters the anchor tag attributes for the next comments page link.
`$attributes` string Attributes for the anchor tag. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . '</a>';
```
| Used By | Description |
| --- | --- |
| [get\_next\_comments\_link()](../functions/get_next_comments_link) wp-includes/link-template.php | Retrieves the link to the next comments page. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress activated_plugin activated\_plugin
=================
**Action Hook:** Fires after a plugin has been activated.
Source: wp-admin/includes/plugin.php:718
Used by [1 function](activated_plugin#used-by) | Uses [0 functions](activated_plugin#uses)
wordpress do_action( 'restore_previous_locale', string $locale, string $previous_locale ) do\_action( 'restore\_previous\_locale', string $locale, string $previous\_locale )
===================================================================================
Fires when the locale is restored to the previous one.
`$locale` string The new locale. `$previous_locale` string The previous locale. File: `wp-includes/class-wp-locale-switcher.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-locale-switcher.php/)
```
do_action( 'restore_previous_locale', $locale, $previous_locale );
```
| Used By | Description |
| --- | --- |
| [WP\_Locale\_Switcher::restore\_previous\_locale()](../classes/wp_locale_switcher/restore_previous_locale) wp-includes/class-wp-locale-switcher.php | Restores the translations according to the previous locale. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'respond_link', string $respond_link, int $post_id ) apply\_filters( 'respond\_link', string $respond\_link, int $post\_id )
=======================================================================
Filters the respond link when a post has no comments.
`$respond_link` string The default response link. `$post_id` int The post ID. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
echo apply_filters( 'respond_link', $respond_link, $post_id );
```
| Used By | Description |
| --- | --- |
| [comments\_popup\_link()](../functions/comments_popup_link) wp-includes/comment-template.php | Displays the link to the comments for the current post ID. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'rest_request_parameter_order', string[] $order, WP_REST_Request $request ) apply\_filters( 'rest\_request\_parameter\_order', string[] $order, WP\_REST\_Request $request )
================================================================================================
Filters the parameter priority order for a REST API request.
The order affects which parameters are checked when using [WP\_REST\_Request::get\_param()](../classes/wp_rest_request/get_param) and family. This acts similarly to PHP’s `request_order` setting.
`$order` string[] Array of types to check, in order of priority. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request object. File: `wp-includes/rest-api/class-wp-rest-request.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-request.php/)
```
return apply_filters( 'rest_request_parameter_order', $order, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Request::get\_parameter\_order()](../classes/wp_rest_request/get_parameter_order) wp-includes/rest-api/class-wp-rest-request.php | Retrieves the parameter priority order. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'no_texturize_shortcodes', string[] $default_no_texturize_shortcodes ) apply\_filters( 'no\_texturize\_shortcodes', string[] $default\_no\_texturize\_shortcodes )
===========================================================================================
Filters the list of shortcodes not to texturize.
`$default_no_texturize_shortcodes` string[] An array of shortcode names. By default, WordPress will automatically texturize all post/page content through the [wptexturize()](../functions/wptexturize) function, even content in shortcodes. The texturize process replaces “normal” quotes with “fancy” quotes (aka “smart” quotes or “curly” quotes). Sometimes this is NOT what you want… particularly if your shortcode must contain raw, preprocessed text.
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$no_texturize_shortcodes = apply_filters( 'no_texturize_shortcodes', $default_no_texturize_shortcodes );
```
| Used By | Description |
| --- | --- |
| [wptexturize()](../functions/wptexturize) wp-includes/formatting.php | Replaces common plain text characters with formatted entities. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_join', string $join, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_join', string $join, WP\_Query $query )
===========================================================================
Filters the JOIN clause of the query.
`$join` string The JOIN clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). When you use the `wp_query` object to run a query, not all tables are queried by default. For example, a query on the blog archive will only query the posts table. If you wanted to display posts that have specific meta value you will have to alter the `wp_query` object to include the required meta key.
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters_deprecated( 'user_erasure_complete_email_headers', string|array $headers, string $subject, string $content, int $request_id, array $email_data ) apply\_filters\_deprecated( 'user\_erasure\_complete\_email\_headers', string|array $headers, string $subject, string $content, int $request\_id, array $email\_data )
======================================================================================================================================================================
This hook has been deprecated. Use [‘user\_erasure\_fulfillment\_email\_headers’](user_erasure_fulfillment_email_headers) instead.
Filters the headers of the data erasure fulfillment notification.
`$headers` string|array The email headers. `$subject` string The email subject. `$content` string The email content. `$request_id` int The request ID. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `message_recipient`stringThe address that the email will be sent to. Defaults to the value of `$request->email`, but can be changed by the `user_erasure_fulfillment_email_to` filter.
* `privacy_policy_url`stringPrivacy policy URL.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$headers = apply_filters_deprecated(
'user_erasure_complete_email_headers',
array( $headers, $subject, $content, $request_id, $email_data ),
'5.8.0',
'user_erasure_fulfillment_email_headers'
);
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_erasure\_fulfillment\_notification()](../functions/_wp_privacy_send_erasure_fulfillment_notification) wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Use ['user\_erasure\_fulfillment\_email\_headers'](user_erasure_fulfillment_email_headers) instead. |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress apply_filters( 'comment_excerpt_length', int $comment_excerpt_length ) apply\_filters( 'comment\_excerpt\_length', int $comment\_excerpt\_length )
===========================================================================
Filters the maximum number of words used in the comment excerpt.
`$comment_excerpt_length` int The amount of words you want to display in the comment excerpt. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$comment_excerpt_length = apply_filters( 'comment_excerpt_length', $comment_excerpt_length );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_excerpt()](../functions/get_comment_excerpt) wp-includes/comment-template.php | Retrieves the excerpt of the given comment. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'switch_theme', string $new_name, WP_Theme $new_theme, WP_Theme $old_theme ) do\_action( 'switch\_theme', string $new\_name, WP\_Theme $new\_theme, WP\_Theme $old\_theme )
==============================================================================================
Fires after the theme is switched.
`$new_name` string Name of the new theme. `$new_theme` [WP\_Theme](../classes/wp_theme) [WP\_Theme](../classes/wp_theme) instance of the new theme. `$old_theme` [WP\_Theme](../classes/wp_theme) [WP\_Theme](../classes/wp_theme) instance of the old theme. switch\_theme is triggered when the blog’s theme is changed. Specifically, it fires after the theme has been switched but before the next request. Theme developers should use this hook to do things when their theme is deactivated.
Theme functions attached to this hook are only triggered in the theme being deactivated. To do things when your theme is activated, use [after\_switch\_theme](after_switch_theme "Plugin API/Action Reference/after switch theme").
Functions attached to this action hook receive one parameter: a string with the name of the new theme being activated.
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
do_action( 'switch_theme', $new_name, $new_theme, $old_theme );
```
| Used By | Description |
| --- | --- |
| [switch\_theme()](../functions/switch_theme) wp-includes/theme.php | Switches the theme. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced the `$old_theme` parameter. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'delete_user_form', WP_User $current_user, int[] $userids ) do\_action( 'delete\_user\_form', WP\_User $current\_user, int[] $userids )
===========================================================================
Fires at the end of the delete users form prior to the confirm button.
`$current_user` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object for the current user. `$userids` int[] Array of IDs for users being deleted. File: `wp-admin/users.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/users.php/)
```
do_action( 'delete_user_form', $current_user, $userids );
```
| Used By | Description |
| --- | --- |
| [confirm\_delete\_users()](../functions/confirm_delete_users) wp-admin/includes/ms.php | |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The `$userids` parameter was added. |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'signup_another_blog_init', array $signup_defaults ) apply\_filters( 'signup\_another\_blog\_init', array $signup\_defaults )
========================================================================
Filters the default site sign-up variables.
`$signup_defaults` array An array of default site sign-up variables.
* `blogname`stringThe site blogname.
* `blog_title`stringThe site title.
* `errors`[WP\_Error](../classes/wp_error)A [WP\_Error](../classes/wp_error) object possibly containing `'blogname'` or `'blog_title'` errors.
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
$filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults );
```
| Used By | Description |
| --- | --- |
| [signup\_another\_blog()](../functions/signup_another_blog) wp-signup.php | Shows a form for returning users to sign up for another site. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_audio_shortcode_class', string $class, array $atts ) apply\_filters( 'wp\_audio\_shortcode\_class', string $class, array $atts )
===========================================================================
Filters the class attribute for the audio shortcode output container.
`$class` string CSS class or list of space-separated classes. `$atts` array Array of audio shortcode attributes. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$atts['class'] = apply_filters( 'wp_audio_shortcode_class', $atts['class'], $atts );
```
| Used By | Description |
| --- | --- |
| [wp\_audio\_shortcode()](../functions/wp_audio_shortcode) wp-includes/media.php | Builds the Audio shortcode output. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `$atts` parameter was added. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'comment_form_submit_button', string $submit_button, array $args ) apply\_filters( 'comment\_form\_submit\_button', string $submit\_button, array $args )
======================================================================================
Filters the submit button for the comment form to display.
`$submit_button` string HTML markup for the submit button. `$args` array Arguments passed to [comment\_form()](../functions/comment_form) . More Arguments from comment\_form( ... $args ) Default arguments and form fields to override.
* `fields`array Default comment fields, filterable by default via the ['comment\_form\_default\_fields'](comment_form_default_fields) hook.
+ `author`stringComment author field HTML.
+ `email`stringComment author email field HTML.
+ `url`stringComment author URL field HTML.
+ `cookies`stringComment cookie opt-in field HTML.
+ `comment_field`stringThe comment textarea field HTML.
+ `must_log_in`stringHTML element for a 'must be logged in to comment' message.
+ `logged_in_as`stringThe HTML for the 'logged in as [user]' message, the Edit profile link, and the Log out link.
+ `comment_notes_before`stringHTML element for a message displayed before the comment fields if the user is not logged in.
Default 'Your email address will not be published.'.
+ `comment_notes_after`stringHTML element for a message displayed after the textarea field.
+ `action`stringThe comment form element action attribute. Default `'/wp-comments-post.php'`.
+ `id_form`stringThe comment form element id attribute. Default `'commentform'`.
+ `id_submit`stringThe comment submit element id attribute. Default `'submit'`.
+ `class_container`stringThe comment form container class attribute. Default `'comment-respond'`.
+ `class_form`stringThe comment form element class attribute. Default `'comment-form'`.
+ `class_submit`stringThe comment submit element class attribute. Default `'submit'`.
+ `name_submit`stringThe comment submit element name attribute. Default `'submit'`.
+ `title_reply`stringThe translatable `'reply'` button label. Default 'Leave a Reply'.
+ `title_reply_to`stringThe translatable `'reply-to'` button label. Default 'Leave a Reply to %s', where %s is the author of the comment being replied to.
+ `title_reply_before`stringHTML displayed before the comment form title.
Default: `<h3 id="reply-title" class="comment-reply-title">`.
+ `title_reply_after`stringHTML displayed after the comment form title.
Default: ``</h3>``.
+ `cancel_reply_before`stringHTML displayed before the cancel reply link.
+ `cancel_reply_after`stringHTML displayed after the cancel reply link.
+ `cancel_reply_link`stringThe translatable 'cancel reply' button label. Default 'Cancel reply'.
+ `label_submit`stringThe translatable `'submit'` button label. Default 'Post a comment'.
+ `submit_button`stringHTML format for the Submit button.
Default: `<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />`.
+ `submit_field`stringHTML format for the markup surrounding the Submit button and comment hidden fields. Default: `<p class="form-submit">%1$s %2$s</p>`, where %1$s is the submit button markup and %2$s is the comment hidden fields.
+ `format`stringThe comment form format. Default `'xhtml'`. Accepts `'xhtml'`, `'html5'`. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$submit_button = apply_filters( 'comment_form_submit_button', $submit_button, $args );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'rss_widget_feed_link', string $feed_link, array $instance ) apply\_filters( 'rss\_widget\_feed\_link', string $feed\_link, array $instance )
================================================================================
Filters the classic RSS widget’s feed icon link.
Themes can remove the icon link by using `add_filter( 'rss_widget_feed_link', '__return_false' );`.
`$feed_link` string HTML for link to RSS feed. `$instance` array Array of settings for the current widget. File: `wp-includes/widgets/class-wp-widget-rss.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-rss.php/)
```
$feed_link = apply_filters( 'rss_widget_feed_link', $feed_link, $instance );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_RSS::widget()](../classes/wp_widget_rss/widget) wp-includes/widgets/class-wp-widget-rss.php | Outputs the content for the current RSS widget instance. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress do_action( 'wp_validate_site_data', WP_Error $errors, array $data, WP_Site|null $old_site ) do\_action( 'wp\_validate\_site\_data', WP\_Error $errors, array $data, WP\_Site|null $old\_site )
==================================================================================================
Fires when data should be validated for a site prior to inserting or updating in the database.
Plugins should amend the `$errors` object via its `WP_Error::add()` method.
`$errors` [WP\_Error](../classes/wp_error) Error object to add validation errors to. `$data` array Associative array of complete site data. See [wp\_insert\_site()](../functions/wp_insert_site) for the included data. More Arguments from wp\_insert\_site( ... $data ) Data for the new site that should be inserted.
* `domain`stringSite domain. Default empty string.
* `path`stringSite path. Default `'/'`.
* `network_id`intThe site's network ID. Default is the current network ID.
* `registered`stringWhen the site was registered, in SQL datetime format. Default is the current time.
* `last_updated`stringWhen the site was last updated, in SQL datetime format. Default is the value of $registered.
* `public`intWhether the site is public. Default 1.
* `archived`intWhether the site is archived. Default 0.
* `mature`intWhether the site is mature. Default 0.
* `spam`intWhether the site is spam. Default 0.
* `deleted`intWhether the site is deleted. Default 0.
* `lang_id`intThe site's language ID. Currently unused. Default 0.
* `user_id`intUser ID for the site administrator. Passed to the `wp_initialize_site` hook.
* `title`stringSite title. Default is 'Site %d' where %d is the site ID. Passed to the `wp_initialize_site` hook.
* `options`arrayCustom option $key => $value pairs to use. Default empty array. Passed to the `wp_initialize_site` hook.
* `meta`arrayCustom site metadata $key => $value pairs to use. Default empty array.
Passed to the `wp_initialize_site` hook.
`$old_site` [WP\_Site](../classes/wp_site)|null The old site object if the data belongs to a site being updated, or null if it is a new site being inserted. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'wp_validate_site_data', $errors, $data, $old_site );
```
| Used By | Description |
| --- | --- |
| [wp\_prepare\_site\_data()](../functions/wp_prepare_site_data) wp-includes/ms-site.php | Prepares site data for insertion or update in the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'recovery_email_support_info', string $message ) apply\_filters( 'recovery\_email\_support\_info', string $message )
===================================================================
Filters the support message sent with the the fatal error protection email.
`$message` string The Message to include in the email. File: `wp-includes/class-wp-recovery-mode-email-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-email-service.php/)
```
$support = apply_filters( 'recovery_email_support_info', __( 'Please contact your host for assistance with investigating this issue further.' ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Email\_Service::send\_recovery\_mode\_email()](../classes/wp_recovery_mode_email_service/send_recovery_mode_email) wp-includes/class-wp-recovery-mode-email-service.php | Sends the Recovery Mode email to the site admin email address. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'hidden_meta_boxes', string[] $hidden, WP_Screen $screen, bool $use_defaults ) apply\_filters( 'hidden\_meta\_boxes', string[] $hidden, WP\_Screen $screen, bool $use\_defaults )
==================================================================================================
Filters the list of hidden meta boxes.
`$hidden` string[] An array of IDs of hidden meta boxes. `$screen` [WP\_Screen](../classes/wp_screen) [WP\_Screen](../classes/wp_screen) object of the current screen. `$use_defaults` bool Whether to show the default meta boxes.
Default true. File: `wp-admin/includes/screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/screen.php/)
```
return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );
```
| Used By | Description |
| --- | --- |
| [get\_hidden\_meta\_boxes()](../functions/get_hidden_meta_boxes) wp-admin/includes/screen.php | Gets an array of IDs of hidden meta boxes. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'manage_users_extra_tablenav', string $which ) do\_action( 'manage\_users\_extra\_tablenav', string $which )
=============================================================
Fires immediately following the closing “actions” div in the tablenav for the users list table.
`$which` string The location of the extra table nav markup: `'top'` or `'bottom'`. File: `wp-admin/includes/class-wp-users-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-users-list-table.php/)
```
do_action( 'manage_users_extra_tablenav', $which );
```
| Used By | Description |
| --- | --- |
| [WP\_Users\_List\_Table::extra\_tablenav()](../classes/wp_users_list_table/extra_tablenav) wp-admin/includes/class-wp-users-list-table.php | Output the controls to allow user roles to be changed in bulk. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'icon_dir', string $path ) apply\_filters( 'icon\_dir', string $path )
===========================================
Filters the icon directory path.
`$path` string Icon directory absolute path. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );
```
| Used By | Description |
| --- | --- |
| [get\_attachment\_icon\_src()](../functions/get_attachment_icon_src) wp-includes/deprecated.php | Retrieve icon URL and Path. |
| [wp\_get\_attachment\_image\_src()](../functions/wp_get_attachment_image_src) wp-includes/media.php | Retrieves an image to represent an attachment. |
| [wp\_mime\_type\_icon()](../functions/wp_mime_type_icon) wp-includes/post.php | Retrieves the icon for a MIME type or attachment. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'feed_links_extra_show_category_feed', bool $show ) apply\_filters( 'feed\_links\_extra\_show\_category\_feed', bool $show )
========================================================================
Filters whether to display the category feed link.
`$show` bool Whether to display the category feed link. Default true. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$show_category_feed = apply_filters( 'feed_links_extra_show_category_feed', true );
```
| Used By | Description |
| --- | --- |
| [feed\_links\_extra()](../functions/feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'activate_blog', int $id ) do\_action( 'activate\_blog', int $id )
=======================================
Fires after a network site is activated.
`$id` int The ID of the activated site. File: `wp-admin/network/sites.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/network/sites.php/)
```
do_action( 'activate_blog', $id );
```
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( 'delete_attachment', int $post_id, WP_Post $post ) do\_action( 'delete\_attachment', int $post\_id, WP\_Post $post )
=================================================================
Fires before an attachment is deleted, at the start of [wp\_delete\_attachment()](../functions/wp_delete_attachment) .
`$post_id` int Attachment ID. `$post` [WP\_Post](../classes/wp_post) Post object. Up to and including WordPress 2.7, it is fired ”after” the attachment is deleted from the database and the file system, limiting its usefulness. As of [changeset #10400](https://trac.wordpress.org/changeset/10400) (WordPress 2.8), the action will fire ”before” anything is deleted.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'delete_attachment', $post_id, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_attachment()](../functions/wp_delete_attachment) wp-includes/post.php | Trashes or deletes an attachment. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$post` parameter. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'jpeg_quality', int $quality, string $context ) apply\_filters( 'jpeg\_quality', int $quality, string $context )
================================================================
Filters the JPEG compression quality for backward-compatibility.
Applies only during initial editor instantiation, or when set\_quality() is run manually without the `$quality` argument.
The [WP\_Image\_Editor::set\_quality()](../classes/wp_image_editor/set_quality) method has priority over the filter.
The filter is evaluated under two contexts: ‘image\_resize’, and ‘edit\_image’, (when a JPEG image is saved to file).
`$quality` int Quality level between 0 (low) and 100 (high) of the JPEG. `$context` string Context of the filter. File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
$quality = apply_filters( 'jpeg_quality', $quality, 'image_resize' );
```
| Used By | Description |
| --- | --- |
| [wp\_save\_image\_file()](../functions/wp_save_image_file) wp-admin/includes/image-edit.php | Saves image to file. |
| [WP\_Image\_Editor::set\_quality()](../classes/wp_image_editor/set_quality) wp-includes/class-wp-image-editor.php | Sets Image Compression quality on a 1-100% scale. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'mce_buttons_4', array $mce_buttons_4, string $editor_id ) apply\_filters( 'mce\_buttons\_4', array $mce\_buttons\_4, string $editor\_id )
===============================================================================
Filters the fourth-row list of TinyMCE buttons (Visual tab).
`$mce_buttons_4` array Fourth-row list of buttons. `$editor_id` string Unique editor identifier, e.g. `'content'`. Accepts `'classic-block'` when called from block editor's Classic block. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mce_buttons_4 = apply_filters( 'mce_buttons_4', array(), $editor_id );
```
| Used By | Description |
| --- | --- |
| [wp\_tinymce\_inline\_scripts()](../functions/wp_tinymce_inline_scripts) wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | The `$editor_id` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'rest_queried_resource_route', string $link ) apply\_filters( 'rest\_queried\_resource\_route', string $link )
================================================================
Filters the REST route for the currently queried object.
`$link` string The route with a leading slash, or an empty string. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
return apply_filters( 'rest_queried_resource_route', $route );
```
| Used By | Description |
| --- | --- |
| [rest\_get\_queried\_resource\_route()](../functions/rest_get_queried_resource_route) wp-includes/rest-api.php | Gets the REST route for the currently queried object. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'manage_posts_columns', string[] $post_columns, string $post_type ) apply\_filters( 'manage\_posts\_columns', string[] $post\_columns, string $post\_type )
=======================================================================================
Filters the columns displayed in the Posts list table.
`$post_columns` string[] An associative array of column headings. `$post_type` string The post type slug. * `manage_posts_columns` is a filter applied to the columns shown on the manage posts screen. It’s applied to posts of all types except pages. To add a custom column for pages, hook the <manage_pages_columns> filter. To add a custom column for specific custom post types, hook the [manage\_{$post\_type}\_posts\_columns](manage_post_type_posts_columns) filter.
* **Built-in Column Types**
Listed in order of appearance. By default, all columns [supported](../functions/post_type_supports) by the post type are shown.
+ **cb** Checkbox for bulk [actions](https://wordpress.org/support/article/posts-screen/#actions).
+ **title** Post title. Includes “edit”, “quick edit”, “trash” and “view” links. If $mode (set from $\_REQUEST[‘mode’]) is ‘excerpt’, a post excerpt is included between the title and links.
+ **author** Post author.
+ **categories** Categories the post belongs to.
+ **tags** Tags for the post.
+ **comments** Number of pending comments.
+ **date** The date and publish status of the post.
File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
$posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::get\_columns()](../classes/wp_posts_list_table/get_columns) wp-admin/includes/class-wp-posts-list-table.php | |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'site_details', stdClass $details ) apply\_filters( 'site\_details', stdClass $details )
====================================================
Filters a site’s extended properties.
`$details` stdClass The site details. File: `wp-includes/class-wp-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-site.php/)
```
$details = apply_filters( 'site_details', $details );
```
| Used By | Description |
| --- | --- |
| [WP\_Site::get\_details()](../classes/wp_site/get_details) wp-includes/class-wp-site.php | Retrieves the details for this site. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'session_token_manager', string $session ) apply\_filters( 'session\_token\_manager', string $session )
============================================================
Filters the class name for the session token manager.
`$session` string Name of class to use as the manager.
Default '[WP\_User\_Meta\_Session\_Tokens](../classes/wp_user_meta_session_tokens)'. File: `wp-includes/class-wp-session-tokens.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-session-tokens.php/)
```
$manager = apply_filters( 'session_token_manager', 'WP_User_Meta_Session_Tokens' );
```
| Used By | Description |
| --- | --- |
| [WP\_Session\_Tokens::destroy\_all\_for\_all\_users()](../classes/wp_session_tokens/destroy_all_for_all_users) wp-includes/class-wp-session-tokens.php | Destroys all sessions for all users. |
| [WP\_Session\_Tokens::get\_instance()](../classes/wp_session_tokens/get_instance) wp-includes/class-wp-session-tokens.php | Retrieves a session manager instance for a user. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'is_multi_author', bool $is_multi_author ) apply\_filters( 'is\_multi\_author', bool $is\_multi\_author )
==============================================================
Filters whether the site has more than one author with published posts.
`$is_multi_author` bool Whether $is\_multi\_author should evaluate as true. File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
return apply_filters( 'is_multi_author', (bool) $is_multi_author );
```
| Used By | Description |
| --- | --- |
| [is\_multi\_author()](../functions/is_multi_author) wp-includes/author-template.php | Determines whether this site has more than one author. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( "term_{$field}", mixed $value, int $term_id, string $taxonomy, string $context ) apply\_filters( "term\_{$field}", mixed $value, int $term\_id, string $taxonomy, string $context )
==================================================================================================
Filters the term field sanitized for display.
The dynamic portion of the hook name, `$field`, refers to the term field name.
`$value` mixed Value of the term field. `$term_id` int Term ID. `$taxonomy` string Taxonomy slug. `$context` string Context to retrieve the term field value. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$value = apply_filters( "term_{$field}", $value, $term_id, $taxonomy, $context );
```
| Used By | Description |
| --- | --- |
| [sanitize\_term\_field()](../functions/sanitize_term_field) wp-includes/taxonomy.php | Sanitizes the field value in the term based on the context. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_search', string $search, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_search', string $search, WP\_Query $query )
===============================================================================
Filters the search SQL that is used in the WHERE clause of [WP\_Query](../classes/wp_query).
`$search` string Search SQL for WHERE clause. `$query` [WP\_Query](../classes/wp_query) The current [WP\_Query](../classes/wp_query) object. Since version 3.0.0, the `posts_search` filter is used to filter the search SQL that is used in the `WHERE` clause of [WP\_Query](../classes/wp_query).
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$search = apply_filters_ref_array( 'posts_search', array( $search, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'unregistered_post_type', string $post_type ) do\_action( 'unregistered\_post\_type', string $post\_type )
============================================================
Fires after a post type was unregistered.
`$post_type` string Post type key. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'unregistered_post_type', $post_type );
```
| Used By | Description |
| --- | --- |
| [unregister\_post\_type()](../functions/unregister_post_type) wp-includes/post.php | Unregisters a post type. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'customize_panel_active', bool $active, WP_Customize_Panel $panel ) apply\_filters( 'customize\_panel\_active', bool $active, WP\_Customize\_Panel $panel )
=======================================================================================
Filters response of [WP\_Customize\_Panel::active()](../classes/wp_customize_panel/active).
`$active` bool Whether the Customizer panel is active. `$panel` [WP\_Customize\_Panel](../classes/wp_customize_panel) [WP\_Customize\_Panel](../classes/wp_customize_panel) instance. File: `wp-includes/class-wp-customize-panel.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-panel.php/)
```
$active = apply_filters( 'customize_panel_active', $active, $panel );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Panel::active()](../classes/wp_customize_panel/active) wp-includes/class-wp-customize-panel.php | Check whether panel is active to current Customizer preview. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'customize_save_response', array $response, WP_Customize_Manager $manager ) apply\_filters( 'customize\_save\_response', array $response, WP\_Customize\_Manager $manager )
===============================================================================================
Filters response data for a successful customize\_save Ajax request.
This filter does not apply if there was a nonce or authentication failure.
`$response` array Additional information passed back to the `'saved'` event on `wp.customize`. `$manager` [WP\_Customize\_Manager](../classes/wp_customize_manager) [WP\_Customize\_Manager](../classes/wp_customize_manager) instance. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
$response = apply_filters( 'customize_save_response', $response, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::save()](../classes/wp_customize_manager/save) wp-includes/class-wp-customize-manager.php | Handles customize\_save WP Ajax request to save/update a changeset. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'subdirectory_reserved_names', string[] $subdirectory_reserved_names ) apply\_filters( 'subdirectory\_reserved\_names', string[] $subdirectory\_reserved\_names )
==========================================================================================
Filters reserved site names on a sub-directory Multisite installation.
`$subdirectory_reserved_names` string[] Array of reserved names. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
return apply_filters( 'subdirectory_reserved_names', $names );
```
| Used By | Description |
| --- | --- |
| [get\_subdirectory\_reserved\_names()](../functions/get_subdirectory_reserved_names) wp-includes/ms-functions.php | Retrieves a list of reserved site on a sub-directory Multisite installation. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | `'wp-admin'`, `'wp-content'`, `'wp-includes'`, `'wp-json'`, and `'embed'` were added to the reserved names list. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'user_row_actions', string[] $actions, WP_User $user_object ) apply\_filters( 'user\_row\_actions', string[] $actions, WP\_User $user\_object )
=================================================================================
Filters the action links displayed under each user in the Users list table.
`$actions` string[] An array of action links to be displayed.
Default `'Edit'`, `'Delete'` for single site, and `'Edit'`, `'Remove'` for Multisite. `$user_object` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object for the currently listed user. File: `wp-admin/includes/class-wp-users-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-users-list-table.php/)
```
$actions = apply_filters( 'user_row_actions', $actions, $user_object );
```
| Used By | Description |
| --- | --- |
| [WP\_Users\_List\_Table::single\_row()](../classes/wp_users_list_table/single_row) wp-admin/includes/class-wp-users-list-table.php | Generate HTML for a single row on the users.php admin panel. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( "saved_{$taxonomy}", int $term_id, int $tt_id, bool $update, array $args ) do\_action( "saved\_{$taxonomy}", int $term\_id, int $tt\_id, bool $update, array $args )
=========================================================================================
Fires after a term in a specific taxonomy has been saved, and the term cache has been cleared.
The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `saved_category`
* `saved_post_tag`
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$update` bool Whether this is an existing term being updated. `$args` array Arguments passed to [wp\_insert\_term()](../functions/wp_insert_term) . More Arguments from wp\_insert\_term( ... $args ) Array or query string of arguments for inserting a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( "saved_{$taxonomy}", $term_id, $tt_id, false, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'send_new_site_email', bool $send, WP_Site $site, WP_User $user ) apply\_filters( 'send\_new\_site\_email', bool $send, WP\_Site $site, WP\_User $user )
======================================================================================
Filters whether to send an email to the Multisite network administrator when a new site is created.
Return false to disable sending the email.
`$send` bool Whether to send the email. `$site` [WP\_Site](../classes/wp_site) Site object of the new site. `$user` [WP\_User](../classes/wp_user) User object of the administrator of the new site. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
if ( ! apply_filters( 'send_new_site_email', true, $site, $user ) ) {
```
| Used By | Description |
| --- | --- |
| [wpmu\_new\_site\_admin\_notification()](../functions/wpmu_new_site_admin_notification) wp-includes/ms-functions.php | Notifies the Multisite network administrator that a new site was created. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_taxonomy', WP_REST_Response $response, WP_Taxonomy $item, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_taxonomy', WP\_REST\_Response $response, WP\_Taxonomy $item, WP\_REST\_Request $request )
=========================================================================================================================
Filters a taxonomy returned from the REST API.
Allows modification of the taxonomy data right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$item` [WP\_Taxonomy](../classes/wp_taxonomy) The original taxonomy object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php/)
```
return apply_filters( 'rest_prepare_taxonomy', $response, $taxonomy, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Taxonomies\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_taxonomies_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php | Prepares a taxonomy object for serialization. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'validate_current_theme', bool $validate ) apply\_filters( 'validate\_current\_theme', bool $validate )
============================================================
Filters whether to validate the active theme.
`$validate` bool Whether to validate the active theme. Default true. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
if ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) ) {
```
| Used By | Description |
| --- | --- |
| [validate\_current\_theme()](../functions/validate_current_theme) wp-includes/theme.php | Checks that the active theme has the required files. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'styles_inline_size_limit', int $total_inline_limit ) apply\_filters( 'styles\_inline\_size\_limit', int $total\_inline\_limit )
==========================================================================
The maximum size of inlined styles in bytes.
`$total_inline_limit` int The file-size threshold, in bytes. Default 20000. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
$total_inline_limit = apply_filters( 'styles_inline_size_limit', $total_inline_limit );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_inline\_styles()](../functions/wp_maybe_inline_styles) wp-includes/script-loader.php | Allows small styles to be inlined. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'secure_auth_redirect', bool $secure ) apply\_filters( 'secure\_auth\_redirect', bool $secure )
========================================================
Filters whether to use a secure authentication redirect.
`$secure` bool Whether to use a secure authentication redirect. Default false. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$secure = apply_filters( 'secure_auth_redirect', $secure );
```
| Used By | Description |
| --- | --- |
| [auth\_redirect()](../functions/auth_redirect) wp-includes/pluggable.php | Checks if a user is logged in, if not it redirects them to the login page. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_user_dashboard_widgets', string[] $dashboard_widgets ) apply\_filters( 'wp\_user\_dashboard\_widgets', string[] $dashboard\_widgets )
==============================================================================
Filters the list of widgets to load for the User Admin dashboard.
`$dashboard_widgets` string[] An array of dashboard widget IDs. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
$dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_setup()](../functions/wp_dashboard_setup) wp-admin/includes/dashboard.php | Registers dashboard widgets. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'teeny_mce_before_init', array $mceInit, string $editor_id ) apply\_filters( 'teeny\_mce\_before\_init', array $mceInit, string $editor\_id )
================================================================================
Filters the teenyMCE config before init.
`$mceInit` array An array with teenyMCE config. `$editor_id` string Unique editor identifier, e.g. `'content'`. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | The `$editor_id` parameter was added. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'user_request_confirmed_email_to', string $admin_email, WP_User_Request $request ) apply\_filters( 'user\_request\_confirmed\_email\_to', string $admin\_email, WP\_User\_Request $request )
=========================================================================================================
Filters the recipient of the data request confirmation notification.
In a Multisite environment, this will default to the email address of the network admin because, by default, single site admins do not have the capabilities required to process requests. Some networks may wish to delegate those capabilities to a single-site admin, or a dedicated person responsible for managing privacy requests.
`$admin_email` string The email address of the notification recipient. `$request` [WP\_User\_Request](../classes/wp_user_request) The request that is initiating the notification. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$admin_email = apply_filters( 'user_request_confirmed_email_to', get_site_option( 'admin_email' ), $request );
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_request\_confirmation\_notification()](../functions/_wp_privacy_send_request_confirmation_notification) wp-includes/user.php | Notifies the site administrator via email when a request is confirmed. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'all_themes', WP_Theme[] $all ) apply\_filters( 'all\_themes', WP\_Theme[] $all )
=================================================
Filters the full array of [WP\_Theme](../classes/wp_theme) objects to list in the Multisite themes list table.
`$all` [WP\_Theme](../classes/wp_theme)[] Array of [WP\_Theme](../classes/wp_theme) objects to display in the list table. File: `wp-admin/includes/class-wp-ms-themes-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-themes-list-table.php/)
```
'all' => apply_filters( 'all_themes', wp_get_themes() ),
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Themes\_List\_Table::prepare\_items()](../classes/wp_ms_themes_list_table/prepare_items) wp-admin/includes/class-wp-ms-themes-list-table.php | |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wpmu_signup_blog_notification', string|false $domain, string $path, string $title, string $user_login, string $user_email, string $key, array $meta ) apply\_filters( 'wpmu\_signup\_blog\_notification', string|false $domain, string $path, string $title, string $user\_login, string $user\_email, string $key, array $meta )
===========================================================================================================================================================================
Filters whether to bypass the new site email notification.
`$domain` string|false Site domain, or false to prevent the email from sending. `$path` string Site path. `$title` string Site title. `$user_login` string User login name. `$user_email` string User email address. `$key` string Activation key created in [wpmu\_signup\_blog()](../functions/wpmu_signup_blog) . `$meta` array Signup meta data. By default, contains the requested privacy setting and lang\_id. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
if ( ! apply_filters( 'wpmu_signup_blog_notification', $domain, $path, $title, $user_login, $user_email, $key, $meta ) ) {
```
| Used By | Description |
| --- | --- |
| [wpmu\_signup\_blog\_notification()](../functions/wpmu_signup_blog_notification) wp-includes/ms-functions.php | Sends a confirmation request email to a user when they sign up for a new site. The new site will not become active until the confirmation link is clicked. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'update_plugin_complete_actions', string[] $update_actions, string $plugin ) apply\_filters( 'update\_plugin\_complete\_actions', string[] $update\_actions, string $plugin )
================================================================================================
Filters the list of action links available following a single plugin update.
`$update_actions` string[] Array of plugin action links. `$plugin` string Path to the plugin file relative to the plugins directory. File: `wp-admin/includes/class-plugin-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-plugin-upgrader-skin.php/)
```
$update_actions = apply_filters( 'update_plugin_complete_actions', $update_actions, $this->plugin );
```
| Used By | Description |
| --- | --- |
| [Plugin\_Upgrader\_Skin::after()](../classes/plugin_upgrader_skin/after) wp-admin/includes/class-plugin-upgrader-skin.php | Action to perform following a single plugin update. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( "customize_update_{$this->type}", mixed $value, WP_Customize_Setting $setting ) do\_action( "customize\_update\_{$this->type}", mixed $value, WP\_Customize\_Setting $setting )
===============================================================================================
Fires when the [WP\_Customize\_Setting::update()](../classes/wp_customize_setting/update) method is called for settings not handled as theme\_mods or options.
The dynamic portion of the hook name, `$this->type`, refers to the type of setting.
`$value` mixed Value of the setting. `$setting` [WP\_Customize\_Setting](../classes/wp_customize_setting) [WP\_Customize\_Setting](../classes/wp_customize_setting) instance. File: `wp-includes/class-wp-customize-setting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-setting.php/)
```
do_action( "customize_update_{$this->type}", $value, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Setting::update()](../classes/wp_customize_setting/update) wp-includes/class-wp-customize-setting.php | Save the value of the setting, using the related API. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'wp_delete_application_password', int $user_id, array $item ) do\_action( 'wp\_delete\_application\_password', int $user\_id, array $item )
=============================================================================
Fires when an application password is deleted.
`$user_id` int The user ID. `$item` array The data about the application password. File: `wp-includes/class-wp-application-passwords.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-application-passwords.php/)
```
do_action( 'wp_delete_application_password', $user_id, $item );
```
| Used By | Description |
| --- | --- |
| [WP\_Application\_Passwords::delete\_application\_password()](../classes/wp_application_passwords/delete_application_password) wp-includes/class-wp-application-passwords.php | Deletes an application password. |
| [WP\_Application\_Passwords::delete\_all\_application\_passwords()](../classes/wp_application_passwords/delete_all_application_passwords) wp-includes/class-wp-application-passwords.php | Deletes all application passwords for the given user. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'print_footer_scripts', bool $print ) apply\_filters( 'print\_footer\_scripts', bool $print )
=======================================================
Filters whether to print the footer scripts.
`$print` bool Whether to print the footer scripts. Default true. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
if ( apply_filters( 'print_footer_scripts', true ) ) {
```
| Used By | Description |
| --- | --- |
| [print\_footer\_scripts()](../functions/print_footer_scripts) wp-includes/script-loader.php | Prints the scripts that were queued for the footer or too late for the HTML head. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'icon_dir_uri', string $uri ) apply\_filters( 'icon\_dir\_uri', string $uri )
===============================================
Filters the icon directory URI.
`$uri` string Icon directory URI. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url( 'images/media' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_mime\_type\_icon()](../functions/wp_mime_type_icon) wp-includes/post.php | Retrieves the icon for a MIME type or attachment. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'http_request_timeout', float $timeout_value, string $url ) apply\_filters( 'http\_request\_timeout', float $timeout\_value, string $url )
==============================================================================
Filters the timeout value for an HTTP request.
`$timeout_value` float Time in seconds until a request times out. Default 5. `$url` string The request URL. File: `wp-includes/class-wp-http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http.php/)
```
'timeout' => apply_filters( 'http_request_timeout', 5, $url ),
```
| Used By | Description |
| --- | --- |
| [WP\_Http::request()](../classes/wp_http/request) wp-includes/class-wp-http.php | Send an HTTP request to a URI. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | The `$url` parameter was added. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'unregister_setting', string $option_group, string $option_name ) do\_action( 'unregister\_setting', string $option\_group, string $option\_name )
================================================================================
Fires immediately before the setting is unregistered and after its filters have been removed.
`$option_group` string Setting group. `$option_name` string Setting name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'unregister_setting', $option_group, $option_name );
```
| Used By | Description |
| --- | --- |
| [unregister\_setting()](../functions/unregister_setting) wp-includes/option.php | Unregisters a setting. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'pre_post_update', int $post_ID, array $data ) do\_action( 'pre\_post\_update', int $post\_ID, array $data )
=============================================================
Fires immediately before an existing post is updated in the database.
`$post_ID` int Post ID. `$data` array Array of unslashed post data. The hook is called just before $[wpdb::update()](../classes/wpdb/update), only on updates (not creates).
This might be useful for editing the contents of $[wpdb](../classes/wpdb)->posts before the content is updated to the DB.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'pre_post_update', $post_ID, $data );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'signup_site_meta', array $meta, string $domain, string $path, string $title, string $user, string $user_email, string $key ) apply\_filters( 'signup\_site\_meta', array $meta, string $domain, string $path, string $title, string $user, string $user\_email, string $key )
================================================================================================================================================
Filters the metadata for a site signup.
The metadata will be serialized prior to storing it in the database.
`$meta` array Signup meta data. Default empty array. `$domain` string The requested domain. `$path` string The requested path. `$title` string The requested site title. `$user` string The user's requested login name. `$user_email` string The user's email address. `$key` string The user's activation key. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$meta = apply_filters( 'signup_site_meta', $meta, $domain, $path, $title, $user, $user_email, $key );
```
| Used By | Description |
| --- | --- |
| [wpmu\_signup\_blog()](../functions/wpmu_signup_blog) wp-includes/ms-functions.php | Records site signup information for future activation. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress do_action( 'personal_options_update', int $user_id ) do\_action( 'personal\_options\_update', int $user\_id )
========================================================
Fires before the page loads on the ‘Profile’ editing screen.
The action only fires if the current user is editing their own profile.
`$user_id` int The user ID. Generally, [action hook](https://codex.wordpress.org/Plugin_API/Action_Reference "Plugin API/Action Reference") is used to save custom fields that have been added to the WordPress profile page.
This hook only triggers when a user is viewing their *own* profile page. If you want to apply your hook to ALL profile pages (including users other than the current one), then you also need to use the [edit\_user\_profile\_update](edit_user_profile_update "Plugin API/Action Reference/edit user profile update") hook.
File: `wp-admin/user-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/user-edit.php/)
```
do_action( 'personal_options_update', $user_id );
```
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress do_action( 'setup_theme' ) do\_action( 'setup\_theme' )
============================
Fires before the theme is loaded.
File: `wp-settings.php`. [View all references](https://developer.wordpress.org/reference/files/wp-settings.php/)
```
do_action( 'setup_theme' );
```
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'wp_signup_location', string $sign_up_url ) apply\_filters( 'wp\_signup\_location', string $sign\_up\_url )
===============================================================
Filters the Multisite sign up URL.
`$sign_up_url` string The sign up URL. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
wp_redirect( apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ) );
```
| Used By | Description |
| --- | --- |
| [redirect\_canonical()](../functions/redirect_canonical) wp-includes/canonical.php | Redirects incoming links to the proper URL based on the site url. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'get_enclosed', string[] $pung, int $post_id ) apply\_filters( 'get\_enclosed', string[] $pung, int $post\_id )
================================================================
Filters the list of enclosures already enclosed for the given post.
`$pung` string[] Array of enclosures for the given post. `$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'get_enclosed', $pung, $post_id );
```
| Used By | Description |
| --- | --- |
| [get\_enclosed()](../functions/get_enclosed) wp-includes/post.php | Retrieves enclosures already enclosed for a post. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'signup_blog_init', array $signup_blog_defaults ) apply\_filters( 'signup\_blog\_init', array $signup\_blog\_defaults )
=====================================================================
Filters the default site creation variables for the site sign-up form.
`$signup_blog_defaults` array An array of default site creation variables.
* `user_name`stringThe user username.
* `user_email`stringThe user email address.
* `blogname`stringThe blogname.
* `blog_title`stringThe title of the site.
* `errors`[WP\_Error](../classes/wp_error)A [WP\_Error](../classes/wp_error) object with possible errors relevant to new site creation variables.
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
$filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults );
```
| Used By | Description |
| --- | --- |
| [signup\_blog()](../functions/signup_blog) wp-signup.php | Shows a form for a user or visitor to sign up for a new site. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_headers', string[] $headers, WP $wp ) apply\_filters( 'wp\_headers', string[] $headers, WP $wp )
==========================================================
Filters the HTTP headers before they’re sent to the browser.
`$headers` string[] Associative array of headers to be sent. `$wp` WP Current WordPress environment instance. File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
$headers = apply_filters( 'wp_headers', $headers, $this );
```
| Used By | Description |
| --- | --- |
| [WP::send\_headers()](../classes/wp/send_headers) wp-includes/class-wp.php | Sends additional HTTP headers for caching, content type, etc. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'widget_customizer_setting_args', array $args, string $id ) apply\_filters( 'widget\_customizer\_setting\_args', array $args, string $id )
==============================================================================
Filters the common arguments supplied when constructing a Customizer setting.
* [WP\_Customize\_Setting](../classes/wp_customize_setting)
`$args` array Array of Customizer setting arguments. `$id` string Widget setting ID. File: `wp-includes/class-wp-customize-widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-widgets.php/)
```
return apply_filters( 'widget_customizer_setting_args', $args, $id );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Widgets::get\_setting\_args()](../classes/wp_customize_widgets/get_setting_args) wp-includes/class-wp-customize-widgets.php | Retrieves common arguments to supply when constructing a Customizer setting. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( "pre_term_{$field}", mixed $value, string $taxonomy ) apply\_filters( "pre\_term\_{$field}", mixed $value, string $taxonomy )
=======================================================================
Filters a term field value before it is sanitized.
The dynamic portion of the hook name, `$field`, refers to the term field.
`$value` mixed Value of the term field. `$taxonomy` string Taxonomy slug. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$value = apply_filters( "pre_term_{$field}", $value, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [sanitize\_term\_field()](../functions/sanitize_term_field) wp-includes/taxonomy.php | Sanitizes the field value in the term based on the context. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'do_redirect_guess_404_permalink', bool $do_redirect_guess ) apply\_filters( 'do\_redirect\_guess\_404\_permalink', bool $do\_redirect\_guess )
==================================================================================
Filters whether to attempt to guess a redirect URL for a 404 request.
Returning a false value from the filter will disable the URL guessing and return early without performing a redirect.
`$do_redirect_guess` bool Whether to attempt to guess a redirect URL for a 404 request. Default true. File: `wp-includes/canonical.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/canonical.php/)
```
if ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) {
```
| Used By | Description |
| --- | --- |
| [redirect\_guess\_404\_permalink()](../functions/redirect_guess_404_permalink) wp-includes/canonical.php | Attempts to guess the correct URL for a 404 request based on query vars. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'admin_post_thumbnail_html', string $content, int $post_id, int|null $thumbnail_id ) apply\_filters( 'admin\_post\_thumbnail\_html', string $content, int $post\_id, int|null $thumbnail\_id )
=========================================================================================================
Filters the admin post thumbnail HTML markup to return.
`$content` string Admin post thumbnail HTML markup. `$post_id` int Post ID. `$thumbnail_id` int|null Thumbnail attachment ID, or null if there isn't one. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
return apply_filters( 'admin_post_thumbnail_html', $content, $post->ID, $thumbnail_id );
```
| Used By | Description |
| --- | --- |
| [\_wp\_post\_thumbnail\_html()](../functions/_wp_post_thumbnail_html) wp-admin/includes/post.php | Returns HTML for the post thumbnail meta box. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$thumbnail_id` parameter. |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Added the `$post_id` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'wp_logout', int $user_id ) do\_action( 'wp\_logout', int $user\_id )
=========================================
Fires after a user is logged out.
`$user_id` int ID of the user that was logged out. The `wp_logout` action hook is triggered when a user logs out using the [wp\_logout()](../functions/wp_logout) function. The action is executed after the [wp\_clear\_auth\_cookie()](../functions/wp_clear_auth_cookie) function call.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'wp_logout', $user_id );
```
| Used By | Description |
| --- | --- |
| [wp\_logout()](../functions/wp_logout) wp-includes/pluggable.php | Logs the current user out. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$user_id` parameter. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( "rest_pre_insert_{$this->taxonomy}", object $prepared_term, WP_REST_Request $request ) apply\_filters( "rest\_pre\_insert\_{$this->taxonomy}", object $prepared\_term, WP\_REST\_Request $request )
============================================================================================================
Filters term data before inserting term via the REST API.
The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `rest_pre_insert_category`
* `rest_pre_insert_post_tag`
`$prepared_term` object Term object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php/)
```
return apply_filters( "rest_pre_insert_{$this->taxonomy}", $prepared_term, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Terms\_Controller::prepare\_item\_for\_database()](../classes/wp_rest_terms_controller/prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Prepares a single term for create or update. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'update_welcome_email', string $welcome_email, int $blog_id, int $user_id, string $password, string $title, array $meta ) apply\_filters( 'update\_welcome\_email', string $welcome\_email, int $blog\_id, int $user\_id, string $password, string $title, array $meta )
==============================================================================================================================================
Filters the content of the welcome email sent to the site administrator after site activation.
Content should be formatted for transmission via [wp\_mail()](../functions/wp_mail) .
`$welcome_email` string Message body of the email. `$blog_id` int Site ID. `$user_id` int User ID of the site administrator. `$password` string User password, or "N/A" if the user account is not new. `$title` string Site title. `$meta` array Signup meta data. By default, contains the requested privacy setting and lang\_id. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta );
```
| Used By | Description |
| --- | --- |
| [wpmu\_welcome\_notification()](../functions/wpmu_welcome_notification) wp-includes/ms-functions.php | Notifies the site administrator that their site activation was successful. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( 'rest_delete_nav_menu_item', object $nav_menu_item, WP_REST_Response $response, WP_REST_Request $request ) do\_action( 'rest\_delete\_nav\_menu\_item', object $nav\_menu\_item, WP\_REST\_Response $response, WP\_REST\_Request $request )
================================================================================================================================
Fires immediately after a single menu item is deleted via the REST API.
`$nav_menu_item` object Inserted or updated menu item object. `$response` [WP\_REST\_Response](../classes/wp_rest_response) The response data. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php/)
```
do_action( 'rest_delete_nav_menu_item', $menu_item, $response, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menu\_Items\_Controller::delete\_item()](../classes/wp_rest_menu_items_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php | Deletes a single menu item. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'comment_form_must_log_in_after' ) do\_action( 'comment\_form\_must\_log\_in\_after' )
===================================================
Fires after the HTML-formatted ‘must log in after’ message in the comment form.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
do_action( 'comment_form_must_log_in_after' );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'allowed_options', array $allowed_options ) apply\_filters( 'allowed\_options', array $allowed\_options )
=============================================================
Filters the allowed options list.
`$allowed_options` array The allowed options list. File: `wp-admin/options.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/options.php/)
```
$allowed_options = apply_filters( 'allowed_options', $allowed_options );
```
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'manage_media_columns', string[] $posts_columns, bool $detached ) apply\_filters( 'manage\_media\_columns', string[] $posts\_columns, bool $detached )
====================================================================================
Filters the Media list table columns.
`$posts_columns` string[] An array of columns displayed in the Media list table. `$detached` bool Whether the list table contains media not attached to any posts. Default true. File: `wp-admin/includes/class-wp-media-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-media-list-table.php/)
```
return apply_filters( 'manage_media_columns', $posts_columns, $this->detached );
```
| Used By | Description |
| --- | --- |
| [WP\_Media\_List\_Table::get\_columns()](../classes/wp_media_list_table/get_columns) wp-admin/includes/class-wp-media-list-table.php | |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action_ref_array( 'wp_authenticate', string $user_login, string $user_password ) do\_action\_ref\_array( 'wp\_authenticate', string $user\_login, string $user\_password )
=========================================================================================
Fires before the user is authenticated.
The variables passed to the callbacks are passed by reference, and can be modified by callback functions.
`$user_login` string Username (passed by reference). `$user_password` string User password (passed by reference). This action is located inside of [wp\_signon()](../functions/wp_signon) . In contrast to the <wp_login> action, it is executed before the WordPress authentication process.
This action hook is not to be confused with the [wp\_authenticate()](../functions/wp_authenticate) pluggable function.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action_ref_array( 'wp_authenticate', array( &$credentials['user_login'], &$credentials['user_password'] ) );
```
| Used By | Description |
| --- | --- |
| [wp\_signon()](../functions/wp_signon) wp-includes/user.php | Authenticates and logs a user in with ‘remember’ capability. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'wp_page_menu', string $menu, array $args ) apply\_filters( 'wp\_page\_menu', string $menu, array $args )
=============================================================
Filters the HTML output of a page-based menu.
* [wp\_page\_menu()](../functions/wp_page_menu)
`$menu` string The HTML output. `$args` array An array of arguments. See [wp\_page\_menu()](../functions/wp_page_menu) for information on accepted arguments. More Arguments from wp\_page\_menu( ... $args ) Array or string of arguments to retrieve pages.
* `child_of`intPage ID to return child and grandchild pages of. Note: The value of `$hierarchical` has no bearing on whether `$child_of` returns hierarchical results. Default 0, or no restriction.
* `sort_order`stringHow to sort retrieved pages. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `sort_column`stringWhat columns to sort pages by, comma-separated. Accepts `'post_author'`, `'post_date'`, `'post_title'`, `'post_name'`, `'post_modified'`, `'menu_order'`, `'post_modified_gmt'`, `'post_parent'`, `'ID'`, `'rand'`, `'comment*count'`.
`'post*'` can be omitted for any values that start with it.
Default `'post_title'`.
* `hierarchical`boolWhether to return pages hierarchically. If false in conjunction with `$child_of` also being false, both arguments will be disregarded.
Default true.
* `exclude`int[]Array of page IDs to exclude.
* `include`int[]Array of page IDs to include. Cannot be used with `$child_of`, `$parent`, `$exclude`, `$meta_key`, `$meta_value`, or `$hierarchical`.
* `meta_key`stringOnly include pages with this meta key.
* `meta_value`stringOnly include pages with this meta value. Requires `$meta_key`.
* `authors`stringA comma-separated list of author IDs.
* `parent`intPage ID to return direct children of. Default -1, or no restriction.
* `exclude_tree`string|int[]Comma-separated string or array of page IDs to exclude.
* `number`intThe number of pages to return. Default 0, or all pages.
* `offset`intThe number of pages to skip before returning. Requires `$number`.
Default 0.
* `post_type`stringThe post type to query. Default `'page'`.
* `post_status`string|arrayA comma-separated list or array of post statuses to include.
Default `'publish'`.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$menu = apply_filters( 'wp_page_menu', $menu, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_page\_menu()](../functions/wp_page_menu) wp-includes/post-template.php | Displays or retrieves a list of pages with an optional home link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'page_link', string $link, int $post_id, bool $sample ) apply\_filters( 'page\_link', string $link, int $post\_id, bool $sample )
=========================================================================
Filters the permalink for a page.
`$link` string The page's permalink. `$post_id` int The ID of the page. `$sample` bool Is it a sample permalink. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'page_link', $link, $post->ID, $sample );
```
| Used By | Description |
| --- | --- |
| [get\_page\_link()](../functions/get_page_link) wp-includes/link-template.php | Retrieves the permalink for the current page or page ID. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'admin_bar_init' ) do\_action( 'admin\_bar\_init' )
================================
Fires after [WP\_Admin\_Bar](../classes/wp_admin_bar) is initialized.
File: `wp-includes/class-wp-admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-admin-bar.php/)
```
do_action( 'admin_bar_init' );
```
| Used By | Description |
| --- | --- |
| [WP\_Admin\_Bar::initialize()](../classes/wp_admin_bar/initialize) wp-includes/class-wp-admin-bar.php | Initializes the admin bar. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'feed_links_show_comments_feed', bool $show ) apply\_filters( 'feed\_links\_show\_comments\_feed', bool $show )
=================================================================
Filters whether to display the comments feed link.
`$show` bool Whether to display the comments feed link. Default true. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
if ( apply_filters( 'feed_links_show_comments_feed', true ) ) {
```
| Used By | Description |
| --- | --- |
| [feed\_links()](../functions/feed_links) wp-includes/general-template.php | Displays the links to the general feeds. |
| [feed\_links\_extra()](../functions/feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'image_add_caption_shortcode', string $shcode, string $html ) apply\_filters( 'image\_add\_caption\_shortcode', string $shcode, string $html )
================================================================================
Filters the image HTML markup including the caption shortcode.
`$shcode` string The image HTML markup with caption shortcode. `$html` string The image HTML markup. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
```
| Used By | Description |
| --- | --- |
| [image\_add\_caption()](../functions/image_add_caption) wp-admin/includes/media.php | Adds image shortcode with caption to editor. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'the_modified_date', string|false $the_modified_date, string $format, string $before, string $after ) apply\_filters( 'the\_modified\_date', string|false $the\_modified\_date, string $format, string $before, string $after )
=========================================================================================================================
Filters the date a post was last modified for display.
`$the_modified_date` string|false The last modified date or false if no post is found. `$format` string PHP date format. `$before` string HTML output before the date. `$after` string HTML output after the date. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );
```
| Used By | Description |
| --- | --- |
| [the\_modified\_date()](../functions/the_modified_date) wp-includes/general-template.php | Displays the date on which the post was last modified. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'load_image_to_edit_attachmenturl', string|false $image_url, int $attachment_id, string|int[] $size ) apply\_filters( 'load\_image\_to\_edit\_attachmenturl', string|false $image\_url, int $attachment\_id, string|int[] $size )
===========================================================================================================================
Filters the path to an attachment’s URL when editing the image.
The filter is only evaluated if the file isn’t stored locally and `allow_url_fopen` is enabled on the server.
`$image_url` string|false Current image URL. `$attachment_id` int Attachment ID. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
$filepath = apply_filters( 'load_image_to_edit_attachmenturl', wp_get_attachment_url( $attachment_id ), $attachment_id, $size );
```
| Used By | Description |
| --- | --- |
| [\_load\_image\_to\_edit\_path()](../functions/_load_image_to_edit_path) wp-admin/includes/image.php | Retrieves the path or URL of an attachment’s attached file. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'upgrader_process_complete', WP_Upgrader $upgrader, array $hook_extra ) do\_action( 'upgrader\_process\_complete', WP\_Upgrader $upgrader, array $hook\_extra )
=======================================================================================
Fires when the upgrader process is complete.
See also [‘upgrader\_package\_options’](upgrader_package_options).
`$upgrader` [WP\_Upgrader](../classes/wp_upgrader) [WP\_Upgrader](../classes/wp_upgrader) instance. In other contexts this might be a [Theme\_Upgrader](../classes/theme_upgrader), [Plugin\_Upgrader](../classes/plugin_upgrader), Core\_Upgrade, or [Language\_Pack\_Upgrader](../classes/language_pack_upgrader) instance. `$hook_extra` array Array of bulk item update data.
* `action`stringType of action. Default `'update'`.
* `type`stringType of update process. Accepts `'plugin'`, `'theme'`, `'translation'`, or `'core'`.
* `bulk`boolWhether the update process is a bulk update. Default true.
* `plugins`arrayArray of the basename paths of the plugins' main files.
* `themes`arrayThe theme slugs.
* `translations`array Array of translations update data.
+ `language`stringThe locale the translation is for.
+ `type`stringType of translation. Accepts `'plugin'`, `'theme'`, or `'core'`.
+ `slug`stringText domain the translation is for. The slug of a theme/plugin or `'default'` for core translations.
+ `version`stringThe version of a theme, plugin, or core. The `upgrader_process_complete` action hook is run when the download process for a plugin install or update finishes.
Use with caution: When you use the `upgrader_process_complete` action hook in your plugin and your plugin is the one which under upgrade, then this action will run the old version of your plugin.
File: `wp-admin/includes/class-wp-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-upgrader.php/)
```
do_action( 'upgrader_process_complete', $this, $options['hook_extra'] );
```
| Used By | Description |
| --- | --- |
| [Core\_Upgrader::upgrade()](../classes/core_upgrader/upgrade) wp-admin/includes/class-core-upgrader.php | Upgrade WordPress core. |
| [Language\_Pack\_Upgrader::bulk\_upgrade()](../classes/language_pack_upgrader/bulk_upgrade) wp-admin/includes/class-language-pack-upgrader.php | Bulk upgrade language packs. |
| [Plugin\_Upgrader::bulk\_upgrade()](../classes/plugin_upgrader/bulk_upgrade) wp-admin/includes/class-plugin-upgrader.php | Bulk upgrade several plugins at once. |
| [Theme\_Upgrader::bulk\_upgrade()](../classes/theme_upgrader/bulk_upgrade) wp-admin/includes/class-theme-upgrader.php | Upgrade several themes at once. |
| [WP\_Upgrader::run()](../classes/wp_upgrader/run) wp-admin/includes/class-wp-upgrader.php | Run an upgrade/installation. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | `$translations` was added as a possible argument to `$hook_extra`. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Added to [WP\_Upgrader::run()](../classes/wp_upgrader/run). |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_allow_anonymous_comments', bool $allow ) apply\_filters( 'xmlrpc\_allow\_anonymous\_comments', bool $allow )
===================================================================
Filters whether to allow anonymous comments over XML-RPC.
`$allow` bool Whether to allow anonymous commenting via XML-RPC.
Default false. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
$allow_anon = apply_filters( 'xmlrpc_allow_anonymous_comments', false );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_newComment()](../classes/wp_xmlrpc_server/wp_newcomment) wp-includes/class-wp-xmlrpc-server.php | Create new comment. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'pre_schedule_event', null|bool|WP_Error $pre, stdClass $event, bool $wp_error ) apply\_filters( 'pre\_schedule\_event', null|bool|WP\_Error $pre, stdClass $event, bool $wp\_error )
====================================================================================================
Filter to preflight or hijack scheduling an event.
Returning a non-null value will short-circuit adding the event to the cron array, causing the function to return the filtered value instead.
Both single events and recurring events are passed through this filter; single events have `$event->schedule` as false, whereas recurring events have this set to a recurrence from [wp\_get\_schedules()](../functions/wp_get_schedules) . Recurring events also have the integer recurrence interval set as `$event->interval`.
For plugins replacing wp-cron, it is recommended you check for an identical event within ten minutes and apply the [‘schedule\_event’](schedule_event) filter to check if another plugin has disallowed the event before scheduling.
Return true if the event was scheduled, false or a [WP\_Error](../classes/wp_error) if not.
`$pre` null|bool|[WP\_Error](../classes/wp_error) Value to return instead. Default null to continue adding the event. `$event` stdClass An object containing an event's data.
* `hook`stringAction hook to execute when the event is run.
* `timestamp`intUnix timestamp (UTC) for when to next run the event.
* `schedule`string|falseHow often the event should subsequently recur.
* `args`arrayArray containing each separate argument to pass to the hook's callback function.
* `interval`intThe interval time in seconds for the schedule. Only present for recurring events.
`$wp_error` bool Whether to return a [WP\_Error](../classes/wp_error) on failure. File: `wp-includes/cron.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/cron.php/)
```
$pre = apply_filters( 'pre_schedule_event', null, $event, $wp_error );
```
| Used By | Description |
| --- | --- |
| [wp\_schedule\_event()](../functions/wp_schedule_event) wp-includes/cron.php | Schedules a recurring event. |
| [wp\_schedule\_single\_event()](../functions/wp_schedule_single_event) wp-includes/cron.php | Schedules an event to run only once. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | The `$wp_error` parameter was added, and a `WP_Error` object can now be returned. |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress do_action( 'delete_post', int $postid, WP_Post $post ) do\_action( 'delete\_post', int $postid, WP\_Post $post )
=========================================================
Fires immediately before a post is deleted from the database.
`$postid` int Post ID. `$post` [WP\_Post](../classes/wp_post) Post object. Take note, by the time the hook triggers, the post **comments and metadata** would have **already been deleted**. Use the [before\_delete\_post](before_delete_post "Plugin API/Action Reference/before delete post") hook to catch post deletion before that.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'delete_post', $postid, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_attachment()](../functions/wp_delete_attachment) wp-includes/post.php | Trashes or deletes an attachment. |
| [wp\_delete\_post()](../functions/wp_delete_post) wp-includes/post.php | Trashes or deletes a post or page. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$post` parameter. |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'wp_enqueue_media' ) do\_action( 'wp\_enqueue\_media' )
==================================
Fires at the conclusion of [wp\_enqueue\_media()](../functions/wp_enqueue_media) .
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
do_action( 'wp_enqueue_media' );
```
| Used By | Description |
| --- | --- |
| [wp\_enqueue\_media()](../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'wp_video_shortcode_class', string $class, array $atts ) apply\_filters( 'wp\_video\_shortcode\_class', string $class, array $atts )
===========================================================================
Filters the class attribute for the video shortcode output container.
`$class` string CSS class or list of space-separated classes. `$atts` array Array of video shortcode attributes. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$atts['class'] = apply_filters( 'wp_video_shortcode_class', $atts['class'], $atts );
```
| Used By | Description |
| --- | --- |
| [wp\_video\_shortcode()](../functions/wp_video_shortcode) wp-includes/media.php | Builds the Video shortcode output. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `$atts` parameter was added. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_get_setting', mixed $result, string $name, array $args ) apply\_filters( 'rest\_pre\_get\_setting', mixed $result, string $name, array $args )
=====================================================================================
Filters the value of a setting recognized by the REST API.
Allow hijacking the setting value and overriding the built-in behavior by returning a non-null value. The returned value will be presented as the setting value instead.
`$result` mixed Value to use for the requested setting. Can be a scalar matching the registered schema for the setting, or null to follow the default [get\_option()](../functions/get_option) behavior. `$name` string Setting name (as shown in REST API responses). `$args` array Arguments passed to [register\_setting()](../functions/register_setting) for this setting. More Arguments from register\_setting( ... $args ) Data used to describe the setting when registered.
* `type`stringThe type of data associated with this setting.
Valid values are `'string'`, `'boolean'`, `'integer'`, `'number'`, `'array'`, and `'object'`.
* `description`stringA description of the data attached to this setting.
* `sanitize_callback`callableA callback function that sanitizes the option's value.
* `show_in_rest`bool|arrayWhether data associated with this setting should be included in the REST API.
When registering complex settings, this argument may optionally be an array with a `'schema'` key.
* `default`mixedDefault value when calling `get_option()`.
File: `wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php/)
```
$response[ $name ] = apply_filters( 'rest_pre_get_setting', null, $name, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Settings\_Controller::get\_item()](../classes/wp_rest_settings_controller/get_item) wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php | Retrieves the settings. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'embed_defaults', int[] $size, string $url ) apply\_filters( 'embed\_defaults', int[] $size, string $url )
=============================================================
Filters the default array of embed dimensions.
`$size` int[] Indexed array of the embed width and height in pixels.
* intThe embed width.
* `1`intThe embed height.
`$url` string The URL that should be embedded. * If the theme does not specify a content width, then 500px is used. The default height is 1.5 times the width, or 1000px, whichever is smaller.
* The callback function is expected to return an array of embed width and height in pixels.
File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
return apply_filters( 'embed_defaults', compact( 'width', 'height' ), $url );
```
| Used By | Description |
| --- | --- |
| [wp\_embed\_defaults()](../functions/wp_embed_defaults) wp-includes/embed.php | Creates default array of embed parameters. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'post_class_taxonomies', string[] $taxonomies, int $post_id, string[] $classes, string[] $class ) apply\_filters( 'post\_class\_taxonomies', string[] $taxonomies, int $post\_id, string[] $classes, string[] $class )
====================================================================================================================
Filters the taxonomies to generate classes for each individual term.
Default is all public taxonomies registered to the post type.
`$taxonomies` string[] List of all taxonomy names to generate classes for. `$post_id` int The post ID. `$classes` string[] An array of post class names. `$class` string[] An array of additional class names added to the post. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$taxonomies = apply_filters( 'post_class_taxonomies', $taxonomies, $post->ID, $classes, $class );
```
| Used By | Description |
| --- | --- |
| [get\_post\_class()](../functions/get_post_class) wp-includes/post-template.php | Retrieves an array of the class names for the post container element. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'wp_ajax_cropped_attachment_metadata', array $metadata ) apply\_filters( 'wp\_ajax\_cropped\_attachment\_metadata', array $metadata )
============================================================================
Filters the cropped image attachment metadata.
* [wp\_generate\_attachment\_metadata()](../functions/wp_generate_attachment_metadata)
`$metadata` array Attachment metadata. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$metadata = apply_filters( 'wp_ajax_cropped_attachment_metadata', $metadata );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_crop\_image()](../functions/wp_ajax_crop_image) wp-admin/includes/ajax-actions.php | Ajax handler for cropping an image. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_blogger_deletePost', int $post_ID, array $args ) do\_action( 'xmlrpc\_call\_success\_blogger\_deletePost', int $post\_ID, array $args )
======================================================================================
Fires after a post has been successfully deleted via the XML-RPC Blogger API.
`$post_ID` int ID of the deleted post. `$args` array An array of arguments to delete the post. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'xmlrpc_call_success_blogger_deletePost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::blogger\_deletePost()](../classes/wp_xmlrpc_server/blogger_deletepost) wp-includes/class-wp-xmlrpc-server.php | Remove a post. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'insert_with_markers_inline_instructions', string[] $instructions, string $marker ) apply\_filters( 'insert\_with\_markers\_inline\_instructions', string[] $instructions, string $marker )
=======================================================================================================
Filters the inline instructions inserted before the dynamically generated content.
`$instructions` string[] Array of lines with inline instructions. `$marker` string The marker being inserted. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
$instructions = apply_filters( 'insert_with_markers_inline_instructions', $instructions, $marker );
```
| Used By | Description |
| --- | --- |
| [insert\_with\_markers()](../functions/insert_with_markers) wp-admin/includes/misc.php | Inserts an array of strings into a file (.htaccess), placing it between BEGIN and END markers. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( "manage_{$screen->id}_columns", string[] $columns ) apply\_filters( "manage\_{$screen->id}\_columns", string[] $columns )
=====================================================================
Filters the column headers for a list table on a specific screen.
The dynamic portion of the hook name, `$screen->id`, refers to the ID of a specific screen. For example, the screen ID for the Posts list table is edit-post, so the filter for that screen would be manage\_edit-post\_columns.
`$columns` string[] The column header labels keyed by column ID. File: `wp-admin/includes/screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/screen.php/)
```
$column_headers[ $screen->id ] = apply_filters( "manage_{$screen->id}_columns", array() );
```
| Used By | Description |
| --- | --- |
| [get\_column\_headers()](../functions/get_column_headers) wp-admin/includes/screen.php | Get the column headers for a screen |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_list_pages', string $output, array $parsed_args, WP_Post[] $pages ) apply\_filters( 'wp\_list\_pages', string $output, array $parsed\_args, WP\_Post[] $pages )
===========================================================================================
Filters the HTML output of the pages to list.
* [wp\_list\_pages()](../functions/wp_list_pages)
`$output` string HTML output of the pages list. `$parsed_args` array An array of page-listing arguments. See [wp\_list\_pages()](../functions/wp_list_pages) for information on accepted arguments. More Arguments from wp\_list\_pages( ... $args ) Array or string of arguments to retrieve pages.
* `child_of`intPage ID to return child and grandchild pages of. Note: The value of `$hierarchical` has no bearing on whether `$child_of` returns hierarchical results. Default 0, or no restriction.
* `sort_order`stringHow to sort retrieved pages. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `sort_column`stringWhat columns to sort pages by, comma-separated. Accepts `'post_author'`, `'post_date'`, `'post_title'`, `'post_name'`, `'post_modified'`, `'menu_order'`, `'post_modified_gmt'`, `'post_parent'`, `'ID'`, `'rand'`, `'comment*count'`.
`'post*'` can be omitted for any values that start with it.
Default `'post_title'`.
* `hierarchical`boolWhether to return pages hierarchically. If false in conjunction with `$child_of` also being false, both arguments will be disregarded.
Default true.
* `exclude`int[]Array of page IDs to exclude.
* `include`int[]Array of page IDs to include. Cannot be used with `$child_of`, `$parent`, `$exclude`, `$meta_key`, `$meta_value`, or `$hierarchical`.
* `meta_key`stringOnly include pages with this meta key.
* `meta_value`stringOnly include pages with this meta value. Requires `$meta_key`.
* `authors`stringA comma-separated list of author IDs.
* `parent`intPage ID to return direct children of. Default -1, or no restriction.
* `exclude_tree`string|int[]Comma-separated string or array of page IDs to exclude.
* `number`intThe number of pages to return. Default 0, or all pages.
* `offset`intThe number of pages to skip before returning. Requires `$number`.
Default 0.
* `post_type`stringThe post type to query. Default `'page'`.
* `post_status`string|arrayA comma-separated list or array of post statuses to include.
Default `'publish'`.
`$pages` [WP\_Post](../classes/wp_post)[] Array of the page objects. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$html = apply_filters( 'wp_list_pages', $output, $parsed_args, $pages );
```
| Used By | Description |
| --- | --- |
| [wp\_list\_pages()](../functions/wp_list_pages) wp-includes/post-template.php | Retrieves or displays a list of pages (or hierarchical post type items) in list (li) format. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | `$pages` added as arguments. |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'is_protected_endpoint', bool $is_protected_endpoint ) apply\_filters( 'is\_protected\_endpoint', bool $is\_protected\_endpoint )
==========================================================================
Filters whether the current request is against a protected endpoint.
This filter is only fired when an endpoint is requested which is not already protected by WordPress core. As such, it exclusively allows providing further protected endpoints in addition to the admin backend, login pages and protected Ajax actions.
`$is_protected_endpoint` bool Whether the currently requested endpoint is protected.
Default false. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
return (bool) apply_filters( 'is_protected_endpoint', false );
```
| Used By | Description |
| --- | --- |
| [is\_protected\_endpoint()](../functions/is_protected_endpoint) wp-includes/load.php | Determines whether we are currently on an endpoint that should be protected against WSODs. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'comment_form_field_comment', string $args_comment_field ) apply\_filters( 'comment\_form\_field\_comment', string $args\_comment\_field )
===============================================================================
Filters the content of the comment textarea field for display.
`$args_comment_field` string The content of the comment textarea field. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
echo apply_filters( 'comment_form_field_comment', $field );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_installed_email', array $installed_email, WP_User $user, string $blog_title, string $blog_url, string $password ) apply\_filters( 'wp\_installed\_email', array $installed\_email, WP\_User $user, string $blog\_title, string $blog\_url, string $password )
===========================================================================================================================================
Filters the contents of the email sent to the site administrator when WordPress is installed.
`$installed_email` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe email address of the recipient.
* `subject`stringThe subject of the email.
* `message`stringThe content of the email.
* `headers`stringHeaders.
`$user` [WP\_User](../classes/wp_user) The site administrator user object. `$blog_title` string The site title. `$blog_url` string The site URL. `$password` string The site administrator's password. Note that a placeholder message is usually passed instead of the user's actual password. File: `wp-admin/includes/upgrade.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/upgrade.php/)
```
$installed_email = apply_filters( 'wp_installed_email', $installed_email, $user, $blog_title, $blog_url, $password );
```
| Used By | Description |
| --- | --- |
| [wp\_new\_blog\_notification()](../functions/wp_new_blog_notification) wp-admin/includes/upgrade.php | Notifies the site admin that the installation of WordPress is complete. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'user_search_columns', string[] $search_columns, string $search, WP_User_Query $query ) apply\_filters( 'user\_search\_columns', string[] $search\_columns, string $search, WP\_User\_Query $query )
============================================================================================================
Filters the columns to search in a [WP\_User\_Query](../classes/wp_user_query) search.
The default columns depend on the search term, and include ‘ID’, ‘user\_login’, ‘user\_email’, ‘user\_url’, ‘user\_nicename’, and ‘display\_name’.
`$search_columns` string[] Array of column names to be searched. `$search` string Text being searched. `$query` [WP\_User\_Query](../classes/wp_user_query) The current [WP\_User\_Query](../classes/wp_user_query) instance. The **user\_search\_columns** filter is used to determine which user fields in the database are used when performing a search on user information.
When the ‘user\_search\_columns’ filter is called, it is passed three parameters: an array of fields to search, the search term, [WP\_User\_Query](../classes/wp_user_query) object
```
<pre>add_filter( 'user_search_columns', 'filter_function_name', 10, 3 );
function filter_function_name( $search_columns, $search, $wp_user_query ) {
// Alter $search_columns to include the fields you want to search on
return $search_columns;
}
```
Where ‘filter\_function\_name’ is the function WordPress should call when the filter is run. Note that the filter function **must** return a value after it is finished processing or the search terms will be empty.
**filter\_function\_name** should be unique function name. It cannot match any other function name already declared
File: `wp-includes/class-wp-user-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-user-query.php/)
```
$search_columns = apply_filters( 'user_search_columns', $search_columns, $search, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_User\_Query::prepare\_query()](../classes/wp_user_query/prepare_query) wp-includes/class-wp-user-query.php | Prepares the query variables. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_untrash_post_status', string $new_status, int $post_id, string $previous_status ) apply\_filters( 'wp\_untrash\_post\_status', string $new\_status, int $post\_id, string $previous\_status )
===========================================================================================================
Filters the status that a post gets assigned when it is restored from the trash (untrashed).
By default posts that are restored will be assigned a status of ‘draft’. Return the value of `$previous_status` in order to assign the status that the post had before it was trashed. The `wp_untrash_post_set_previous_status()` function is available for this.
Prior to WordPress 5.6.0, restored posts were always assigned their original status.
`$new_status` string The new status of the post being restored. `$post_id` int The ID of the post being restored. `$previous_status` string The status of the post at the point where it was trashed. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$post_status = apply_filters( 'wp_untrash_post_status', $new_status, $post_id, $previous_status );
```
| Used By | Description |
| --- | --- |
| [wp\_untrash\_post()](../functions/wp_untrash_post) wp-includes/post.php | Restores a post from the Trash. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'wp_audio_embed_handler', callable $handler ) apply\_filters( 'wp\_audio\_embed\_handler', callable $handler )
================================================================
Filters the audio embed handler callback.
`$handler` callable Audio embed handler callback function. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . implode( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_load\_embeds()](../functions/wp_maybe_load_embeds) wp-includes/embed.php | Determines if default embed handlers should be loaded. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( "_wp_post_revision_field_{$field}", string $revision_field, string $field, WP_Post $compare_from, string $context ) apply\_filters( "\_wp\_post\_revision\_field\_{$field}", string $revision\_field, string $field, WP\_Post $compare\_from, string $context )
===========================================================================================================================================
Contextually filter a post revision field.
The dynamic portion of the hook name, `$field`, corresponds to a name of a field of the revision object.
Possible hook names include:
* `_wp_post_revision_field_post_title`
* `_wp_post_revision_field_post_content`
* `_wp_post_revision_field_post_excerpt`
`$revision_field` string The current revision field to compare to or from. `$field` string The current revision field. `$compare_from` [WP\_Post](../classes/wp_post) The revision post object to compare to or from. `$context` string The context of whether the current revision is the old or the new one. Values are `'to'` or `'from'`. File: `wp-admin/includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/revision.php/)
```
$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';
```
| Used By | Description |
| --- | --- |
| [wp\_get\_revision\_ui\_diff()](../functions/wp_get_revision_ui_diff) wp-admin/includes/revision.php | Get the revision UI diff. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'pre_untrash_post', bool|null $untrash, WP_Post $post, string $previous_status ) apply\_filters( 'pre\_untrash\_post', bool|null $untrash, WP\_Post $post, string $previous\_status )
====================================================================================================
Filters whether a post untrashing should take place.
`$untrash` bool|null Whether to go forward with untrashing. `$post` [WP\_Post](../classes/wp_post) Post object. `$previous_status` string The status of the post at the point where it was trashed. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$check = apply_filters( 'pre_untrash_post', null, $post, $previous_status );
```
| Used By | Description |
| --- | --- |
| [wp\_untrash\_post()](../functions/wp_untrash_post) wp-includes/post.php | Restores a post from the Trash. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The `$previous_status` parameter was added. |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'login_language_dropdown_args', array $args ) apply\_filters( 'login\_language\_dropdown\_args', array $args )
================================================================
Filters default arguments for the Languages select input on the login screen.
The arguments get passed to the [wp\_dropdown\_languages()](../functions/wp_dropdown_languages) function.
`$args` array Arguments for the Languages select input on the login screen. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
wp_dropdown_languages( apply_filters( 'login_language_dropdown_args', $args ) );
```
| Used By | Description |
| --- | --- |
| [login\_footer()](../functions/login_footer) wp-login.php | Outputs the footer for the login page. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress do_action( 'unmature_blog', int $site_id ) do\_action( 'unmature\_blog', int $site\_id )
=============================================
Fires when the ‘mature’ status is removed from a site.
`$site_id` int Site ID. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'unmature_blog', $site_id );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_transition\_site\_statuses\_on\_update()](../functions/wp_maybe_transition_site_statuses_on_update) wp-includes/ms-site.php | Triggers actions on site status updates. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_posts_show_on_front_entry', array $sitemap_entry ) apply\_filters( 'wp\_sitemaps\_posts\_show\_on\_front\_entry', array $sitemap\_entry )
======================================================================================
Filters the sitemap entry for the home page when the ‘show\_on\_front’ option equals ‘posts’.
`$sitemap_entry` array Sitemap entry for the home page. File: `wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php/)
```
$sitemap_entry = apply_filters( 'wp_sitemaps_posts_show_on_front_entry', $sitemap_entry );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Posts::get\_url\_list()](../classes/wp_sitemaps_posts/get_url_list) wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | Gets a URL list for a post type sitemap. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( "manage_{$post->post_type}_posts_custom_column", string $column_name, int $post_id ) do\_action( "manage\_{$post->post\_type}\_posts\_custom\_column", string $column\_name, int $post\_id )
=======================================================================================================
Fires for each custom column of a specific post type in the Posts list table.
The dynamic portion of the hook name, `$post->post_type`, refers to the post type.
Possible hook names include:
* `manage_post_posts_custom_column`
* `manage_page_posts_custom_column`
`$column_name` string The name of the column to display. `$post_id` int The current post ID. This action is called whenever a value for a custom column should be output for a custom post type. Combined with the [manage\_${post\_type}\_posts\_columns](manage_post_type_posts_columns) filter, this allows you to add or remove (unset) custom columns to a list of custom post types.
For built-in post types and multiple custom types, use <manage_posts_custom_column>.
**Terms and Taxonomies**
When passing this function on terms and taxonomies, a third parameter is added.
**$column\_name**
(string) (required) The name of the column to display.
Default: None
**$term\_id**
(int) (required) The ID of the current term. Can also be taken from the global $current\_screen->taxonomy.
Default: None
**$null**
(null) (required) Unused and won’t pass anything.
Default: None
File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID );
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::column\_default()](../classes/wp_posts_list_table/column_default) wp-admin/includes/class-wp-posts-list-table.php | Handles the default column output. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'newblog_notify_siteadmin', string $msg, int|string $blog_id ) apply\_filters( 'newblog\_notify\_siteadmin', string $msg, int|string $blog\_id )
=================================================================================
Filters the message body of the new site activation email sent to the network administrator.
`$msg` string Email body. `$blog_id` int|string The new site's ID as an integer or numeric string. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$msg = apply_filters( 'newblog_notify_siteadmin', $msg, $blog_id );
```
| Used By | Description |
| --- | --- |
| [newblog\_notify\_siteadmin()](../functions/newblog_notify_siteadmin) wp-includes/ms-functions.php | Notifies the network admin that a new site has been activated. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | MU (3.0.0) |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress apply_filters( 'feed_links_extra_show_tag_feed', bool $show ) apply\_filters( 'feed\_links\_extra\_show\_tag\_feed', bool $show )
===================================================================
Filters whether to display the tag feed link.
`$show` bool Whether to display the tag feed link. Default true. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$show_tag_feed = apply_filters( 'feed_links_extra_show_tag_feed', true );
```
| Used By | Description |
| --- | --- |
| [feed\_links\_extra()](../functions/feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'wp_update_term_parent', int $parent, int $term_id, string $taxonomy, array $parsed_args, array $args ) apply\_filters( 'wp\_update\_term\_parent', int $parent, int $term\_id, string $taxonomy, array $parsed\_args, array $args )
============================================================================================================================
Filters the term parent.
Hook to this filter to see if it will cause a hierarchy loop.
`$parent` int ID of the parent term. `$term_id` int Term ID. `$taxonomy` string Taxonomy slug. `$parsed_args` array An array of potentially altered update arguments for the given term. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$parent = (int) apply_filters( 'wp_update_term_parent', $args['parent'], $term_id, $taxonomy, $parsed_args, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'includes_url', string $url, string $path, string|null $scheme ) apply\_filters( 'includes\_url', string $url, string $path, string|null $scheme )
=================================================================================
Filters the URL to the includes directory.
`$url` string The complete URL to the includes directory including scheme and path. `$path` string Path relative to the URL to the wp-includes directory. Blank string if no path is specified. `$scheme` string|null Scheme to give the includes URL context. Accepts `'http'`, `'https'`, `'relative'`, or null. Default null. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'includes_url', $url, $path, $scheme );
```
| Used By | Description |
| --- | --- |
| [includes\_url()](../functions/includes_url) wp-includes/link-template.php | Retrieves the URL to the includes directory. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | The `$scheme` parameter was added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'after_setup_theme' ) do\_action( 'after\_setup\_theme' )
===================================
Fires after the theme is loaded.
This hook is called during each page load, after the theme is initialized. It is generally used to perform basic setup, registration, and init actions for a theme.
File: `wp-settings.php`. [View all references](https://developer.wordpress.org/reference/files/wp-settings.php/)
```
do_action( 'after_setup_theme' );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'img_caption_shortcode_width', int $width, array $atts, string $content ) apply\_filters( 'img\_caption\_shortcode\_width', int $width, array $atts, string $content )
============================================================================================
Filters the width of an image’s caption.
By default, the caption is 10 pixels greater than the width of the image, to prevent post content from running up against a floated image.
* [img\_caption\_shortcode()](../functions/img_caption_shortcode)
`$width` int Width of the caption in pixels. To remove this inline style, return zero. `$atts` array Attributes of the caption shortcode. `$content` string The image element, possibly wrapped in a hyperlink. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$caption_width = apply_filters( 'img_caption_shortcode_width', $width, $atts, $content );
```
| Used By | Description |
| --- | --- |
| [img\_caption\_shortcode()](../functions/img_caption_shortcode) wp-includes/media.php | Builds the Caption shortcode output. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'make_clickable_rel', string $rel, string $url ) apply\_filters( 'make\_clickable\_rel', string $rel, string $url )
==================================================================
Filters the rel value that is added to URL matches converted to links.
`$rel` string The rel value. `$url` string The matched URL being converted to a link tag. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$rel = apply_filters( 'make_clickable_rel', $rel, $url );
```
| Used By | Description |
| --- | --- |
| [\_make\_url\_clickable\_cb()](../functions/_make_url_clickable_cb) wp-includes/formatting.php | Callback to convert URI match to HTML A element. |
| [\_make\_web\_ftp\_clickable\_cb()](../functions/_make_web_ftp_clickable_cb) wp-includes/formatting.php | Callback to convert URL match to HTML A element. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'term_search_min_chars', int $characters, WP_Taxonomy $taxonomy_object, string $search ) apply\_filters( 'term\_search\_min\_chars', int $characters, WP\_Taxonomy $taxonomy\_object, string $search )
=============================================================================================================
Filters the minimum number of characters required to fire a tag search via Ajax.
`$characters` int The minimum number of characters required. Default 2. `$taxonomy_object` [WP\_Taxonomy](../classes/wp_taxonomy) The taxonomy object. `$search` string The search term. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $taxonomy_object, $search );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_ajax\_tag\_search()](../functions/wp_ajax_ajax_tag_search) wp-admin/includes/ajax-actions.php | Ajax handler for tag search. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress do_action( 'delete_comment', string $comment_id, WP_Comment $comment ) do\_action( 'delete\_comment', string $comment\_id, WP\_Comment $comment )
==========================================================================
Fires immediately before a comment is deleted from the database.
`$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The comment to be deleted. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'delete_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_comment()](../functions/wp_delete_comment) wp-includes/comment.php | Trashes or deletes a comment. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$comment` parameter. |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'comment_duplicate_trigger', array $commentdata ) do\_action( 'comment\_duplicate\_trigger', array $commentdata )
===============================================================
Fires immediately after a duplicate comment is detected.
`$commentdata` array Comment data. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'comment_duplicate_trigger', $commentdata );
```
| Used By | Description |
| --- | --- |
| [wp\_allow\_comment()](../functions/wp_allow_comment) wp-includes/comment.php | Validates whether this comment is allowed to be made. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( "in_plugin_update_message-{$file}", array $plugin_data, object $response ) do\_action( "in\_plugin\_update\_message-{$file}", array $plugin\_data, object $response )
==========================================================================================
Fires at the end of the update message container in each row of the plugins list table.
The dynamic portion of the hook name, `$file`, refers to the path of the plugin’s primary file relative to the plugins directory.
`$plugin_data` array An array of plugin metadata. See [get\_plugin\_data()](../functions/get_plugin_data) and the ['plugin\_row\_meta'](plugin_row_meta) filter for the list of possible values. `$response` object An object of metadata about the available plugin update.
* `id`stringPlugin ID, e.g. `w.org/plugins/[plugin-name]`.
* `slug`stringPlugin slug.
* `plugin`stringPlugin basename.
* `new_version`stringNew plugin version.
* `url`stringPlugin URL.
* `package`stringPlugin update package URL.
* `icons`string[]An array of plugin icon URLs.
* `banners`string[]An array of plugin banner URLs.
* `banners_rtl`string[]An array of plugin RTL banner URLs.
* `requires`stringThe version of WordPress which the plugin requires.
* `tested`stringThe version of WordPress the plugin is tested against.
* `requires_php`stringThe version of PHP which the plugin requires.
File: `wp-admin/includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update.php/)
```
do_action( "in_plugin_update_message-{$file}", $plugin_data, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [wp\_plugin\_update\_row()](../functions/wp_plugin_update_row) wp-admin/includes/update.php | Displays update information for a plugin. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_mime_type_icon', string $icon, string $mime, int $post_id ) apply\_filters( 'wp\_mime\_type\_icon', string $icon, string $mime, int $post\_id )
===================================================================================
Filters the mime type icon.
`$icon` string Path to the mime type icon. `$mime` string Mime type. `$post_id` int Attachment ID. Will equal 0 if the function passed the mime type. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_mime\_type\_icon()](../functions/wp_mime_type_icon) wp-includes/post.php | Retrieves the icon for a MIME type or attachment. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'load_image_to_edit', resource|GdImage $image, int $attachment_id, string|int[] $size ) apply\_filters( 'load\_image\_to\_edit', resource|GdImage $image, int $attachment\_id, string|int[] $size )
===========================================================================================================
Filters the current image being loaded for editing.
`$image` resource|GdImage Current image. `$attachment_id` int Attachment ID. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
$image = apply_filters( 'load_image_to_edit', $image, $attachment_id, $size );
```
| Used By | Description |
| --- | --- |
| [load\_image\_to\_edit()](../functions/load_image_to_edit) wp-admin/includes/image.php | Loads an image resource for editing. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'install_themes_tabs', string[] $tabs ) apply\_filters( 'install\_themes\_tabs', string[] $tabs )
=========================================================
Filters the tabs shown on the Add Themes screen.
This filter is for backward compatibility only, for the suppression of the upload tab.
`$tabs` string[] Associative array of the tabs shown on the Add Themes screen. Default is `'upload'`. File: `wp-admin/theme-install.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/theme-install.php/)
```
$tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme\_Install\_List\_Table::prepare\_items()](../classes/wp_theme_install_list_table/prepare_items) wp-admin/includes/class-wp-theme-install-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'manage_sites_custom_column', string $column_name, int $blog_id ) do\_action( 'manage\_sites\_custom\_column', string $column\_name, int $blog\_id )
==================================================================================
Fires for each registered custom column in the Sites list table.
`$column_name` string The name of the column to display. `$blog_id` int The site ID. File: `wp-admin/includes/class-wp-ms-sites-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-sites-list-table.php/)
```
do_action( 'manage_sites_custom_column', $column_name, $item['blog_id'] );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Sites\_List\_Table::column\_default()](../classes/wp_ms_sites_list_table/column_default) wp-admin/includes/class-wp-ms-sites-list-table.php | Handles output for the default column. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action_ref_array( 'wp_feed_options', SimplePie $feed, string|string[] $url ) do\_action\_ref\_array( 'wp\_feed\_options', SimplePie $feed, string|string[] $url )
====================================================================================
Fires just before processing the SimplePie feed object.
`$feed` SimplePie SimplePie feed object (passed by reference). `$url` string|string[] URL of feed or array of URLs of feeds to retrieve. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
```
| Used By | Description |
| --- | --- |
| [fetch\_feed()](../functions/fetch_feed) wp-includes/feed.php | Builds SimplePie object based on RSS or Atom feed from URL. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'editable_extensions', string[] $default_types, string $plugin ) apply\_filters( 'editable\_extensions', string[] $default\_types, string $plugin )
==================================================================================
Filters the list of file types allowed for editing in the plugin file editor.
`$default_types` string[] An array of editable plugin file extensions. `$plugin` string Path to the plugin file relative to the plugins directory. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$file_types = (array) apply_filters( 'editable_extensions', $default_types, $plugin );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_plugin\_file\_editable\_extensions()](../functions/wp_get_plugin_file_editable_extensions) wp-admin/includes/file.php | Gets the list of file extensions that are editable in plugins. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$plugin` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_mail_from', string $from_email ) apply\_filters( 'wp\_mail\_from', string $from\_email )
=======================================================
Filters the email address to send from.
`$from_email` string Email address to send from. * The `wp_mail_from` filter modifies the “from email address” used in an email sent using the [wp\_mail()](../functions/wp_mail) function. When used together with the ‘<wp_mail_from_name>‘ filter, it creates a from address like “Name”. The filter should return an email address.
* To avoid your email being marked as spam, it is highly recommended that your “from” domain match your website.
* Some hosts may require that your “from” address be a legitimate address.
* If you apply your filter using an anonymous function, you cannot remove it using [remove\_filter()](../functions/remove_filter) .
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$from_email = apply_filters( 'wp_mail_from', $from_email );
```
| Used By | Description |
| --- | --- |
| [wp\_mail()](../functions/wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'should_load_separate_core_block_assets', bool $load_separate_assets ) apply\_filters( 'should\_load\_separate\_core\_block\_assets', bool $load\_separate\_assets )
=============================================================================================
Filters whether block styles should be loaded separately.
Returning false loads all core block assets, regardless of whether they are rendered in a page or not. Returning true loads core block assets only when they are rendered.
`$load_separate_assets` bool Whether separate assets will be loaded.
Default false (all block assets are loaded, even when not used). File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
return apply_filters( 'should_load_separate_core_block_assets', false );
```
| Used By | Description |
| --- | --- |
| [wp\_should\_load\_separate\_core\_block\_assets()](../functions/wp_should_load_separate_core_block_assets) wp-includes/script-loader.php | Checks whether separate styles should be loaded for core blocks on-render. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress do_action( "customize_render_panel_{$this->id}" ) do\_action( "customize\_render\_panel\_{$this->id}" )
=====================================================
Fires before rendering a specific Customizer panel.
The dynamic portion of the hook name, `$this->id`, refers to the ID of the specific Customizer panel to be rendered.
File: `wp-includes/class-wp-customize-panel.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-panel.php/)
```
do_action( "customize_render_panel_{$this->id}" );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Panel::maybe\_render()](../classes/wp_customize_panel/maybe_render) wp-includes/class-wp-customize-panel.php | Check capabilities and render the panel. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'upgrader_install_package_result', array|WP_Error $result, array $hook_extra ) apply\_filters( 'upgrader\_install\_package\_result', array|WP\_Error $result, array $hook\_extra )
===================================================================================================
Filters the result of [WP\_Upgrader::install\_package()](../classes/wp_upgrader/install_package).
`$result` array|[WP\_Error](../classes/wp_error) Result from [WP\_Upgrader::install\_package()](../classes/wp_upgrader/install_package). More Arguments from WP\_Upgrader::install\_package( ... $args ) Array or string of arguments for installing a package.
* `source`stringRequired path to the package source.
* `destination`stringRequired path to a folder to install the package in.
* `clear_destination`boolWhether to delete any files already in the destination folder. Default false.
* `clear_working`boolWhether to delete the files from the working directory after copying them to the destination. Default false.
* `abort_if_destination_exists`boolWhether to abort the installation if the destination folder already exists. Default true.
* `hook_extra`arrayExtra arguments to pass to the filter hooks called by [WP\_Upgrader::install\_package()](../classes/wp_upgrader/install_package).
`$hook_extra` array Extra arguments passed to hooked filters. File: `wp-admin/includes/class-wp-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-upgrader.php/)
```
$result = apply_filters( 'upgrader_install_package_result', $result, $options['hook_extra'] );
```
| Used By | Description |
| --- | --- |
| [WP\_Upgrader::run()](../classes/wp_upgrader/run) wp-admin/includes/class-wp-upgrader.php | Run an upgrade/installation. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'wp_img_tag_add_srcset_and_sizes_attr', bool $value, string $image, string $context, int $attachment_id ) apply\_filters( 'wp\_img\_tag\_add\_srcset\_and\_sizes\_attr', bool $value, string $image, string $context, int $attachment\_id )
=================================================================================================================================
Filters whether to add the `srcset` and `sizes` HTML attributes to the img tag. Default `true`.
Returning anything else than `true` will not add the attributes.
`$value` bool The filtered value, defaults to `true`. `$image` string The HTML `img` tag where the attribute should be added. `$context` string Additional context about how the function was called or where the img tag is. `$attachment_id` int The image attachment ID. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$add = apply_filters( 'wp_img_tag_add_srcset_and_sizes_attr', true, $image, $context, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_img\_tag\_add\_srcset\_and\_sizes\_attr()](../functions/wp_img_tag_add_srcset_and_sizes_attr) wp-includes/media.php | Adds `srcset` and `sizes` attributes to an existing `img` HTML tag. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'the_excerpt', string $post_excerpt ) apply\_filters( 'the\_excerpt', string $post\_excerpt )
=======================================================
Filters the displayed post excerpt.
* [get\_the\_excerpt()](../functions/get_the_excerpt)
`$post_excerpt` string The post excerpt. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
echo apply_filters( 'the_excerpt', get_the_excerpt() );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::prepare\_excerpt\_response()](../classes/wp_rest_revisions_controller/prepare_excerpt_response) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Checks the post excerpt and prepare it for single post output. |
| [WP\_REST\_Attachments\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_attachments_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Prepares a single attachment output for response. |
| [WP\_REST\_Posts\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_posts_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Prepares a single post output for response. |
| [the\_excerpt()](../functions/the_excerpt) wp-includes/post-template.php | Displays the post excerpt. |
| [do\_trackbacks()](../functions/do_trackbacks) wp-includes/comment.php | Performs trackbacks. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress do_action_deprecated( 'add_category_form_pre', object $arg ) do\_action\_deprecated( 'add\_category\_form\_pre', object $arg )
=================================================================
This hook has been deprecated. Use [‘{$taxonomy](../functions/%e2%80%98taxonomy)\_pre\_add\_form’} instead.
Fires before the Add Category form.
`$arg` object arguments cast to an object. File: `wp-admin/edit-tags.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-tags.php/)
```
do_action_deprecated( 'add_category_form_pre', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_pre_add_form' );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Use ['{$taxonomy](../functions/taxonomy)\_pre\_add\_form'} instead. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_title', string $title, string $sep, string $seplocation ) apply\_filters( 'wp\_title', string $title, string $sep, string $seplocation )
==============================================================================
Filters the text of the page title.
`$title` string Page title. `$sep` string Title separator. `$seplocation` string Location of the separator (`'left'` or `'right'`). The `wp_title` filter is used to filter the title of the page (called with `[wp\_title()](../functions/wp_title "Function Reference/wp title")`). This filters the text appearing in the HTML <title> tag (sometimes called the “title tag” or “meta title”), not the post, page, or category title.
A plugin (or theme) can register as a content filter with the code:
```
add_filter( 'wp_title', 'filter_function_name', 10, 2 );
```
Where ‘filter\_function\_name’ is the function WordPress should call when the content is being retrieved. Note that the filter function **must** return the content after it is finished processing, or the title will be blank and other plugins also filtering the content may generate errors.
**filter\_function\_name** should be unique function name. It cannot match any other function name already declared.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$title = apply_filters( 'wp_title', $title, $sep, $seplocation );
```
| Used By | Description |
| --- | --- |
| [wp\_title()](../functions/wp_title) wp-includes/general-template.php | Displays or retrieves page title for all areas of blog. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'list_cats', string $element, WP_Term|null $category ) apply\_filters( 'list\_cats', string $element, WP\_Term|null $category )
========================================================================
Filters a taxonomy drop-down display element.
A variety of taxonomy drop-down display elements can be modified just prior to display via this filter. Filterable arguments include ‘show\_option\_none’, ‘show\_option\_all’, and various forms of the term name.
* [wp\_dropdown\_categories()](../functions/wp_dropdown_categories)
`$element` string Category name. `$category` [WP\_Term](../classes/wp_term)|null The category object, or null if there's no corresponding category. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$show_option_none = apply_filters( 'list_cats', $parsed_args['show_option_none'], null );
```
| Used By | Description |
| --- | --- |
| [Walker\_CategoryDropdown::start\_el()](../classes/walker_categorydropdown/start_el) wp-includes/class-walker-category-dropdown.php | Starts the element output. |
| [Walker\_Category::start\_el()](../classes/walker_category/start_el) wp-includes/class-walker-category.php | Starts the element output. |
| [wp\_dropdown\_categories()](../functions/wp_dropdown_categories) wp-includes/category-template.php | Displays or retrieves the HTML dropdown list of categories. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress do_action_ref_array( 'user_profile_update_errors', WP_Error $errors, bool $update, stdClass $user ) do\_action\_ref\_array( 'user\_profile\_update\_errors', WP\_Error $errors, bool $update, stdClass $user )
==========================================================================================================
Fires before user profile update errors are returned.
`$errors` [WP\_Error](../classes/wp_error) [WP\_Error](../classes/wp_error) object (passed by reference). `$update` bool Whether this is a user update. `$user` stdClass User object (passed by reference). This hook runs AFTER [edit\_user\_profile\_update](edit_user_profile_update "Plugin API/Action Reference/edit user profile update") and [personal\_options\_update](personal_options_update "Plugin API/Action Reference/personal options update"). If you want to validate some custom fields before saving, a workaround is to check the $errors array in this same callback, after performing your validations, and save the data if it is empty.
On return, if the errors object contains errors then the save is not completed & the errors displayed to the user.
File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
do_action_ref_array( 'user_profile_update_errors', array( &$errors, $update, &$user ) );
```
| Used By | Description |
| --- | --- |
| [edit\_user()](../functions/edit_user) wp-admin/includes/user.php | Edit user settings based on contents of $\_POST |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'get_post_modified_time', string|int $time, string $format, bool $gmt ) apply\_filters( 'get\_post\_modified\_time', string|int $time, string $format, bool $gmt )
==========================================================================================
Filters the localized time a post was last modified.
`$time` string|int Formatted date string or Unix timestamp if `$format` is `'U'` or `'G'`. `$format` string Format to use for retrieving the time the post was modified.
Accepts `'G'`, `'U'`, or PHP date format. Default `'U'`. `$gmt` bool Whether to retrieve the GMT time. Default false. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'get_post_modified_time', $time, $format, $gmt );
```
| Used By | Description |
| --- | --- |
| [get\_post\_modified\_time()](../functions/get_post_modified_time) wp-includes/general-template.php | Retrieves the time at which the post was last modified. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'theme_file_uri', string $url, string $file ) apply\_filters( 'theme\_file\_uri', string $url, string $file )
===============================================================
Filters the URL to a file in the theme.
`$url` string The file URL. `$file` string The requested file to search for. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'theme_file_uri', $url, $file );
```
| Used By | Description |
| --- | --- |
| [get\_theme\_file\_uri()](../functions/get_theme_file_uri) wp-includes/link-template.php | Retrieves the URL of a file in the theme. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'upgrader_pre_download', bool $reply, string $package, WP_Upgrader $upgrader, array $hook_extra ) apply\_filters( 'upgrader\_pre\_download', bool $reply, string $package, WP\_Upgrader $upgrader, array $hook\_extra )
=====================================================================================================================
Filters whether to return the package.
`$reply` bool Whether to bail without returning the package.
Default false. `$package` string The package file name. `$upgrader` [WP\_Upgrader](../classes/wp_upgrader) The [WP\_Upgrader](../classes/wp_upgrader) instance. `$hook_extra` array Extra arguments passed to hooked filters. File: `wp-admin/includes/class-wp-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-upgrader.php/)
```
$reply = apply_filters( 'upgrader_pre_download', false, $package, $this, $hook_extra );
```
| Used By | Description |
| --- | --- |
| [WP\_Upgrader::download\_package()](../classes/wp_upgrader/download_package) wp-admin/includes/class-wp-upgrader.php | Download a package. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$hook_extra` parameter. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress do_action( 'wp_before_load_template', string $_template_file, bool $require_once, array $args ) do\_action( 'wp\_before\_load\_template', string $\_template\_file, bool $require\_once, array $args )
======================================================================================================
Fires before a template file is loaded.
`$_template_file` string The full path to the template file. `$require_once` bool Whether to require\_once or require. `$args` array Additional arguments passed to the template. File: `wp-includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/template.php/)
```
do_action( 'wp_before_load_template', $_template_file, $require_once, $args );
```
| Used By | Description |
| --- | --- |
| [load\_template()](../functions/load_template) wp-includes/template.php | Requires the template file with WordPress environment. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'trashed_post', int $post_id ) do\_action( 'trashed\_post', int $post\_id )
============================================
Fires after a post is sent to the Trash.
`$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'trashed_post', $post_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::trash\_changeset\_post()](../classes/wp_customize_manager/trash_changeset_post) wp-includes/class-wp-customize-manager.php | Trashes or deletes a changeset post. |
| [wp\_trash\_post()](../functions/wp_trash_post) wp-includes/post.php | Moves a post or page to the Trash |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'plugins_api', false|object|array $result, string $action, object $args ) apply\_filters( 'plugins\_api', false|object|array $result, string $action, object $args )
==========================================================================================
Filters the response for the current WordPress.org Plugin Installation API request.
Returning a non-false value will effectively short-circuit the WordPress.org API request.
If `$action` is ‘query\_plugins’ or ‘plugin\_information’, an object MUST be passed.
If `$action` is ‘hot\_tags’ or ‘hot\_categories’, an array should be passed.
`$result` false|object|array The result object or array. Default false. `$action` string The type of information being requested from the Plugin Installation API. `$args` object Plugin API arguments. File: `wp-admin/includes/plugin-install.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin-install.php/)
```
$res = apply_filters( 'plugins_api', false, $action, $args );
```
| Used By | Description |
| --- | --- |
| [plugins\_api()](../functions/plugins_api) wp-admin/includes/plugin-install.php | Retrieves plugin installer pages from the WordPress.org Plugins API. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'the_title_rss', string $title ) apply\_filters( 'the\_title\_rss', string $title )
==================================================
Filters the post title for use in a feed.
`$title` string The current post title. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
return apply_filters( 'the_title_rss', $title );
```
| Used By | Description |
| --- | --- |
| [get\_the\_title\_rss()](../functions/get_the_title_rss) wp-includes/feed.php | Retrieves the current post title for the feed. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'wp_is_application_passwords_available_for_user', bool $available, WP_User $user ) apply\_filters( 'wp\_is\_application\_passwords\_available\_for\_user', bool $available, WP\_User $user )
=========================================================================================================
Filters whether Application Passwords is available for a specific user.
`$available` bool True if available, false otherwise. `$user` [WP\_User](../classes/wp_user) The user to check. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'wp_is_application_passwords_available_for_user', true, $user );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_application\_passwords\_available\_for\_user()](../functions/wp_is_application_passwords_available_for_user) wp-includes/user.php | Checks if Application Passwords is available for a specific user. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( "create_{$taxonomy}", int $term_id, int $tt_id, array $args ) do\_action( "create\_{$taxonomy}", int $term\_id, int $tt\_id, array $args )
============================================================================
Fires after a new term is created for a specific taxonomy.
The dynamic portion of the hook name, `$taxonomy`, refers to the slug of the taxonomy the term was created for.
Possible hook names include:
* `create_category`
* `create_post_tag`
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$args` array Arguments passed to [wp\_insert\_term()](../functions/wp_insert_term) . More Arguments from wp\_insert\_term( ... $args ) Array or query string of arguments for inserting a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( "create_{$taxonomy}", $term_id, $tt_id, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'disable_categories_dropdown', bool $disable, string $post_type ) apply\_filters( 'disable\_categories\_dropdown', bool $disable, string $post\_type )
====================================================================================
Filters whether to remove the ‘Categories’ drop-down from the post list table.
`$disable` bool Whether to disable the categories drop-down. Default false. `$post_type` string Post type slug. File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
if ( false !== apply_filters( 'disable_categories_dropdown', false, $post_type ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::categories\_dropdown()](../classes/wp_posts_list_table/categories_dropdown) wp-admin/includes/class-wp-posts-list-table.php | Displays a categories drop-down for filtering on the Posts list table. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'add_menu_classes', array $menu ) apply\_filters( 'add\_menu\_classes', array $menu )
===================================================
Filters administration menu array with classes added for top-level items.
`$menu` array Associative array of administration menu items. File: `wp-admin/includes/menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/menu.php/)
```
return apply_filters( 'add_menu_classes', $menu );
```
| Used By | Description |
| --- | --- |
| [add\_menu\_classes()](../functions/add_menu_classes) wp-admin/includes/menu.php | Adds CSS classes for top-level administration menu items. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'wp_get_update_data', array $update_data, array $titles ) apply\_filters( 'wp\_get\_update\_data', array $update\_data, array $titles )
=============================================================================
Filters the returned array of update data for plugins, themes, and WordPress core.
`$update_data` array Fetched update data.
* `counts`arrayAn array of counts for available plugin, theme, and WordPress updates.
* `update_title`stringTitles of available updates.
`$titles` array An array of update counts and UI strings for available updates. File: `wp-includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/update.php/)
```
return apply_filters( 'wp_get_update_data', $update_data, $titles );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_update\_data()](../functions/wp_get_update_data) wp-includes/update.php | Collects counts and UI strings for available updates. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'oembed_iframe_title_attribute', string $title, string $result, object $data, string $url ) apply\_filters( 'oembed\_iframe\_title\_attribute', string $title, string $result, object $data, string $url )
==============================================================================================================
Filters the title attribute of the given oEmbed HTML iframe.
`$title` string The title attribute. `$result` string The oEmbed HTML result. `$data` object A data object result from an oEmbed provider. `$url` string The URL of the content to be embedded. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
$title = apply_filters( 'oembed_iframe_title_attribute', $title, $result, $data, $url );
```
| Used By | Description |
| --- | --- |
| [wp\_filter\_oembed\_iframe\_title\_attribute()](../functions/wp_filter_oembed_iframe_title_attribute) wp-includes/embed.php | Filters the given oEmbed HTML to make sure iframes have a title attribute. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'protected_title_format', string $prepend, WP_Post $post ) apply\_filters( 'protected\_title\_format', string $prepend, WP\_Post $post )
=============================================================================
Filters the text prepended to the post title for protected posts.
The filter is only applied on the front end.
`$prepend` string Text displayed before the post title.
Default 'Protected: %s'. `$post` [WP\_Post](../classes/wp_post) Current post object. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$protected_title_format = apply_filters( 'protected_title_format', $prepend, $post );
```
| Used By | Description |
| --- | --- |
| [get\_the\_title()](../functions/get_the_title) wp-includes/post-template.php | Retrieves the post title. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'edit_comment', int $comment_id, array $data ) do\_action( 'edit\_comment', int $comment\_id, array $data )
============================================================
Fires immediately after a comment is updated in the database.
The hook also fires immediately before comment status transition hooks are fired.
`$comment_id` int The comment ID. `$data` array Comment data. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'edit_comment', $comment_id, $data );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_comment()](../functions/wp_update_comment) wp-includes/comment.php | Updates an existing comment in the database. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$data` parameter. |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'untrashed_post_comments', int $post_id ) do\_action( 'untrashed\_post\_comments', int $post\_id )
========================================================
Fires after comments are restored for a post from the Trash.
`$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'untrashed_post_comments', $post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_untrash\_post\_comments()](../functions/wp_untrash_post_comments) wp-includes/post.php | Restores comments for a post from the Trash. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'feed_links_extra_show_post_comments_feed', bool $show_comments_feed ) apply\_filters( 'feed\_links\_extra\_show\_post\_comments\_feed', bool $show\_comments\_feed )
==============================================================================================
Filters whether to display the post comments feed link.
This filter allows to enable or disable the feed link for a singular post in a way that is independent of [‘feed\_links\_show\_comments\_feed’](feed_links_show_comments_feed) (which controls the global comments feed). The result of that filter is accepted as a parameter.
`$show_comments_feed` bool Whether to display the post comments feed link. Defaults to the ['feed\_links\_show\_comments\_feed'](feed_links_show_comments_feed) filter result. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$show_post_comments_feed = apply_filters( 'feed_links_extra_show_post_comments_feed', $show_comments_feed );
```
| Used By | Description |
| --- | --- |
| [feed\_links\_extra()](../functions/feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'wp_update_comment_type_batch_size', int $comment_batch_size ) apply\_filters( 'wp\_update\_comment\_type\_batch\_size', int $comment\_batch\_size )
=====================================================================================
Filters the comment batch size for updating the comment type.
`$comment_batch_size` int The comment batch size. Default 100. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$comment_batch_size = (int) apply_filters( 'wp_update_comment_type_batch_size', 100 );
```
| Used By | Description |
| --- | --- |
| [\_wp\_batch\_update\_comment\_type()](../functions/_wp_batch_update_comment_type) wp-includes/comment.php | Updates the comment type for a batch of comments. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'set_url_scheme', string $url, string $scheme, string|null $orig_scheme ) apply\_filters( 'set\_url\_scheme', string $url, string $scheme, string|null $orig\_scheme )
============================================================================================
Filters the resulting URL after setting the scheme.
`$url` string The complete URL including scheme and path. `$scheme` string Scheme applied to the URL. One of `'http'`, `'https'`, or `'relative'`. `$orig_scheme` string|null Scheme requested for the URL. One of `'http'`, `'https'`, `'login'`, `'login_post'`, `'admin'`, `'relative'`, `'rest'`, `'rpc'`, or null. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'set_url_scheme', $url, $scheme, $orig_scheme );
```
| Used By | Description |
| --- | --- |
| [set\_url\_scheme()](../functions/set_url_scheme) wp-includes/link-template.php | Sets the scheme for a URL. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_stylesheet_index_url', string $sitemap_url ) apply\_filters( 'wp\_sitemaps\_stylesheet\_index\_url', string $sitemap\_url )
==============================================================================
Filters the URL for the sitemap index stylesheet.
If a falsey value is returned, no stylesheet will be used and the "raw" XML of the sitemap index will be displayed.
`$sitemap_url` string Full URL for the sitemaps index XSL file. File: `wp-includes/sitemaps/class-wp-sitemaps-renderer.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/class-wp-sitemaps-renderer.php/)
```
return apply_filters( 'wp_sitemaps_stylesheet_index_url', $sitemap_url );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Renderer::get\_sitemap\_index\_stylesheet\_url()](../classes/wp_sitemaps_renderer/get_sitemap_index_stylesheet_url) wp-includes/sitemaps/class-wp-sitemaps-renderer.php | Gets the URL for the sitemap index stylesheet. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( "pre_option_{$option}", mixed $pre_option, string $option, mixed $default ) apply\_filters( "pre\_option\_{$option}", mixed $pre\_option, string $option, mixed $default )
==============================================================================================
Filters the value of an existing option before it is retrieved.
The dynamic portion of the hook name, `$option`, refers to the option name.
Returning a value other than false from the filter will short-circuit retrieval and return that value instead.
`$pre_option` mixed The value to return instead of the option value. This differs from `$default`, which is used as the fallback value in the event the option doesn't exist elsewhere in [get\_option()](../functions/get_option) .
Default false (to skip past the short-circuit). `$option` string Option name. `$default` mixed The fallback value to return if the option does not exist.
Default false. * This hook is used to temporarily alter a WordPress option before the display of a specific view. WordPress options (e.g. the blog configuration) are usually set in the back-end by the user or programmatically by a plugin. The options are stored in the database. To alter the value of an option during the rendering of a page without changing it permanently in the database, you may use this hook.
* Example option name {$option} can the following:
`pre_option_posts_per_page
pre_option_posts_per_rss
pre_option_template
pre_option_stylesheet
pre_option_blog_charset
pre_option_home
...`
* For a list of all available options, call
`wp_load_alloptions()`
which returns the list of available options as an array that you could store in a variable or display for debugging purposes.
File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$pre = apply_filters( "pre_option_{$option}", false, $option, $default );
```
| Used By | Description |
| --- | --- |
| [get\_option()](../functions/get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `$default` parameter was added. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$option` parameter was added. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_get_custom_css', string $css, string $stylesheet ) apply\_filters( 'wp\_get\_custom\_css', string $css, string $stylesheet )
=========================================================================
Filters the custom CSS output into the head element.
`$css` string CSS pulled in from the Custom CSS post type. `$stylesheet` string The theme stylesheet name. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
$css = apply_filters( 'wp_get_custom_css', $css, $stylesheet );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_custom\_css()](../functions/wp_get_custom_css) wp-includes/theme.php | Fetches the saved Custom CSS content for rendering. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( "add_{$meta_type}_meta", int $object_id, string $meta_key, mixed $_meta_value ) do\_action( "add\_{$meta\_type}\_meta", int $object\_id, string $meta\_key, mixed $\_meta\_value )
==================================================================================================
Fires immediately before meta of a specific type is added.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Possible hook names include:
* `add_post_meta`
* `add_comment_meta`
* `add_term_meta`
* `add_user_meta`
`$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$_meta_value` mixed Metadata value. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value );
```
| Used By | Description |
| --- | --- |
| [add\_metadata()](../functions/add_metadata) wp-includes/meta.php | Adds metadata for the specified object. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'get_attached_file', string|false $file, int $attachment_id ) apply\_filters( 'get\_attached\_file', string|false $file, int $attachment\_id )
================================================================================
Filters the attached file based on the given ID.
`$file` string|false The file path to where the attached file should be, false otherwise. `$attachment_id` int Attachment ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'get_attached_file', $file, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [get\_attached\_file()](../functions/get_attached_file) wp-includes/post.php | Retrieves attached file path based on attachment ID. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'pre_determine_locale', string|null $locale ) apply\_filters( 'pre\_determine\_locale', string|null $locale )
===============================================================
Filters the locale for the current request prior to the default determination process.
Using this filter allows to override the default logic, effectively short-circuiting the function.
`$locale` string|null The locale to return and short-circuit. Default null. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$determined_locale = apply_filters( 'pre_determine_locale', null );
```
| Used By | Description |
| --- | --- |
| [determine\_locale()](../functions/determine_locale) wp-includes/l10n.php | Determines the current locale desired for the request. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'self_admin_url', string $url, string $path, string $scheme ) apply\_filters( 'self\_admin\_url', string $url, string $path, string $scheme )
===============================================================================
Filters the admin URL for the current site or network depending on context.
`$url` string The complete URL including scheme and path. `$path` string Path relative to the URL. Blank string if no path is specified. `$scheme` string The scheme to use. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'self_admin_url', $url, $path, $scheme );
```
| Used By | Description |
| --- | --- |
| [self\_admin\_url()](../functions/self_admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for either the current site or the network depending on context. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'sidebars_widgets', array $sidebars_widgets ) apply\_filters( 'sidebars\_widgets', array $sidebars\_widgets )
===============================================================
Filters the list of sidebars and their widgets.
`$sidebars_widgets` array An associative array of sidebars and their widgets. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
return apply_filters( 'sidebars_widgets', $sidebars_widgets );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_sidebars\_widgets()](../functions/wp_get_sidebars_widgets) wp-includes/widgets.php | Retrieve full list of sidebars and their widget instance IDs. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'get_template_part', string $slug, string $name, string[] $templates, array $args ) do\_action( 'get\_template\_part', string $slug, string $name, string[] $templates, array $args )
=================================================================================================
Fires before an attempt is made to locate and load a template part.
`$slug` string The slug name for the generic template. `$name` string The name of the specialized template. `$templates` string[] Array of template files to search for, in order. `$args` array Additional arguments passed to the template. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'get_template_part', $slug, $name, $templates, $args );
```
| Used By | Description |
| --- | --- |
| [get\_template\_part()](../functions/get_template_part) wp-includes/general-template.php | Loads a template part into a template. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$args` parameter was added. |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'filesystem_method_file', string $path, string $method ) apply\_filters( 'filesystem\_method\_file', string $path, string $method )
==========================================================================
Filters the path for a specific filesystem method class file.
* [get\_filesystem\_method()](../functions/get_filesystem_method)
`$path` string Path to the specific filesystem method class file. `$method` string The filesystem method to use. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
```
| Used By | Description |
| --- | --- |
| [WP\_Filesystem()](../functions/wp_filesystem) wp-admin/includes/file.php | Initializes and connects the WordPress Filesystem Abstraction classes. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'do_all_pings' ) do\_action( 'do\_all\_pings' )
==============================
Fires immediately after the `do_pings` event to hook services individually.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'do_all_pings' );
```
| Used By | Description |
| --- | --- |
| [do\_all\_pings()](../functions/do_all_pings) wp-includes/comment.php | Performs all pingbacks, enclosures, trackbacks, and sends to pingback services. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'wp_img_tag_add_decoding_attr', string|false|null $value, string $image, string $context ) apply\_filters( 'wp\_img\_tag\_add\_decoding\_attr', string|false|null $value, string $image, string $context )
===============================================================================================================
Filters the `decoding` attribute value to add to an image. Default `async`.
Returning a falsey value will omit the attribute.
`$value` string|false|null The `decoding` attribute value. Returning a falsey value will result in the attribute being omitted for the image.
Otherwise, it may be: `'async'` (default), `'sync'`, or `'auto'`. `$image` string The HTML `img` tag to be filtered. `$context` string Additional context about how the function was called or where the img tag is. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$value = apply_filters( 'wp_img_tag_add_decoding_attr', 'async', $image, $context );
```
| Used By | Description |
| --- | --- |
| [wp\_img\_tag\_add\_decoding\_attr()](../functions/wp_img_tag_add_decoding_attr) wp-includes/media.php | Adds `decoding` attribute to an `img` HTML tag. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( "update_{$meta_type}_meta", int $meta_id, int $object_id, string $meta_key, mixed $_meta_value ) do\_action( "update\_{$meta\_type}\_meta", int $meta\_id, int $object\_id, string $meta\_key, mixed $\_meta\_value )
====================================================================================================================
Fires immediately before updating metadata of a specific type.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Possible hook names include:
* `update_post_meta`
* `update_comment_meta`
* `update_term_meta`
* `update_user_meta`
`$meta_id` int ID of the metadata entry to update. `$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$_meta_value` mixed Metadata value. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
```
| Used By | Description |
| --- | --- |
| [update\_metadata\_by\_mid()](../functions/update_metadata_by_mid) wp-includes/meta.php | Updates metadata by meta ID. |
| [update\_metadata()](../functions/update_metadata) wp-includes/meta.php | Updates metadata for the specified object. If no value already exists for the specified object ID and metadata key, the metadata will be added. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'ms_user_row_actions', string[] $actions, WP_User $user ) apply\_filters( 'ms\_user\_row\_actions', string[] $actions, WP\_User $user )
=============================================================================
Filters the action links displayed under each user in the Network Admin Users list table.
`$actions` string[] An array of action links to be displayed. Default `'Edit'`, `'Delete'`. `$user` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object. File: `wp-admin/includes/class-wp-ms-users-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-users-list-table.php/)
```
$actions = apply_filters( 'ms_user_row_actions', $actions, $user );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Users\_List\_Table::handle\_row\_actions()](../classes/wp_ms_users_list_table/handle_row_actions) wp-admin/includes/class-wp-ms-users-list-table.php | Generates and displays row action links. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress do_action( 'post_updated', int $post_ID, WP_Post $post_after, WP_Post $post_before ) do\_action( 'post\_updated', int $post\_ID, WP\_Post $post\_after, WP\_Post $post\_before )
===========================================================================================
Fires once an existing post has been updated.
`$post_ID` int Post ID. `$post_after` [WP\_Post](../classes/wp_post) Post object following the update. `$post_before` [WP\_Post](../classes/wp_post) Post object before the update. Use this hook whenever you need to compare values **before** and **after** the post update.
This hook runs after the database update.
This hook pass up to 3 arguments, as follows:
* `$post_ID`;
* `$post_after` (post object after the update);
* `$post_before` (post object before the update);
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'post_updated', $post_ID, $post_after, $post_before );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'default_page_template_title', string $label, string $context ) apply\_filters( 'default\_page\_template\_title', string $label, string $context )
==================================================================================
Filters the title of the default page template displayed in the drop-down.
`$label` string The display value for the default page template title. `$context` string Where the option label is displayed. Possible values include `'meta-box'` or `'quick-edit'`. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
$default_title = apply_filters( 'default_page_template_title', __( 'Default template' ), 'meta-box' );
```
| Used By | Description |
| --- | --- |
| [page\_attributes\_meta\_box()](../functions/page_attributes_meta_box) wp-admin/includes/meta-boxes.php | Displays page attributes form fields. |
| [WP\_Posts\_List\_Table::inline\_edit()](../classes/wp_posts_list_table/inline_edit) wp-admin/includes/class-wp-posts-list-table.php | Outputs the hidden row displayed when inline editing |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'update_welcome_user_email', string $welcome_email, int $user_id, string $password, array $meta ) apply\_filters( 'update\_welcome\_user\_email', string $welcome\_email, int $user\_id, string $password, array $meta )
======================================================================================================================
Filters the content of the welcome email after user activation.
Content should be formatted for transmission via [wp\_mail()](../functions/wp_mail) .
`$welcome_email` string The message body of the account activation success email. `$user_id` int User ID. `$password` string User password. `$meta` array Signup meta data. Default empty array. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$welcome_email = apply_filters( 'update_welcome_user_email', $welcome_email, $user_id, $password, $meta );
```
| Used By | Description |
| --- | --- |
| [wpmu\_welcome\_user\_notification()](../functions/wpmu_welcome_user_notification) wp-includes/ms-functions.php | Notifies a user that their account activation has been successful. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'the_excerpt_embed', string $output ) apply\_filters( 'the\_excerpt\_embed', string $output )
=======================================================
Filters the post excerpt for the embed template.
`$output` string The current post excerpt. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
echo apply_filters( 'the_excerpt_embed', $output );
```
| Used By | Description |
| --- | --- |
| [the\_excerpt\_embed()](../functions/the_excerpt_embed) wp-includes/embed.php | Displays the post excerpt for the embed template. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_check_filetype_and_ext', array $wp_check_filetype_and_ext, string $file, string $filename, string[] $mimes, string|false $real_mime ) apply\_filters( 'wp\_check\_filetype\_and\_ext', array $wp\_check\_filetype\_and\_ext, string $file, string $filename, string[] $mimes, string|false $real\_mime )
==================================================================================================================================================================
Filters the “real” file type of the given file.
`$wp_check_filetype_and_ext` array Values for the extension, mime type, and corrected filename.
* `ext`string|falseFile extension, or false if the file doesn't match a mime type.
* `type`string|falseFile mime type, or false if the file doesn't match a mime type.
* `proper_filename`string|falseFile name with its correct extension, or false if it cannot be determined.
`$file` string Full path to the file. `$filename` string The name of the file (may differ from $file due to $file being in a tmp directory). `$mimes` string[] Array of mime types keyed by their file extension regex. `$real_mime` string|false The actual mime type or false if the type cannot be determined. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes, $real_mime );
```
| Used By | Description |
| --- | --- |
| [wp\_check\_filetype\_and\_ext()](../functions/wp_check_filetype_and_ext) wp-includes/functions.php | Attempts to determine the real file type of a file. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | The $real\_mime parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'get_the_tags', WP_Term[]|false|WP_Error $terms ) apply\_filters( 'get\_the\_tags', WP\_Term[]|false|WP\_Error $terms )
=====================================================================
Filters the array of tags for the given post.
* [get\_the\_terms()](../functions/get_the_terms)
`$terms` [WP\_Term](../classes/wp_term)[]|false|[WP\_Error](../classes/wp_error) Array of [WP\_Term](../classes/wp_term) objects on success, false if there are no terms or the post does not exist, [WP\_Error](../classes/wp_error) on failure. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
return apply_filters( 'get_the_tags', $terms );
```
| Used By | Description |
| --- | --- |
| [get\_the\_tags()](../functions/get_the_tags) wp-includes/category-template.php | Retrieves the tags for a post. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'block_categories_all', array[] $block_categories, WP_Block_Editor_Context $block_editor_context ) apply\_filters( 'block\_categories\_all', array[] $block\_categories, WP\_Block\_Editor\_Context $block\_editor\_context )
==========================================================================================================================
Filters the default array of categories for block types.
`$block_categories` array[] Array of categories for block types. `$block_editor_context` [WP\_Block\_Editor\_Context](../classes/wp_block_editor_context) The current block editor context. File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
$block_categories = apply_filters( 'block_categories_all', $block_categories, $block_editor_context );
```
| Used By | Description |
| --- | --- |
| [get\_block\_categories()](../functions/get_block_categories) wp-includes/block-editor.php | Returns all the categories for block types that will be shown in the block editor. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress do_action( 'activate_header' ) do\_action( 'activate\_header' )
================================
Fires before the Site Activation page is loaded.
File: `wp-activate.php`. [View all references](https://developer.wordpress.org/reference/files/wp-activate.php/)
```
do_action( 'activate_header' );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( "term_{$field}_rss", mixed $value, string $taxonomy ) apply\_filters( "term\_{$field}\_rss", mixed $value, string $taxonomy )
=======================================================================
Filters the term field for use in RSS.
The dynamic portion of the hook name, `$field`, refers to the term field.
`$value` mixed Value of the term field. `$taxonomy` string Taxonomy slug. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$value = apply_filters( "term_{$field}_rss", $value, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [sanitize\_term\_field()](../functions/sanitize_term_field) wp-includes/taxonomy.php | Sanitizes the field value in the term based on the context. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action_deprecated( 'delete_blog', int $site_id, bool $drop ) do\_action\_deprecated( 'delete\_blog', int $site\_id, bool $drop )
===================================================================
This hook has been deprecated.
Fires before a site is deleted.
`$site_id` int The site ID. `$drop` bool True if site's table should be dropped. Default false. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action_deprecated( 'delete_blog', array( $old_site->id, true ), '5.1.0' );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_site()](../functions/wp_delete_site) wp-includes/ms-site.php | Deletes a site from the database. |
| [wpmu\_delete\_blog()](../functions/wpmu_delete_blog) wp-admin/includes/ms.php | Delete a site. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | This hook has been deprecated. |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'rest_endpoints', array $endpoints ) apply\_filters( 'rest\_endpoints', array $endpoints )
=====================================================
Filters the array of available REST API endpoints.
`$endpoints` array The available endpoints. An array of matching regex patterns, each mapped to an array of callbacks for the endpoint. These take the format `'/path/regex' => array( $callback, $bitmask )` or ``'/path/regex'` => array( array( $callback, $bitmask ). File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
$endpoints = apply_filters( 'rest_endpoints', $endpoints );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::get\_routes()](../classes/wp_rest_server/get_routes) wp-includes/rest-api/class-wp-rest-server.php | Retrieves the route map. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'wp_print_styles' ) do\_action( 'wp\_print\_styles' )
=================================
Fires before styles in the $handles queue are printed.
Since WordPress 3.3, wp\_print\_styles should not be used to enqueue styles or scripts.
See: <https://make.wordpress.org/core/2011/12/12/use-wp_enqueue_scripts-not-wp_print_styles-to-enqueue-scripts-and-styles-for-the-frontend/>
Use [wp\_enqueue\_scripts](https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts) instead.
File: `wp-includes/functions.wp-styles.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions-wp-styles.php/)
```
do_action( 'wp_print_styles' );
```
| Used By | Description |
| --- | --- |
| [wp\_print\_styles()](../functions/wp_print_styles) wp-includes/functions.wp-styles.php | Display styles that are in the $handles queue. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'edit_form_advanced', WP_Post $post ) do\_action( 'edit\_form\_advanced', WP\_Post $post )
====================================================
Fires after ‘normal’ context meta boxes have been output for all post types other than ‘page’.
`$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-admin/edit-form-advanced.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-form-advanced.php/)
```
do_action( 'edit_form_advanced', $post );
```
| Used By | Description |
| --- | --- |
| [the\_block\_editor\_meta\_box\_post\_form\_hidden\_fields()](../functions/the_block_editor_meta_box_post_form_hidden_fields) wp-admin/includes/post.php | Renders the hidden form required for the meta boxes form. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( '_wp_put_post_revision', int $revision_id ) do\_action( '\_wp\_put\_post\_revision', int $revision\_id )
============================================================
Fires once a revision has been saved.
`$revision_id` int Post revision ID. File: `wp-includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/revision.php/)
```
do_action( '_wp_put_post_revision', $revision_id );
```
| Used By | Description |
| --- | --- |
| [\_wp\_put\_post\_revision()](../functions/_wp_put_post_revision) wp-includes/revision.php | Inserts post data into the posts table as a post revision. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters_deprecated( 'signup_create_blog_meta', array $blog_meta_defaults ) apply\_filters\_deprecated( 'signup\_create\_blog\_meta', array $blog\_meta\_defaults )
=======================================================================================
This hook has been deprecated. Use the [‘add\_signup\_meta’](add_signup_meta) filter instead.
Filters the new site meta variables.
Use the [‘add\_signup\_meta’](add_signup_meta) filter instead.
`$blog_meta_defaults` array An array of default blog meta variables. File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
$meta_defaults = apply_filters_deprecated( 'signup_create_blog_meta', array( $blog_meta_defaults ), '3.0.0', 'add_signup_meta' );
```
| Used By | Description |
| --- | --- |
| [validate\_another\_blog\_signup()](../functions/validate_another_blog_signup) wp-signup.php | Validates a new site sign-up for an existing user. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Use the ['add\_signup\_meta'](add_signup_meta) filter instead. |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'new_site_email', array $new_site_email, WP_Site $site, WP_User $user ) apply\_filters( 'new\_site\_email', array $new\_site\_email, WP\_Site $site, WP\_User $user )
=============================================================================================
Filters the content of the email sent to the Multisite network administrator when a new site is created.
Content should be formatted for transmission via [wp\_mail()](../functions/wp_mail) .
`$new_site_email` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe email address of the recipient.
* `subject`stringThe subject of the email.
* `message`stringThe content of the email.
* `headers`stringHeaders.
`$site` [WP\_Site](../classes/wp_site) Site object of the new site. `$user` [WP\_User](../classes/wp_user) User object of the administrator of the new site. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$new_site_email = apply_filters( 'new_site_email', $new_site_email, $site, $user );
```
| Used By | Description |
| --- | --- |
| [wpmu\_new\_site\_admin\_notification()](../functions/wpmu_new_site_admin_notification) wp-includes/ms-functions.php | Notifies the Multisite network administrator that a new site was created. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'wpmu_validate_user_signup', array $result ) apply\_filters( 'wpmu\_validate\_user\_signup', array $result )
===============================================================
Filters the validated user registration details.
This does not allow you to override the username or email of the user during registration. The values are solely used for validation and error handling.
`$result` array The array of user name, email, and the error messages.
* `user_name`stringSanitized and unique username.
* `orig_username`stringOriginal username.
* `user_email`stringUser email address.
* `errors`[WP\_Error](../classes/wp_error)
[WP\_Error](../classes/wp_error) object containing any errors found.
File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
return apply_filters( 'wpmu_validate_user_signup', $result );
```
| Used By | Description |
| --- | --- |
| [wpmu\_validate\_user\_signup()](../functions/wpmu_validate_user_signup) wp-includes/ms-functions.php | Sanitizes and validates data required for a user sign-up. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'after_delete_post', int $postid, WP_Post $post ) do\_action( 'after\_delete\_post', int $postid, WP\_Post $post )
================================================================
Fires after a post is deleted, at the conclusion of [wp\_delete\_post()](../functions/wp_delete_post) .
* [wp\_delete\_post()](../functions/wp_delete_post)
`$postid` int Post ID. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'after_delete_post', $postid, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_post()](../functions/wp_delete_post) wp-includes/post.php | Trashes or deletes a post or page. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$post` parameter. |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'wp_update_attachment_metadata', array $data, int $attachment_id ) apply\_filters( 'wp\_update\_attachment\_metadata', array $data, int $attachment\_id )
======================================================================================
Filters the updated attachment meta data.
`$data` array Array of updated attachment meta data. `$attachment_id` int Attachment post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_attachment\_metadata()](../functions/wp_update_attachment_metadata) wp-includes/post.php | Updates metadata for an attachment. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'clean_network_cache', int $id ) do\_action( 'clean\_network\_cache', int $id )
==============================================
Fires immediately after a network has been removed from the object cache.
`$id` int Network ID. File: `wp-includes/ms-network.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-network.php/)
```
do_action( 'clean_network_cache', $id );
```
| Used By | Description |
| --- | --- |
| [clean\_network\_cache()](../functions/clean_network_cache) wp-includes/ms-network.php | Removes a network from the object cache. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'style_loader_tag', string $tag, string $handle, string $href, string $media ) apply\_filters( 'style\_loader\_tag', string $tag, string $handle, string $href, string $media )
================================================================================================
Filters the HTML link tag of an enqueued style.
`$tag` string The link tag for the enqueued style. `$handle` string The style's registered handle. `$href` string The stylesheet's source URL. `$media` string The stylesheet's media attribute. File: `wp-includes/class-wp-styles.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes_class-wp-styles-php-2/)
```
$tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media );
```
| Used By | Description |
| --- | --- |
| [WP\_Styles::do\_item()](../classes/wp_styles/do_item) wp-includes/class-wp-styles.php | Processes a style dependency. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced the `$media` parameter. |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced the `$href` parameter. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'customize_changeset_save_data', array $data, array $context ) apply\_filters( 'customize\_changeset\_save\_data', array $data, array $context )
=================================================================================
Filters the settings’ data that will be persisted into the changeset.
Plugins may amend additional data (such as additional meta for settings) into the changeset with this filter.
`$data` array Updated changeset data, mapping setting IDs to arrays containing a $value item and optionally other metadata. `$context` array Filter context.
* `uuid`stringChangeset UUID.
* `title`stringRequested title for the changeset post.
* `status`stringRequested status for the changeset post.
* `date_gmt`stringRequested date for the changeset post in MySQL format and GMT timezone.
* `post_id`int|falsePost ID for the changeset, or false if it doesn't exist yet.
* `previous_data`arrayPrevious data contained in the changeset.
* `manager`[WP\_Customize\_Manager](../classes/wp_customize_manager)Manager instance.
File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
$data = apply_filters( 'customize_changeset_save_data', $data, $filter_context );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::save\_changeset\_post()](../classes/wp_customize_manager/save_changeset_post) wp-includes/class-wp-customize-manager.php | Saves the post for the loaded changeset. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'get_sidebar', string|null $name, array $args ) do\_action( 'get\_sidebar', string|null $name, array $args )
============================================================
Fires before the sidebar template file is loaded.
`$name` string|null Name of the specific sidebar file to use. Null for the default sidebar. `$args` array Additional arguments passed to the sidebar template. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'get_sidebar', $name, $args );
```
| Used By | Description |
| --- | --- |
| [get\_sidebar()](../functions/get_sidebar) wp-includes/general-template.php | Loads sidebar template. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$args` parameter was added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | The `$name` parameter was added. |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'list_pages', string $title, WP_Post $page ) apply\_filters( 'list\_pages', string $title, WP\_Post $page )
==============================================================
Filters the page title when creating an HTML drop-down list of pages.
`$title` string Page title. `$page` [WP\_Post](../classes/wp_post) Page data object. File: `wp-includes/class-walker-page-dropdown.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-page-dropdown.php/)
```
$title = apply_filters( 'list_pages', $title, $page );
```
| Used By | Description |
| --- | --- |
| [Walker\_PageDropdown::start\_el()](../classes/walker_pagedropdown/start_el) wp-includes/class-walker-page-dropdown.php | Starts the element output. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'created_term', int $term_id, int $tt_id, string $taxonomy, array $args ) do\_action( 'created\_term', int $term\_id, int $tt\_id, string $taxonomy, array $args )
========================================================================================
Fires after a new term is created, and after the term cache has been cleaned.
The [‘created\_$taxonomy’](created_taxonomy) hook is also available for targeting a specific taxonomy.
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_insert\_term()](../functions/wp_insert_term) . More Arguments from wp\_insert\_term( ... $args ) Array or query string of arguments for inserting a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'created_term', $term_id, $tt_id, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( "postbox_classes_{$screen_id}_{$box_id}", string[] $classes ) apply\_filters( "postbox\_classes\_{$screen\_id}\_{$box\_id}", string[] $classes )
==================================================================================
Filters the postbox classes for a specific screen and box ID combo.
The dynamic portions of the hook name, `$screen_id` and `$box_id`, refer to the screen ID and meta box ID, respectively.
`$classes` string[] An array of postbox classes. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$classes = apply_filters( "postbox_classes_{$screen_id}_{$box_id}", $classes );
```
| Used By | Description |
| --- | --- |
| [postbox\_classes()](../functions/postbox_classes) wp-admin/includes/post.php | Returns the list of classes to be used by a meta box. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress do_action( 'rest_after_save_widget', string $id, string $sidebar_id, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_after\_save\_widget', string $id, string $sidebar\_id, WP\_REST\_Request $request, bool $creating )
======================================================================================================================
Fires after a widget is created or updated via the REST API.
`$id` string ID of the widget being saved. `$sidebar_id` string ID of the sidebar containing the widget being saved. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating a widget, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php/)
```
do_action( 'rest_after_save_widget', $id, $sidebar_id, $request, $creating );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widgets\_Controller::save\_widget()](../classes/wp_rest_widgets_controller/save_widget) wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php | Saves the widget in the request object. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'wp_fatal_error_handler_enabled', bool $enabled ) apply\_filters( 'wp\_fatal\_error\_handler\_enabled', bool $enabled )
=====================================================================
Filters whether the fatal error handler is enabled.
**Important:** This filter runs before it can be used by plugins. It cannot be used by plugins, mu-plugins, or themes. To use this filter you must define a `$wp_filter` global before WordPress loads, usually in `wp-config.php`.
Example:
```
$GLOBALS['wp_filter'] = array(
'wp_fatal_error_handler_enabled' => array(
10 => array(
array(
'accepted_args' => 0,
'function' => function() {
return false;
},
),
),
),
);
```
Alternatively you can use the `WP_DISABLE_FATAL_ERROR_HANDLER` constant.
`$enabled` bool True if the fatal error handler is enabled, false otherwise. File: `wp-includes/error-protection.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/error-protection.php/)
```
return apply_filters( 'wp_fatal_error_handler_enabled', $enabled );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_fatal\_error\_handler\_enabled()](../functions/wp_is_fatal_error_handler_enabled) wp-includes/error-protection.php | Checks whether the fatal error handler is enabled. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( "delete_{$meta_type}_metadata_by_mid", null|bool $delete, int $meta_id ) apply\_filters( "delete\_{$meta\_type}\_metadata\_by\_mid", null|bool $delete, int $meta\_id )
==============================================================================================
Short-circuits deleting metadata of a specific type by meta ID.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
* `delete_post_metadata_by_mid`
* `delete_comment_metadata_by_mid`
* `delete_term_metadata_by_mid`
* `delete_user_metadata_by_mid`
`$delete` null|bool Whether to allow metadata deletion of the given type. `$meta_id` int Meta ID. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
$check = apply_filters( "delete_{$meta_type}_metadata_by_mid", null, $meta_id );
```
| Used By | Description |
| --- | --- |
| [delete\_metadata\_by\_mid()](../functions/delete_metadata_by_mid) wp-includes/meta.php | Deletes metadata by meta ID. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'enable_live_network_counts', bool $small_network, string $context ) apply\_filters( 'enable\_live\_network\_counts', bool $small\_network, string $context )
========================================================================================
Filters whether to update network site or user counts when a new site is created.
* [wp\_is\_large\_network()](../functions/wp_is_large_network)
`$small_network` bool Whether the network is considered small. `$context` string Context. Either `'users'` or `'sites'`. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_update\_user\_counts()](../functions/wp_maybe_update_user_counts) wp-includes/user.php | Updates the total count of users on the site if live user counting is enabled. |
| [wp\_maybe\_update\_network\_site\_counts()](../functions/wp_maybe_update_network_site_counts) wp-includes/ms-functions.php | Updates the count of sites for the current network. |
| [wp\_maybe\_update\_network\_user\_counts()](../functions/wp_maybe_update_network_user_counts) wp-includes/ms-functions.php | Updates the network-wide users count. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'login_body_class', string[] $classes, string $action ) apply\_filters( 'login\_body\_class', string[] $classes, string $action )
=========================================================================
Filters the login page body classes.
`$classes` string[] An array of body classes. `$action` string The action that brought the visitor to the login page. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
$classes = apply_filters( 'login_body_class', $classes, $action );
```
| Used By | Description |
| --- | --- |
| [login\_header()](../functions/login_header) wp-login.php | Output the login page header. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'strip_shortcodes_tagnames', array $tags_to_remove, string $content ) apply\_filters( 'strip\_shortcodes\_tagnames', array $tags\_to\_remove, string $content )
=========================================================================================
Filters the list of shortcode tags to remove from the content.
`$tags_to_remove` array Array of shortcode tags to remove. `$content` string Content shortcodes are being removed from. File: `wp-includes/shortcodes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/shortcodes.php/)
```
$tags_to_remove = apply_filters( 'strip_shortcodes_tagnames', $tags_to_remove, $content );
```
| Used By | Description |
| --- | --- |
| [strip\_shortcodes()](../functions/strip_shortcodes) wp-includes/shortcodes.php | Removes all shortcode tags from the given content. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'no_texturize_tags', string[] $default_no_texturize_tags ) apply\_filters( 'no\_texturize\_tags', string[] $default\_no\_texturize\_tags )
===============================================================================
Filters the list of HTML elements not to texturize.
`$default_no_texturize_tags` string[] An array of HTML element names. * The ‘`no_texturize_tags`‘ filter allows you to specify which HTML elements should not run through the [wptexturize()](../functions/wptexturize) function.
* By default, WordPress will automatically texturize all post/page content. The texturize process replaces “normal” quotes with “fancy” quotes (aka “smart” quotes or “curly” quotes). Sometimes this is NOT what you want… particularly if your shortcode must contain raw, preprocessed text.
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$no_texturize_tags = apply_filters( 'no_texturize_tags', $default_no_texturize_tags );
```
| Used By | Description |
| --- | --- |
| [wptexturize()](../functions/wptexturize) wp-includes/formatting.php | Replaces common plain text characters with formatted entities. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'sanitize_file_name_chars', string[] $special_chars, string $filename_raw ) apply\_filters( 'sanitize\_file\_name\_chars', string[] $special\_chars, string $filename\_raw )
================================================================================================
Filters the list of characters to remove from a filename.
`$special_chars` string[] Array of characters to remove. `$filename_raw` string The original filename to be sanitized. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
```
| Used By | Description |
| --- | --- |
| [sanitize\_file\_name()](../functions/sanitize_file_name) wp-includes/formatting.php | Sanitizes a filename, replacing whitespace with dashes. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'deactivated_plugin', string $plugin, bool $network_deactivating ) do\_action( 'deactivated\_plugin', string $plugin, bool $network\_deactivating )
================================================================================
Fires after a plugin is deactivated.
If a plugin is silently deactivated (such as during an update), this hook does not fire.
`$plugin` string Path to the plugin file relative to the plugins directory. `$network_deactivating` bool Whether the plugin is deactivated for all sites in the network or just the current site. Multisite only. Default false. This hook is run immediately after any plugin is deactivated, and may be used to detect the deactivation of other plugins.
File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
do_action( 'deactivated_plugin', $plugin, $network_deactivating );
```
| Used By | Description |
| --- | --- |
| [deactivate\_plugins()](../functions/deactivate_plugins) wp-admin/includes/plugin.php | Deactivates a single plugin or multiple plugins. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'register_post', string $sanitized_user_login, string $user_email, WP_Error $errors ) do\_action( 'register\_post', string $sanitized\_user\_login, string $user\_email, WP\_Error $errors )
======================================================================================================
Fires when submitting registration form data, before the user is created.
`$sanitized_user_login` string The submitted username after being sanitized. `$user_email` string The submitted email. `$errors` [WP\_Error](../classes/wp_error) Contains any errors with submitted username and email, e.g., an empty field, an invalid username or email, or an existing username or email. This [action hook](https://codex.wordpress.org/Plugin_API/Action_Reference "Plugin API/Action Reference") can be used to handle post data from a user registration **before** the [registration\_errors](registration_errors "Plugin API/Filter Reference/registration errors") filter is called or errors are returned.
Please note that this hook should **never** be used for custom validation. Any custom validation rules should be performed using the [registration\_errors](registration_errors "Plugin API/Filter Reference/registration errors") filter.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'register_post', $sanitized_user_login, $user_email, $errors );
```
| Used By | Description |
| --- | --- |
| [register\_new\_user()](../functions/register_new_user) wp-includes/user.php | Handles registering a new user. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'clean_taxonomy_cache', string $taxonomy ) do\_action( 'clean\_taxonomy\_cache', string $taxonomy )
========================================================
Fires after a taxonomy’s caches have been cleaned.
`$taxonomy` string Taxonomy slug. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'clean_taxonomy_cache', $taxonomy );
```
| Used By | Description |
| --- | --- |
| [clean\_taxonomy\_cache()](../functions/clean_taxonomy_cache) wp-includes/taxonomy.php | Cleans the caches for a taxonomy. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'secure_signon_cookie', bool $secure_cookie, array $credentials ) apply\_filters( 'secure\_signon\_cookie', bool $secure\_cookie, array $credentials )
====================================================================================
Filters whether to use a secure sign-on cookie.
`$secure_cookie` bool Whether to use a secure sign-on cookie. `$credentials` array Array of entered sign-on data.
* `user_login`stringUsername.
* `user_password`stringPassword entered.
* `remember`boolWhether to `'remember'` the user. Increases the time that the cookie will be kept. Default false.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$secure_cookie = apply_filters( 'secure_signon_cookie', $secure_cookie, $credentials );
```
| Used By | Description |
| --- | --- |
| [wp\_signon()](../functions/wp_signon) wp-includes/user.php | Authenticates and logs a user in with ‘remember’ capability. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'stylesheet_uri', string $stylesheet_uri, string $stylesheet_dir_uri ) apply\_filters( 'stylesheet\_uri', string $stylesheet\_uri, string $stylesheet\_dir\_uri )
==========================================================================================
Filters the URI of the active theme stylesheet.
`$stylesheet_uri` string Stylesheet URI for the active theme/child theme. `$stylesheet_dir_uri` string Stylesheet directory URI for the active theme/child theme. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );
```
| Used By | Description |
| --- | --- |
| [get\_stylesheet\_uri()](../functions/get_stylesheet_uri) wp-includes/theme.php | Retrieves stylesheet URI for the active theme. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'is_post_status_viewable', bool $is_viewable, stdClass $post_status ) apply\_filters( 'is\_post\_status\_viewable', bool $is\_viewable, stdClass $post\_status )
==========================================================================================
Filters whether a post status is considered “viewable”.
The returned filtered value must be a boolean type to ensure `is_post_status_viewable()` only returns a boolean. This strictness is by design to maintain backwards-compatibility and guard against potential type errors in PHP 8.1+. Non-boolean values (even falsey and truthy values) will result in the function returning false.
`$is_viewable` bool Whether the post status is "viewable" (strict type). `$post_status` stdClass Post status object. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return true === apply_filters( 'is_post_status_viewable', $is_viewable, $post_status );
```
| Used By | Description |
| --- | --- |
| [is\_post\_status\_viewable()](../functions/is_post_status_viewable) wp-includes/post.php | Determines whether a post status is considered “viewable”. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'wp_php_error_message', string $message, array $error ) apply\_filters( 'wp\_php\_error\_message', string $message, array $error )
==========================================================================
Filters the message that the default PHP error template displays.
`$message` string HTML error message to display. `$error` array Error information retrieved from `error_get_last()`. File: `wp-includes/class-wp-fatal-error-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-fatal-error-handler.php/)
```
$message = apply_filters( 'wp_php_error_message', $message, $error );
```
| Used By | Description |
| --- | --- |
| [WP\_Fatal\_Error\_Handler::display\_default\_error\_template()](../classes/wp_fatal_error_handler/display_default_error_template) wp-includes/class-wp-fatal-error-handler.php | Displays the default PHP error template. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'plugins_auto_update_enabled', bool $enabled ) apply\_filters( 'plugins\_auto\_update\_enabled', bool $enabled )
=================================================================
Filters whether plugins auto-update is enabled.
`$enabled` bool True if plugins auto-update is enabled, false otherwise. File: `wp-admin/includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update.php/)
```
return apply_filters( 'plugins_auto_update_enabled', $enabled );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_auto\_update\_enabled\_for\_type()](../functions/wp_is_auto_update_enabled_for_type) wp-admin/includes/update.php | Checks whether auto-updates are enabled. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'pre_redirect_guess_404_permalink', null|string|false $pre ) apply\_filters( 'pre\_redirect\_guess\_404\_permalink', null|string|false $pre )
================================================================================
Short-circuits the redirect URL guessing for 404 requests.
Returning a non-null value from the filter will effectively short-circuit the URL guessing, returning the passed value instead.
`$pre` null|string|false Whether to short-circuit guessing the redirect for a 404.
Default null to continue with the URL guessing. File: `wp-includes/canonical.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/canonical.php/)
```
$pre = apply_filters( 'pre_redirect_guess_404_permalink', null );
```
| Used By | Description |
| --- | --- |
| [redirect\_guess\_404\_permalink()](../functions/redirect_guess_404_permalink) wp-includes/canonical.php | Attempts to guess the correct URL for a 404 request based on query vars. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'is_sticky', bool $is_sticky, int $post_id ) apply\_filters( 'is\_sticky', bool $is\_sticky, int $post\_id )
===============================================================
Filters whether a post is sticky.
`$is_sticky` bool Whether a post is sticky. `$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'is_sticky', $is_sticky, $post_id );
```
| Used By | Description |
| --- | --- |
| [is\_sticky()](../functions/is_sticky) wp-includes/post.php | Determines whether a post is sticky. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'author_feed_link', string $link, string $feed ) apply\_filters( 'author\_feed\_link', string $link, string $feed )
==================================================================
Filters the feed link for a given author.
`$link` string The author feed link. `$feed` string Feed type. Possible values include `'rss2'`, `'atom'`. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$link = apply_filters( 'author_feed_link', $link, $feed );
```
| Used By | Description |
| --- | --- |
| [get\_author\_feed\_link()](../functions/get_author_feed_link) wp-includes/link-template.php | Retrieves the feed link for a given author. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'xmlrpc_login_error', IXR_Error $error, WP_Error $user ) apply\_filters( 'xmlrpc\_login\_error', IXR\_Error $error, WP\_Error $user )
============================================================================
Filters the XML-RPC user login error message.
`$error` [IXR\_Error](../classes/ixr_error) The XML-RPC error message. `$user` [WP\_Error](../classes/wp_error) [WP\_Error](../classes/wp_error) object. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
$this->error = apply_filters( 'xmlrpc_login_error', $this->error, $user );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::login()](../classes/wp_xmlrpc_server/login) wp-includes/class-wp-xmlrpc-server.php | Log user in. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress do_action( 'wp_network_dashboard_setup' ) do\_action( 'wp\_network\_dashboard\_setup' )
=============================================
Fires after core widgets for the Network Admin dashboard have been registered.
File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
do_action( 'wp_network_dashboard_setup' );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_setup()](../functions/wp_dashboard_setup) wp-admin/includes/dashboard.php | Registers dashboard widgets. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'add_user_role', int $user_id, string $role ) do\_action( 'add\_user\_role', int $user\_id, string $role )
============================================================
Fires immediately after the user has been given a new role.
`$user_id` int The user ID. `$role` string The new role. File: `wp-includes/class-wp-user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-user.php/)
```
do_action( 'add_user_role', $this->ID, $role );
```
| Used By | Description |
| --- | --- |
| [WP\_User::add\_role()](../classes/wp_user/add_role) wp-includes/class-wp-user.php | Adds role to user. |
| [WP\_User::set\_role()](../classes/wp_user/set_role) wp-includes/class-wp-user.php | Sets the role of the user. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters_ref_array( 'networks_pre_query', array|int|null $network_data, WP_Network_Query $query ) apply\_filters\_ref\_array( 'networks\_pre\_query', array|int|null $network\_data, WP\_Network\_Query $query )
==============================================================================================================
Filters the network data before the query takes place.
Return a non-null value to bypass WordPress’ default network queries.
The expected return type from this filter depends on the value passed in the request query vars:
* When `$this->query_vars['count']` is set, the filter should return the network count as an integer.
* When `'ids' === $this->query_vars['fields']`, the filter should return an array of network IDs.
* Otherwise the filter should return an array of [WP\_Network](../classes/wp_network) objects.
Note that if the filter returns an array of network data, it will be assigned to the `networks` property of the current [WP\_Network\_Query](../classes/wp_network_query) instance.
Filtering functions that require pagination information are encouraged to set the `found_networks` and `max_num_pages` properties of the [WP\_Network\_Query](../classes/wp_network_query) object, passed to the filter by reference. If [WP\_Network\_Query](../classes/wp_network_query) does not perform a database query, it will not have enough information to generate these values itself.
`$network_data` array|int|null Return an array of network data to short-circuit WP's network query, the network count as an integer if `$this->query_vars['count']` is set, or null to allow WP to run its normal queries. `$query` [WP\_Network\_Query](../classes/wp_network_query) The [WP\_Network\_Query](../classes/wp_network_query) instance, passed by reference. File: `wp-includes/class-wp-network-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-network-query.php/)
```
$network_data = apply_filters_ref_array( 'networks_pre_query', array( $network_data, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Network\_Query::get\_networks()](../classes/wp_network_query/get_networks) wp-includes/class-wp-network-query.php | Gets a list of networks matching the query vars. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The returned array of network data is assigned to the `networks` property of the current [WP\_Network\_Query](../classes/wp_network_query) instance. |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'get_terms_fields', string[] $selects, array $args, string[] $taxonomies ) apply\_filters( 'get\_terms\_fields', string[] $selects, array $args, string[] $taxonomies )
============================================================================================
Filters the fields to select in the terms query.
Field lists modified using this filter will only modify the term fields returned by the function when the `$fields` parameter set to ‘count’ or ‘all’. In all other cases, the term fields in the results array will be determined by the `$fields` parameter alone.
Use of this filter can result in unpredictable behavior, and is not recommended.
`$selects` string[] An array of fields to select for the terms query. `$args` array An array of term query arguments. `$taxonomies` string[] An array of taxonomy names. File: `wp-includes/class-wp-term-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-term-query.php/)
```
$fields = implode( ', ', apply_filters( 'get_terms_fields', $selects, $args, $taxonomies ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Term\_Query::get\_terms()](../classes/wp_term_query/get_terms) wp-includes/class-wp-term-query.php | Retrieves the query results. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( "after_plugin_row_{$plugin_file}", string $plugin_file, array $plugin_data, string $status ) do\_action( "after\_plugin\_row\_{$plugin\_file}", string $plugin\_file, array $plugin\_data, string $status )
==============================================================================================================
Fires after each specific row in the Plugins list table.
The dynamic portion of the hook name, `$plugin_file`, refers to the path to the plugin file, relative to the plugins directory.
`$plugin_file` string Path to the plugin file relative to the plugins directory. `$plugin_data` array An array of plugin data. See [get\_plugin\_data()](../functions/get_plugin_data) and the ['plugin\_row\_meta'](plugin_row_meta) filter for the list of possible values. `$status` string Status filter currently applied to the plugin list.
Possible values are: `'all'`, `'active'`, `'inactive'`, `'recently_activated'`, `'upgrade'`, `'mustuse'`, `'dropins'`, `'search'`, `'paused'`, `'auto-update-enabled'`, `'auto-update-disabled'`. File: `wp-admin/includes/class-wp-plugins-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-plugins-list-table.php/)
```
do_action( "after_plugin_row_{$plugin_file}", $plugin_file, $plugin_data, $status );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugins\_List\_Table::single\_row()](../classes/wp_plugins_list_table/single_row) wp-admin/includes/class-wp-plugins-list-table.php | |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added `'auto-update-enabled'` and `'auto-update-disabled'` to possible values for `$status`. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_theme_json_data_user', WP_Theme_JSON_Data ) apply\_filters( 'wp\_theme\_json\_data\_user', WP\_Theme\_JSON\_Data )
======================================================================
Filters the data provided by the user for global styles & settings.
Class to access and update the underlying data. File: `wp-includes/class-wp-theme-json-resolver.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme-json-resolver.php/)
```
$theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme\_JSON\_Resolver::get\_user\_data()](../classes/wp_theme_json_resolver/get_user_data) wp-includes/class-wp-theme-json-resolver.php | Returns the user’s origin config. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'make_ham_blog', int $site_id ) do\_action( 'make\_ham\_blog', int $site\_id )
==============================================
Fires when the ‘spam’ status is removed from a site.
`$site_id` int Site ID. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'make_ham_blog', $site_id );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_transition\_site\_statuses\_on\_update()](../functions/wp_maybe_transition_site_statuses_on_update) wp-includes/ms-site.php | Triggers actions on site status updates. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( 'unarchive_blog', int $site_id ) do\_action( 'unarchive\_blog', int $site\_id )
==============================================
Fires when the ‘archived’ status is removed from a site.
`$site_id` int Site ID. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'unarchive_blog', $site_id );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_transition\_site\_statuses\_on\_update()](../functions/wp_maybe_transition_site_statuses_on_update) wp-includes/ms-site.php | Triggers actions on site status updates. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_mce_translation', array $mce_translation, string $mce_locale ) apply\_filters( 'wp\_mce\_translation', array $mce\_translation, string $mce\_locale )
======================================================================================
Filters translated strings prepared for TinyMCE.
`$mce_translation` array Key/value pairs of strings. `$mce_locale` string Locale. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mce_translation = apply_filters( 'wp_mce_translation', $mce_translation, $mce_locale );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::wp\_mce\_translation()](../classes/_wp_editors/wp_mce_translation) wp-includes/class-wp-editor.php | Translates the default TinyMCE strings and returns them as JSON encoded object ready to be loaded with tinymce.addI18n(), or as JS snippet that should run after tinymce.js is loaded. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'load_default_embeds', bool $maybe_load_embeds ) apply\_filters( 'load\_default\_embeds', bool $maybe\_load\_embeds )
====================================================================
Filters whether to load the default embed handlers.
Returning a falsey value will prevent loading the default embed handlers.
`$maybe_load_embeds` bool Whether to load the embeds library. Default true. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
if ( ! apply_filters( 'load_default_embeds', true ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_load\_embeds()](../functions/wp_maybe_load_embeds) wp-includes/embed.php | Determines if default embed handlers should be loaded. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action_ref_array( 'pre_get_networks', WP_Network_Query $query ) do\_action\_ref\_array( 'pre\_get\_networks', WP\_Network\_Query $query )
=========================================================================
Fires before networks are retrieved.
`$query` [WP\_Network\_Query](../classes/wp_network_query) Current instance of [WP\_Network\_Query](../classes/wp_network_query) (passed by reference). File: `wp-includes/class-wp-network-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-network-query.php/)
```
do_action_ref_array( 'pre_get_networks', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Network\_Query::get\_networks()](../classes/wp_network_query/get_networks) wp-includes/class-wp-network-query.php | Gets a list of networks matching the query vars. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress do_action_ref_array( 'parse_network_query', WP_Network_Query $query ) do\_action\_ref\_array( 'parse\_network\_query', WP\_Network\_Query $query )
============================================================================
Fires after the network query vars have been parsed.
`$query` [WP\_Network\_Query](../classes/wp_network_query) The [WP\_Network\_Query](../classes/wp_network_query) instance (passed by reference). File: `wp-includes/class-wp-network-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-network-query.php/)
```
do_action_ref_array( 'parse_network_query', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Network\_Query::parse\_query()](../classes/wp_network_query/parse_query) wp-includes/class-wp-network-query.php | Parses arguments passed to the network query with default query parameters. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'embed_cache_oembed_types', string[] $post_types ) apply\_filters( 'embed\_cache\_oembed\_types', string[] $post\_types )
======================================================================
Filters the array of post types to cache oEmbed results for.
`$post_types` string[] Array of post type names to cache oEmbed results for. Defaults to post types with `show_ui` set to true. File: `wp-includes/class-wp-embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-embed.php/)
```
$cache_oembed_types = apply_filters( 'embed_cache_oembed_types', $post_types );
```
| Used By | Description |
| --- | --- |
| [WP\_Embed::cache\_oembed()](../classes/wp_embed/cache_oembed) wp-includes/class-wp-embed.php | Triggers a caching of all oEmbed results. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'dbdelta_create_queries', string[] $cqueries ) apply\_filters( 'dbdelta\_create\_queries', string[] $cqueries )
================================================================
Filters the dbDelta SQL queries for creating tables and/or databases.
Queries filterable via this hook contain "CREATE TABLE" or "CREATE DATABASE".
`$cqueries` string[] An array of dbDelta create SQL queries. File: `wp-admin/includes/upgrade.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/upgrade.php/)
```
$cqueries = apply_filters( 'dbdelta_create_queries', $cqueries );
```
| Used By | Description |
| --- | --- |
| [dbDelta()](../functions/dbdelta) wp-admin/includes/upgrade.php | Modifies the database based on specified SQL statements. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress do_action( 'wp_update_comment_count', int $post_id, int $new, int $old ) do\_action( 'wp\_update\_comment\_count', int $post\_id, int $new, int $old )
=============================================================================
Fires immediately after a post’s comment count is updated in the database.
`$post_id` int Post ID. `$new` int The new comment count. `$old` int The old comment count. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'wp_update_comment_count', $post_id, $new, $old );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_comment\_count\_now()](../functions/wp_update_comment_count_now) wp-includes/comment.php | Updates the comment count for the post. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'home_url', string $url, string $path, string|null $orig_scheme, int|null $blog_id ) apply\_filters( 'home\_url', string $url, string $path, string|null $orig\_scheme, int|null $blog\_id )
=======================================================================================================
Filters the home URL.
`$url` string The complete home URL including scheme and path. `$path` string Path relative to the home URL. Blank string if no path is specified. `$orig_scheme` string|null Scheme to give the home URL context. Accepts `'http'`, `'https'`, `'relative'`, `'rest'`, or null. `$blog_id` int|null Site ID, or null for the current site. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );
```
| Used By | Description |
| --- | --- |
| [get\_home\_url()](../functions/get_home_url) wp-includes/link-template.php | Retrieves the URL for a given site where the front end is accessible. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'override_post_lock', bool $override, WP_Post $post, WP_User $user ) apply\_filters( 'override\_post\_lock', bool $override, WP\_Post $post, WP\_User $user )
========================================================================================
Filters whether to allow the post lock to be overridden.
Returning false from the filter will disable the ability to override the post lock.
`$override` bool Whether to allow the post lock to be overridden. Default true. `$post` [WP\_Post](../classes/wp_post) Post object. `$user` [WP\_User](../classes/wp_user) The user with the lock for the post. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$override = apply_filters( 'override_post_lock', true, $post, $user );
```
| Used By | Description |
| --- | --- |
| [\_admin\_notice\_post\_locked()](../functions/_admin_notice_post_locked) wp-admin/includes/post.php | Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress do_action( 'edited_term', int $term_id, int $tt_id, string $taxonomy, array $args ) do\_action( 'edited\_term', int $term\_id, int $tt\_id, string $taxonomy, array $args )
=======================================================================================
Fires after a term has been updated, and the term cache has been cleaned.
The [‘edited\_$taxonomy’](edited_taxonomy) hook is also available for targeting a specific taxonomy.
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'edited_term', $term_id, $tt_id, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'template_include', string $template ) apply\_filters( 'template\_include', string $template )
=======================================================
Filters the path of the current template before including it.
`$template` string The path of the template to include. This filter hook is executed immediately before WordPress includes the predetermined template file. This can be used to override WordPress’s default template behavior.
File: `wp-includes/template-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/template-loader.php/)
```
$template = apply_filters( 'template_include', $template );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters_ref_array( 'sites_clauses', string[] $clauses, WP_Site_Query $query ) apply\_filters\_ref\_array( 'sites\_clauses', string[] $clauses, WP\_Site\_Query $query )
=========================================================================================
Filters the site query clauses.
`$clauses` string[] An associative array of site query clauses. `$query` [WP\_Site\_Query](../classes/wp_site_query) Current instance of [WP\_Site\_Query](../classes/wp_site_query) (passed by reference). File: `wp-includes/class-wp-site-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-site-query.php/)
```
$clauses = apply_filters_ref_array( 'sites_clauses', array( compact( $pieces ), &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Query::get\_site\_ids()](../classes/wp_site_query/get_site_ids) wp-includes/class-wp-site-query.php | Used internally to get a list of site IDs matching the query vars. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( "rest_prepare_{$this->taxonomy}", WP_REST_Response $response, WP_Term $item, WP_REST_Request $request ) apply\_filters( "rest\_prepare\_{$this->taxonomy}", WP\_REST\_Response $response, WP\_Term $item, WP\_REST\_Request $request )
==============================================================================================================================
Filters the term data for a REST API response.
The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `rest_prepare_category`
* `rest_prepare_post_tag`
Allows modification of the term data right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$item` [WP\_Term](../classes/wp_term) The original term object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php/)
```
return apply_filters( "rest_prepare_{$this->taxonomy}", $response, $item, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menus\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_menus_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Prepares a single term output for response. |
| [WP\_REST\_Terms\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_terms_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Prepares a single term output for response. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'default_template_types', array $default_template_types ) apply\_filters( 'default\_template\_types', array $default\_template\_types )
=============================================================================
Filters the list of template types.
`$default_template_types` array An array of template types, formatted as [ slug => [ title, description ] ]. File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
return apply_filters( 'default_template_types', $default_template_types );
```
| Used By | Description |
| --- | --- |
| [get\_default\_block\_template\_types()](../functions/get_default_block_template_types) wp-includes/block-template-utils.php | Returns a filtered list of default template types, containing their localized titles and descriptions. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'wp_read_video_metadata', array $metadata, string $file, string|null $file_format, array $data ) apply\_filters( 'wp\_read\_video\_metadata', array $metadata, string $file, string|null $file\_format, array $data )
====================================================================================================================
Filters the array of metadata retrieved from a video.
In core, usually this selection is what is stored.
More complete data can be parsed from the `$data` parameter.
`$metadata` array Filtered video metadata. `$file` string Path to video file. `$file_format` string|null File format of video, as analyzed by getID3.
Null if unknown. `$data` array Raw metadata from getID3. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
return apply_filters( 'wp_read_video_metadata', $metadata, $file, $file_format, $data );
```
| Used By | Description |
| --- | --- |
| [wp\_read\_video\_metadata()](../functions/wp_read_video_metadata) wp-admin/includes/media.php | Retrieves metadata from a video file’s ID3 tags. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'get_block_file_template', WP_Block_Template|null $block_template, string $id, string $template_type ) apply\_filters( 'get\_block\_file\_template', WP\_Block\_Template|null $block\_template, string $id, string $template\_type )
=============================================================================================================================
Filters the block template object after it has been (potentially) fetched from the theme file.
`$block_template` [WP\_Block\_Template](../classes/wp_block_template)|null The found block template, or null if there is none. `$id` string Template unique identifier (example: theme\_slug//template\_slug). `$template_type` string Template type: `'wp_template'` or '`wp_template_part'`. File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
return apply_filters( 'get_block_file_template', $block_template, $id, $template_type );
```
| Used By | Description |
| --- | --- |
| [get\_block\_file\_template()](../functions/get_block_file_template) wp-includes/block-template-utils.php | Retrieves a unified template object based on a theme file. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress do_action( 'auth_redirect', int $user_id ) do\_action( 'auth\_redirect', int $user\_id )
=============================================
Fires before the authentication redirect.
`$user_id` int User ID. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'auth_redirect', $user_id );
```
| Used By | Description |
| --- | --- |
| [auth\_redirect()](../functions/auth_redirect) wp-includes/pluggable.php | Checks if a user is logged in, if not it redirects them to the login page. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'site_url', string $url, string $path, string|null $scheme, int|null $blog_id ) apply\_filters( 'site\_url', string $url, string $path, string|null $scheme, int|null $blog\_id )
=================================================================================================
Filters the site URL.
`$url` string The complete site URL including scheme and path. `$path` string Path relative to the site URL. Blank string if no path is specified. `$scheme` string|null Scheme to give the site URL context. Accepts `'http'`, `'https'`, `'login'`, `'login_post'`, `'admin'`, `'relative'` or null. `$blog_id` int|null Site ID, or null for the current site. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'site_url', $url, $path, $scheme, $blog_id );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_site\_url\_using\_https()](../functions/wp_is_site_url_using_https) wp-includes/https-detection.php | Checks whether the current site’s URL where WordPress is stored is using HTTPS. |
| [get\_site\_url()](../functions/get_site_url) wp-includes/link-template.php | Retrieves the URL for a given site where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'rest_url_details_http_request_args', array $args, string $url ) apply\_filters( 'rest\_url\_details\_http\_request\_args', array $args, string $url )
=====================================================================================
Filters the HTTP request args for URL data retrieval.
Can be used to adjust response size limit and other [WP\_Http::request()](../classes/wp_http/request) args.
`$args` array Arguments used for the HTTP request. `$url` string The attempted URL. File: `wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php/)
```
$args = apply_filters( 'rest_url_details_http_request_args', $args, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_URL\_Details\_Controller::get\_remote\_url()](../classes/wp_rest_url_details_controller/get_remote_url) wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php | Retrieves the document title from a remote URL. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_exports_dir', string $exports_dir ) apply\_filters( 'wp\_privacy\_exports\_dir', string $exports\_dir )
===================================================================
Filters the directory used to store personal data export files.
`$exports_dir` string Exports directory. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'wp_privacy_exports_dir', $exports_dir );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_exports\_dir()](../functions/wp_privacy_exports_dir) wp-includes/functions.php | Returns the directory used to store personal data export files. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Exports now use relative paths, so changes to the directory via this filter should be reflected on the server. |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress do_action( 'switch_blog', int $new_blog_id, int $prev_blog_id, string $context ) do\_action( 'switch\_blog', int $new\_blog\_id, int $prev\_blog\_id, string $context )
======================================================================================
Fires when the blog is switched.
`$new_blog_id` int New blog ID. `$prev_blog_id` int Previous blog ID. `$context` string Additional context. Accepts `'switch'` when called from [switch\_to\_blog()](../functions/switch_to_blog) or `'restore'` when called from [restore\_current\_blog()](../functions/restore_current_blog) . File: `wp-includes/ms-blogs.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-blogs.php/)
```
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );
```
| Used By | Description |
| --- | --- |
| [switch\_to\_blog()](../functions/switch_to_blog) wp-includes/ms-blogs.php | Switch the current blog. |
| [restore\_current\_blog()](../functions/restore_current_blog) wp-includes/ms-blogs.php | Restore the current blog, after calling [switch\_to\_blog()](../functions/switch_to_blog) . |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | MU (3.0.0) |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress do_action( 'rest_insert_attachment', WP_Post $attachment, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_insert\_attachment', WP\_Post $attachment, WP\_REST\_Request $request, bool $creating )
==========================================================================================================
Fires after a single attachment is created or updated via the REST API.
`$attachment` [WP\_Post](../classes/wp_post) Inserted or updated attachment object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request sent to the API. `$creating` bool True when creating an attachment, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php/)
```
do_action( 'rest_insert_attachment', $attachment, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Attachments\_Controller::insert\_attachment()](../classes/wp_rest_attachments_controller/insert_attachment) wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Inserts the attachment post in the database. Does not update the attachment meta. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( "in_theme_update_message-{$theme_key}", WP_Theme $theme, array $response ) do\_action( "in\_theme\_update\_message-{$theme\_key}", WP\_Theme $theme, array $response )
===========================================================================================
Fires at the end of the update message container in each row of the themes list table.
The dynamic portion of the hook name, `$theme_key`, refers to the theme slug as found in the WordPress.org themes repository.
`$theme` [WP\_Theme](../classes/wp_theme) The [WP\_Theme](../classes/wp_theme) object. `$response` array An array of metadata about the available theme update.
* `new_version`stringNew theme version.
* `url`stringTheme URL.
* `package`stringTheme update package URL.
File: `wp-admin/includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update.php/)
```
do_action( "in_theme_update_message-{$theme_key}", $theme, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [wp\_theme\_update\_row()](../functions/wp_theme_update_row) wp-admin/includes/update.php | Displays update information for a theme. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'deleted_site_transient', string $transient ) do\_action( 'deleted\_site\_transient', string $transient )
===========================================================
Fires after a transient is deleted.
`$transient` string Deleted transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'deleted_site_transient', $transient );
```
| Used By | Description |
| --- | --- |
| [delete\_site\_transient()](../functions/delete_site_transient) wp-includes/option.php | Deletes a site transient. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'default_content', string $post_content, WP_Post $post ) apply\_filters( 'default\_content', string $post\_content, WP\_Post $post )
===========================================================================
Filters the default post content initially used in the “Write Post” form.
`$post_content` string Default post content. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$post->post_content = (string) apply_filters( 'default_content', $post_content, $post );
```
| Used By | Description |
| --- | --- |
| [get\_default\_post\_to\_edit()](../functions/get_default_post_to_edit) wp-admin/includes/post.php | Returns default post information to use when populating the “Write Post” form. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( "rest_{$this->post_type}_trashable", bool $supports_trash, WP_Post $post ) apply\_filters( "rest\_{$this->post\_type}\_trashable", bool $supports\_trash, WP\_Post $post )
===============================================================================================
Filters whether a post is trashable.
The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
Possible hook names include:
* `rest_post_trashable`
* `rest_page_trashable`
* `rest_attachment_trashable`
Pass false to disable Trash support for the post.
`$supports_trash` bool Whether the post type support trashing. `$post` [WP\_Post](../classes/wp_post) The Post object being considered for trashing support. File: `wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php/)
```
$supports_trash = apply_filters( "rest_{$this->post_type}_trashable", $supports_trash, $post );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::delete\_item()](../classes/wp_rest_posts_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Deletes a single post. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'comment_link', string $comment_permalink ) apply\_filters( 'comment\_link', string $comment\_permalink )
=============================================================
Filters the current comment’s permalink.
* [get\_comment\_link()](../functions/get_comment_link)
`$comment_permalink` string The current comment permalink. The **comment\_link** filter provides the ability to alter the links to post comments in the RSS feed.
When the ‘comment\_link’ filter is called, it is passed one parameter: the link.
```
add_filter( 'comment_link', 'filter_function_name', 10, 3 );
function filter_function_name( $link) {
// Manipulate comment link
return $link;
}
```
Where ‘filter\_function\_name’ is the function WordPress should call when the filter is run. Note that the filter function **must** return a value after it is finished processing or the result will be empty.
**filter\_function\_name** should be unique function name. It cannot match any other function name already declared.
File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
echo esc_url( apply_filters( 'comment_link', get_comment_link( $comment ) ) );
```
| Used By | Description |
| --- | --- |
| [comment\_link()](../functions/comment_link) wp-includes/feed.php | Displays the link to the comments. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'get_attached_media', WP_Post[] $children, string $type, WP_Post $post ) apply\_filters( 'get\_attached\_media', WP\_Post[] $children, string $type, WP\_Post $post )
============================================================================================
Filters the list of media attached to the given post.
`$children` [WP\_Post](../classes/wp_post)[] Array of media attached to the given post. `$type` string Mime type of the media desired. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return (array) apply_filters( 'get_attached_media', $children, $type, $post );
```
| Used By | Description |
| --- | --- |
| [get\_attached\_media()](../functions/get_attached_media) wp-includes/media.php | Retrieves media attached to the passed post. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'pre_user_last_name', string $last_name ) apply\_filters( 'pre\_user\_last\_name', string $last\_name )
=============================================================
Filters a user’s last name before the user is created or updated.
`$last_name` string The user's last name. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$meta['last_name'] = apply_filters( 'pre_user_last_name', $last_name );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [2.0.3](https://developer.wordpress.org/reference/since/2.0.3/) | Introduced. |
wordpress apply_filters( 'get_schedule', string|false $schedule, string $hook, array $args ) apply\_filters( 'get\_schedule', string|false $schedule, string $hook, array $args )
====================================================================================
Filters the schedule for a hook.
`$schedule` string|false Schedule for the hook. False if not found. `$hook` string Action hook to execute when cron is run. `$args` array Arguments to pass to the hook's callback function. File: `wp-includes/cron.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/cron.php/)
```
return apply_filters( 'get_schedule', $schedule, $hook, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_schedule()](../functions/wp_get_schedule) wp-includes/cron.php | Retrieve the recurrence schedule for an event. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'get_edit_user_link', string $link, int $user_id ) apply\_filters( 'get\_edit\_user\_link', string $link, int $user\_id )
======================================================================
Filters the user edit link.
`$link` string The edit link. `$user_id` int User ID. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'get_edit_user_link', $link, $user->ID );
```
| Used By | Description |
| --- | --- |
| [get\_edit\_user\_link()](../functions/get_edit_user_link) wp-includes/link-template.php | Retrieves the edit user link. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'wpmu_drop_tables', string[] $tables, int $site_id ) apply\_filters( 'wpmu\_drop\_tables', string[] $tables, int $site\_id )
=======================================================================
Filters the tables to drop when the site is deleted.
`$tables` string[] Array of names of the site tables to be dropped. `$site_id` int The ID of the site to drop tables for. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
$drop_tables = apply_filters( 'wpmu_drop_tables', $tables, $site->id );
```
| Used By | Description |
| --- | --- |
| [wp\_uninitialize\_site()](../functions/wp_uninitialize_site) wp-includes/ms-site.php | Runs the uninitialization routine for a given site. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters_ref_array( 'terms_pre_query', array|null $terms, WP_Term_Query $query ) apply\_filters\_ref\_array( 'terms\_pre\_query', array|null $terms, WP\_Term\_Query $query )
============================================================================================
Filters the terms array before the query takes place.
Return a non-null value to bypass WordPress’ default term queries.
`$terms` array|null Return an array of term data to short-circuit WP's term query, or null to allow WP queries to run normally. `$query` [WP\_Term\_Query](../classes/wp_term_query) The [WP\_Term\_Query](../classes/wp_term_query) instance, passed by reference. File: `wp-includes/class-wp-term-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-term-query.php/)
```
$this->terms = apply_filters_ref_array( 'terms_pre_query', array( $this->terms, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Term\_Query::get\_terms()](../classes/wp_term_query/get_terms) wp-includes/class-wp-term-query.php | Retrieves the query results. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
| programming_docs |
wordpress do_action_ref_array( 'pre_get_sites', WP_Site_Query $query ) do\_action\_ref\_array( 'pre\_get\_sites', WP\_Site\_Query $query )
===================================================================
Fires before sites are retrieved.
`$query` [WP\_Site\_Query](../classes/wp_site_query) Current instance of [WP\_Site\_Query](../classes/wp_site_query) (passed by reference). File: `wp-includes/class-wp-site-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-site-query.php/)
```
do_action_ref_array( 'pre_get_sites', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Query::get\_sites()](../classes/wp_site_query/get_sites) wp-includes/class-wp-site-query.php | Retrieves a list of sites matching the query vars. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'registration_errors', WP_Error $errors, string $sanitized_user_login, string $user_email ) apply\_filters( 'registration\_errors', WP\_Error $errors, string $sanitized\_user\_login, string $user\_email )
================================================================================================================
Filters the errors encountered when a new user is being registered.
The filtered [WP\_Error](../classes/wp_error) object may, for example, contain errors for an invalid or existing username or email address. A [WP\_Error](../classes/wp_error) object should always be returned, but may or may not contain errors.
If any errors are present in $errors, this will abort the user’s registration.
`$errors` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object containing any errors encountered during registration. `$sanitized_user_login` string User's username after it has been sanitized. `$user_email` string User's email. This filter can be used to create custom validation rules on user registration. This fires when the form is submitted but before user information is saved to the database.
When used with other hooks, this filter can be used to create custom registration processes.
The form will not create a new user if any errors are returned. Notice: The function must return the variable $errors in any case (even when there is no error in your logic), otherwise the function may cause this problem: `Fatal error: Call to a member function get_error_code() on a non-object.`
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
```
| Used By | Description |
| --- | --- |
| [register\_new\_user()](../functions/register_new_user) wp-includes/user.php | Handles registering a new user. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_plugin', WP_REST_Response $response, array $item, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_plugin', WP\_REST\_Response $response, array $item, WP\_REST\_Request $request )
================================================================================================================
Filters plugin data for a REST API response.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$item` array The plugin item from [get\_plugin\_data()](../functions/get_plugin_data) . `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php/)
```
return apply_filters( 'rest_prepare_plugin', $response, $item, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Plugins\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_plugins_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php | Prepares the plugin for the REST response. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'the_title_export', string $post_title ) apply\_filters( 'the\_title\_export', string $post\_title )
===========================================================
Filters the post title used for WXR exports.
`$post_title` string Title of the current post. File: `wp-admin/includes/export.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/export.php/)
```
$title = wxr_cdata( apply_filters( 'the_title_export', $post->post_title ) );
```
| Used By | Description |
| --- | --- |
| [export\_wp()](../functions/export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_thumb_file', string $thumbfile, int $post_id ) apply\_filters( 'wp\_get\_attachment\_thumb\_file', string $thumbfile, int $post\_id )
======================================================================================
Filters the attachment thumbnail file path.
`$thumbfile` string File path to the attachment thumbnail. `$post_id` int Attachment ID. The [wp\_get\_attachment\_thumb\_file()](../functions/wp_get_attachment_thumb_file) function fetches the path to the thumbnail file of a given attachment. Just before the function returns the path, the filter is applied and the path to the file and attachment ID are passed as parameters.
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_thumb\_file()](../functions/wp_get_attachment_thumb_file) wp-includes/deprecated.php | Retrieves thumbnail for an attachment. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'add_admin_bar_menus' ) do\_action( 'add\_admin\_bar\_menus' )
======================================
Fires after menus are added to the menu bar.
File: `wp-includes/class-wp-admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-admin-bar.php/)
```
do_action( 'add_admin_bar_menus' );
```
| Used By | Description |
| --- | --- |
| [WP\_Admin\_Bar::add\_menus()](../classes/wp_admin_bar/add_menus) wp-includes/class-wp-admin-bar.php | Adds menus to the admin bar. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'password_reset_expiration', int $expiration ) apply\_filters( 'password\_reset\_expiration', int $expiration )
================================================================
Filters the expiration time of password reset keys.
`$expiration` int The expiration time in seconds. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$expiration_duration = apply_filters( 'password_reset_expiration', DAY_IN_SECONDS );
```
| Used By | Description |
| --- | --- |
| [check\_password\_reset\_key()](../functions/check_password_reset_key) wp-includes/user.php | Retrieves a user row based on password reset key and login. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'wp_save_image_editor_file', bool|null $override, string $filename, WP_Image_Editor $image, string $mime_type, int $post_id ) apply\_filters( 'wp\_save\_image\_editor\_file', bool|null $override, string $filename, WP\_Image\_Editor $image, string $mime\_type, int $post\_id )
=====================================================================================================================================================
Filters whether to skip saving the image file.
Returning a non-null value will short-circuit the save method, returning that value instead.
`$override` bool|null Value to return instead of saving. Default null. `$filename` string Name of the file to be saved. `$image` [WP\_Image\_Editor](../classes/wp_image_editor) The image editor instance. `$mime_type` string The mime type of the image. `$post_id` int Attachment post ID. File: `wp-admin/includes/image-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image-edit.php/)
```
$saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_save\_image\_file()](../functions/wp_save_image_file) wp-admin/includes/image-edit.php | Saves image to file. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'wp_page_menu_args', array $args ) apply\_filters( 'wp\_page\_menu\_args', array $args )
=====================================================
Filters the arguments used to generate a page-based menu.
* [wp\_page\_menu()](../functions/wp_page_menu)
`$args` array An array of page menu arguments. See [wp\_page\_menu()](../functions/wp_page_menu) for information on accepted arguments. More Arguments from wp\_page\_menu( ... $args ) Array or string of arguments to retrieve pages.
* `child_of`intPage ID to return child and grandchild pages of. Note: The value of `$hierarchical` has no bearing on whether `$child_of` returns hierarchical results. Default 0, or no restriction.
* `sort_order`stringHow to sort retrieved pages. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `sort_column`stringWhat columns to sort pages by, comma-separated. Accepts `'post_author'`, `'post_date'`, `'post_title'`, `'post_name'`, `'post_modified'`, `'menu_order'`, `'post_modified_gmt'`, `'post_parent'`, `'ID'`, `'rand'`, `'comment*count'`.
`'post*'` can be omitted for any values that start with it.
Default `'post_title'`.
* `hierarchical`boolWhether to return pages hierarchically. If false in conjunction with `$child_of` also being false, both arguments will be disregarded.
Default true.
* `exclude`int[]Array of page IDs to exclude.
* `include`int[]Array of page IDs to include. Cannot be used with `$child_of`, `$parent`, `$exclude`, `$meta_key`, `$meta_value`, or `$hierarchical`.
* `meta_key`stringOnly include pages with this meta key.
* `meta_value`stringOnly include pages with this meta value. Requires `$meta_key`.
* `authors`stringA comma-separated list of author IDs.
* `parent`intPage ID to return direct children of. Default -1, or no restriction.
* `exclude_tree`string|int[]Comma-separated string or array of page IDs to exclude.
* `number`intThe number of pages to return. Default 0, or all pages.
* `offset`intThe number of pages to skip before returning. Requires `$number`.
Default 0.
* `post_type`stringThe post type to query. Default `'page'`.
* `post_status`string|arrayA comma-separated list or array of post statuses to include.
Default `'publish'`.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$args = apply_filters( 'wp_page_menu_args', $args );
```
| Used By | Description |
| --- | --- |
| [wp\_page\_menu()](../functions/wp_page_menu) wp-includes/post-template.php | Displays or retrieves a list of pages with an optional home link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'nav_menu_meta_box_object', WP_Post_Type|false $post_type ) apply\_filters( 'nav\_menu\_meta\_box\_object', WP\_Post\_Type|false $post\_type )
==================================================================================
Filters whether a menu items meta box will be added for the current object type.
If a falsey value is returned instead of an object, the menu items meta box for the current meta box object will not be added.
`$post_type` [WP\_Post\_Type](../classes/wp_post_type)|false The current object to add a menu items meta box for. File: `wp-admin/includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/nav-menu.php/)
```
$post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_menu\_get\_metabox()](../functions/wp_ajax_menu_get_metabox) wp-admin/includes/ajax-actions.php | Ajax handler for retrieving menu meta boxes. |
| [wp\_nav\_menu\_post\_type\_meta\_boxes()](../functions/wp_nav_menu_post_type_meta_boxes) wp-admin/includes/nav-menu.php | Creates meta boxes for any post type menu item. |
| [wp\_nav\_menu\_taxonomy\_meta\_boxes()](../functions/wp_nav_menu_taxonomy_meta_boxes) wp-admin/includes/nav-menu.php | Creates meta boxes for any taxonomy menu item. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'site_allowed_themes', string[] $allowed_themes, int $blog_id ) apply\_filters( 'site\_allowed\_themes', string[] $allowed\_themes, int $blog\_id )
===================================================================================
Filters the array of themes allowed on the site.
`$allowed_themes` string[] An array of theme stylesheet names. `$blog_id` int ID of the site. Defaults to current site. File: `wp-includes/class-wp-theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme.php/)
```
return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme::get\_allowed\_on\_site()](../classes/wp_theme/get_allowed_on_site) wp-includes/class-wp-theme.php | Returns array of stylesheet names of themes allowed on the site. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'load_default_widgets', bool $wp_maybe_load_widgets ) apply\_filters( 'load\_default\_widgets', bool $wp\_maybe\_load\_widgets )
==========================================================================
Filters whether to load the Widgets library.
Returning a falsey value from the filter will effectively short-circuit the Widgets library from loading.
`$wp_maybe_load_widgets` bool Whether to load the Widgets library.
Default true. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
if ( ! apply_filters( 'load_default_widgets', true ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_load\_widgets()](../functions/wp_maybe_load_widgets) wp-includes/functions.php | Determines if Widgets library should be loaded. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'enqueue_block_assets' ) do\_action( 'enqueue\_block\_assets' )
======================================
Fires after enqueuing block assets for both editor and front-end.
Call `add_action` on any hook before ‘wp\_enqueue\_scripts’.
In the function call you supply, simply use `wp_enqueue_script` and `wp_enqueue_style` to add your functionality to the Gutenberg editor.
File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
do_action( 'enqueue_block_assets' );
```
| Used By | Description |
| --- | --- |
| [wp\_common\_block\_scripts\_and\_styles()](../functions/wp_common_block_scripts_and_styles) wp-includes/script-loader.php | Handles the enqueueing of block scripts and styles that are common to both the editor and the front-end. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'get_comment', WP_Comment $_comment ) apply\_filters( 'get\_comment', WP\_Comment $\_comment )
========================================================
Fires after a comment is retrieved.
`$_comment` [WP\_Comment](../classes/wp_comment) Comment data. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$_comment = apply_filters( 'get_comment', $_comment );
```
| Used By | Description |
| --- | --- |
| [get\_comment()](../functions/get_comment) wp-includes/comment.php | Retrieves comment data given a comment ID or comment object. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( "get_the_generator_{$type}", string $gen, string $type ) apply\_filters( "get\_the\_generator\_{$type}", string $gen, string $type )
===========================================================================
Filters the HTML for the retrieved generator type.
The dynamic portion of the hook name, `$type`, refers to the generator type.
Possible hook names include:
* `get_the_generator_atom`
* `get_the_generator_comment`
* `get_the_generator_export`
* `get_the_generator_html`
* `get_the_generator_rdf`
* `get_the_generator_rss2`
* `get_the_generator_xhtml`
`$gen` string The HTML markup output to [wp\_head()](../functions/wp_head) . `$type` string The type of generator. Accepts `'html'`, `'xhtml'`, `'atom'`, `'rss2'`, `'rdf'`, `'comment'`, `'export'`. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( "get_the_generator_{$type}", $gen, $type );
```
| Used By | Description |
| --- | --- |
| [get\_the\_generator()](../functions/get_the_generator) wp-includes/general-template.php | Creates the generator XML or Comment for RSS, ATOM, etc. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_audio_shortcode', string $html, array $atts, string $audio, int $post_id, string $library ) apply\_filters( 'wp\_audio\_shortcode', string $html, array $atts, string $audio, int $post\_id, string $library )
==================================================================================================================
Filters the audio shortcode output.
`$html` string Audio shortcode HTML output. `$atts` array Array of audio shortcode attributes. `$audio` string Audio file. `$post_id` int Post ID. `$library` string Media library used for the audio shortcode. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );
```
| Used By | Description |
| --- | --- |
| [wp\_audio\_shortcode()](../functions/wp_audio_shortcode) wp-includes/media.php | Builds the Audio shortcode output. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'tag_link', string $termlink, int $term_id ) apply\_filters( 'tag\_link', string $termlink, int $term\_id )
==============================================================
Filters the tag link.
`$termlink` string Tag link URL. `$term_id` int Term ID. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$termlink = apply_filters( 'tag_link', $termlink, $term->term_id );
```
| Used By | Description |
| --- | --- |
| [get\_term\_link()](../functions/get_term_link) wp-includes/taxonomy.php | Generates a permalink for a taxonomy term archive. |
| Version | Description |
| --- | --- |
| [5.4.1](https://developer.wordpress.org/reference/since/5.4.1/) | Restored (un-deprecated). |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Deprecated in favor of ['term\_link'](term_link) filter. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'gallery_style', string $gallery_style ) apply\_filters( 'gallery\_style', string $gallery\_style )
==========================================================
Filters the default gallery shortcode CSS styles.
`$gallery_style` string Default CSS styles and opening HTML div container for the gallery shortcode output. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );
```
| Used By | Description |
| --- | --- |
| [gallery\_shortcode()](../functions/gallery_shortcode) wp-includes/media.php | Builds the Gallery shortcode output. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( "nav_menu_items_{$post_type_name}_recent", WP_Post[] $most_recent, array $args, array $box, array $recent_args ) apply\_filters( "nav\_menu\_items\_{$post\_type\_name}\_recent", WP\_Post[] $most\_recent, array $args, array $box, array $recent\_args )
=========================================================================================================================================
Filters the posts displayed in the ‘Most Recent’ tab of the current post type’s menu items meta box.
The dynamic portion of the hook name, `$post_type_name`, refers to the post type name.
Possible hook names include:
* `nav_menu_items_post_recent`
* `nav_menu_items_page_recent`
`$most_recent` [WP\_Post](../classes/wp_post)[] An array of post objects being listed. `$args` array An array of `WP_Query` arguments for the meta box. `$box` array Arguments passed to `wp_nav_menu_item_post_type_meta_box()`. `$recent_args` array An array of `WP_Query` arguments for 'Most Recent' tab. File: `wp-admin/includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/nav-menu.php/)
```
$most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box, $recent_args );
```
| Used By | Description |
| --- | --- |
| [wp\_nav\_menu\_item\_post\_type\_meta\_box()](../functions/wp_nav_menu_item_post_type_meta_box) wp-admin/includes/nav-menu.php | Displays a meta box for a post type menu item. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$recent_args` parameter. |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'user_erasure_fulfillment_email_headers', string|array $headers, string $subject, string $content, int $request_id, array $email_data ) apply\_filters( 'user\_erasure\_fulfillment\_email\_headers', string|array $headers, string $subject, string $content, int $request\_id, array $email\_data )
=============================================================================================================================================================
Filters the headers of the data erasure fulfillment notification.
`$headers` string|array The email headers. `$subject` string The email subject. `$content` string The email content. `$request_id` int The request ID. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `message_recipient`stringThe address that the email will be sent to. Defaults to the value of `$request->email`, but can be changed by the `user_erasure_fulfillment_email_to` filter.
* `privacy_policy_url`stringPrivacy policy URL.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$headers = apply_filters( 'user_erasure_fulfillment_email_headers', $headers, $subject, $content, $request_id, $email_data );
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_erasure\_fulfillment\_notification()](../functions/_wp_privacy_send_erasure_fulfillment_notification) wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress do_action( 'update_postmeta', int $meta_id, int $object_id, string $meta_key, mixed $meta_value ) do\_action( 'update\_postmeta', int $meta\_id, int $object\_id, string $meta\_key, mixed $meta\_value )
=======================================================================================================
Fires immediately before updating a post’s metadata.
`$meta_id` int ID of metadata entry to update. `$object_id` int Post ID. `$meta_key` string Metadata key. `$meta_value` mixed Metadata value. This will be a PHP-serialized string representation of the value if the value is an array, an object, or itself a PHP-serialized string. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
```
| Used By | Description |
| --- | --- |
| [update\_metadata\_by\_mid()](../functions/update_metadata_by_mid) wp-includes/meta.php | Updates metadata by meta ID. |
| [update\_metadata()](../functions/update_metadata) wp-includes/meta.php | Updates metadata for the specified object. If no value already exists for the specified object ID and metadata key, the metadata will be added. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_new_user_notification_email', array $wp_new_user_notification_email, WP_User $user, string $blogname ) apply\_filters( 'wp\_new\_user\_notification\_email', array $wp\_new\_user\_notification\_email, WP\_User $user, string $blogname )
===================================================================================================================================
Filters the contents of the new user notification email sent to the new user.
`$wp_new_user_notification_email` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe intended recipient - New user email address.
* `subject`stringThe subject of the email.
* `message`stringThe body of the email.
* `headers`stringThe headers of the email.
`$user` [WP\_User](../classes/wp_user) User object for new user. `$blogname` string The site title. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$wp_new_user_notification_email = apply_filters( 'wp_new_user_notification_email', $wp_new_user_notification_email, $user, $blogname );
```
| Used By | Description |
| --- | --- |
| [wp\_new\_user\_notification()](../functions/wp_new_user_notification) wp-includes/pluggable.php | Emails login credentials to a newly-registered user. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( "widget_{$this->id_base}_instance_schema", array $schema, WP_Widget_Media $widget ) apply\_filters( "widget\_{$this->id\_base}\_instance\_schema", array $schema, WP\_Widget\_Media $widget )
=========================================================================================================
Filters the media widget instance schema to add additional properties.
`$schema` array Instance schema. `$widget` [WP\_Widget\_Media](../classes/wp_widget_media) Widget object. File: `wp-includes/widgets/class-wp-widget-media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-media.php/)
```
$schema = apply_filters( "widget_{$this->id_base}_instance_schema", $schema, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Media\_Gallery::get\_instance\_schema()](../classes/wp_widget_media_gallery/get_instance_schema) wp-includes/widgets/class-wp-widget-media-gallery.php | Get schema for properties of a widget instance (item). |
| [WP\_Widget\_Media::get\_instance\_schema()](../classes/wp_widget_media/get_instance_schema) wp-includes/widgets/class-wp-widget-media.php | Get schema for properties of a widget instance (item). |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'wp_content_img_tag', string $filtered_image, string $context, int $attachment_id ) apply\_filters( 'wp\_content\_img\_tag', string $filtered\_image, string $context, int $attachment\_id )
========================================================================================================
Filters an img tag within the content for a given context.
`$filtered_image` string Full img tag with attributes that will replace the source img tag. `$context` string Additional context, like the current filter name or the function name from where this was called. `$attachment_id` int The image attachment ID. May be 0 in case the image is not an attachment. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$filtered_image = apply_filters( 'wp_content_img_tag', $filtered_image, $context, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_filter\_content\_tags()](../functions/wp_filter_content_tags) wp-includes/media.php | Filters specific tags in post content and modifies their markup. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters_ref_array( 'users_pre_query', array|null $results, WP_User_Query $query ) apply\_filters\_ref\_array( 'users\_pre\_query', array|null $results, WP\_User\_Query $query )
==============================================================================================
Filters the users array before the query takes place.
Return a non-null value to bypass WordPress’ default user queries.
Filtering functions that require pagination information are encouraged to set the `total_users` property of the [WP\_User\_Query](../classes/wp_user_query) object, passed to the filter by reference. If [WP\_User\_Query](../classes/wp_user_query) does not perform a database query, it will not have enough information to generate these values itself.
`$results` array|null Return an array of user data to short-circuit WP's user query or null to allow WP to run its normal queries. `$query` [WP\_User\_Query](../classes/wp_user_query) The [WP\_User\_Query](../classes/wp_user_query) instance (passed by reference). File: `wp-includes/class-wp-user-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-user-query.php/)
```
$this->results = apply_filters_ref_array( 'users_pre_query', array( null, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_User\_Query::query()](../classes/wp_user_query/query) wp-includes/class-wp-user-query.php | Executes the query, with the current variables. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'template_directory_uri', string $template_dir_uri, string $template, string $theme_root_uri ) apply\_filters( 'template\_directory\_uri', string $template\_dir\_uri, string $template, string $theme\_root\_uri )
====================================================================================================================
Filters the active theme directory URI.
`$template_dir_uri` string The URI of the active theme directory. `$template` string Directory name of the active theme. `$theme_root_uri` string The themes root URI. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'template_directory_uri', $template_dir_uri, $template, $theme_root_uri );
```
| Used By | Description |
| --- | --- |
| [get\_template\_directory\_uri()](../functions/get_template_directory_uri) wp-includes/theme.php | Retrieves template directory URI for the active theme. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'rest_delete_user', WP_User $user, WP_REST_Response $response, WP_REST_Request $request ) do\_action( 'rest\_delete\_user', WP\_User $user, WP\_REST\_Response $response, WP\_REST\_Request $request )
============================================================================================================
Fires immediately after a user is deleted via the REST API.
`$user` [WP\_User](../classes/wp_user) The user data. `$response` [WP\_REST\_Response](../classes/wp_rest_response) The response returned from the API. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request sent to the API. File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
do_action( 'rest_delete_user', $user, $response, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::delete\_item()](../classes/wp_rest_users_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Deletes a single user. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'oembed_discovery_links', string $output ) apply\_filters( 'oembed\_discovery\_links', string $output )
============================================================
Filters the oEmbed discovery links HTML.
`$output` string HTML of the discovery links. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
echo apply_filters( 'oembed_discovery_links', $output );
```
| Used By | Description |
| --- | --- |
| [wp\_oembed\_add\_discovery\_links()](../functions/wp_oembed_add_discovery_links) wp-includes/embed.php | Adds oEmbed discovery links in the head element of the website. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_text_filters', array $filters ) apply\_filters( 'xmlrpc\_text\_filters', array $filters )
=========================================================
Filters the MoveableType text filters list for XML-RPC.
`$filters` array An array of text filters. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
return apply_filters( 'xmlrpc_text_filters', array() );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::mt\_supportedTextFilters()](../classes/wp_xmlrpc_server/mt_supportedtextfilters) wp-includes/class-wp-xmlrpc-server.php | Retrieve an empty array because we don’t support per-post text filters. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'wp_iframe_tag_add_loading_attr', string|bool $value, string $iframe, string $context ) apply\_filters( 'wp\_iframe\_tag\_add\_loading\_attr', string|bool $value, string $iframe, string $context )
============================================================================================================
Filters the `loading` attribute value to add to an iframe. Default `lazy`.
Returning `false` or an empty string will not add the attribute.
Returning `true` will add the default value.
`$value` string|bool The `loading` attribute value. Returning a falsey value will result in the attribute being omitted for the iframe. `$iframe` string The HTML `iframe` tag to be filtered. `$context` string Additional context about how the function was called or where the iframe tag is. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$value = apply_filters( 'wp_iframe_tag_add_loading_attr', $value, $iframe, $context );
```
| Used By | Description |
| --- | --- |
| [wp\_iframe\_tag\_add\_loading\_attr()](../functions/wp_iframe_tag_add_loading_attr) wp-includes/media.php | Adds `loading` attribute to an `iframe` HTML tag. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress do_action( 'wp_add_nav_menu_item', int $menu_id, int $menu_item_db_id, array $args ) do\_action( 'wp\_add\_nav\_menu\_item', int $menu\_id, int $menu\_item\_db\_id, array $args )
=============================================================================================
Fires immediately after a new navigation menu item has been added.
* [wp\_update\_nav\_menu\_item()](../functions/wp_update_nav_menu_item)
`$menu_id` int ID of the updated menu. `$menu_item_db_id` int ID of the new menu item. `$args` array An array of arguments used to update/add the menu item. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
do_action( 'wp_add_nav_menu_item', $menu_id, $menu_item_db_id, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_nav\_menu\_item()](../functions/wp_update_nav_menu_item) wp-includes/nav-menu.php | Saves the properties of a menu item or create a new one. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_normalize_site_data', array $data ) apply\_filters( 'wp\_normalize\_site\_data', array $data )
==========================================================
Filters passed site data in order to normalize it.
`$data` array Associative array of site data passed to the respective function.
See [wp\_insert\_site()](../functions/wp_insert_site) for the possibly included data. More Arguments from wp\_insert\_site( ... $data ) Data for the new site that should be inserted.
* `domain`stringSite domain. Default empty string.
* `path`stringSite path. Default `'/'`.
* `network_id`intThe site's network ID. Default is the current network ID.
* `registered`stringWhen the site was registered, in SQL datetime format. Default is the current time.
* `last_updated`stringWhen the site was last updated, in SQL datetime format. Default is the value of $registered.
* `public`intWhether the site is public. Default 1.
* `archived`intWhether the site is archived. Default 0.
* `mature`intWhether the site is mature. Default 0.
* `spam`intWhether the site is spam. Default 0.
* `deleted`intWhether the site is deleted. Default 0.
* `lang_id`intThe site's language ID. Currently unused. Default 0.
* `user_id`intUser ID for the site administrator. Passed to the `wp_initialize_site` hook.
* `title`stringSite title. Default is 'Site %d' where %d is the site ID. Passed to the `wp_initialize_site` hook.
* `options`arrayCustom option $key => $value pairs to use. Default empty array. Passed to the `wp_initialize_site` hook.
* `meta`arrayCustom site metadata $key => $value pairs to use. Default empty array.
Passed to the `wp_initialize_site` hook.
File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
$data = apply_filters( 'wp_normalize_site_data', $data );
```
| Used By | Description |
| --- | --- |
| [wp\_prepare\_site\_data()](../functions/wp_prepare_site_data) wp-includes/ms-site.php | Prepares site data for insertion or update in the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'teeny_mce_plugins', array $plugins, string $editor_id ) apply\_filters( 'teeny\_mce\_plugins', array $plugins, string $editor\_id )
===========================================================================
Filters the list of teenyMCE plugins.
`$plugins` array An array of teenyMCE plugins. `$editor_id` string Unique editor identifier, e.g. `'content'`. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$plugins = apply_filters(
'teeny_mce_plugins',
array(
'colorpicker',
'lists',
'fullscreen',
'image',
'wordpress',
'wpeditimage',
'wplink',
),
$editor_id
);
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | The `$editor_id` parameter was added. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'feed_links_extra_show_tax_feed', bool $show ) apply\_filters( 'feed\_links\_extra\_show\_tax\_feed', bool $show )
===================================================================
Filters whether to display the custom taxonomy feed link.
`$show` bool Whether to display the custom taxonomy feed link. Default true. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$show_tax_feed = apply_filters( 'feed_links_extra_show_tax_feed', true );
```
| Used By | Description |
| --- | --- |
| [feed\_links\_extra()](../functions/feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'deprecated_function_run', string $function, string $replacement, string $version ) do\_action( 'deprecated\_function\_run', string $function, string $replacement, string $version )
=================================================================================================
Fires when a deprecated function is called.
`$function` string The function that was called. `$replacement` string The function that should have been called. `$version` string The version of WordPress that deprecated the function. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
do_action( 'deprecated_function_run', $function, $replacement, $version );
```
| Used By | Description |
| --- | --- |
| [\_deprecated\_function()](../functions/_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'disable_captions', bool $bool ) apply\_filters( 'disable\_captions', bool $bool )
=================================================
Filters whether to disable captions.
Prevents image captions from being appended to image HTML when inserted into the editor.
`$bool` bool Whether to disable appending captions. Returning true from the filter will disable captions. Default empty string. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
if ( empty( $caption ) || apply_filters( 'disable_captions', '' ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_tinymce\_inline\_scripts()](../functions/wp_tinymce_inline_scripts) wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| [media\_upload\_type\_url\_form()](../functions/media_upload_type_url_form) wp-admin/includes/media.php | Outputs the legacy media upload form for external media. |
| [wp\_media\_insert\_url\_form()](../functions/wp_media_insert_url_form) wp-admin/includes/media.php | Creates the form for external url. |
| [image\_add\_caption()](../functions/image_add_caption) wp-admin/includes/media.php | Adds image shortcode with caption to editor. |
| [wp\_enqueue\_media()](../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| [wp\_print\_media\_templates()](../functions/wp_print_media_templates) wp-includes/media-template.php | Prints the templates used in the media manager. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters_deprecated( 'query_string', string $query_string ) apply\_filters\_deprecated( 'query\_string', string $query\_string )
====================================================================
This hook has been deprecated. Use [‘query\_vars’](query_vars) or [‘request’](request) filters instead.
Filters the query string before parsing.
`$query_string` string The query string to modify. File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
$this->query_string = apply_filters_deprecated(
'query_string',
array( $this->query_string ),
'2.1.0',
'query_vars, request'
);
```
| Used By | Description |
| --- | --- |
| [WP::build\_query\_string()](../classes/wp/build_query_string) wp-includes/class-wp.php | Sets the query string property based off of the query variable property. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Use ['query\_vars'](query_vars) or ['request'](request) filters instead. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'nav_menu_attr_title', string $item_title ) apply\_filters( 'nav\_menu\_attr\_title', string $item\_title )
===============================================================
Filters a navigation menu item’s title attribute.
`$item_title` string The menu item title attribute. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
$menu_item->attr_title = ! isset( $menu_item->attr_title ) ? apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ) : $menu_item->attr_title;
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Nav\_Menu\_Item\_Setting::value\_as\_wp\_post\_nav\_menu\_item()](../classes/wp_customize_nav_menu_item_setting/value_as_wp_post_nav_menu_item) wp-includes/customize/class-wp-customize-nav-menu-item-setting.php | Get the value emulated into a [WP\_Post](../classes/wp_post) and set up as a nav\_menu\_item. |
| [wp\_setup\_nav\_menu\_item()](../functions/wp_setup_nav_menu_item) wp-includes/nav-menu.php | Decorates a menu item object with the shared navigation menu item properties. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( "pre_site_transient_{$transient}", mixed $pre_site_transient, string $transient ) apply\_filters( "pre\_site\_transient\_{$transient}", mixed $pre\_site\_transient, string $transient )
======================================================================================================
Filters the value of an existing site transient before it is retrieved.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
Returning a value other than boolean false will short-circuit retrieval and return that value instead.
`$pre_site_transient` mixed The default value to return if the site transient does not exist.
Any value other than false will short-circuit the retrieval of the transient, and return that value. `$transient` string Transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$pre = apply_filters( "pre_site_transient_{$transient}", false, $transient );
```
| Used By | Description |
| --- | --- |
| [get\_site\_transient()](../functions/get_site_transient) wp-includes/option.php | Retrieves the value of a site transient. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$transient` parameter was added. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'comment_form_after' ) do\_action( 'comment\_form\_after' )
====================================
Fires after the comment form.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
do_action( 'comment_form_after' );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'rest_url_prefix', string $prefix ) apply\_filters( 'rest\_url\_prefix', string $prefix )
=====================================================
Filters the REST URL prefix.
`$prefix` string URL prefix. Default `'wp-json'`. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
return apply_filters( 'rest_url_prefix', 'wp-json' );
```
| Used By | Description |
| --- | --- |
| [rest\_get\_url\_prefix()](../functions/rest_get_url_prefix) wp-includes/rest-api.php | Retrieves the URL prefix for any API resource. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action_ref_array( 'pre_get_posts', WP_Query $query ) do\_action\_ref\_array( 'pre\_get\_posts', WP\_Query $query )
=============================================================
Fires after the query variable object is created, but before the actual query is run.
Note: If using conditional tags, use the method versions within the passed instance (e.g. $this->is\_main\_query() instead of [is\_main\_query()](../functions/is_main_query) ). This is because the functions like [is\_main\_query()](../functions/is_main_query) test against the global $wp\_query instance, not the passed one.
`$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). Be aware of the queries you are changing when using the `pre_get_posts` action. Make use of [conditional tags](https://developer.wordpress.org/themes/basics/conditional-tags/) to target the right query. For example, its recommended to use the the [is\_admin()](../functions/is_admin) conditional to **not** change queries in the admin screens. With the `$query->is_main_query()` conditional from the query object you can target the main query of a page request. The main query is used by the primary [post loop](https://developer.wordpress.org/themes/basics/the-loop/) that displays the main content for a post, page or archive. Without these conditionals you could unintentionally be changing the query for custom loops in sidebars, footers, or elsewhere.
Example targeting the main query for category archives:
```
function target_main_category_query_with_conditional_tags( $query ) {
if ( ! is_admin() && $query->is_main_query() ) {
// Not a query for an admin page.
// It's the main query for a front end page of your site.
if ( is_category() ) {
// It's the main query for a category archive.
// Let's change the query for category archives.
$query->set( 'posts_per_page', 15 );
}
}
}
add_action( 'pre_get_posts', 'target_main_category_query_with_conditional_tags' );
```
The *main query* (object) already has some default properties set depending on the page request. For example, for single posts the `$query->is_single` property is set to true. This means you can’t simply change a *single post or page query* into an *archive of posts query* (or the other way around). To achieve this you’ll have to reset these properties in the query object itself. Unless you are intimately familiar with these settings and are willing to coordinate them yourself, it’s suggested that you replace the main query by using [WP\_Query](../classes/wp_query) in the page.php or single.php (child) [theme template files](https://developer.wordpress.org/themes/template-files-section/).
`pre_get_posts` runs **before** [WP\_Query](../classes/wp_query "Class Reference/WP Query") has been set up. Some [template tags](https://developer.wordpress.org/themes/basics/template-tags/) and conditional functions that rely on [WP\_Query](../classes/wp_query) will not work. For example, `[is\_front\_page()](../functions/is_front_page)` will **not** work, although `[is\_home()](../functions/is_home "Function Reference/is home")` *will* work. In such cases, you will need to work directly with the query vars, which are passed to the `pre_get_posts` hook as an argument (`$query` in examples on this page).
Using the offset argument in **any** WordPress query can break pagination. If you need to use offset and preserve pagination, please keep in mind that you will need to handle pagination manually. Read the codex article [Making Custom Queries using Offset and Pagination](https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination "Making Custom Queries using Offset and Pagination") for more information.
```
function exclude_single_posts_home($query) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'post__not_in', array( 7, 11 ) );
}
}
add_action( 'pre_get_posts', 'exclude_single_posts_home' );
```
```
function search_filter($query) {
if ( ! is_admin() && $query->is_main_query() ) {
if ( $query->is_search ) {
$query->set( 'post_type', 'post' );
}
}
}
add_action( 'pre_get_posts', 'search_filter' );
```
```
function date_search_filter($query) {
if ( ! is_admin() && $query->is_main_query() ) {
if ( $query->is_search ) {
$query->set( 'date_query', array(
array(
'after' => 'May 17, 2019',
)
) );
}
}
}
add_action( 'pre_get_posts', 'date_search_filter' );
```
```
function hwl_home_pagesize( $query ) {
if ( ! is_admin() && $query->is_main_query() && is_post_type_archive( 'movie' ) ) {
// Display 50 posts for a custom post type called 'movie'
$query->set( 'posts_per_page', 50 );
return;
}
}
add_action( 'pre_get_posts', 'hwl_home_pagesize', 1 );
```
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
do_action_ref_array( 'pre_get_posts', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'login_title', string $login_title, string $title ) apply\_filters( 'login\_title', string $login\_title, string $title )
=====================================================================
Filters the title tag content for login page.
`$login_title` string The page title, with extra context added. `$title` string The original page title. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
$login_title = apply_filters( 'login_title', $login_title, $title );
```
| Used By | Description |
| --- | --- |
| [login\_header()](../functions/login_header) wp-login.php | Output the login page header. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'single_post_title', string $_post_title, WP_Post $_post ) apply\_filters( 'single\_post\_title', string $\_post\_title, WP\_Post $\_post )
================================================================================
Filters the page title for a single post.
`$_post_title` string The single post page title. `$_post` [WP\_Post](../classes/wp_post) The current post. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$title = apply_filters( 'single_post_title', $_post->post_title, $_post );
```
| Used By | Description |
| --- | --- |
| [single\_post\_title()](../functions/single_post_title) wp-includes/general-template.php | Displays or retrieves page title for post. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress apply_filters( "current_theme_supports-{$feature}", bool $supports, array $args, string $feature ) apply\_filters( "current\_theme\_supports-{$feature}", bool $supports, array $args, string $feature )
=====================================================================================================
Filters whether the active theme supports a specific feature.
The dynamic portion of the hook name, `$feature`, refers to the specific theme feature. See [add\_theme\_support()](../functions/add_theme_support) for the list of possible values.
`$supports` bool Whether the active theme supports the given feature. Default true. `$args` array Array of arguments for the feature. `$feature` string The theme feature. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [current\_theme\_supports()](../functions/current_theme_supports) wp-includes/theme.php | Checks a theme’s support for a given feature. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'customize_changeset_branching', bool $allow_branching, WP_Customize_Manager $wp_customize ) apply\_filters( 'customize\_changeset\_branching', bool $allow\_branching, WP\_Customize\_Manager $wp\_customize )
==================================================================================================================
Filters whether or not changeset branching is allowed.
By default in core, when changeset branching is not allowed, changesets will operate linearly in that only one saved changeset will exist at a time (with a ‘draft’ or ‘future’ status). This makes the Customizer operate in a way that is similar to going to "edit" to one existing post: all users will be making changes to the same post, and autosave revisions will be made for that post.
By contrast, when changeset branching is allowed, then the model is like users going to "add new" for a page and each user makes changes independently of each other since they are all operating on their own separate pages, each getting their own separate initial auto-drafts and then once initially saved, autosave revisions on top of that user’s specific post.
Since linear changesets are deemed to be more suitable for the majority of WordPress users, they are the default. For WordPress sites that have heavy site management in the Customizer by multiple users then branching changesets should be enabled by means of this filter.
`$allow_branching` bool Whether branching is allowed. If `false`, the default, then only one saved changeset exists at a time. `$wp_customize` [WP\_Customize\_Manager](../classes/wp_customize_manager) Manager instance. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
$this->branching = apply_filters( 'customize_changeset_branching', $this->branching, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::branching()](../classes/wp_customize_manager/branching) wp-includes/class-wp-customize-manager.php | Whether the changeset branching is allowed. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'get_bookmarks', array $bookmarks, array $parsed_args ) apply\_filters( 'get\_bookmarks', array $bookmarks, array $parsed\_args )
=========================================================================
Filters the returned list of bookmarks.
The first time the hook is evaluated in this file, it returns the cached bookmarks list. The second evaluation returns a cached bookmarks list if the link category is passed but does not exist. The third evaluation returns the full cached results.
* [get\_bookmarks()](../functions/get_bookmarks)
`$bookmarks` array List of the cached bookmarks. `$parsed_args` array An array of bookmark query arguments. File: `wp-includes/bookmark.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/bookmark.php/)
```
return apply_filters( 'get_bookmarks', $bookmarks, $parsed_args );
```
| Used By | Description |
| --- | --- |
| [get\_bookmarks()](../functions/get_bookmarks) wp-includes/bookmark.php | Retrieves the list of bookmarks. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'make_undelete_blog', int $site_id ) do\_action( 'make\_undelete\_blog', int $site\_id )
===================================================
Fires when the ‘deleted’ status is removed from a site.
`$site_id` int Site ID. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'make_undelete_blog', $site_id );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_transition\_site\_statuses\_on\_update()](../functions/wp_maybe_transition_site_statuses_on_update) wp-includes/ms-site.php | Triggers actions on site status updates. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'network_allowed_themes', string[] $allowed_themes, int $blog_id ) apply\_filters( 'network\_allowed\_themes', string[] $allowed\_themes, int $blog\_id )
======================================================================================
Filters the array of themes allowed on the network.
Site is provided as context so that a list of network allowed themes can be filtered further.
`$allowed_themes` string[] An array of theme stylesheet names. `$blog_id` int ID of the site. File: `wp-includes/class-wp-theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme.php/)
```
$network = (array) apply_filters( 'network_allowed_themes', self::get_allowed_on_network(), $blog_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme::get\_allowed()](../classes/wp_theme/get_allowed) wp-includes/class-wp-theme.php | Returns array of stylesheet names of themes allowed on the site or network. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_insert_application_password', stdClass $prepared, WP_REST_Request $request ) apply\_filters( 'rest\_pre\_insert\_application\_password', stdClass $prepared, WP\_REST\_Request $request )
============================================================================================================
Filters an application password before it is inserted via the REST API.
`$prepared` stdClass An object representing a single application password prepared for inserting or updating the database. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php/)
```
return apply_filters( 'rest_pre_insert_application_password', $prepared, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Application\_Passwords\_Controller::prepare\_item\_for\_database()](../classes/wp_rest_application_passwords_controller/prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php | Prepares an application password for a create or update operation. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'wp_is_mobile', bool $is_mobile ) apply\_filters( 'wp\_is\_mobile', bool $is\_mobile )
====================================================
Filters whether the request should be treated as coming from a mobile device or not.
`$is_mobile` bool Whether the request is from a mobile device or not. File: `wp-includes/vars.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/vars.php/)
```
return apply_filters( 'wp_is_mobile', $is_mobile );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_mobile()](../functions/wp_is_mobile) wp-includes/vars.php | Test if the current browser runs on a mobile device (smart phone, tablet, etc.) |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'wp_list_table_show_post_checkbox', bool $show, WP_Post $post ) apply\_filters( 'wp\_list\_table\_show\_post\_checkbox', bool $show, WP\_Post $post )
=====================================================================================
Filters whether to show the bulk edit checkbox for a post in its list table.
By default the checkbox is only shown if the current user can edit the post.
`$show` bool Whether to show the checkbox. `$post` [WP\_Post](../classes/wp_post) The current [WP\_Post](../classes/wp_post) object. File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
if ( apply_filters( 'wp_list_table_show_post_checkbox', $show, $post ) ) :
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::column\_cb()](../classes/wp_posts_list_table/column_cb) wp-admin/includes/class-wp-posts-list-table.php | Handles the checkbox column output. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'edit_custom_thumbnail_sizes', bool|string[] $edit_custom_sizes ) apply\_filters( 'edit\_custom\_thumbnail\_sizes', bool|string[] $edit\_custom\_sizes )
======================================================================================
Filters whether custom sizes are available options for image editing.
`$edit_custom_sizes` bool|string[] True if custom sizes can be edited or array of custom size names. File: `wp-admin/includes/image-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image-edit.php/)
```
$edit_custom_sizes = apply_filters( 'edit_custom_thumbnail_sizes', $edit_custom_sizes );
```
| Used By | Description |
| --- | --- |
| [wp\_image\_editor()](../functions/wp_image_editor) wp-admin/includes/image-edit.php | Loads the WP image-editing interface. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_distinct_request', string $distinct, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_distinct\_request', string $distinct, WP\_Query $query )
============================================================================================
Filters the DISTINCT clause of the query.
For use by caching plugins.
`$distinct` string The DISTINCT clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_unique_term_slug', string $slug, object $term, string $original_slug ) apply\_filters( 'wp\_unique\_term\_slug', string $slug, object $term, string $original\_slug )
==============================================================================================
Filters the unique term slug.
`$slug` string Unique term slug. `$term` object Term object. `$original_slug` string Slug originally passed to the function for testing. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
return apply_filters( 'wp_unique_term_slug', $slug, $term, $original_slug );
```
| Used By | Description |
| --- | --- |
| [wp\_unique\_term\_slug()](../functions/wp_unique_term_slug) wp-includes/taxonomy.php | Makes term slug unique, if it isn’t already. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'get_comment_author_link', string $return, string $author, string $comment_ID ) apply\_filters( 'get\_comment\_author\_link', string $return, string $author, string $comment\_ID )
===================================================================================================
Filters the comment author’s link for display.
`$return` string The HTML-formatted comment author link.
Empty for an invalid URL. `$author` string The comment author's username. `$comment_ID` string The comment ID as a numeric string. Both `get_comment_author_url()` and `get_comment_author()` rely on `get_comment()`, which falls back to the global comment variable if the `$comment_ID` argument is empty.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'get_comment_author_link', $return, $author, $comment->comment_ID );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_author\_link()](../functions/get_comment_author_link) wp-includes/comment-template.php | Retrieves the HTML link to the URL of the author of the current comment. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$author` and `$comment_ID` parameters were added. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_stylesheet_css', string $css ) apply\_filters( 'wp\_sitemaps\_stylesheet\_css', string $css )
==============================================================
Filters the CSS only for the sitemap stylesheet.
`$css` string CSS to be applied to default XSL file. File: `wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php/)
```
return apply_filters( 'wp_sitemaps_stylesheet_css', $css );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Stylesheet::get\_stylesheet\_css()](../classes/wp_sitemaps_stylesheet/get_stylesheet_css) wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | Gets the CSS to be included in sitemap XSL stylesheets. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_constrain_dimensions', int[] $dimensions, int $current_width, int $current_height, int $max_width, int $max_height ) apply\_filters( 'wp\_constrain\_dimensions', int[] $dimensions, int $current\_width, int $current\_height, int $max\_width, int $max\_height )
==============================================================================================================================================
Filters dimensions to constrain down-sampled images to.
`$dimensions` int[] An array of width and height values.
* intThe width in pixels.
* `1`intThe height in pixels.
`$current_width` int The current width of the image. `$current_height` int The current height of the image. `$max_width` int The maximum width permitted. `$max_height` int The maximum height permitted. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_constrain_dimensions', array( $w, $h ), $current_width, $current_height, $max_width, $max_height );
```
| Used By | Description |
| --- | --- |
| [wp\_constrain\_dimensions()](../functions/wp_constrain_dimensions) wp-includes/media.php | Calculates the new dimensions for a down-sampled image. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'comments_link_feed', string $comment_permalink ) apply\_filters( 'comments\_link\_feed', string $comment\_permalink )
====================================================================
Filters the comments permalink for the current post.
`$comment_permalink` string The current comment permalink with `'#comments'` appended. The **comments\_link\_feed** allows you to alter the link to the comments section of a post within the context of a feed.
When the ‘comments\_link\_feed’ filter is called, it is passed once parameters: the list item containing the powered by link.
```
<pre>add_filter( 'comments_link_feed', 'filter_function_name', 10 );
function filter_function_name( $link) {
// Manipulate comment link
return $link;
}
```
Where ‘filter\_function\_name’ is the function WordPress should call when the filter is run. Note that the filter function **must** return a value after it is finished processing or the result will be empty.
**filter\_function\_name** should be unique function name. It cannot match any other function name already declared.
File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) );
```
| Used By | Description |
| --- | --- |
| [comments\_link\_feed()](../functions/comments_link_feed) wp-includes/feed.php | Outputs the link to the comments for the current post in an XML safe way. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'login_form_defaults', array $defaults ) apply\_filters( 'login\_form\_defaults', array $defaults )
==========================================================
Filters the default login form output arguments.
* [wp\_login\_form()](../functions/wp_login_form)
`$defaults` array An array of default login form arguments. The defaults set in the `wp_login_form()` function are as follows:
```
$defaults = array(
'echo' => true,
'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
'form_id' => 'loginform',
'label_username' => __( 'Username' ),
'label_password' => __( 'Password' ),
'label_remember' => __( 'Remember Me' ),
'label_log_in' => __( 'Log In' ),
'id_username' => 'user_login',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'remember' => true,
'value_username' => '',
'value_remember' => false, // Set this to true to default the "Remember me" checkbox to be checked.
);
```
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) );
```
| Used By | Description |
| --- | --- |
| [wp\_login\_form()](../functions/wp_login_form) wp-includes/general-template.php | Provides a simple login form for use anywhere within WordPress. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'make_ham_user', int $user_id ) do\_action( 'make\_ham\_user', int $user\_id )
==============================================
Fires after the user is marked as a HAM user. Opposite of SPAM.
`$user_id` int ID of the user marked as HAM. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'make_ham_user', $user_id );
```
| Used By | Description |
| --- | --- |
| [update\_user\_status()](../functions/update_user_status) wp-includes/ms-deprecated.php | Update the status of a user in the database. |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'login_site_html_link', string $link ) apply\_filters( 'login\_site\_html\_link', string $link )
=========================================================
Filter the “Go to site” link displayed in the login page footer.
`$link` string HTML link to the home URL of the current site. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
echo apply_filters( 'login_site_html_link', $html_link );
```
| Used By | Description |
| --- | --- |
| [login\_footer()](../functions/login_footer) wp-login.php | Outputs the footer for the login page. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress do_action( 'install_plugins_table_header' ) do\_action( 'install\_plugins\_table\_header' )
===============================================
Fires before the Plugin Install table header pagination is displayed.
File: `wp-admin/includes/class-wp-plugin-install-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-plugin-install-list-table.php/)
```
do_action( 'install_plugins_table_header' );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugin\_Install\_List\_Table::display\_tablenav()](../classes/wp_plugin_install_list_table/display_tablenav) wp-admin/includes/class-wp-plugin-install-list-table.php | |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'pre_delete_post', WP_Post|false|null $delete, WP_Post $post, bool $force_delete ) apply\_filters( 'pre\_delete\_post', WP\_Post|false|null $delete, WP\_Post $post, bool $force\_delete )
=======================================================================================================
Filters whether a post deletion should take place.
`$delete` [WP\_Post](../classes/wp_post)|false|null Whether to go forward with deletion. `$post` [WP\_Post](../classes/wp_post) Post object. `$force_delete` bool Whether to bypass the Trash. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$check = apply_filters( 'pre_delete_post', null, $post, $force_delete );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_post()](../functions/wp_delete_post) wp-includes/post.php | Trashes or deletes a post or page. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'run_wptexturize', bool $run_texturize ) apply\_filters( 'run\_wptexturize', bool $run\_texturize )
==========================================================
Filters whether to skip running [wptexturize()](../functions/wptexturize) .
Returning false from the filter will effectively short-circuit [wptexturize()](../functions/wptexturize) and return the original text passed to the function instead.
The filter runs only once, the first time [wptexturize()](../functions/wptexturize) is called.
* [wptexturize()](../functions/wptexturize)
`$run_texturize` bool Whether to short-circuit [wptexturize()](../functions/wptexturize) . File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$run_texturize = apply_filters( 'run_wptexturize', $run_texturize );
```
| Used By | Description |
| --- | --- |
| [wptexturize()](../functions/wptexturize) wp-includes/formatting.php | Replaces common plain text characters with formatted entities. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'mce_buttons_3', array $mce_buttons_3, string $editor_id ) apply\_filters( 'mce\_buttons\_3', array $mce\_buttons\_3, string $editor\_id )
===============================================================================
Filters the third-row list of TinyMCE buttons (Visual tab).
`$mce_buttons_3` array Third-row list of buttons. `$editor_id` string Unique editor identifier, e.g. `'content'`. Accepts `'classic-block'` when called from block editor's Classic block. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mce_buttons_3 = apply_filters( 'mce_buttons_3', array(), $editor_id );
```
| Used By | Description |
| --- | --- |
| [wp\_tinymce\_inline\_scripts()](../functions/wp_tinymce_inline_scripts) wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | The `$editor_id` parameter was added. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'use_default_gallery_style', bool $print ) apply\_filters( 'use\_default\_gallery\_style', bool $print )
=============================================================
Filters whether to print default gallery styles.
`$print` bool Whether to print default gallery styles.
Defaults to false if the theme supports HTML5 galleries.
Otherwise, defaults to true. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
```
| Used By | Description |
| --- | --- |
| [gallery\_shortcode()](../functions/gallery_shortcode) wp-includes/media.php | Builds the Gallery shortcode output. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'comments_template_top_level_query_args', array $top_level_args ) apply\_filters( 'comments\_template\_top\_level\_query\_args', array $top\_level\_args )
========================================================================================
Filters the arguments used in the top level comments query.
* [WP\_Comment\_Query::\_\_construct()](../classes/wp_comment_query/__construct)
`$top_level_args` array The top level query arguments for the comments template.
* `count`boolWhether to return a comment count.
* `orderby`string|arrayThe field(s) to order by.
* `post_id`intThe post ID.
* `status`string|arrayThe comment status to limit results by.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$top_level_args = apply_filters( 'comments_template_top_level_query_args', $top_level_args );
```
| Used By | Description |
| --- | --- |
| [comments\_template()](../functions/comments_template) wp-includes/comment-template.php | Loads the comment template specified in $file. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( 'deleted_term_relationships', int $object_id, array $tt_ids, string $taxonomy ) do\_action( 'deleted\_term\_relationships', int $object\_id, array $tt\_ids, string $taxonomy )
===============================================================================================
Fires immediately after an object-term relationship is deleted.
`$object_id` int Object ID. `$tt_ids` array An array of term taxonomy IDs. `$taxonomy` string Taxonomy slug. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'deleted_term_relationships', $object_id, $tt_ids, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [wp\_remove\_object\_terms()](../functions/wp_remove_object_terms) wp-includes/taxonomy.php | Removes term(s) associated with a given object. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Added the `$taxonomy` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'get_terms_orderby', string $orderby, array $args, string[] $taxonomies ) apply\_filters( 'get\_terms\_orderby', string $orderby, array $args, string[] $taxonomies )
===========================================================================================
Filters the ORDERBY clause of the terms query.
`$orderby` string `ORDERBY` clause of the terms query. `$args` array An array of term query arguments. `$taxonomies` string[] An array of taxonomy names. File: `wp-includes/class-wp-term-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-term-query.php/)
```
$orderby = apply_filters( 'get_terms_orderby', $orderby, $this->query_vars, $this->query_vars['taxonomy'] );
```
| Used By | Description |
| --- | --- |
| [WP\_Term\_Query::parse\_orderby()](../classes/wp_term_query/parse_orderby) wp-includes/class-wp-term-query.php | Parse and sanitize ‘orderby’ keys passed to the term query. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_link_pages', string $output, array|string $args ) apply\_filters( 'wp\_link\_pages', string $output, array|string $args )
=======================================================================
Filters the HTML output of page links for paginated posts.
`$output` string HTML output of paginated posts' page links. `$args` array|string An array or query string of arguments. See [wp\_link\_pages()](../functions/wp_link_pages) for information on accepted arguments. More Arguments from wp\_link\_pages( ... $args ) Array or string of default arguments.
* `before`stringHTML or text to prepend to each link. Default is `<p> Pages:`.
* `after`stringHTML or text to append to each link. Default is `</p>`.
* `link_before`stringHTML or text to prepend to each link, inside the `<a>` tag.
Also prepended to the current item, which is not linked.
* `link_after`stringHTML or text to append to each Pages link inside the `<a>` tag.
Also appended to the current item, which is not linked.
* `aria_current`stringThe value for the aria-current attribute. Possible values are `'page'`, `'step'`, `'location'`, `'date'`, `'time'`, `'true'`, `'false'`. Default is `'page'`.
* `next_or_number`stringIndicates whether page numbers should be used. Valid values are number and next. Default is `'number'`.
* `separator`stringText between pagination links. Default is ' '.
* `nextpagelink`stringLink text for the next page link, if available. Default is 'Next Page'.
* `previouspagelink`stringLink text for the previous page link, if available. Default is 'Previous Page'.
* `pagelink`stringFormat string for page numbers. The % in the parameter string will be replaced with the page number, so 'Page %' generates "Page 1", "Page 2", etc.
Defaults to `'%'`, just the page number.
* `echo`int|boolWhether to echo or not. Accepts `1|true` or `0|false`. Default `1|true`.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$html = apply_filters( 'wp_link_pages', $output, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_link\_pages()](../functions/wp_link_pages) wp-includes/post-template.php | The formatted output of a list of pages. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'customize_partial_render', string|array|false $rendered, WP_Customize_Partial $partial, array $container_context ) apply\_filters( 'customize\_partial\_render', string|array|false $rendered, WP\_Customize\_Partial $partial, array $container\_context )
========================================================================================================================================
Filters partial rendering.
`$rendered` string|array|false The partial value. Default false. `$partial` [WP\_Customize\_Partial](../classes/wp_customize_partial) [WP\_Customize\_Setting](../classes/wp_customize_setting) instance. `$container_context` array array of context data associated with the target container. File: `wp-includes/customize/class-wp-customize-partial.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-partial.php/)
```
$rendered = apply_filters( 'customize_partial_render', $rendered, $partial, $container_context );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Partial::render()](../classes/wp_customize_partial/render) wp-includes/customize/class-wp-customize-partial.php | Renders the template partial involving the associated settings. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'ngettext', string $translation, string $single, string $plural, int $number, string $domain ) apply\_filters( 'ngettext', string $translation, string $single, string $plural, int $number, string $domain )
==============================================================================================================
Filters the singular or plural form of a string.
`$translation` string Translated text. `$single` string The text to be used if the number is singular. `$plural` string The text to be used if the number is plural. `$number` int The number to compare against to use either the singular or plural form. `$domain` string Text domain. Unique identifier for retrieving translated strings. This filter hook is applied to the translated text by the internationalization function that handle plurals (`[\_n()](../functions/_n)`).
**IMPORTANT:** This filter is always applied even if internationalization is not in effect, and if the text domain has not been loaded. If there are functions hooked to this filter, they will always run. This could lead to a performance problem.
For regular translation functions such as `[\_e()](../functions/_e)`, and for examples on usage, see `[gettext()](gettext)`.
For context-specific translation functions such as `[\_x()](../functions/_x)`, see filter hook [`gettext_with_context()`](gettext_with_context) and `[ngettext\_with\_context()](ngettext_with_context)`.
File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$translation = apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );
```
| Used By | Description |
| --- | --- |
| [\_n()](../functions/_n) wp-includes/l10n.php | Translates and retrieves the singular or plural form based on the supplied number. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'pre_get_block_template', WP_Block_Template|null $block_template, string $id, string $template_type ) apply\_filters( 'pre\_get\_block\_template', WP\_Block\_Template|null $block\_template, string $id, string $template\_type )
============================================================================================================================
Filters the block template object before the query takes place.
Return a non-null value to bypass the WordPress queries.
`$block_template` [WP\_Block\_Template](../classes/wp_block_template)|null Return block template object to short-circuit the default query, or null to allow WP to run its normal queries. `$id` string Template unique identifier (example: theme\_slug//template\_slug). `$template_type` string Template type: `'wp_template'` or '`wp_template_part'`. File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
$block_template = apply_filters( 'pre_get_block_template', null, $id, $template_type );
```
| Used By | Description |
| --- | --- |
| [get\_block\_template()](../functions/get_block_template) wp-includes/block-template-utils.php | Retrieves a single unified template object using its id. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'pre_comment_content', string $comment_content ) apply\_filters( 'pre\_comment\_content', string $comment\_content )
===================================================================
Filters the comment content before it is set.
`$comment_content` string The comment content. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$commentdata['comment_content'] = apply_filters( 'pre_comment_content', $commentdata['comment_content'] );
```
| Used By | Description |
| --- | --- |
| [wp\_filter\_comment()](../functions/wp_filter_comment) wp-includes/comment.php | Filters and sanitizes comment data. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'author_rewrite_rules', string[] $author_rewrite ) apply\_filters( 'author\_rewrite\_rules', string[] $author\_rewrite )
=====================================================================
Filters rewrite rules used for author archives.
Likely author archives would include `/author/author-name/`, as well as pagination and feed paths for author archives.
`$author_rewrite` string[] Array of rewrite rules for author archives, keyed by their regex pattern. File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
$author_rewrite = apply_filters( 'author_rewrite_rules', $author_rewrite );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::rewrite\_rules()](../classes/wp_rewrite/rewrite_rules) wp-includes/class-wp-rewrite.php | Constructs rewrite matches and queries from permalink structure. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'comments_template', string $theme_template ) apply\_filters( 'comments\_template', string $theme\_template )
===============================================================
Filters the path to the theme template file used for the comments template.
`$theme_template` string The path to the theme template file. The `comments_template` filter can be used to load a custom template form a plugin which replaces the theme’s default comment template.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$include = apply_filters( 'comments_template', $theme_template );
```
| Used By | Description |
| --- | --- |
| [comments\_template()](../functions/comments_template) wp-includes/comment-template.php | Loads the comment template specified in $file. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'year_link', string $yearlink, int $year ) apply\_filters( 'year\_link', string $yearlink, int $year )
===========================================================
Filters the year archive permalink.
`$yearlink` string Permalink for the year archive. `$year` int Year for the archive. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'year_link', $yearlink, $year );
```
| Used By | Description |
| --- | --- |
| [get\_year\_link()](../functions/get_year_link) wp-includes/link-template.php | Retrieves the permalink for the year archives. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'login_form_top', string $content, array $args ) apply\_filters( 'login\_form\_top', string $content, array $args )
==================================================================
Filters content to display at the top of the login form.
The filter evaluates just following the opening form tag element.
`$content` string Content to display. Default empty. `$args` array Array of login form arguments. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$login_form_top = apply_filters( 'login_form_top', '', $args );
```
| Used By | Description |
| --- | --- |
| [wp\_login\_form()](../functions/wp_login_form) wp-includes/general-template.php | Provides a simple login form for use anywhere within WordPress. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'rest_block_directory_collection_params', array $query_params ) apply\_filters( 'rest\_block\_directory\_collection\_params', array $query\_params )
====================================================================================
Filters REST API collection parameters for the block directory controller.
`$query_params` array JSON Schema-formatted collection parameters. File: `wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php/)
```
return apply_filters( 'rest_block_directory_collection_params', $query_params );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Block\_Directory\_Controller::get\_collection\_params()](../classes/wp_rest_block_directory_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Retrieves the search params for the blocks collection. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'post_comment_status_meta_box-options', WP_Post $post ) do\_action( 'post\_comment\_status\_meta\_box-options', WP\_Post $post )
========================================================================
Fires at the end of the Discussion meta box on the post editing screen.
`$post` [WP\_Post](../classes/wp_post) [WP\_Post](../classes/wp_post) object for the current post. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
do_action( 'post_comment_status_meta_box-options', $post ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [post\_comment\_status\_meta\_box()](../functions/post_comment_status_meta_box) wp-admin/includes/meta-boxes.php | Displays comments status form fields. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'default_hidden_meta_boxes', string[] $hidden, WP_Screen $screen ) apply\_filters( 'default\_hidden\_meta\_boxes', string[] $hidden, WP\_Screen $screen )
======================================================================================
Filters the default list of hidden meta boxes.
`$hidden` string[] An array of IDs of meta boxes hidden by default. `$screen` [WP\_Screen](../classes/wp_screen) [WP\_Screen](../classes/wp_screen) object of the current screen. File: `wp-admin/includes/screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/screen.php/)
```
$hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );
```
| Used By | Description |
| --- | --- |
| [get\_hidden\_meta\_boxes()](../functions/get_hidden_meta_boxes) wp-admin/includes/screen.php | Gets an array of IDs of hidden meta boxes. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'http_request_reject_unsafe_urls', bool $pass_url, string $url ) apply\_filters( 'http\_request\_reject\_unsafe\_urls', bool $pass\_url, string $url )
=====================================================================================
Filters whether to pass URLs through [wp\_http\_validate\_url()](../functions/wp_http_validate_url) in an HTTP request.
`$pass_url` bool Whether to pass URLs through [wp\_http\_validate\_url()](../functions/wp_http_validate_url) . Default false. `$url` string The request URL. File: `wp-includes/class-wp-http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http.php/)
```
'reject_unsafe_urls' => apply_filters( 'http_request_reject_unsafe_urls', false, $url ),
```
| Used By | Description |
| --- | --- |
| [WP\_Http::request()](../classes/wp_http/request) wp-includes/class-wp-http.php | Send an HTTP request to a URI. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | The `$url` parameter was added. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( "{$context}_memory_limit", int|string $filtered_limit ) apply\_filters( "{$context}\_memory\_limit", int|string $filtered\_limit )
==========================================================================
Filters the memory limit allocated for arbitrary contexts.
The dynamic portion of the hook name, `$context`, refers to an arbitrary context passed on calling the function. This allows for plugins to define their own contexts for raising the memory limit.
`$filtered_limit` int|string Maximum memory limit to allocate for images.
Default `'256M'` or the original php.ini `memory_limit`, whichever is higher. Accepts an integer (bytes), or a shorthand string notation, such as `'256M'`. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$filtered_limit = apply_filters( "{$context}_memory_limit", $filtered_limit );
```
| Used By | Description |
| --- | --- |
| [wp\_raise\_memory\_limit()](../functions/wp_raise_memory_limit) wp-includes/functions.php | Attempts to raise the PHP memory limit for memory intensive processes. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'screen_options_show_submit', bool $show_button, WP_Screen $screen ) apply\_filters( 'screen\_options\_show\_submit', bool $show\_button, WP\_Screen $screen )
=========================================================================================
Filters whether to show the Screen Options submit button.
`$show_button` bool Whether to show Screen Options submit button.
Default false. `$screen` [WP\_Screen](../classes/wp_screen) Current [WP\_Screen](../classes/wp_screen) instance. File: `wp-admin/includes/class-wp-screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-screen.php/)
```
$show_button = apply_filters( 'screen_options_show_submit', false, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::render\_screen\_options()](../classes/wp_screen/render_screen_options) wp-admin/includes/class-wp-screen.php | Renders the screen options tab. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'wp_install', WP_User $user ) do\_action( 'wp\_install', WP\_User $user )
===========================================
Fires after a site is fully installed.
`$user` [WP\_User](../classes/wp_user) The site owner. File: `wp-admin/includes/upgrade.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/upgrade.php/)
```
do_action( 'wp_install', $user );
```
| Used By | Description |
| --- | --- |
| [wp\_install()](../functions/wp_install) wp-admin/includes/upgrade.php | Installs the site. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( "pre_set_site_transient_{$transient}", mixed $value, string $transient ) apply\_filters( "pre\_set\_site\_transient\_{$transient}", mixed $value, string $transient )
============================================================================================
Filters the value of a specific site transient before it is set.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$value` mixed New value of site transient. `$transient` string Transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$value = apply_filters( "pre_set_site_transient_{$transient}", $value, $transient );
```
| Used By | Description |
| --- | --- |
| [set\_site\_transient()](../functions/set_site_transient) wp-includes/option.php | Sets/updates the value of a site transient. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$transient` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'widget_display_callback', array $instance, WP_Widget $widget, array $args ) apply\_filters( 'widget\_display\_callback', array $instance, WP\_Widget $widget, array $args )
===============================================================================================
Filters the settings for a particular widget instance.
Returning false will effectively short-circuit display of the widget.
`$instance` array The current widget instance's settings. `$widget` [WP\_Widget](../classes/wp_widget) The current widget instance. `$args` array An array of default widget arguments. File: `wp-includes/class-wp-widget.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-widget.php/)
```
$instance = apply_filters( 'widget_display_callback', $instance, $this, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget::display\_callback()](../classes/wp_widget/display_callback) wp-includes/class-wp-widget.php | Generates the actual widget content (Do NOT override). |
| [the\_widget()](../functions/the_widget) wp-includes/widgets.php | Output an arbitrary widget as a template tag. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'split_the_query', bool $split_the_query, WP_Query $query ) apply\_filters( 'split\_the\_query', bool $split\_the\_query, WP\_Query $query )
================================================================================
Filters whether to split the query.
Splitting the query will cause it to fetch just the IDs of the found posts (and then individually fetch each post by ID), rather than fetching every complete row at once. One massive result vs. many small results.
`$split_the_query` bool Whether or not to split the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance. File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$split_the_query = apply_filters( 'split_the_query', $split_the_query, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'transition_post_status', string $new_status, string $old_status, WP_Post $post ) do\_action( 'transition\_post\_status', string $new\_status, string $old\_status, WP\_Post $post )
==================================================================================================
Fires when a post is transitioned from one status to another.
`$new_status` string New post status. `$old_status` string Old post status. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'transition_post_status', $new_status, $old_status, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_transition\_post\_status()](../functions/wp_transition_post_status) wp-includes/post.php | Fires actions related to the transitioning of a post’s status. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'sanitize_trackback_urls', string $urls_to_ping, string $to_ping ) apply\_filters( 'sanitize\_trackback\_urls', string $urls\_to\_ping, string $to\_ping )
=======================================================================================
Filters a list of trackback URLs following sanitization.
The string returned here consists of a space or carriage return-delimited list of trackback URLs.
`$urls_to_ping` string Sanitized space or carriage return separated URLs. `$to_ping` string Space or carriage return separated URLs before sanitization. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping );
```
| Used By | Description |
| --- | --- |
| [sanitize\_trackback\_urls()](../functions/sanitize_trackback_urls) wp-includes/formatting.php | Sanitizes space or carriage return separated URLs that are used to send trackbacks. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'query_loop_block_query_vars', array $query, WP_Block $block, int $page ) apply\_filters( 'query\_loop\_block\_query\_vars', array $query, WP\_Block $block, int $page )
==============================================================================================
Filters the arguments which will be passed to `WP_Query` for the Query Loop Block.
Anything to this filter should be compatible with the `WP_Query` API to form the query context which will be passed down to the Query Loop Block’s children.
This can help, for example, to include additional settings or meta queries not directly supported by the core Query Loop Block, and extend its capabilities.
Please note that this will only influence the query that will be rendered on the front-end. The editor preview is not affected by this filter. Also, worth noting that the editor preview uses the REST API, so, ideally, one should aim to provide attributes which are also compatible with the REST API, in order to be able to implement identical queries on both sides.
`$query` array Array containing parameters for `WP_Query` as parsed by the block context. `$block` [WP\_Block](../classes/wp_block) Block instance. `$page` int Current query's page. File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
return apply_filters( 'query_loop_block_query_vars', $query, $block, $page );
```
| Used By | Description |
| --- | --- |
| [build\_query\_vars\_from\_query\_block()](../functions/build_query_vars_from_query_block) wp-includes/blocks.php | Helper function that constructs a [WP\_Query](../classes/wp_query) args array from a `Query` block properties. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( "delete_{$taxonomy}", int $term, int $tt_id, WP_Term $deleted_term, array $object_ids ) do\_action( "delete\_{$taxonomy}", int $term, int $tt\_id, WP\_Term $deleted\_term, array $object\_ids )
========================================================================================================
Fires after a term in a specific taxonomy is deleted.
The dynamic portion of the hook name, `$taxonomy`, refers to the specific taxonomy the term belonged to.
Possible hook names include:
* `delete_category`
* `delete_post_tag`
`$term` int Term ID. `$tt_id` int Term taxonomy ID. `$deleted_term` [WP\_Term](../classes/wp_term) Copy of the already-deleted term. `$object_ids` array List of term object IDs. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( "delete_{$taxonomy}", $term, $tt_id, $deleted_term, $object_ids );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_term()](../functions/wp_delete_term) wp-includes/taxonomy.php | Removes a term from the database. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced the `$object_ids` argument. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'widget_text_content', string $text, array $instance, WP_Widget_Text $widget ) apply\_filters( 'widget\_text\_content', string $text, array $instance, WP\_Widget\_Text $widget )
==================================================================================================
Filters the content of the Text widget to apply changes expected from the visual (TinyMCE) editor.
By default a subset of the\_content filters are applied, including wpautop and wptexturize.
`$text` string The widget content. `$instance` array Array of settings for the current widget. `$widget` [WP\_Widget\_Text](../classes/wp_widget_text) Current Text widget instance. File: `wp-includes/widgets/class-wp-widget-text.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-text.php/)
```
$text = apply_filters( 'widget_text_content', $text, $instance, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Text::widget()](../classes/wp_widget_text/widget) wp-includes/widgets/class-wp-widget-text.php | Outputs the content for the current Text widget instance. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress do_action( 'wp_initialize_site', WP_Site $new_site, array $args ) do\_action( 'wp\_initialize\_site', WP\_Site $new\_site, array $args )
======================================================================
Fires when a site’s initialization routine should be executed.
`$new_site` [WP\_Site](../classes/wp_site) New site object. `$args` array Arguments for the initialization. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'wp_initialize_site', $new_site, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_site()](../functions/wp_insert_site) wp-includes/ms-site.php | Inserts a new site into the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_groupby', string $groupby, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_groupby', string $groupby, WP\_Query $query )
=================================================================================
Filters the GROUP BY clause of the query.
`$groupby` string The GROUP BY clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). * If you come with MySQL knowledge, the `GROUP BY` clause is pretty useless without the ability to modify the `SELECT` statement.
* There is no `SELECT` filter since the query is supposed to return only the post data. The `GROUP BY` clause is set *only when* there are [Custom Field Parameters](../classes/wp_query#custom-field-post-meta-parameters) for querying by post meta or [Taxonomy Parameters](../classes/wp_query#taxonomy-parameters) for querying by taxonomy.
* The default `posts_groupby` is set to `{$wpdb->posts}.ID`, which means that even if there are multiple results because of multiple meta and taxonomy, they are grouped together by the post id.
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress do_action( "wp_ajax_{$action}" ) do\_action( "wp\_ajax\_{$action}" )
===================================
Fires authenticated Ajax actions for logged-in users.
The dynamic portion of the hook name, `$action`, refers to the name of the Ajax action callback being fired.
* This hook allows you to handle your custom AJAX endpoints. The `wp_ajax_` hooks follows the format “`wp_ajax_$action`“, where `$action` is the ‘`action`‘ field submitted to `admin-ajax.php`.
* This hook only fires for **logged-in users**. If your action only allows Ajax requests to come from users not logged-in, you need to instead use [wp\_ajax\_nopriv\_$action](wp_ajax_nopriv_action) such as: `add_action( 'wp_ajax_nopriv_add_foobar', 'prefix_ajax_add_foobar' );`. To allow both, you must register both hooks!
* See also <wp_ajax__requestaction>
* See also [Ajax Plugin Handbook](https://developer.wordpress.org/plugins/javascript/ajax/)
File: `wp-admin/admin-ajax.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-ajax.php/)
```
do_action( "wp_ajax_{$action}" );
```
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'date_rewrite_rules', string[] $date_rewrite ) apply\_filters( 'date\_rewrite\_rules', string[] $date\_rewrite )
=================================================================
Filters rewrite rules used for date archives.
Likely date archives would include `/yyyy/`, `/yyyy/mm/`, and `/yyyy/mm/dd/`.
`$date_rewrite` string[] Array of rewrite rules for date archives, keyed by their regex pattern. File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
$date_rewrite = apply_filters( 'date_rewrite_rules', $date_rewrite );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::rewrite\_rules()](../classes/wp_rewrite/rewrite_rules) wp-includes/class-wp-rewrite.php | Constructs rewrite matches and queries from permalink structure. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'ms_site_check', bool|null $check ) apply\_filters( 'ms\_site\_check', bool|null $check )
=====================================================
Filters checking the status of the current blog.
`$check` bool|null Whether to skip the blog status check. Default null. File: `wp-includes/ms-load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-load.php/)
```
$check = apply_filters( 'ms_site_check', null );
```
| Used By | Description |
| --- | --- |
| [ms\_site\_check()](../functions/ms_site_check) wp-includes/ms-load.php | Checks status of current blog. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( "manage_{$this->screen->taxonomy}_custom_column", string $string, string $column_name, int $term_id ) apply\_filters( "manage\_{$this->screen->taxonomy}\_custom\_column", string $string, string $column\_name, int $term\_id )
==========================================================================================================================
Filters the displayed columns in the terms list table.
The dynamic portion of the hook name, `$this->screen->taxonomy`, refers to the slug of the current taxonomy.
Possible hook names include:
* `manage_category_custom_column`
* `manage_post_tag_custom_column`
`$string` string Custom column output. Default empty. `$column_name` string Name of the column. `$term_id` int Term ID. File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $item->term_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::column\_default()](../classes/wp_terms_list_table/column_default) wp-admin/includes/class-wp-terms-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_add_provider', WP_Sitemaps_Provider $provider, string $name ) apply\_filters( 'wp\_sitemaps\_add\_provider', WP\_Sitemaps\_Provider $provider, string $name )
===============================================================================================
Filters the sitemap provider before it is added.
`$provider` [WP\_Sitemaps\_Provider](../classes/wp_sitemaps_provider) Instance of a [WP\_Sitemaps\_Provider](../classes/wp_sitemaps_provider). `$name` string Name of the sitemap provider. File: `wp-includes/sitemaps/class-wp-sitemaps-registry.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/class-wp-sitemaps-registry.php/)
```
$provider = apply_filters( 'wp_sitemaps_add_provider', $provider, $name );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Registry::add\_provider()](../classes/wp_sitemaps_registry/add_provider) wp-includes/sitemaps/class-wp-sitemaps-registry.php | Adds a new sitemap provider. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'newuser_notify_siteadmin', string $msg, WP_User $user ) apply\_filters( 'newuser\_notify\_siteadmin', string $msg, WP\_User $user )
===========================================================================
Filters the message body of the new user activation email sent to the network administrator.
`$msg` string Email body. `$user` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) instance of the new user. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );
```
| Used By | Description |
| --- | --- |
| [newuser\_notify\_siteadmin()](../functions/newuser_notify_siteadmin) wp-includes/ms-functions.php | Notifies the network admin that a new user has been activated. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'language_attributes', string $output, string $doctype ) apply\_filters( 'language\_attributes', string $output, string $doctype )
=========================================================================
Filters the language attributes for display in the ‘html’ tag.
`$output` string A space-separated list of language attributes. `$doctype` string The type of HTML document (`xhtml|html`). File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'language_attributes', $output, $doctype );
```
| Used By | Description |
| --- | --- |
| [get\_language\_attributes()](../functions/get_language_attributes) wp-includes/general-template.php | Gets the language attributes for the ‘html’ tag. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Added the `$doctype` parameter. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( "comment_{$new_status}_{$comment->comment_type}", string $comment_ID, WP_Comment $comment ) do\_action( "comment\_{$new\_status}\_{$comment->comment\_type}", string $comment\_ID, WP\_Comment $comment )
=============================================================================================================
Fires when the status of a specific comment type is in transition.
The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`, refer to the new comment status, and the type of comment, respectively.
Typical comment types include ‘comment’, ‘pingback’, or ‘trackback’.
Possible hook names include:
* `comment_approved_comment`
* `comment_approved_pingback`
* `comment_approved_trackback`
* `comment_unapproved_comment`
* `comment_unapproved_pingback`
* `comment_unapproved_trackback`
* `comment_spam_comment`
* `comment_spam_pingback`
* `comment_spam_trackback`
`$comment_ID` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) Comment object. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( "comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_transition\_comment\_status()](../functions/wp_transition_comment_status) wp-includes/comment.php | Calls hooks for when a comment status transition occurs. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'updated_postmeta', int $meta_id, int $object_id, string $meta_key, mixed $meta_value ) do\_action( 'updated\_postmeta', int $meta\_id, int $object\_id, string $meta\_key, mixed $meta\_value )
========================================================================================================
Fires immediately after updating a post’s metadata.
`$meta_id` int ID of updated metadata entry. `$object_id` int Post ID. `$meta_key` string Metadata key. `$meta_value` mixed Metadata value. This will be a PHP-serialized string representation of the value if the value is an array, an object, or itself a PHP-serialized string. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
```
| Used By | Description |
| --- | --- |
| [update\_metadata\_by\_mid()](../functions/update_metadata_by_mid) wp-includes/meta.php | Updates metadata by meta ID. |
| [update\_metadata()](../functions/update_metadata) wp-includes/meta.php | Updates metadata for the specified object. If no value already exists for the specified object ID and metadata key, the metadata will be added. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( "views_{$this->screen->id}", string[] $views ) apply\_filters( "views\_{$this->screen->id}", string[] $views )
===============================================================
Filters the list of available list table views.
The dynamic portion of the hook name, `$this->screen->id`, refers to the ID of the current screen.
`$views` string[] An array of available list table views. File: `wp-admin/includes/class-wp-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-list-table.php/)
```
$views = apply_filters( "views_{$this->screen->id}", $views );
```
| Used By | Description |
| --- | --- |
| [WP\_Media\_List\_Table::views()](../classes/wp_media_list_table/views) wp-admin/includes/class-wp-media-list-table.php | Override parent views so we can use the filter bar display. |
| [WP\_Plugin\_Install\_List\_Table::views()](../classes/wp_plugin_install_list_table/views) wp-admin/includes/class-wp-plugin-install-list-table.php | Overrides parent views so we can use the filter bar display. |
| [WP\_List\_Table::views()](../classes/wp_list_table/views) wp-admin/includes/class-wp-list-table.php | Displays the list of views available on this table. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'delete_user', int $id, int|null $reassign, WP_User $user ) do\_action( 'delete\_user', int $id, int|null $reassign, WP\_User $user )
=========================================================================
Fires immediately before a user is deleted from the database.
`$id` int ID of the user to delete. `$reassign` int|null ID of the user to reassign posts and links to.
Default null, for no reassignment. `$user` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object of the user to delete. The delete\_user action/hook can be used to perform additional actions when a user is deleted. For example, you can delete rows from custom tables created by a plugin.
This hook runs before a user is deleted. The hook deleted\_user (notice the “ed”) runs after a user is deleted. Choose the appropriate hook for your needs. If you need access to user meta or fields from the user table, use delete\_user.
Users deleted from Network Site installs may not trigger this hook. Be sure to use the wpmu\_delete\_user hook for those cases. The deleted\_user hook is called in either case.
File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
do_action( 'delete_user', $id, $reassign, $user );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_user()](../functions/wp_delete_user) wp-admin/includes/user.php | Remove user and optionally reassign posts and links to another user. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$user` parameter. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'wp_nav_menu_container_allowedtags', string[] $tags ) apply\_filters( 'wp\_nav\_menu\_container\_allowedtags', string[] $tags )
=========================================================================
Filters the list of HTML tags that are valid for use as menu containers.
`$tags` string[] The acceptable HTML tags for use as menu containers.
Default is array containing `'div'` and `'nav'`. File: `wp-includes/nav-menu-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu-template.php/)
```
$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_nav\_menu()](../functions/wp_nav_menu) wp-includes/nav-menu-template.php | Displays a navigation menu. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'media_view_strings', string[] $strings, WP_Post $post ) apply\_filters( 'media\_view\_strings', string[] $strings, WP\_Post $post )
===========================================================================
Filters the media view strings.
`$strings` string[] Array of media view strings keyed by the name they'll be referenced by in JavaScript. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$strings = apply_filters( 'media_view_strings', $strings, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_enqueue\_media()](../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress do_action( 'registered_taxonomy', string $taxonomy, array|string $object_type, array $args ) do\_action( 'registered\_taxonomy', string $taxonomy, array|string $object\_type, array $args )
===============================================================================================
Fires after a taxonomy is registered.
`$taxonomy` string Taxonomy slug. `$object_type` array|string Object type or array of object types. `$args` array Array of taxonomy registration arguments. registered\_taxonomy is a hook triggered after a custom taxonomy has been registered. This hook provides the taxonomy key, the name of the object type for the taxonomy object, and arguments used to register the taxonomy as parameters.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'registered_taxonomy', $taxonomy, $object_type, (array) $taxonomy_object );
```
| Used By | Description |
| --- | --- |
| [register\_taxonomy()](../functions/register_taxonomy) wp-includes/taxonomy.php | Creates or modifies a taxonomy object. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'widget_posts_args', array $args, array $instance ) apply\_filters( 'widget\_posts\_args', array $args, array $instance )
=====================================================================
Filters the arguments for the Recent Posts widget.
* [WP\_Query::get\_posts()](../classes/wp_query/get_posts)
`$args` array An array of arguments used to retrieve the recent posts. `$instance` array Array of settings for the current widget. Use any of the [WP\_Query](../classes/wp_query) parameters for $args.
File: `wp-includes/widgets/class-wp-widget-recent-posts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-recent-posts.php/)
```
apply_filters(
'widget_posts_args',
array(
'posts_per_page' => $number,
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true,
),
$instance
)
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Recent\_Posts::widget()](../classes/wp_widget_recent_posts/widget) wp-includes/widgets/class-wp-widget-recent-posts.php | Outputs the content for the current Recent Posts widget instance. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'admin_footer', string $data ) do\_action( 'admin\_footer', string $data )
===========================================
Prints scripts or data before the default footer scripts.
`$data` string The data to print. The `admin_footer` action is triggered just after closing the <div id=”wpfooter”> tag and right before `admin_print_footer_scripts` action call of the `admin-footer.php` page.
This hook is for admin only and can’t be used to add anything on the front end.
File: `wp-admin/admin-footer.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-footer.php/)
```
do_action( 'admin_footer', '' );
```
| Used By | Description |
| --- | --- |
| [iframe\_footer()](../functions/iframe_footer) wp-admin/includes/template.php | Generic Iframe footer for use with Thickbox. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress do_action_deprecated( 'wp_blacklist_check', string $author, string $email, string $url, string $comment, string $user_ip, string $user_agent ) do\_action\_deprecated( 'wp\_blacklist\_check', string $author, string $email, string $url, string $comment, string $user\_ip, string $user\_agent )
====================================================================================================================================================
This hook has been deprecated. Use [‘wp\_check\_comment\_disallowed\_list’](wp_check_comment_disallowed_list) instead.
Fires before the comment is tested for disallowed characters or words.
`$author` string Comment author. `$email` string Comment author's email. `$url` string Comment author's URL. `$comment` string Comment content. `$user_ip` string Comment author's IP address. `$user_agent` string Comment author's browser user agent. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action_deprecated(
'wp_blacklist_check',
array( $author, $email, $url, $comment, $user_ip, $user_agent ),
'5.5.0',
'wp_check_comment_disallowed_list',
__( 'Please consider writing more inclusive code.' )
);
```
| Used By | Description |
| --- | --- |
| [wp\_check\_comment\_disallowed\_list()](../functions/wp_check_comment_disallowed_list) wp-includes/comment.php | Checks if a comment contains disallowed characters or words. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Use ['wp\_check\_comment\_disallowed\_list'](wp_check_comment_disallowed_list) instead. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'the_tags', string $tag_list, string $before, string $sep, string $after, int $post_id ) apply\_filters( 'the\_tags', string $tag\_list, string $before, string $sep, string $after, int $post\_id )
===========================================================================================================
Filters the tags list for a given post.
`$tag_list` string List of tags. `$before` string String to use before the tags. `$sep` string String to use between the tags. `$after` string String to use after the tags. `$post_id` int Post ID. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
return apply_filters( 'the_tags', $tag_list, $before, $sep, $after, $post_id );
```
| Used By | Description |
| --- | --- |
| [get\_the\_tag\_list()](../functions/get_the_tag_list) wp-includes/category-template.php | Retrieves the tags for a post formatted as a string. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'parent_theme_file_path', string $path, string $file ) apply\_filters( 'parent\_theme\_file\_path', string $path, string $file )
=========================================================================
Filters the path to a file in the parent theme.
`$path` string The file path. `$file` string The requested file to search for. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'parent_theme_file_path', $path, $file );
```
| Used By | Description |
| --- | --- |
| [get\_parent\_theme\_file\_path()](../functions/get_parent_theme_file_path) wp-includes/link-template.php | Retrieves the path of a file in the parent theme. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_prepare_term', array $_term, array|object $term ) apply\_filters( 'xmlrpc\_prepare\_term', array $\_term, array|object $term )
============================================================================
Filters XML-RPC-prepared data for the given term.
`$_term` array An array of term data. `$term` array|object Term object or array. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
return apply_filters( 'xmlrpc_prepare_term', $_term, $term );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_prepare\_term()](../classes/wp_xmlrpc_server/_prepare_term) wp-includes/class-wp-xmlrpc-server.php | Prepares term data for return in an XML-RPC object. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_mw_newMediaObject', int $id, array $args ) do\_action( 'xmlrpc\_call\_success\_mw\_newMediaObject', int $id, array $args )
===============================================================================
Fires after a new attachment has been added via the XML-RPC MovableType API.
`$id` int ID of the new attachment. `$args` array An array of arguments to add the attachment. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::mw\_newMediaObject()](../classes/wp_xmlrpc_server/mw_newmediaobject) wp-includes/class-wp-xmlrpc-server.php | Uploads a file, following your settings. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'admin_referrer_policy', string $policy ) apply\_filters( 'admin\_referrer\_policy', string $policy )
===========================================================
Filters the admin referrer policy header value.
`$policy` string The admin referrer policy header value. Default `'strict-origin-when-cross-origin'`. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
$policy = apply_filters( 'admin_referrer_policy', $policy );
```
| Used By | Description |
| --- | --- |
| [wp\_admin\_headers()](../functions/wp_admin_headers) wp-admin/includes/misc.php | Sends a referrer policy header so referrers are not sent externally from administration screens. |
| Version | Description |
| --- | --- |
| [4.9.5](https://developer.wordpress.org/reference/since/4.9.5/) | The default value was changed to `'strict-origin-when-cross-origin'`. |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'random_password', string $password, int $length, bool $special_chars, bool $extra_special_chars ) apply\_filters( 'random\_password', string $password, int $length, bool $special\_chars, bool $extra\_special\_chars )
======================================================================================================================
Filters the randomly-generated password.
`$password` string The generated password. `$length` int The length of password to generate. `$special_chars` bool Whether to include standard special characters. `$extra_special_chars` bool Whether to include other special characters. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
return apply_filters( 'random_password', $password, $length, $special_chars, $extra_special_chars );
```
| Used By | Description |
| --- | --- |
| [wp\_generate\_password()](../functions/wp_generate_password) wp-includes/pluggable.php | Generates a random password drawn from the defined set of characters. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Added the `$length`, `$special_chars`, and `$extra_special_chars` parameters. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'term_exists_default_query_args', array $defaults, int|string $term, string $taxonomy, int|null $parent ) apply\_filters( 'term\_exists\_default\_query\_args', array $defaults, int|string $term, string $taxonomy, int|null $parent )
=============================================================================================================================
Filters default query arguments for checking if a term exists.
`$defaults` array An array of arguments passed to [get\_terms()](../functions/get_terms) . More Arguments from get\_terms( ... $args ) Array or query string of term query parameters.
* `taxonomy`string|string[]Taxonomy name, or array of taxonomy names, to which results should be limited.
* `object_ids`int|int[]Object ID, or array of object IDs. Results will be limited to terms associated with these objects.
* `orderby`stringField(s) to order terms by. Accepts:
+ Term fields (`'name'`, `'slug'`, `'term_group'`, `'term_id'`, `'id'`, `'description'`, `'parent'`, `'term_order'`). Unless `$object_ids` is not empty, `'term_order'` is treated the same as `'term_id'`.
+ `'count'` to use the number of objects associated with the term.
+ `'include'` to match the `'order'` of the `$include` param.
+ `'slug__in'` to match the `'order'` of the `$slug` param.
+ `'meta_value'`
+ `'meta_value_num'`.
+ The value of `$meta_key`.
+ The array keys of `$meta_query`.
+ `'none'` to omit the ORDER BY clause. Default `'name'`.
* `order`stringWhether to order terms in ascending or descending order.
Accepts `'ASC'` (ascending) or `'DESC'` (descending).
Default `'ASC'`.
* `hide_empty`bool|intWhether to hide terms not assigned to any posts. Accepts `1|true` or `0|false`. Default `1|true`.
* `include`int[]|stringArray or comma/space-separated string of term IDs to include.
Default empty array.
* `exclude`int[]|stringArray or comma/space-separated string of term IDs to exclude.
If `$include` is non-empty, `$exclude` is ignored.
Default empty array.
* `exclude_tree`int[]|stringArray or comma/space-separated string of term IDs to exclude along with all of their descendant terms. If `$include` is non-empty, `$exclude_tree` is ignored. Default empty array.
* `number`int|stringMaximum number of terms to return. Accepts ``''`|0` (all) or any positive number. Default ``''`|0` (all). Note that `$number` may not return accurate results when coupled with `$object_ids`.
See #41796 for details.
* `offset`intThe number by which to offset the terms query.
* `fields`stringTerm fields to query for. Accepts:
+ `'all'` Returns an array of complete term objects (`WP_Term[]`).
+ `'all_with_object_id'` Returns an array of term objects with the `'object_id'` param (`WP_Term[]`). Works only when the `$object_ids` parameter is populated.
+ `'ids'` Returns an array of term IDs (`int[]`).
+ `'tt_ids'` Returns an array of term taxonomy IDs (`int[]`).
+ `'names'` Returns an array of term names (`string[]`).
+ `'slugs'` Returns an array of term slugs (`string[]`).
+ `'count'` Returns the number of matching terms (`int`).
+ `'id=>parent'` Returns an associative array of parent term IDs, keyed by term ID (`int[]`).
+ `'id=>name'` Returns an associative array of term names, keyed by term ID (`string[]`).
+ `'id=>slug'` Returns an associative array of term slugs, keyed by term ID (`string[]`). Default `'all'`.
* `count`boolWhether to return a term count. If true, will take precedence over `$fields`. Default false.
* `name`string|string[]Name or array of names to return term(s) for.
* `slug`string|string[]Slug or array of slugs to return term(s) for.
* `term_taxonomy_id`int|int[]Term taxonomy ID, or array of term taxonomy IDs, to match when querying terms.
* `hierarchical`boolWhether to include terms that have non-empty descendants (even if `$hide_empty` is set to true). Default true.
* `search`stringSearch criteria to match terms. Will be SQL-formatted with wildcards before and after.
* `name__like`stringRetrieve terms with criteria by which a term is LIKE `$name__like`.
* `description__like`stringRetrieve terms where the description is LIKE `$description__like`.
* `pad_counts`boolWhether to pad the quantity of a term's children in the quantity of each term's "count" object variable. Default false.
* `get`stringWhether to return terms regardless of ancestry or whether the terms are empty. Accepts `'all'` or `''` (disabled). Default `''`.
* `child_of`intTerm ID to retrieve child terms of. If multiple taxonomies are passed, `$child_of` is ignored. Default 0.
* `parent`intParent term ID to retrieve direct-child terms of.
* `childless`boolTrue to limit results to terms that have no children.
This parameter has no effect on non-hierarchical taxonomies.
Default false.
* `cache_domain`stringUnique cache key to be produced when this query is stored in an object cache. Default `'core'`.
* `update_term_meta_cache`boolWhether to prime meta caches for matched terms. Default true.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
`$term` int|string The term to check. Accepts term ID, slug, or name. `$taxonomy` string The taxonomy name to use. An empty string indicates the search is against all taxonomies. `$parent` int|null ID of parent term under which to confine the exists search.
Null indicates the search is unconfined. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$defaults = apply_filters( 'term_exists_default_query_args', $defaults, $term, $taxonomy, $parent );
```
| Used By | Description |
| --- | --- |
| [term\_exists()](../functions/term_exists) wp-includes/taxonomy.php | Determines whether a taxonomy term exists. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( "{$permastructname}_rewrite_rules", string[] $rules ) apply\_filters( "{$permastructname}\_rewrite\_rules", string[] $rules )
=======================================================================
Filters rewrite rules used for individual permastructs.
The dynamic portion of the hook name, `$permastructname`, refers to the name of the registered permastruct.
Possible hook names include:
* `category_rewrite_rules`
* `post_format_rewrite_rules`
* `post_tag_rewrite_rules`
`$rules` string[] Array of rewrite rules generated for the current permastruct, keyed by their regex pattern. This filter hook allows you to modify various custom permastructs, such as those generated for custom post types or taxonomies (both built-in or custom).
File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
$rules = apply_filters( "{$permastructname}_rewrite_rules", $rules );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::rewrite\_rules()](../classes/wp_rewrite/rewrite_rules) wp-includes/class-wp-rewrite.php | Constructs rewrite matches and queries from permalink structure. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_prepare_comment', array $_comment, WP_Comment $comment ) apply\_filters( 'xmlrpc\_prepare\_comment', array $\_comment, WP\_Comment $comment )
====================================================================================
Filters XML-RPC-prepared data for the given comment.
`$_comment` array An array of prepared comment data. `$comment` [WP\_Comment](../classes/wp_comment) Comment object. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
return apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_prepare\_comment()](../classes/wp_xmlrpc_server/_prepare_comment) wp-includes/class-wp-xmlrpc-server.php | Prepares comment data for return in an XML-RPC object. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'wp_calculate_image_srcset_meta', array $image_meta, int[] $size_array, string $image_src, int $attachment_id ) apply\_filters( 'wp\_calculate\_image\_srcset\_meta', array $image\_meta, int[] $size\_array, string $image\_src, int $attachment\_id )
=======================================================================================================================================
Pre-filters the image meta to be able to fix inconsistencies in the stored data.
`$image_meta` array The image meta data as returned by '[wp\_get\_attachment\_metadata()](../functions/wp_get_attachment_metadata) '. `$size_array` int[] An array of requested width and height values.
* intThe width in pixels.
* `1`intThe height in pixels.
`$image_src` string The `'src'` of the image. `$attachment_id` int The image attachment ID or 0 if not supplied. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$image_meta = apply_filters( 'wp_calculate_image_srcset_meta', $image_meta, $size_array, $image_src, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_calculate\_image\_srcset()](../functions/wp_calculate_image_srcset) wp-includes/media.php | A helper function to calculate the image sources to include in a ‘srcset’ attribute. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( "update_{$meta_type}_metadata_by_mid", null|bool $check, int $meta_id, mixed $meta_value, string|false $meta_key ) apply\_filters( "update\_{$meta\_type}\_metadata\_by\_mid", null|bool $check, int $meta\_id, mixed $meta\_value, string|false $meta\_key )
==========================================================================================================================================
Short-circuits updating metadata of a specific type by meta ID.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
* `update_post_metadata_by_mid`
* `update_comment_metadata_by_mid`
* `update_term_metadata_by_mid`
* `update_user_metadata_by_mid`
`$check` null|bool Whether to allow updating metadata for the given type. `$meta_id` int Meta ID. `$meta_value` mixed Meta value. Must be serializable if non-scalar. `$meta_key` string|false Meta key, if provided. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
$check = apply_filters( "update_{$meta_type}_metadata_by_mid", null, $meta_id, $meta_value, $meta_key );
```
| Used By | Description |
| --- | --- |
| [update\_metadata\_by\_mid()](../functions/update_metadata_by_mid) wp-includes/meta.php | Updates metadata by meta ID. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( "extra_{$context}_headers", array $extra_context_headers ) apply\_filters( "extra\_{$context}\_headers", array $extra\_context\_headers )
==============================================================================
Filters extra file headers by context.
The dynamic portion of the hook name, `$context`, refers to the context where extra headers might be loaded.
`$extra_context_headers` array Empty array by default. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$extra_headers = $context ? apply_filters( "extra_{$context}_headers", array() ) : array();
```
| Used By | Description |
| --- | --- |
| [get\_file\_data()](../functions/get_file_data) wp-includes/functions.php | Retrieves metadata from a file. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'register_url', string $register ) apply\_filters( 'register\_url', string $register )
===================================================
Filters the user registration URL.
`$register` string The user registration URL. register\_url is a filter applied to the URL returned by the function [wp\_registration\_url()](../functions/wp_registration_url) which allows you to have that function direct users to a specific (different) URL for registration.
The URL that is passed to this filter is generated by [site\_url()](../functions/site_url) using the ‘login’ $scheme:
```
site_url( 'wp-login.php?action=register', 'login' )
```
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_registration\_url()](../functions/wp_registration_url) wp-includes/general-template.php | Returns the URL that allows the user to register on the site. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'the_category_rss', string $the_list, string $type ) apply\_filters( 'the\_category\_rss', string $the\_list, string $type )
=======================================================================
Filters all of the post categories for display in a feed.
`$the_list` string All of the RSS post categories. `$type` string Type of feed. Possible values include `'rss2'`, `'atom'`.
Default `'rss2'`. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
return apply_filters( 'the_category_rss', $the_list, $type );
```
| Used By | Description |
| --- | --- |
| [get\_the\_category\_rss()](../functions/get_the_category_rss) wp-includes/feed.php | Retrieves all of the post categories, formatted for use in feeds. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress do_action( "delete_site_transient_{$transient}", string $transient ) do\_action( "delete\_site\_transient\_{$transient}", string $transient )
========================================================================
Fires immediately before a specific site transient is deleted.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$transient` string Transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( "delete_site_transient_{$transient}", $transient );
```
| Used By | Description |
| --- | --- |
| [delete\_site\_transient()](../functions/delete_site_transient) wp-includes/option.php | Deletes a site transient. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'wp_mail_succeeded', array $mail_data ) do\_action( 'wp\_mail\_succeeded', array $mail\_data )
======================================================
Fires after PHPMailer has successfully sent an email.
The firing of this action does not necessarily mean that the recipient(s) received the email successfully. It only means that the `send` method above was able to process the request without any errors.
`$mail_data` array An array containing the email recipient(s), subject, message, headers, and attachments.
* `to`string[]Email addresses to send message.
* `subject`stringEmail subject.
* `message`stringMessage contents.
* `headers`string[]Additional headers.
* `attachments`string[]Paths to files to attach.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'wp_mail_succeeded', $mail_data );
```
| Used By | Description |
| --- | --- |
| [wp\_mail()](../functions/wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'incompatible_sql_modes', array $incompatible_modes ) apply\_filters( 'incompatible\_sql\_modes', array $incompatible\_modes )
========================================================================
Filters the list of incompatible SQL modes to exclude.
`$incompatible_modes` array An array of incompatible modes. File: `wp-includes/class-wpdb.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wpdb.php/)
```
$incompatible_modes = (array) apply_filters( 'incompatible_sql_modes', $this->incompatible_modes );
```
| Used By | Description |
| --- | --- |
| [wpdb::set\_sql\_mode()](../classes/wpdb/set_sql_mode) wp-includes/class-wpdb.php | Changes the current SQL mode, and ensures its WordPress compatibility. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress do_action( "activate_{$plugin}", bool $network_wide ) do\_action( "activate\_{$plugin}", bool $network\_wide )
========================================================
Fires as a specific plugin is being activated.
This hook is the "activation" hook used internally by [register\_activation\_hook()](../functions/register_activation_hook) .
The dynamic portion of the hook name, `$plugin`, refers to the plugin basename.
If a plugin is silently activated (such as during an update), this hook does not fire.
`$network_wide` bool Whether to enable the plugin for all sites in the network or just the current site. Multisite only. Default false. This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
It is recommended to use the function [register\_activation\_hook()](../functions/register_activation_hook) instead of this function.
File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
do_action( "activate_{$plugin}", $network_wide );
```
| Used By | Description |
| --- | --- |
| [activate\_plugin()](../functions/activate_plugin) wp-admin/includes/plugin.php | Attempts activation of plugin in a “sandbox” and redirects on success. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress do_action( 'comment_closed', int $comment_post_id ) do\_action( 'comment\_closed', int $comment\_post\_id )
=======================================================
Fires when a comment is attempted on a post that has comments closed.
`$comment_post_id` int Post ID. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'comment_closed', $comment_post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_handle\_comment\_submission()](../functions/wp_handle_comment_submission) wp-includes/comment.php | Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'widget_block_content', string $content, array $instance, WP_Widget_Block $widget ) apply\_filters( 'widget\_block\_content', string $content, array $instance, WP\_Widget\_Block $widget )
=======================================================================================================
Filters the content of the Block widget before output.
`$content` string The widget content. `$instance` array Array of settings for the current widget. `$widget` [WP\_Widget\_Block](../classes/wp_widget_block) Current Block widget instance. File: `wp-includes/widgets/class-wp-widget-block.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-block.php/)
```
echo apply_filters(
'widget_block_content',
$instance['content'],
$instance,
$this
);
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Block::widget()](../classes/wp_widget_block/widget) wp-includes/widgets/class-wp-widget-block.php | Outputs the content for the current Block widget instance. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'get_archives_link', string $link_html, string $url, string $text, string $format, string $before, string $after, bool $selected ) apply\_filters( 'get\_archives\_link', string $link\_html, string $url, string $text, string $format, string $before, string $after, bool $selected )
=====================================================================================================================================================
Filters the archive link content.
`$link_html` string The archive HTML link content. `$url` string URL to archive. `$text` string Archive text description. `$format` string Link format. Can be `'link'`, `'option'`, `'html'`, or custom. `$before` string Content to prepend to the description. `$after` string Content to append to the description. `$selected` bool True if the current page is the selected archive. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'get_archives_link', $link_html, $url, $text, $format, $before, $after, $selected );
```
| Used By | Description |
| --- | --- |
| [get\_archives\_link()](../functions/get_archives_link) wp-includes/general-template.php | Retrieves archive link content based on predefined or custom code. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Added the `$selected` parameter. |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Added the `$url`, `$text`, `$format`, `$before`, and `$after` parameters. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'intermediate_image_sizes_advanced', array $new_sizes, array $image_meta, int $attachment_id ) apply\_filters( 'intermediate\_image\_sizes\_advanced', array $new\_sizes, array $image\_meta, int $attachment\_id )
====================================================================================================================
Filters the image sizes automatically generated when uploading an image.
`$new_sizes` array Associative array of image sizes to be created. `$image_meta` array The image meta data: width, height, file, sizes, etc. `$attachment_id` int The attachment post ID for the image. File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
$new_sizes = apply_filters( 'intermediate_image_sizes_advanced', $new_sizes, $image_meta, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_create\_image\_subsizes()](../functions/wp_create_image_subsizes) wp-admin/includes/image.php | Creates image sub-sizes, adds the new data to the image meta `sizes` array, and updates the image metadata. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Added the `$attachment_id` argument. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$image_meta` argument. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'retrieve_password_message', string $message, string $key, string $user_login, WP_User $user_data ) apply\_filters( 'retrieve\_password\_message', string $message, string $key, string $user\_login, WP\_User $user\_data )
========================================================================================================================
Filters the message body of the password reset mail.
If the filtered message is empty, the password reset email will not be sent.
`$message` string Email message. `$key` string The activation key. `$user_login` string The username for the user. `$user_data` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );
```
| Used By | Description |
| --- | --- |
| [retrieve\_password()](../functions/retrieve_password) wp-includes/user.php | Handles sending a password retrieval email to a user. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Added `$user_login` and `$user_data` parameters. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'user_erasure_fulfillment_email_to', string $user_email, WP_User_Request $request ) apply\_filters( 'user\_erasure\_fulfillment\_email\_to', string $user\_email, WP\_User\_Request $request )
==========================================================================================================
Filters the recipient of the data erasure fulfillment notification.
`$user_email` string The email address of the notification recipient. `$request` [WP\_User\_Request](../classes/wp_user_request) The request that is initiating the notification. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$user_email = apply_filters( 'user_erasure_fulfillment_email_to', $request->email, $request );
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_erasure\_fulfillment\_notification()](../functions/_wp_privacy_send_erasure_fulfillment_notification) wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress do_action( "customize_save_{$id_base}", WP_Customize_Setting $setting ) do\_action( "customize\_save\_{$id\_base}", WP\_Customize\_Setting $setting )
=============================================================================
Fires when the [WP\_Customize\_Setting::save()](../classes/wp_customize_setting/save) method is called.
The dynamic portion of the hook name, `$id_base` refers to the base slug of the setting name.
`$setting` [WP\_Customize\_Setting](../classes/wp_customize_setting) [WP\_Customize\_Setting](../classes/wp_customize_setting) instance. File: `wp-includes/class-wp-customize-setting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-setting.php/)
```
do_action( "customize_save_{$id_base}", $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Setting::save()](../classes/wp_customize_setting/save) wp-includes/class-wp-customize-setting.php | Checks user capabilities and theme supports, and then saves the value of the setting. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'nav_menu_submenu_css_class', string[] $classes, stdClass $args, int $depth ) apply\_filters( 'nav\_menu\_submenu\_css\_class', string[] $classes, stdClass $args, int $depth )
=================================================================================================
Filters the CSS class(es) applied to a menu list element.
`$classes` string[] Array of the CSS classes that are applied to the menu `<ul>` element. `$args` stdClass An object of `wp_nav_menu()` arguments. `$depth` int Depth of menu item. Used for padding. File: `wp-includes/class-walker-nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-nav-menu.php/)
```
$class_names = implode( ' ', apply_filters( 'nav_menu_submenu_css_class', $classes, $args, $depth ) );
```
| Used By | Description |
| --- | --- |
| [Walker\_Nav\_Menu::start\_lvl()](../classes/walker_nav_menu/start_lvl) wp-includes/class-walker-nav-menu.php | Starts the list before the elements are added. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( 'gettext', string $translation, string $text, string $domain ) apply\_filters( 'gettext', string $translation, string $text, string $domain )
==============================================================================
Filters text with its translation.
`$translation` string Translated text. `$text` string Text to translate. `$domain` string Text domain. Unique identifier for retrieving translated strings. This filter hook is applied to the translated text by the internationalization functions (`[\_\_()](../functions/__)`, `[\_e()](../functions/_e)`, etc.).
**IMPORTANT:** This filter is always applied even if internationalization is not in effect, and if the text domain has not been loaded. If there are functions hooked to this filter, they will always run. This could lead to a performance problem.
For singular/plural aware translation functions such as `[\_n()](../functions/_n)`, see `[ngettext()](ngettext)`.
For context-specific translation functions such as `[\_x()](../functions/_x)`, see filter hook [`gettext_with_context()`](gettext_with_context) and `[ngettext\_with\_context()](ngettext_with_context)`.
File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$translation = apply_filters( 'gettext', $translation, $text, $domain );
```
| Used By | Description |
| --- | --- |
| [translate()](../functions/translate) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [2.0.11](https://developer.wordpress.org/reference/since/2.0.11/) | Introduced. |
wordpress apply_filters( 'widget_links_args', array $widget_links_args, array $instance ) apply\_filters( 'widget\_links\_args', array $widget\_links\_args, array $instance )
====================================================================================
Filters the arguments for the Links widget.
* [wp\_list\_bookmarks()](../functions/wp_list_bookmarks)
`$widget_links_args` array An array of arguments to retrieve the links list. `$instance` array The settings for the particular instance of the widget. File: `wp-includes/widgets/class-wp-widget-links.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-links.php/)
```
wp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Links::widget()](../classes/wp_widget_links/widget) wp-includes/widgets/class-wp-widget-links.php | Outputs the content for the current Links widget instance. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$instance` parameter. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
| programming_docs |
wordpress apply_filters_deprecated( 'blog_details', WP_Site $details ) apply\_filters\_deprecated( 'blog\_details', WP\_Site $details )
================================================================
This hook has been deprecated. Use [‘site\_details’](site_details) instead.
Filters a blog’s details.
`$details` [WP\_Site](../classes/wp_site) The blog details. File: `wp-includes/ms-blogs.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-blogs.php/)
```
$details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' );
```
| Used By | Description |
| --- | --- |
| [WP\_Site::get\_details()](../classes/wp_site/get_details) wp-includes/class-wp-site.php | Retrieves the details for this site. |
| [get\_blog\_details()](../functions/get_blog_details) wp-includes/ms-blogs.php | Retrieve the details for a blog from the blogs table and blog options. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Use ['site\_details'](site_details) instead. |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( 'granted_super_admin', int $user_id ) do\_action( 'granted\_super\_admin', int $user\_id )
====================================================
Fires after the user is granted Super Admin privileges.
`$user_id` int ID of the user that was granted Super Admin privileges. File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
do_action( 'granted_super_admin', $user_id );
```
| Used By | Description |
| --- | --- |
| [grant\_super\_admin()](../functions/grant_super_admin) wp-includes/capabilities.php | Grants Super Admin privileges. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'restrict_manage_posts', string $post_type, string $which ) do\_action( 'restrict\_manage\_posts', string $post\_type, string $which )
==========================================================================
Fires before the Filter button on the Posts and Pages list tables.
The Filter button allows sorting by date and/or category on the Posts list table, and sorting by date on the Pages list table.
`$post_type` string The post type slug. `$which` string The location of the extra table nav markup: `'top'` or `'bottom'` for [WP\_Posts\_List\_Table](../classes/wp_posts_list_table), `'bar'` for [WP\_Media\_List\_Table](../classes/wp_media_list_table). File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
```
| Used By | Description |
| --- | --- |
| [WP\_Media\_List\_Table::extra\_tablenav()](../classes/wp_media_list_table/extra_tablenav) wp-admin/includes/class-wp-media-list-table.php | |
| [WP\_Posts\_List\_Table::extra\_tablenav()](../classes/wp_posts_list_table/extra_tablenav) wp-admin/includes/class-wp-posts-list-table.php | |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | The `$which` parameter was added. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$post_type` parameter was added. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( "ngettext_{$domain}", string $translation, string $single, string $plural, int $number, string $domain ) apply\_filters( "ngettext\_{$domain}", string $translation, string $single, string $plural, int $number, string $domain )
=========================================================================================================================
Filters the singular or plural form of a string for a domain.
The dynamic portion of the hook name, `$domain`, refers to the text domain.
`$translation` string Translated text. `$single` string The text to be used if the number is singular. `$plural` string The text to be used if the number is plural. `$number` int The number to compare against to use either the singular or plural form. `$domain` string Text domain. Unique identifier for retrieving translated strings. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$translation = apply_filters( "ngettext_{$domain}", $translation, $single, $plural, $number, $domain );
```
| Used By | Description |
| --- | --- |
| [\_n()](../functions/_n) wp-includes/l10n.php | Translates and retrieves the singular or plural form based on the supplied number. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'set_user_role', int $user_id, string $role, string[] $old_roles ) do\_action( 'set\_user\_role', int $user\_id, string $role, string[] $old\_roles )
==================================================================================
Fires after the user’s role has changed.
`$user_id` int The user ID. `$role` string The new role. `$old_roles` string[] An array of the user's previous roles. File: `wp-includes/class-wp-user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-user.php/)
```
do_action( 'set_user_role', $this->ID, $role, $old_roles );
```
| Used By | Description |
| --- | --- |
| [WP\_User::set\_role()](../classes/wp_user/set_role) wp-includes/class-wp-user.php | Sets the role of the user. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Added $old\_roles to include an array of the user's previous roles. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'pre_update_option', mixed $value, string $option, mixed $old_value ) apply\_filters( 'pre\_update\_option', mixed $value, string $option, mixed $old\_value )
========================================================================================
Filters an option before its value is (maybe) serialized and updated.
`$value` mixed The new, unserialized option value. `$option` string Name of the option. `$old_value` mixed The old option value. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$value = apply_filters( 'pre_update_option', $value, $option, $old_value );
```
| Used By | Description |
| --- | --- |
| [update\_option()](../functions/update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'excerpt_allowed_wrapper_blocks', string[] $allowed_wrapper_blocks ) apply\_filters( 'excerpt\_allowed\_wrapper\_blocks', string[] $allowed\_wrapper\_blocks )
=========================================================================================
Filters the list of blocks that can be used as wrapper blocks, allowing excerpts to be generated from the `innerBlocks` of these wrappers.
`$allowed_wrapper_blocks` string[] The list of names of allowed wrapper blocks. File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
$allowed_wrapper_blocks = apply_filters( 'excerpt_allowed_wrapper_blocks', $allowed_wrapper_blocks );
```
| Used By | Description |
| --- | --- |
| [excerpt\_remove\_blocks()](../functions/excerpt_remove_blocks) wp-includes/blocks.php | Parses blocks out of a content string, and renders those appropriate for the excerpt. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress do_action( 'wp_head' ) do\_action( 'wp\_head' )
========================
Prints scripts or data in the head tag on the front end.
The wp\_head action hook is triggered within the `<head></head>` section of the theme’s `header.php` template by the [`wp_head()`](../functions/wp_head) function.
Although this is theme-dependent, it is one of the most essential theme hooks, so it is widely supported. See the [Plugin API Hooks](https://developer.wordpress.org/themes/advanced-topics/plugin-api-hooks/) page on the [Theme handbook](https://developer.wordpress.org/themes/) for more information.
WordPress core uses this hook to perform many actions. Most of default actions into the 'wp-head' hook by WordPress core are set up in `[wp-includes/default-filters.php](https://core.trac.wordpress.org/browser/tags/5.2.3/src/wp-includes/default-filters.php#L0)`. If you need to [remove](../functions/remove_action) a default hook, this file will give you the priority for which to use to remove the hook.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'wp_head' );
```
| Used By | Description |
| --- | --- |
| [wp\_head()](../functions/wp_head) wp-includes/general-template.php | Fires the wp\_head action. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( "pre_{$taxonomy}_{$field}", mixed $value ) apply\_filters( "pre\_{$taxonomy}\_{$field}", mixed $value )
============================================================
Filters a taxonomy field before it is sanitized.
The dynamic portions of the filter name, `$taxonomy` and `$field`, refer to the taxonomy slug and field name, respectively.
`$value` mixed Value of the taxonomy field. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$value = apply_filters( "pre_{$taxonomy}_{$field}", $value );
```
| Used By | Description |
| --- | --- |
| [sanitize\_term\_field()](../functions/sanitize_term_field) wp-includes/taxonomy.php | Sanitizes the field value in the term based on the context. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_request', string $request, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_request', string $request, WP\_Query $query )
=================================================================================
Filters the completed SQL query before sending.
`$request` string The complete SQL query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). The input of this filter is the post request SQL, something like the following:
`SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts LEFT JOIN wp_posts AS p2 ON ( wp_posts.post_parent = p2.ID ) WHERE 1=1 AND wp_posts.ID IN ( 3, 632 ) AND wp_posts.post_type != 'revision' AND ( ( wp_posts.post_status = 'publish' ) OR ( wp_posts.post_status = 'inherit' AND ( p2.post_status = 'publish' ) ) ) ORDER BY wp_posts.post_date DESC LIMIT 0, 20`
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'screen_options_show_screen', bool $show_screen, WP_Screen $screen ) apply\_filters( 'screen\_options\_show\_screen', bool $show\_screen, WP\_Screen $screen )
=========================================================================================
Filters whether to show the Screen Options tab.
`$show_screen` bool Whether to show Screen Options tab.
Default true. `$screen` [WP\_Screen](../classes/wp_screen) Current [WP\_Screen](../classes/wp_screen) instance. File: `wp-admin/includes/class-wp-screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-screen.php/)
```
$this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::show\_screen\_options()](../classes/wp_screen/show_screen_options) wp-admin/includes/class-wp-screen.php | |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'edit_tags_per_page', int $tags_per_page ) apply\_filters( 'edit\_tags\_per\_page', int $tags\_per\_page )
===============================================================
Filters the number of terms displayed per page for the Tags list table.
`$tags_per_page` int Number of tags to be displayed. Default 20. File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
```
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::prepare\_items()](../classes/wp_terms_list_table/prepare_items) wp-admin/includes/class-wp-terms-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'the_weekday', string $the_weekday ) apply\_filters( 'the\_weekday', string $the\_weekday )
======================================================
Filters the weekday on which the post was written, for display.
`$the_weekday` string File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
echo apply_filters( 'the_weekday', $the_weekday );
```
| Used By | Description |
| --- | --- |
| [the\_weekday()](../functions/the_weekday) wp-includes/general-template.php | Displays the weekday on which the post was written. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress do_action_ref_array( 'pre_get_terms', WP_Term_Query $query ) do\_action\_ref\_array( 'pre\_get\_terms', WP\_Term\_Query $query )
===================================================================
Fires before terms are retrieved.
`$query` [WP\_Term\_Query](../classes/wp_term_query) Current instance of [WP\_Term\_Query](../classes/wp_term_query) (passed by reference). File: `wp-includes/class-wp-term-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-term-query.php/)
```
do_action_ref_array( 'pre_get_terms', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Term\_Query::get\_terms()](../classes/wp_term_query/get_terms) wp-includes/class-wp-term-query.php | Retrieves the query results. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'get_calendar', string $calendar_output ) apply\_filters( 'get\_calendar', string $calendar\_output )
===========================================================
Filters the HTML calendar output.
`$calendar_output` string HTML output of the calendar. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
echo apply_filters( 'get_calendar', $calendar_output );
```
| Used By | Description |
| --- | --- |
| [get\_calendar()](../functions/get_calendar) wp-includes/general-template.php | Displays calendar with days that have posts as links. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'get_comments_number', string|int $count, int $post_id ) apply\_filters( 'get\_comments\_number', string|int $count, int $post\_id )
===========================================================================
Filters the returned comment count for a post.
`$count` string|int A string representing the number of comments a post has, otherwise 0. `$post_id` int Post ID. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'get_comments_number', $count, $post_id );
```
| Used By | Description |
| --- | --- |
| [get\_comments\_number()](../functions/get_comments_number) wp-includes/comment-template.php | Retrieves the amount of comments a post has. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'edit_attachment', int $post_ID ) do\_action( 'edit\_attachment', int $post\_ID )
===============================================
Fires once an existing attachment has been updated.
`$post_ID` int Attachment ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'edit_attachment', $post_ID );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'wpmu_users_columns', string[] $users_columns ) apply\_filters( 'wpmu\_users\_columns', string[] $users\_columns )
==================================================================
Filters the columns displayed in the Network Admin Users list table.
`$users_columns` string[] An array of user columns. Default `'cb'`, `'username'`, `'name'`, `'email'`, `'registered'`, `'blogs'`. File: `wp-admin/includes/class-wp-ms-users-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-users-list-table.php/)
```
return apply_filters( 'wpmu_users_columns', $users_columns );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Users\_List\_Table::get\_columns()](../classes/wp_ms_users_list_table/get_columns) wp-admin/includes/class-wp-ms-users-list-table.php | |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( "delete_option_{$option}", string $option ) do\_action( "delete\_option\_{$option}", string $option )
=========================================================
Fires after a specific option has been deleted.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$option` string Name of the deleted option. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( "delete_option_{$option}", $option );
```
| Used By | Description |
| --- | --- |
| [delete\_option()](../functions/delete_option) wp-includes/option.php | Removes option by name. Prevents removal of protected WordPress options. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'embed_handler_html', string|false $return, string $url, array $attr ) apply\_filters( 'embed\_handler\_html', string|false $return, string $url, array $attr )
========================================================================================
Filters the returned embed HTML.
* [WP\_Embed::shortcode()](../classes/wp_embed/shortcode)
`$return` string|false The HTML result of the shortcode, or false on failure. `$url` string The embed URL. `$attr` array An array of shortcode attributes. File: `wp-includes/class-wp-embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-embed.php/)
```
return apply_filters( 'embed_handler_html', $return, $url, $attr );
```
| Used By | Description |
| --- | --- |
| [WP\_Embed::get\_embed\_handler\_html()](../classes/wp_embed/get_embed_handler_html) wp-includes/class-wp-embed.php | Returns embed HTML for a given URL from embed handlers. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_image_attributes', string[] $attr, WP_Post $attachment, string|int[] $size ) apply\_filters( 'wp\_get\_attachment\_image\_attributes', string[] $attr, WP\_Post $attachment, string|int[] $size )
====================================================================================================================
Filters the list of attachment image attributes.
`$attr` string[] Array of attribute values for the image markup, keyed by attribute name.
See [wp\_get\_attachment\_image()](../functions/wp_get_attachment_image) . More Arguments from wp\_get\_attachment\_image( ... $attr ) Attributes for the image markup.
* `src`stringImage attachment URL.
* `class`stringCSS class name or space-separated list of classes.
Default `attachment-$size_class size-$size_class`, where `$size_class` is the image size being requested.
* `alt`stringImage description for the alt attribute.
* `srcset`stringThe `'srcset'` attribute value.
* `sizes`stringThe `'sizes'` attribute value.
* `loading`string|falseThe `'loading'` attribute value. Passing a value of false will result in the attribute being omitted for the image.
Defaults to `'lazy'`, depending on [wp\_lazy\_loading\_enabled()](../functions/wp_lazy_loading_enabled) .
* `decoding`stringThe `'decoding'` attribute value. Possible values are `'async'` (default), `'sync'`, or `'auto'`.
`$attachment` [WP\_Post](../classes/wp_post) Image attachment post. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_image()](../functions/wp_get_attachment_image) wp-includes/media.php | Gets an HTML img element representing an image attachment. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( "{$action}_prefilter", array $file ) apply\_filters( "{$action}\_prefilter", array $file )
=====================================================
Filters the data for a file before it is uploaded to WordPress.
The dynamic portion of the hook name, `$action`, refers to the post action.
Possible hook names include:
* `wp_handle_sideload_prefilter`
* `wp_handle_upload_prefilter`
`$file` array Reference to a single element from `$_FILES`.
* `name`stringThe original name of the file on the client machine.
* `type`stringThe mime type of the file, if the browser provided this information.
* `tmp_name`stringThe temporary filename of the file in which the uploaded file was stored on the server.
* `size`intThe size, in bytes, of the uploaded file.
* `error`intThe error code associated with this file upload.
File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$file = apply_filters( "{$action}_prefilter", $file );
```
| Used By | Description |
| --- | --- |
| [\_wp\_handle\_upload()](../functions/_wp_handle_upload) wp-admin/includes/file.php | Handles PHP uploads in WordPress. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Converted to a dynamic hook with `$action`. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'change_locale', string $locale ) do\_action( 'change\_locale', string $locale )
==============================================
Fires when the locale is switched to or restored.
`$locale` string The new locale. File: `wp-includes/class-wp-locale-switcher.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-locale-switcher.php/)
```
do_action( 'change_locale', $locale );
```
| Used By | Description |
| --- | --- |
| [WP\_Locale\_Switcher::change\_locale()](../classes/wp_locale_switcher/change_locale) wp-includes/class-wp-locale-switcher.php | Changes the site’s locale to the given one. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'site_status_test_php_modules', array $modules ) apply\_filters( 'site\_status\_test\_php\_modules', array $modules )
====================================================================
Filters the array representing all the modules we wish to test for.
`$modules` array An associative array of modules to test for.
* `...$0`array An associative array of module properties used during testing.
One of either `$function` or `$extension` must be provided, or they will fail by default.
+ `function`stringOptional. A function name to test for the existence of.
+ `extension`stringOptional. An extension to check if is loaded in PHP.
+ `constant`stringOptional. A constant name to check for to verify an extension exists.
+ `class`stringOptional. A class name to check for to verify an extension exists.
+ `required`boolIs this a required feature or not.
+ `fallback_for`stringOptional. The module this module replaces as a fallback. File: `wp-admin/includes/class-wp-site-health.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-site-health.php/)
```
$modules = apply_filters( 'site_status_test_php_modules', $modules );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::get\_test\_php\_extensions()](../classes/wp_site_health/get_test_php_extensions) wp-admin/includes/class-wp-site-health.php | Tests if required PHP modules are installed on the host. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | The `$constant` and `$class` parameters were added. |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'block_editor_rest_api_preload_paths', string[] $preload_paths, WP_Block_Editor_Context $block_editor_context ) apply\_filters( 'block\_editor\_rest\_api\_preload\_paths', string[] $preload\_paths, WP\_Block\_Editor\_Context $block\_editor\_context )
==========================================================================================================================================
Filters the array of REST API paths that will be used to preloaded common data for the block editor.
`$preload_paths` string[] Array of paths to preload. `$block_editor_context` [WP\_Block\_Editor\_Context](../classes/wp_block_editor_context) The current block editor context. File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
$preload_paths = apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context );
```
| Used By | Description |
| --- | --- |
| [block\_editor\_rest\_api\_preload()](../functions/block_editor_rest_api_preload) wp-includes/block-editor.php | Preloads common data used with the block editor by specifying an array of REST API paths that will be preloaded for a given block editor context. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'load_image_to_edit_filesystempath', string $path, int $attachment_id, string|int[] $size ) apply\_filters( 'load\_image\_to\_edit\_filesystempath', string $path, int $attachment\_id, string|int[] $size )
================================================================================================================
Filters the path to an attachment’s file when editing the image.
The filter is evaluated for all image sizes except ‘full’.
`$path` string Path to the current image. `$attachment_id` int Attachment ID. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
$filepath = apply_filters( 'load_image_to_edit_filesystempath', $filepath, $attachment_id, $size );
```
| Used By | Description |
| --- | --- |
| [\_load\_image\_to\_edit\_path()](../functions/_load_image_to_edit_path) wp-admin/includes/image.php | Retrieves the path or URL of an attachment’s attached file. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'rest_after_insert_user', WP_User $user, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_after\_insert\_user', WP\_User $user, WP\_REST\_Request $request, bool $creating )
=====================================================================================================
Fires after a user is completely created or updated via the REST API.
`$user` [WP\_User](../classes/wp_user) Inserted or updated user object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating a user, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php/)
```
do_action( 'rest_after_insert_user', $user, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::create\_item()](../classes/wp_rest_users_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Creates a single user. |
| [WP\_REST\_Users\_Controller::update\_item()](../classes/wp_rest_users_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates a single user. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'comment_row_actions', string[] $actions, WP_Comment $comment ) apply\_filters( 'comment\_row\_actions', string[] $actions, WP\_Comment $comment )
==================================================================================
Filters the action links displayed for each comment in the ‘Recent Comments’ dashboard widget.
`$actions` string[] An array of comment actions. Default actions include: `'Approve'`, `'Unapprove'`, `'Edit'`, `'Reply'`, `'Spam'`, `'Delete'`, and `'Trash'`. `$comment` [WP\_Comment](../classes/wp_comment) The comment object. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
$actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
```
| Used By | Description |
| --- | --- |
| [WP\_Comments\_List\_Table::handle\_row\_actions()](../classes/wp_comments_list_table/handle_row_actions) wp-admin/includes/class-wp-comments-list-table.php | Generates and displays row actions links. |
| [\_wp\_dashboard\_recent\_comments\_row()](../functions/_wp_dashboard_recent_comments_row) wp-admin/includes/dashboard.php | Outputs a row for the Recent Comments widget. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'pre_user_nickname', string $nickname ) apply\_filters( 'pre\_user\_nickname', string $nickname )
=========================================================
Filters a user’s nickname before the user is created or updated.
`$nickname` string The user's nickname. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$meta['nickname'] = apply_filters( 'pre_user_nickname', $nickname );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [2.0.3](https://developer.wordpress.org/reference/since/2.0.3/) | Introduced. |
wordpress apply_filters( 'get_canonical_url', string $canonical_url, WP_Post $post ) apply\_filters( 'get\_canonical\_url', string $canonical\_url, WP\_Post $post )
===============================================================================
Filters the canonical URL for a post.
`$canonical_url` string The post's canonical URL. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'get_canonical_url', $canonical_url, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_canonical\_url()](../functions/wp_get_canonical_url) wp-includes/link-template.php | Returns the canonical URL for a post. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'wp_read_audio_metadata', array $metadata, string $file, string|null $file_format, array $data ) apply\_filters( 'wp\_read\_audio\_metadata', array $metadata, string $file, string|null $file\_format, array $data )
====================================================================================================================
Filters the array of metadata retrieved from an audio file.
In core, usually this selection is what is stored.
More complete data can be parsed from the `$data` parameter.
`$metadata` array Filtered audio metadata. `$file` string Path to audio file. `$file_format` string|null File format of audio, as analyzed by getID3.
Null if unknown. `$data` array Raw metadata from getID3. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
return apply_filters( 'wp_read_audio_metadata', $metadata, $file, $file_format, $data );
```
| Used By | Description |
| --- | --- |
| [wp\_read\_audio\_metadata()](../functions/wp_read_audio_metadata) wp-admin/includes/media.php | Retrieves metadata from an audio file’s ID3 tags. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'rest_avatar_sizes', int[] $sizes ) apply\_filters( 'rest\_avatar\_sizes', int[] $sizes )
=====================================================
Filters the REST avatar sizes.
Use this filter to adjust the array of sizes returned by the `rest_get_avatar_sizes` function.
`$sizes` int[] An array of int values that are the pixel sizes for avatars.
Default `[ 24, 48, 96 ]`. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
return apply_filters( 'rest_avatar_sizes', array( 24, 48, 96 ) );
```
| Used By | Description |
| --- | --- |
| [rest\_get\_avatar\_sizes()](../functions/rest_get_avatar_sizes) wp-includes/rest-api.php | Retrieves the pixel sizes for avatars. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'teeny_mce_buttons', array $mce_buttons, string $editor_id ) apply\_filters( 'teeny\_mce\_buttons', array $mce\_buttons, string $editor\_id )
================================================================================
Filters the list of teenyMCE buttons (Text tab).
`$mce_buttons` array An array of teenyMCE buttons. `$editor_id` string Unique editor identifier, e.g. `'content'`. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mce_buttons = apply_filters( 'teeny_mce_buttons', $mce_buttons, $editor_id );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | The `$editor_id` parameter was added. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'get_comment_type', string $comment_type, string $comment_ID, WP_Comment $comment ) apply\_filters( 'get\_comment\_type', string $comment\_type, string $comment\_ID, WP\_Comment $comment )
========================================================================================================
Filters the returned comment type.
`$comment_type` string The type of comment, such as `'comment'`, `'pingback'`, or `'trackback'`. `$comment_ID` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The comment object. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_type()](../functions/get_comment_type) wp-includes/comment-template.php | Retrieves the comment type of the current comment. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$comment_ID` and `$comment` parameters were added. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'http_request_args', array $parsed_args, string $url ) apply\_filters( 'http\_request\_args', array $parsed\_args, string $url )
=========================================================================
Filters the arguments used in an HTTP request.
`$parsed_args` array An array of HTTP request arguments. `$url` string The request URL. File: `wp-includes/class-wp-http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http.php/)
```
$parsed_args = apply_filters( 'http_request_args', $parsed_args, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_Http::request()](../classes/wp_http/request) wp-includes/class-wp-http.php | Send an HTTP request to a URI. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'sanitize_user', string $username, string $raw_username, bool $strict ) apply\_filters( 'sanitize\_user', string $username, string $raw\_username, bool $strict )
=========================================================================================
Filters a sanitized username string.
`$username` string Sanitized username. `$raw_username` string The username prior to sanitization. `$strict` bool Whether to limit the sanitization to specific characters. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'sanitize_user', $username, $raw_username, $strict );
```
| Used By | Description |
| --- | --- |
| [sanitize\_user()](../functions/sanitize_user) wp-includes/formatting.php | Sanitizes a username, stripping out unsafe characters. |
| Version | Description |
| --- | --- |
| [2.0.1](https://developer.wordpress.org/reference/since/2.0.1/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_wp_editComment', int $comment_ID, array $args ) do\_action( 'xmlrpc\_call\_success\_wp\_editComment', int $comment\_ID, array $args )
=====================================================================================
Fires after a comment has been successfully updated via XML-RPC.
`$comment_ID` int ID of the updated comment. `$args` array An array of arguments to update the comment. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'xmlrpc_call_success_wp_editComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_editComment()](../classes/wp_xmlrpc_server/wp_editcomment) wp-includes/class-wp-xmlrpc-server.php | Edit comment. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'deleted_comment', string $comment_id, WP_Comment $comment ) do\_action( 'deleted\_comment', string $comment\_id, WP\_Comment $comment )
===========================================================================
Fires immediately after a comment is deleted from the database.
`$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The deleted comment. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'deleted_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_comment()](../functions/wp_delete_comment) wp-includes/comment.php | Trashes or deletes a comment. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$comment` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'manage_posts_extra_tablenav', string $which ) do\_action( 'manage\_posts\_extra\_tablenav', string $which )
=============================================================
Fires immediately following the closing “actions” div in the tablenav for the posts list table.
`$which` string The location of the extra table nav markup: `'top'` or `'bottom'`. File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
do_action( 'manage_posts_extra_tablenav', $which );
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::extra\_tablenav()](../classes/wp_posts_list_table/extra_tablenav) wp-admin/includes/class-wp-posts-list-table.php | |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'comments_popup_link_attributes', string $attributes ) apply\_filters( 'comments\_popup\_link\_attributes', string $attributes )
=========================================================================
Filters the comments link attributes for display.
`$attributes` string The comments link attributes. Default empty. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
echo apply_filters( 'comments_popup_link_attributes', $attributes );
```
| Used By | Description |
| --- | --- |
| [comments\_popup\_link()](../functions/comments_popup_link) wp-includes/comment-template.php | Displays the link to the comments for the current post ID. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_nav_menu_objects', array $sorted_menu_items, stdClass $args ) apply\_filters( 'wp\_nav\_menu\_objects', array $sorted\_menu\_items, stdClass $args )
======================================================================================
Filters the sorted list of menu item objects before generating the menu’s HTML.
`$sorted_menu_items` array The menu items, sorted by each menu item's menu order. `$args` stdClass An object containing [wp\_nav\_menu()](../functions/wp_nav_menu) arguments. More Arguments from wp\_nav\_menu( ... $args ) Array of nav menu arguments.
* `menu`int|string|[WP\_Term](../classes/wp_term)Desired menu. Accepts a menu ID, slug, name, or object.
* `menu_class`stringCSS class to use for the ul element which forms the menu.
Default `'menu'`.
* `menu_id`stringThe ID that is applied to the ul element which forms the menu.
Default is the menu slug, incremented.
* `container`stringWhether to wrap the ul, and what to wrap it with.
Default `'div'`.
* `container_class`stringClass that is applied to the container.
Default 'menu-{menu slug}-container'.
* `container_id`stringThe ID that is applied to the container.
* `container_aria_label`stringThe aria-label attribute that is applied to the container when it's a nav element.
* `fallback_cb`callable|falseIf the menu doesn't exist, a callback function will fire.
Default is `'wp_page_menu'`. Set to false for no fallback.
* `before`stringText before the link markup.
* `after`stringText after the link markup.
* `link_before`stringText before the link text.
* `link_after`stringText after the link text.
* `echo`boolWhether to echo the menu or return it. Default true.
* `depth`intHow many levels of the hierarchy are to be included.
0 means all. Default 0.
Default 0.
* `walker`objectInstance of a custom walker class.
* `theme_location`stringTheme location to be used. Must be registered with [register\_nav\_menu()](../functions/register_nav_menu) in order to be selectable by the user.
* `items_wrap`stringHow the list items should be wrapped. Uses printf() format with numbered placeholders. Default is a ul with an id and class.
* `item_spacing`stringWhether to preserve whitespace within the menu's HTML.
Accepts `'preserve'` or `'discard'`. Default `'preserve'`.
File: `wp-includes/nav-menu-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu-template.php/)
```
$sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_nav\_menu()](../functions/wp_nav_menu) wp-includes/nav-menu-template.php | Displays a navigation menu. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_pre_insert_user_data', array $data, bool $update, int|null $user_id, array $userdata ) apply\_filters( 'wp\_pre\_insert\_user\_data', array $data, bool $update, int|null $user\_id, array $userdata )
===============================================================================================================
Filters user data before the record is created or updated.
It only includes data in the users table, not any user metadata.
`$data` array Values and keys for the user.
* `user_login`stringThe user's login. Only included if $update == false
* `user_pass`stringThe user's password.
* `user_email`stringThe user's email.
* `user_url`stringThe user's url.
* `user_nicename`stringThe user's nice name. Defaults to a URL-safe version of user's login
* `display_name`stringThe user's display name.
* `user_registered`stringMySQL timestamp describing the moment when the user registered. Defaults to the current UTC timestamp.
`$update` bool Whether the user is being updated rather than created. `$user_id` int|null ID of the user to be updated, or NULL if the user is being created. `$userdata` array The raw array of data passed to [wp\_insert\_user()](../functions/wp_insert_user) . More Arguments from wp\_insert\_user( ... $userdata ) An array, object, or [WP\_User](../classes/wp_user) object of user data arguments.
* `ID`intUser ID. If supplied, the user will be updated.
* `user_pass`stringThe plain-text user password.
* `user_login`stringThe user's login username.
* `user_nicename`stringThe URL-friendly user name.
* `user_url`stringThe user URL.
* `user_email`stringThe user email address.
* `display_name`stringThe user's display name.
Default is the user's username.
* `nickname`stringThe user's nickname.
Default is the user's username.
* `first_name`stringThe user's first name. For new users, will be used to build the first part of the user's display name if `$display_name` is not specified.
* `last_name`stringThe user's last name. For new users, will be used to build the second part of the user's display name if `$display_name` is not specified.
* `description`stringThe user's biographical description.
* `rich_editing`stringWhether to enable the rich-editor for the user.
Accepts `'true'` or `'false'` as a string literal, not boolean. Default `'true'`.
* `syntax_highlighting`stringWhether to enable the rich code editor for the user.
Accepts `'true'` or `'false'` as a string literal, not boolean. Default `'true'`.
* `comment_shortcuts`stringWhether to enable comment moderation keyboard shortcuts for the user. Accepts `'true'` or `'false'` as a string literal, not boolean. Default `'false'`.
* `admin_color`stringAdmin color scheme for the user. Default `'fresh'`.
* `use_ssl`boolWhether the user should always access the admin over https. Default false.
* `user_registered`stringDate the user registered in UTC. Format is 'Y-m-d H:i:s'.
* `user_activation_key`stringPassword reset key. Default empty.
* `spam`boolMultisite only. Whether the user is marked as spam.
Default false.
* `show_admin_bar_front`stringWhether to display the Admin Bar for the user on the site's front end. Accepts `'true'` or `'false'` as a string literal, not boolean. Default `'true'`.
* `role`stringUser's role.
* `locale`stringUser's locale. Default empty.
* `meta_input`arrayArray of custom user meta values keyed by meta key.
Default empty.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$data = apply_filters( 'wp_pre_insert_user_data', $data, $update, ( $update ? $user_id : null ), $userdata );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | The `$userdata` parameter was added. |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress do_action( 'upload_ui_over_quota' ) do\_action( 'upload\_ui\_over\_quota' )
=======================================
Fires when an upload will exceed the defined upload space quota for a network site.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'upload_ui_over_quota' );
```
| Used By | Description |
| --- | --- |
| [media\_upload\_form()](../functions/media_upload_form) wp-admin/includes/media.php | Outputs the legacy media upload form. |
| [wp\_print\_media\_templates()](../functions/wp_print_media_templates) wp-includes/media-template.php | Prints the templates used in the media manager. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'allowed_http_origin', string $origin, string $origin_arg ) apply\_filters( 'allowed\_http\_origin', string $origin, string $origin\_arg )
==============================================================================
Change the allowed HTTP origin result.
`$origin` string Origin URL if allowed, empty string if not. `$origin_arg` string Original origin string passed into is\_allowed\_http\_origin function. File: `wp-includes/http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/http.php/)
```
return apply_filters( 'allowed_http_origin', $origin, $origin_arg );
```
| Used By | Description |
| --- | --- |
| [is\_allowed\_http\_origin()](../functions/is_allowed_http_origin) wp-includes/http.php | Determines if the HTTP origin is an authorized one. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'pre_kses', string $string, array[]|string $allowed_html, string[] $allowed_protocols ) apply\_filters( 'pre\_kses', string $string, array[]|string $allowed\_html, string[] $allowed\_protocols )
==========================================================================================================
Filters content to be run through KSES.
`$string` string Content to filter through KSES. `$allowed_html` array[]|string An array of allowed HTML elements and attributes, or a context name such as `'post'`. See [wp\_kses\_allowed\_html()](../functions/wp_kses_allowed_html) for the list of accepted context names. `$allowed_protocols` string[] Array of allowed URL protocols. KSES is a recursive acronym which stands for “KSES Strips Evil Scripts”.
The filter is used to change the types of HTML elements/attributes or context names are allowed in WordPress content, then strips any HTML elements/attributes that are registered as not allowed.
File: `wp-includes/kses.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/kses.php/)
```
return apply_filters( 'pre_kses', $string, $allowed_html, $allowed_protocols );
```
| Used By | Description |
| --- | --- |
| [wp\_kses\_hook()](../functions/wp_kses_hook) wp-includes/kses.php | You add any KSES hooks here. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'wp_new_user_notification_email_admin', array $wp_new_user_notification_email_admin, WP_User $user, string $blogname ) apply\_filters( 'wp\_new\_user\_notification\_email\_admin', array $wp\_new\_user\_notification\_email\_admin, WP\_User $user, string $blogname )
=================================================================================================================================================
Filters the contents of the new user notification email sent to the site admin.
`$wp_new_user_notification_email_admin` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe intended recipient - site admin email address.
* `subject`stringThe subject of the email.
* `message`stringThe body of the email.
* `headers`stringThe headers of the email.
`$user` [WP\_User](../classes/wp_user) User object for new user. `$blogname` string The site title. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname );
```
| Used By | Description |
| --- | --- |
| [wp\_new\_user\_notification()](../functions/wp_new_user_notification) wp-includes/pluggable.php | Emails login credentials to a newly-registered user. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress do_action( 'clean_page_cache', int $post_id ) do\_action( 'clean\_page\_cache', int $post\_id )
=================================================
Fires immediately after the given page’s cache is cleaned.
`$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'clean_page_cache', $post->ID );
```
| Used By | Description |
| --- | --- |
| [clean\_post\_cache()](../functions/clean_post_cache) wp-includes/post.php | Will clean the post in the cache. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'admin_print_footer_scripts' ) do\_action( 'admin\_print\_footer\_scripts' )
=============================================
Prints any scripts and data queued for the footer.
File: `wp-admin/admin-footer.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-footer.php/)
```
do_action( 'admin_print_footer_scripts' );
```
| Used By | Description |
| --- | --- |
| [iframe\_footer()](../functions/iframe_footer) wp-admin/includes/template.php | Generic Iframe footer for use with Thickbox. |
| [wp\_iframe()](../functions/wp_iframe) wp-admin/includes/media.php | Outputs the iframe to display the media upload page. |
| [WP\_Customize\_Widgets::print\_footer\_scripts()](../classes/wp_customize_widgets/print_footer_scripts) wp-includes/class-wp-customize-widgets.php | Calls admin\_print\_footer\_scripts and admin\_print\_scripts hooks to allow custom scripts from plugins. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'override_unload_textdomain', bool $override, string $domain, bool $reloadable ) apply\_filters( 'override\_unload\_textdomain', bool $override, string $domain, bool $reloadable )
==================================================================================================
Filters whether to override the text domain unloading.
`$override` bool Whether to override the text domain unloading. Default false. `$domain` string Text domain. Unique identifier for retrieving translated strings. `$reloadable` bool Whether the text domain can be loaded just-in-time again. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$plugin_override = apply_filters( 'override_unload_textdomain', false, $domain, $reloadable );
```
| Used By | Description |
| --- | --- |
| [unload\_textdomain()](../functions/unload_textdomain) wp-includes/l10n.php | Unloads translations for a text domain. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Added the `$reloadable` parameter. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters_deprecated( 'block_categories', array[] $block_categories, WP_Post $post ) apply\_filters\_deprecated( 'block\_categories', array[] $block\_categories, WP\_Post $post )
=============================================================================================
This hook has been deprecated. Use the [‘block\_categories\_all’](block_categories_all) filter instead.
Filters the default array of categories for block types.
`$block_categories` array[] Array of categories for block types. `$post` [WP\_Post](../classes/wp_post) Post being loaded. File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
$block_categories = apply_filters_deprecated( 'block_categories', array( $block_categories, $post ), '5.8.0', 'block_categories_all' );
```
| Used By | Description |
| --- | --- |
| [get\_block\_categories()](../functions/get_block_categories) wp-includes/block-editor.php | Returns all the categories for block types that will be shown in the block editor. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Use the ['block\_categories\_all'](block_categories_all) filter instead. |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'manage_themes_custom_column', string $column_name, string $stylesheet, WP_Theme $theme ) do\_action( 'manage\_themes\_custom\_column', string $column\_name, string $stylesheet, WP\_Theme $theme )
==========================================================================================================
Fires inside each custom column of the Multisite themes list table.
`$column_name` string Name of the column. `$stylesheet` string Directory name of the theme. `$theme` [WP\_Theme](../classes/wp_theme) Current [WP\_Theme](../classes/wp_theme) object. File: `wp-admin/includes/class-wp-ms-themes-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-themes-list-table.php/)
```
do_action(
'manage_themes_custom_column',
$column_name,
$item->get_stylesheet(), // Directory name of the theme.
$item // Theme object.
);
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Themes\_List\_Table::column\_default()](../classes/wp_ms_themes_list_table/column_default) wp-admin/includes/class-wp-ms-themes-list-table.php | Handles default column output. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'get_comments_pagenum_link', string $result ) apply\_filters( 'get\_comments\_pagenum\_link', string $result )
================================================================
Filters the comments page number link for the current request.
`$result` string The comments page number link. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'get_comments_pagenum_link', $result );
```
| Used By | Description |
| --- | --- |
| [get\_comments\_pagenum\_link()](../functions/get_comments_pagenum_link) wp-includes/link-template.php | Retrieves the comments page number link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'user_request_confirmed_email_subject', string $subject, string $sitename, array $email_data ) apply\_filters( 'user\_request\_confirmed\_email\_subject', string $subject, string $sitename, array $email\_data )
===================================================================================================================
Filters the subject of the user request confirmation email.
`$subject` string The email subject. `$sitename` string The name of the site. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `user_email`stringThe email address confirming a request
* `description`stringDescription of the action being performed so the user knows what the email is for.
* `manage_url`stringThe link to click manage privacy requests of this type.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail.
* `admin_email`stringThe administrator email receiving the mail.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_request\_confirmation\_notification()](../functions/_wp_privacy_send_request_confirmation_notification) wp-includes/user.php | Notifies the site administrator via email when a request is confirmed. |
| Version | Description |
| --- | --- |
| [4.9.8](https://developer.wordpress.org/reference/since/4.9.8/) | Introduced. |
wordpress apply_filters( 'update_theme_complete_actions', string[] $update_actions, string $theme ) apply\_filters( 'update\_theme\_complete\_actions', string[] $update\_actions, string $theme )
==============================================================================================
Filters the list of action links available following a single theme update.
`$update_actions` string[] Array of theme action links. `$theme` string Theme directory name. File: `wp-admin/includes/class-theme-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-theme-upgrader-skin.php/)
```
$update_actions = apply_filters( 'update_theme_complete_actions', $update_actions, $this->theme );
```
| Used By | Description |
| --- | --- |
| [Theme\_Upgrader\_Skin::after()](../classes/theme_upgrader_skin/after) wp-admin/includes/class-theme-upgrader-skin.php | Action to perform following a single theme update. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'edited_term_taxonomy', int $tt_id, string $taxonomy, array $args ) do\_action( 'edited\_term\_taxonomy', int $tt\_id, string $taxonomy, array $args )
==================================================================================
Fires immediately after a term-taxonomy relationship is updated.
`$tt_id` int Term taxonomy ID. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'edited_term_taxonomy', $tt_id, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [\_update\_post\_term\_count()](../functions/_update_post_term_count) wp-includes/taxonomy.php | Updates term count based on object types of the current taxonomy. |
| [\_update\_generic\_term\_count()](../functions/_update_generic_term_count) wp-includes/taxonomy.php | Updates term count based on number of objects. |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'get_comment_author_url_link', string $return ) apply\_filters( 'get\_comment\_author\_url\_link', string $return )
===================================================================
Filters the comment author’s returned URL link.
`$return` string The HTML-formatted comment author URL link. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'get_comment_author_url_link', $return );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_author\_url\_link()](../functions/get_comment_author_url_link) wp-includes/comment-template.php | Retrieves the HTML link of the URL of the author of the current comment. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_mw_newPost', int $post_ID, array $args ) do\_action( 'xmlrpc\_call\_success\_mw\_newPost', int $post\_ID, array $args )
==============================================================================
Fires after a new post has been successfully created via the XML-RPC MovableType API.
`$post_ID` int ID of the new post. `$args` array An array of arguments to create the new post. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::mw\_newPost()](../classes/wp_xmlrpc_server/mw_newpost) wp-includes/class-wp-xmlrpc-server.php | Create a new post. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'rest_route_for_term', string $route, WP_Term $term ) apply\_filters( 'rest\_route\_for\_term', string $route, WP\_Term $term )
=========================================================================
Filters the REST API route for a term.
`$route` string The route path. `$term` [WP\_Term](../classes/wp_term) The term object. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
return apply_filters( 'rest_route_for_term', $route, $term );
```
| Used By | Description |
| --- | --- |
| [rest\_get\_route\_for\_term()](../functions/rest_get_route_for_term) wp-includes/rest-api.php | Gets the REST API route for a term. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'users_list_table_query_args', array $args ) apply\_filters( 'users\_list\_table\_query\_args', array $args )
================================================================
Filters the query arguments used to retrieve users for the current users list table.
`$args` array Arguments passed to [WP\_User\_Query](../classes/wp_user_query) to retrieve items for the current users list table. File: `wp-admin/includes/class-wp-users-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-users-list-table.php/)
```
$args = apply_filters( 'users_list_table_query_args', $args );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Users\_List\_Table::prepare\_items()](../classes/wp_ms_users_list_table/prepare_items) wp-admin/includes/class-wp-ms-users-list-table.php | |
| [WP\_Users\_List\_Table::prepare\_items()](../classes/wp_users_list_table/prepare_items) wp-admin/includes/class-wp-users-list-table.php | Prepare the users list for display. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'script_loader_tag', string $tag, string $handle, string $src ) apply\_filters( 'script\_loader\_tag', string $tag, string $handle, string $src )
=================================================================================
Filters the HTML script tag of an enqueued script.
`$tag` string The `<script>` tag for the enqueued script. `$handle` string The script's registered handle. `$src` string The script's source URL. File: `wp-includes/class-wp-scripts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes_class-wp-scripts-php-2/)
```
$tag = apply_filters( 'script_loader_tag', $tag, $handle, $src );
```
| Used By | Description |
| --- | --- |
| [WP\_Scripts::do\_item()](../classes/wp_scripts/do_item) wp-includes/class-wp-scripts.php | Processes a script dependency. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'upgrader_pre_install', bool|WP_Error $response, array $hook_extra ) apply\_filters( 'upgrader\_pre\_install', bool|WP\_Error $response, array $hook\_extra )
========================================================================================
Filters the installation response before the installation has started.
Returning a value that could be evaluated as a `WP_Error` will effectively short-circuit the installation, returning that value instead.
`$response` bool|[WP\_Error](../classes/wp_error) Installation response. `$hook_extra` array Extra arguments passed to hooked filters. File: `wp-admin/includes/class-wp-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-upgrader.php/)
```
$res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );
```
| Used By | Description |
| --- | --- |
| [WP\_Upgrader::install\_package()](../classes/wp_upgrader/install_package) wp-admin/includes/class-wp-upgrader.php | Install a package. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( "rest_insert_{$this->taxonomy}", WP_Term $term, WP_REST_Request $request, bool $creating ) do\_action( "rest\_insert\_{$this->taxonomy}", WP\_Term $term, WP\_REST\_Request $request, bool $creating )
===========================================================================================================
Fires after a single term is created or updated via the REST API.
The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `rest_insert_category`
* `rest_insert_post_tag`
`$term` [WP\_Term](../classes/wp_term) Inserted or updated term object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating a term, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php/)
```
do_action( "rest_insert_{$this->taxonomy}", $term, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menus\_Controller::create\_item()](../classes/wp_rest_menus_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Creates a single term in a taxonomy. |
| [WP\_REST\_Menus\_Controller::update\_item()](../classes/wp_rest_menus_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Updates a single term from a taxonomy. |
| [WP\_REST\_Terms\_Controller::create\_item()](../classes/wp_rest_terms_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Creates a single term in a taxonomy. |
| [WP\_REST\_Terms\_Controller::update\_item()](../classes/wp_rest_terms_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Updates a single term from a taxonomy. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'get_the_archive_title_prefix', string $prefix ) apply\_filters( 'get\_the\_archive\_title\_prefix', string $prefix )
====================================================================
Filters the archive title prefix.
`$prefix` string Archive title prefix. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$prefix = apply_filters( 'get_the_archive_title_prefix', $prefix );
```
| Used By | Description |
| --- | --- |
| [get\_the\_archive\_title()](../functions/get_the_archive_title) wp-includes/general-template.php | Retrieves the archive title based on the queried object. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'comment_author_rss', string $comment_author ) apply\_filters( 'comment\_author\_rss', string $comment\_author )
=================================================================
Filters the current comment author for use in a feed.
* [get\_comment\_author()](../functions/get_comment_author)
`$comment_author` string The current comment author. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
return apply_filters( 'comment_author_rss', get_comment_author() );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_author\_rss()](../functions/get_comment_author_rss) wp-includes/feed.php | Retrieves the current comment author for use in the feeds. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'trackback_url', string $trackback_url ) apply\_filters( 'trackback\_url', string $trackback\_url )
==========================================================
Filters the returned trackback URL.
`$trackback_url` string The trackback URL. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'trackback_url', $trackback_url );
```
| Used By | Description |
| --- | --- |
| [get\_trackback\_url()](../functions/get_trackback_url) wp-includes/comment-template.php | Retrieves the current post’s trackback URL. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( "rest_prepare_{$this->post_type}", WP_REST_Response $response, WP_Post $post, WP_REST_Request $request ) apply\_filters( "rest\_prepare\_{$this->post\_type}", WP\_REST\_Response $response, WP\_Post $post, WP\_REST\_Request $request )
================================================================================================================================
Filters the post data for a REST API response.
The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
Possible hook names include:
* `rest_prepare_post`
* `rest_prepare_page`
* `rest_prepare_attachment`
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$post` [WP\_Post](../classes/wp_post) Post object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php/)
```
return apply_filters( "rest_prepare_{$this->post_type}", $response, $post, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_posts_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Prepares a single post output for response. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'switch_locale', string $locale ) do\_action( 'switch\_locale', string $locale )
==============================================
Fires when the locale is switched.
`$locale` string The new locale. File: `wp-includes/class-wp-locale-switcher.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-locale-switcher.php/)
```
do_action( 'switch_locale', $locale );
```
| Used By | Description |
| --- | --- |
| [WP\_Locale\_Switcher::switch\_to\_locale()](../classes/wp_locale_switcher/switch_to_locale) wp-includes/class-wp-locale-switcher.php | Switches the translations according to the given locale. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'rest_after_insert_application_password', array $item, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_after\_insert\_application\_password', array $item, WP\_REST\_Request $request, bool $creating )
===================================================================================================================
Fires after a single application password is completely created or updated via the REST API.
`$item` array Inserted or updated password item. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating an application password, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php/)
```
do_action( 'rest_after_insert_application_password', $item, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Application\_Passwords\_Controller::create\_item()](../classes/wp_rest_application_passwords_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php | Creates an application password. |
| [WP\_REST\_Application\_Passwords\_Controller::update\_item()](../classes/wp_rest_application_passwords_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php | Updates an application password. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( 'comment_form_comments_closed' ) do\_action( 'comment\_form\_comments\_closed' )
===============================================
Fires after the comment form if comments are closed.
For backward compatibility, this action also fires if [comment\_form()](../functions/comment_form) is called with an invalid post object or ID.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
do_action( 'comment_form_comments_closed' );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'user_request_action_email_content', string $content, array $email_data ) apply\_filters( 'user\_request\_action\_email\_content', string $content, array $email\_data )
==============================================================================================
Filters the text of the email sent when an account action is attempted.
The following strings have a special meaning and will get replaced dynamically:
`$content` string Text in the email. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `email`stringThe email address this is being sent to.
* `description`stringDescription of the action being performed so the user knows what the email is for.
* `confirm_url`stringThe link to click on to confirm the account action.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$content = apply_filters( 'user_request_action_email_content', $content, $email_data );
```
| Used By | Description |
| --- | --- |
| [wp\_send\_user\_request()](../functions/wp_send_user_request) wp-includes/user.php | Send a confirmation request email to confirm an action. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'the_content_rss', string $content ) apply\_filters( 'the\_content\_rss', string $content )
======================================================
Filters the post content in the context of an RSS feed.
`$content` string Content of the current post. * This filter hook has been deprecated, as indicated in the [Source](the_content_rss#source) section below ( File: wp-includes/deprecated.php ).
* As of version 2.9 upwards, you should use the new filter hook <the_content_feed> in its place.
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
$content = apply_filters('the_content_rss', $content);
```
| Used By | Description |
| --- | --- |
| [the\_content\_rss()](../functions/the_content_rss) wp-includes/deprecated.php | Display the post content for the feed. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress do_action( 'restrict_manage_sites', string $which ) do\_action( 'restrict\_manage\_sites', string $which )
======================================================
Fires before the Filter button on the MS sites list table.
`$which` string The location of the extra table nav markup: `'top'` or `'bottom'`. File: `wp-admin/includes/class-wp-ms-sites-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-sites-list-table.php/)
```
do_action( 'restrict_manage_sites', $which );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Sites\_List\_Table::extra\_tablenav()](../classes/wp_ms_sites_list_table/extra_tablenav) wp-admin/includes/class-wp-ms-sites-list-table.php | Extra controls to be displayed between bulk actions and pagination. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'document_title_parts', array $title ) apply\_filters( 'document\_title\_parts', array $title )
========================================================
Filters the parts of the document title.
`$title` array The document title parts.
* `title`stringTitle of the viewed page.
* `page`stringOptional. Page number if paginated.
* `tagline`stringOptional. Site description when on home page.
* `site`stringOptional. Site title when not on home page.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$title = apply_filters( 'document_title_parts', $title );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_document\_title()](../functions/wp_get_document_title) wp-includes/general-template.php | Returns document title for the current page. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'atom_enclosure', string $html_link_tag ) apply\_filters( 'atom\_enclosure', string $html\_link\_tag )
============================================================
Filters the atom enclosure HTML link tag for the current post.
`$html_link_tag` string The HTML link tag with a URI and other attributes. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
echo apply_filters( 'atom_enclosure', $html_link_tag );
```
| Used By | Description |
| --- | --- |
| [atom\_enclosure()](../functions/atom_enclosure) wp-includes/feed.php | Displays the atom enclosure for the current post. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'format_to_edit', string $content ) apply\_filters( 'format\_to\_edit', string $content )
=====================================================
Filters the text to be formatted for editing.
`$content` string The text, prior to formatting for editing. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$content = apply_filters( 'format_to_edit', $content );
```
| Used By | Description |
| --- | --- |
| [format\_to\_edit()](../functions/format_to_edit) wp-includes/formatting.php | Acts on text which is about to be edited. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress do_action( 'wp_print_scripts' ) do\_action( 'wp\_print\_scripts' )
==================================
Fires before scripts in the $handles queue are printed.
Since WordPress 3.3, wp\_print\_scripts should not be used to enqueue styles or scripts.
See: <https://make.wordpress.org/core/2011/12/12/use-wp_enqueue_scripts-not-wp_print_styles-to-enqueue-scripts-and-styles-for-the-frontend/>
Use <wp_enqueue_scripts> instead.
File: `wp-includes/functions.wp-scripts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions-wp-scripts.php/)
```
do_action( 'wp_print_scripts' );
```
| Used By | Description |
| --- | --- |
| [wp\_print\_scripts()](../functions/wp_print_scripts) wp-includes/functions.wp-scripts.php | Prints scripts in document head that are in the $handles queue. |
| [print\_head\_scripts()](../functions/print_head_scripts) wp-includes/script-loader.php | Prints the script queue in the HTML head on admin pages. |
| [wp\_print\_head\_scripts()](../functions/wp_print_head_scripts) wp-includes/script-loader.php | Prints the script queue in the HTML head on the front end. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_image_editor_before_change', WP_Image_Editor $image, array $changes ) apply\_filters( 'wp\_image\_editor\_before\_change', WP\_Image\_Editor $image, array $changes )
===============================================================================================
Filters the [WP\_Image\_Editor](../classes/wp_image_editor) instance before applying changes to the image.
`$image` [WP\_Image\_Editor](../classes/wp_image_editor) [WP\_Image\_Editor](../classes/wp_image_editor) instance. `$changes` array Array of change operations. File: `wp-admin/includes/image-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image-edit.php/)
```
$image = apply_filters( 'wp_image_editor_before_change', $image, $changes );
```
| Used By | Description |
| --- | --- |
| [image\_edit\_apply\_changes()](../functions/image_edit_apply_changes) wp-admin/includes/image-edit.php | Performs group of changes on Editor specified. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress do_action( "delete_{$meta_type}_meta", string[] $meta_ids, int $object_id, string $meta_key, mixed $_meta_value ) do\_action( "delete\_{$meta\_type}\_meta", string[] $meta\_ids, int $object\_id, string $meta\_key, mixed $\_meta\_value )
==========================================================================================================================
Fires immediately before deleting metadata of a specific type.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Possible hook names include:
* `delete_post_meta`
* `delete_comment_meta`
* `delete_term_meta`
* `delete_user_meta`
`$meta_ids` string[] An array of metadata entry IDs to delete. `$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$_meta_value` mixed Metadata value. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
```
| Used By | Description |
| --- | --- |
| [delete\_metadata()](../functions/delete_metadata) wp-includes/meta.php | Deletes metadata for the specified object. |
| [delete\_metadata\_by\_mid()](../functions/delete_metadata_by_mid) wp-includes/meta.php | Deletes metadata by meta ID. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'dynamic_sidebar', array $widget ) do\_action( 'dynamic\_sidebar', array $widget )
===============================================
Fires before a widget’s display callback is called.
Note: The action fires on both the front end and back end, including for widgets in the Inactive Widgets sidebar on the Widgets screen.
The action is not fired for empty sidebars.
`$widget` array An associative array of widget arguments.
* `name`stringName of the widget.
* `id`stringWidget ID.
* `callback`callableWhen the hook is fired on the front end, `$callback` is an array containing the widget object. Fired on the back end, `$callback` is `'wp_widget_control'`, see `$_callback`.
* `params`arrayAn associative array of multi-widget arguments.
* `classname`stringCSS class applied to the widget container.
* `description`stringThe widget description.
* `_callback`arrayWhen the hook is fired on the back end, `$_callback` is populated with an array containing the widget object, see `$callback`.
File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
do_action( 'dynamic_sidebar', $wp_registered_widgets[ $id ] );
```
| Used By | Description |
| --- | --- |
| [wp\_render\_widget()](../functions/wp_render_widget) wp-includes/widgets.php | Calls the render callback of a widget and returns the output. |
| [dynamic\_sidebar()](../functions/dynamic_sidebar) wp-includes/widgets.php | Display dynamic sidebar. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'email_exists', int|false $user_id, string $email ) apply\_filters( 'email\_exists', int|false $user\_id, string $email )
=====================================================================
Filters whether the given email exists.
`$user_id` int|false The user ID associated with the email, or false if the email does not exist. `$email` string The email to check for existence. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'email_exists', $user_id, $email );
```
| Used By | Description |
| --- | --- |
| [email\_exists()](../functions/email_exists) wp-includes/user.php | Determines whether the given email exists. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( "customize_preview_{$this->id}", WP_Customize_Setting $setting ) do\_action( "customize\_preview\_{$this->id}", WP\_Customize\_Setting $setting )
================================================================================
Fires when the [WP\_Customize\_Setting::preview()](../classes/wp_customize_setting/preview) method is called for settings not handled as theme\_mods or options.
The dynamic portion of the hook name, `$this->id`, refers to the setting ID.
`$setting` [WP\_Customize\_Setting](../classes/wp_customize_setting) [WP\_Customize\_Setting](../classes/wp_customize_setting) instance. File: `wp-includes/class-wp-customize-setting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-setting.php/)
```
do_action( "customize_preview_{$this->id}", $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Setting::preview()](../classes/wp_customize_setting/preview) wp-includes/class-wp-customize-setting.php | Add filters to supply the setting’s value when accessed. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'get_comment_link', string $link, WP_Comment $comment, array $args, int $cpage ) apply\_filters( 'get\_comment\_link', string $link, WP\_Comment $comment, array $args, int $cpage )
===================================================================================================
Filters the returned single comment permalink.
* [get\_page\_of\_comment()](../functions/get_page_of_comment)
`$link` string The comment permalink with `'#comment-$id'` appended. `$comment` [WP\_Comment](../classes/wp_comment) The current comment object. `$args` array An array of arguments to override the defaults. `$cpage` int The calculated `'cpage'` value. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'get_comment_link', $link, $comment, $args, $cpage );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_link()](../functions/get_comment_link) wp-includes/comment-template.php | Retrieves the link to a given comment. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$cpage` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_save_post_revision_post_has_changed', bool $post_has_changed, WP_Post $latest_revision, WP_Post $post ) apply\_filters( 'wp\_save\_post\_revision\_post\_has\_changed', bool $post\_has\_changed, WP\_Post $latest\_revision, WP\_Post $post )
======================================================================================================================================
Filters whether a post has changed.
By default a revision is saved only if one of the revisioned fields has changed.
This filter allows for additional checks to determine if there were changes.
`$post_has_changed` bool Whether the post has changed. `$latest_revision` [WP\_Post](../classes/wp_post) The latest revision post object. `$post` [WP\_Post](../classes/wp_post) The post object. File: `wp-includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/revision.php/)
```
$post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $latest_revision, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_save\_post\_revision()](../functions/wp_save_post_revision) wp-includes/revision.php | Creates a revision for the current version of a post. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'after_wp_tiny_mce', array $mce_settings ) do\_action( 'after\_wp\_tiny\_mce', array $mce\_settings )
==========================================================
Fires after any core TinyMCE editor instances are created.
`$mce_settings` array TinyMCE settings array. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
do_action( 'after_wp_tiny_mce', self::$mce_settings );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::editor\_js()](../classes/_wp_editors/editor_js) wp-includes/class-wp-editor.php | Print (output) the TinyMCE configuration and initialization scripts. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_comment', WP_REST_Response $response, WP_Comment $comment, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_comment', WP\_REST\_Response $response, WP\_Comment $comment, WP\_REST\_Request $request )
==========================================================================================================================
Filters a comment returned from the REST API.
Allows modification of the comment right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$comment` [WP\_Comment](../classes/wp_comment) The original comment object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php/)
```
return apply_filters( 'rest_prepare_comment', $response, $comment, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_comments_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Prepares a single comment output for response. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'rest_post_search_query', array $query_args, WP_REST_Request $request ) apply\_filters( 'rest\_post\_search\_query', array $query\_args, WP\_REST\_Request $request )
=============================================================================================
Filters the query arguments for a REST API search request.
Enables adding extra arguments or setting defaults for a post search request.
`$query_args` array Key value array of query var to query value. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request used. File: `wp-includes/rest-api/search/class-wp-rest-post-search-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/search/class-wp-rest-post-search-handler.php/)
```
$query_args = apply_filters( 'rest_post_search_query', $query_args, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Post\_Search\_Handler::search\_items()](../classes/wp_rest_post_search_handler/search_items) wp-includes/rest-api/search/class-wp-rest-post-search-handler.php | Searches the object type content for a given search request. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress do_action( 'ms_site_not_found', WP_Network $current_site, string $domain, string $path ) do\_action( 'ms\_site\_not\_found', WP\_Network $current\_site, string $domain, string $path )
==============================================================================================
Fires when a network can be determined but a site cannot.
At the time of this action, the only recourse is to redirect somewhere and exit. If you want to declare a particular site, do so earlier.
`$current_site` [WP\_Network](../classes/wp_network) The network that had been determined. `$domain` string The domain used to search for a site. `$path` string The path used to search for a site. File: `wp-includes/ms-load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-load.php/)
```
do_action( 'ms_site_not_found', $current_site, $domain, $path );
```
| Used By | Description |
| --- | --- |
| [ms\_load\_current\_site\_and\_network()](../functions/ms_load_current_site_and_network) wp-includes/ms-load.php | Identifies the network and site of a requested domain and path and populates the corresponding network and site global objects as part of the multisite bootstrap process. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'determine_current_user', int|false $user_id ) apply\_filters( 'determine\_current\_user', int|false $user\_id )
=================================================================
Filters the current user.
The default filters use this to determine the current user from the request’s cookies, if available.
Returning a value of false will effectively short-circuit setting the current user.
`$user_id` int|false User ID if one has been determined, false otherwise. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$user_id = apply_filters( 'determine_current_user', false );
```
| Used By | Description |
| --- | --- |
| [\_wp\_get\_current\_user()](../functions/_wp_get_current_user) wp-includes/user.php | Retrieves the current user object. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress do_action( 'wp_body_open' ) do\_action( 'wp\_body\_open' )
==============================
Triggered after the opening body tag.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'wp_body_open' );
```
| Used By | Description |
| --- | --- |
| [wp\_body\_open()](../functions/wp_body_open) wp-includes/general-template.php | Fires the wp\_body\_open action. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action_deprecated( 'wpmu_new_blog', int $site_id, int $user_id, string $domain, string $path, int $network_id, array $meta ) do\_action\_deprecated( 'wpmu\_new\_blog', int $site\_id, int $user\_id, string $domain, string $path, int $network\_id, array $meta )
======================================================================================================================================
This hook has been deprecated. Use [‘wp\_initialize\_site’](wp_initialize_site) instead.
Fires immediately after a new site is created.
`$site_id` int Site ID. `$user_id` int User ID. `$domain` string Site domain. `$path` string Site path. `$network_id` int Network ID. Only relevant on multi-network installations. `$meta` array Meta data. Used to set initial site options. `wpmu_new_blog` is an action triggered whenever a new blog is created within a multisite network.
File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action_deprecated(
'wpmu_new_blog',
array( $new_site->id, $user_id, $new_site->domain, $new_site->path, $new_site->network_id, $meta ),
'5.1.0',
'wp_initialize_site'
);
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_site()](../functions/wp_insert_site) wp-includes/ms-site.php | Inserts a new site into the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Use ['wp\_initialize\_site'](wp_initialize_site) instead. |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( "customize_render_section_{$this->id}" ) do\_action( "customize\_render\_section\_{$this->id}" )
=======================================================
Fires before rendering a specific Customizer section.
The dynamic portion of the hook name, `$this->id`, refers to the ID of the specific Customizer section to be rendered.
File: `wp-includes/class-wp-customize-section.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-section.php/)
```
do_action( "customize_render_section_{$this->id}" );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Section::maybe\_render()](../classes/wp_customize_section/maybe_render) wp-includes/class-wp-customize-section.php | Check capabilities and render the section. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'date_query_valid_columns', string[] $valid_columns ) apply\_filters( 'date\_query\_valid\_columns', string[] $valid\_columns )
=========================================================================
Filters the list of valid date query columns.
`$valid_columns` string[] An array of valid date query columns. Defaults are `'post_date'`, `'post_date_gmt'`, `'post_modified'`, `'post_modified_gmt'`, `'comment_date'`, `'comment_date_gmt'`, `'user_registered'`, `'registered'`, `'last_updated'`. File: `wp-includes/class-wp-date-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-date-query.php/)
```
if ( ! in_array( $column, apply_filters( 'date_query_valid_columns', $valid_columns ), true ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Date\_Query::validate\_column()](../classes/wp_date_query/validate_column) wp-includes/class-wp-date-query.php | Validates a column name parameter. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added `'registered'` and `'last_updated'` to the default recognized columns. |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Added `'user_registered'` to the default recognized columns. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_personal_data_erasure_page', array $response, int $eraser_index, string $email_address, int $page, int $request_id, string $eraser_key ) apply\_filters( 'wp\_privacy\_personal\_data\_erasure\_page', array $response, int $eraser\_index, string $email\_address, int $page, int $request\_id, string $eraser\_key )
=============================================================================================================================================================================
Filters a page of personal data eraser data.
Allows the erasure response to be consumed by destinations in addition to Ajax.
`$response` array The personal data for the given exporter and page. `$eraser_index` int The index of the eraser that provided this data. `$email_address` string The email address associated with this personal data. `$page` int The page for this response. `$request_id` int The privacy request post ID associated with this request. `$eraser_key` string The key (slug) of the eraser that provided this data. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id, $eraser_key );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_wp\_privacy\_erase\_personal\_data()](../functions/wp_ajax_wp_privacy_erase_personal_data) wp-admin/includes/ajax-actions.php | Ajax handler for erasing personal data. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress do_action( 'add_term_relationship', int $object_id, int $tt_id, string $taxonomy ) do\_action( 'add\_term\_relationship', int $object\_id, int $tt\_id, string $taxonomy )
=======================================================================================
Fires immediately before an object-term relationship is added.
`$object_id` int Object ID. `$tt_id` int Term taxonomy ID. `$taxonomy` string Taxonomy slug. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'add_term_relationship', $object_id, $tt_id, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_object\_terms()](../functions/wp_set_object_terms) wp-includes/taxonomy.php | Creates term and taxonomy relationships. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Added the `$taxonomy` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'activated_plugin', string $plugin, bool $network_wide ) do\_action( 'activated\_plugin', string $plugin, bool $network\_wide )
======================================================================
Fires after a plugin has been activated.
If a plugin is silently activated (such as during an update), this hook does not fire.
`$plugin` string Path to the plugin file relative to the plugins directory. `$network_wide` bool Whether to enable the plugin for all sites in the network or just the current site. Multisite only. Default false. File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
do_action( 'activated_plugin', $plugin, $network_wide );
```
| Used By | Description |
| --- | --- |
| [activate\_plugin()](../functions/activate_plugin) wp-admin/includes/plugin.php | Attempts activation of plugin in a “sandbox” and redirects on success. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'the_author_link', string $link, string $author_url, WP_User $authordata ) apply\_filters( 'the\_author\_link', string $link, string $author\_url, WP\_User $authordata )
==============================================================================================
Filters the author URL link HTML.
`$link` string The default rendered author HTML link. `$author_url` string Author's URL. `$authordata` [WP\_User](../classes/wp_user) Author user data. File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
return apply_filters( 'the_author_link', $link, $author_url, $authordata );
```
| Used By | Description |
| --- | --- |
| [get\_the\_author\_link()](../functions/get_the_author_link) wp-includes/author-template.php | Retrieves either author’s link or author’s name. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'update_welcome_subject', string $subject ) apply\_filters( 'update\_welcome\_subject', string $subject )
=============================================================
Filters the subject of the welcome email sent to the site administrator after site activation.
`$subject` string Subject of the email. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$subject = apply_filters( 'update_welcome_subject', sprintf( $subject, $current_network->site_name, wp_unslash( $title ) ) );
```
| Used By | Description |
| --- | --- |
| [wpmu\_welcome\_notification()](../functions/wpmu_welcome_notification) wp-includes/ms-functions.php | Notifies the site administrator that their site activation was successful. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'edit_tag_link', string $link ) apply\_filters( 'edit\_tag\_link', string $link )
=================================================
Filters the anchor tag for the edit link for a tag (or term in another taxonomy).
`$link` string The anchor tag for the edit link. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
echo $before . apply_filters( 'edit_tag_link', $link ) . $after;
```
| Used By | Description |
| --- | --- |
| [edit\_tag\_link()](../functions/edit_tag_link) wp-includes/link-template.php | Displays or retrieves the edit link for a tag with formatting. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'untrashed_comment', string $comment_id, WP_Comment $comment ) do\_action( 'untrashed\_comment', string $comment\_id, WP\_Comment $comment )
=============================================================================
Fires immediately after a comment is restored from the Trash.
`$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The untrashed comment. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'untrashed_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_untrash\_comment()](../functions/wp_untrash_comment) wp-includes/comment.php | Removes a comment from the Trash |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$comment` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'upload_size_limit', int $size, int $u_bytes, int $p_bytes ) apply\_filters( 'upload\_size\_limit', int $size, int $u\_bytes, int $p\_bytes )
================================================================================
Filters the maximum upload size allowed in php.ini.
`$size` int Max upload size limit in bytes. `$u_bytes` int Maximum upload filesize in bytes. `$p_bytes` int Maximum size of POST data in bytes. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes );
```
| Used By | Description |
| --- | --- |
| [wp\_max\_upload\_size()](../functions/wp_max_upload_size) wp-includes/media.php | Determines the maximum upload size allowed in php.ini. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'wp_create_application_password', int $user_id, array $new_item, string $new_password, array $args ) do\_action( 'wp\_create\_application\_password', int $user\_id, array $new\_item, string $new\_password, array $args )
======================================================================================================================
Fires when an application password is created.
`$user_id` int The user ID. `$new_item` array The details about the created password.
* `uuid`stringThe unique identifier for the application password.
* `app_id`stringA UUID provided by the application to uniquely identify it.
* `name`stringThe name of the application password.
* `password`stringA one-way hash of the password.
* `created`intUnix timestamp of when the password was created.
* `last_used`nullNull.
* `last_ip`nullNull.
`$new_password` string The unhashed generated application password. `$args` array Arguments used to create the application password.
* `name`stringThe name of the application password.
* `app_id`stringA UUID provided by the application to uniquely identify it.
File: `wp-includes/class-wp-application-passwords.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-application-passwords.php/)
```
do_action( 'wp_create_application_password', $user_id, $new_item, $new_password, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_Application\_Passwords::create\_new\_application\_password()](../classes/wp_application_passwords/create_new_application_password) wp-includes/class-wp-application-passwords.php | Creates a new application password. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( "add_{$meta_type}_metadata", null|bool $check, int $object_id, string $meta_key, mixed $meta_value, bool $unique ) apply\_filters( "add\_{$meta\_type}\_metadata", null|bool $check, int $object\_id, string $meta\_key, mixed $meta\_value, bool $unique )
========================================================================================================================================
Short-circuits adding metadata of a specific type.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
* `add_post_metadata`
* `add_comment_metadata`
* `add_term_metadata`
* `add_user_metadata`
`$check` null|bool Whether to allow adding metadata for the given type. `$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$meta_value` mixed Metadata value. Must be serializable if non-scalar. `$unique` bool Whether the specified meta key should be unique for the object. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
$check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique );
```
| Used By | Description |
| --- | --- |
| [add\_metadata()](../functions/add_metadata) wp-includes/meta.php | Adds metadata for the specified object. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'do_faviconico' ) do\_action( 'do\_faviconico' )
==============================
Fires when serving the favicon.ico file.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
do_action( 'do_faviconico' );
```
| Used By | Description |
| --- | --- |
| [do\_favicon()](../functions/do_favicon) wp-includes/functions.php | Displays the favicon.ico file content. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress apply_filters( 'use_curl_transport', bool $use_class, array $args ) apply\_filters( 'use\_curl\_transport', bool $use\_class, array $args )
=======================================================================
Filters whether cURL can be used as a transport for retrieving a URL.
`$use_class` bool Whether the class can be used. Default true. `$args` array An array of request arguments. File: `wp-includes/class-wp-http-curl.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-curl.php/)
```
return apply_filters( 'use_curl_transport', true, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_Http\_Curl::test()](../classes/wp_http_curl/test) wp-includes/class-wp-http-curl.php | Determines whether this class can be used for retrieving a URL. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'register_taxonomy_args', array $args, string $taxonomy, string[] $object_type ) apply\_filters( 'register\_taxonomy\_args', array $args, string $taxonomy, string[] $object\_type )
===================================================================================================
Filters the arguments for registering a taxonomy.
`$args` array Array of arguments for registering a taxonomy.
See the [register\_taxonomy()](../functions/register_taxonomy) function for accepted arguments. More Arguments from register\_taxonomy( ... $args ) Array or query string of arguments for registering a taxonomy.
* `labels`string[]An array of labels for this taxonomy. By default, Tag labels are used for non-hierarchical taxonomies, and Category labels are used for hierarchical taxonomies. See accepted values in [get\_taxonomy\_labels()](../functions/get_taxonomy_labels) .
* `description`stringA short descriptive summary of what the taxonomy is for.
* `public`boolWhether a taxonomy is intended for use publicly either via the admin interface or by front-end users. The default settings of `$publicly_queryable`, `$show_ui`, and `$show_in_nav_menus` are inherited from `$public`.
* `publicly_queryable`boolWhether the taxonomy is publicly queryable.
If not set, the default is inherited from `$public`
* `hierarchical`boolWhether the taxonomy is hierarchical. Default false.
* `show_ui`boolWhether to generate and allow a UI for managing terms in this taxonomy in the admin. If not set, the default is inherited from `$public` (default true).
* `show_in_menu`boolWhether to show the taxonomy in the admin menu. If true, the taxonomy is shown as a submenu of the object type menu. If false, no menu is shown.
`$show_ui` must be true. If not set, default is inherited from `$show_ui` (default true).
* `show_in_nav_menus`boolMakes this taxonomy available for selection in navigation menus. If not set, the default is inherited from `$public` (default true).
* `show_in_rest`boolWhether to include the taxonomy in the REST API. Set this to true for the taxonomy to be available in the block editor.
* `rest_base`stringTo change the base url of REST API route. Default is $taxonomy.
* `rest_namespace`stringTo change the namespace URL of REST API route. Default is wp/v2.
* `rest_controller_class`stringREST API Controller class name. Default is '[WP\_REST\_Terms\_Controller](../classes/wp_rest_terms_controller)'.
* `show_tagcloud`boolWhether to list the taxonomy in the Tag Cloud Widget controls. If not set, the default is inherited from `$show_ui` (default true).
* `show_in_quick_edit`boolWhether to show the taxonomy in the quick/bulk edit panel. It not set, the default is inherited from `$show_ui` (default true).
* `show_admin_column`boolWhether to display a column for the taxonomy on its post type listing screens. Default false.
* `meta_box_cb`bool|callableProvide a callback function for the meta box display. If not set, [post\_categories\_meta\_box()](../functions/post_categories_meta_box) is used for hierarchical taxonomies, and [post\_tags\_meta\_box()](../functions/post_tags_meta_box) is used for non-hierarchical. If false, no meta box is shown.
* `meta_box_sanitize_cb`callableCallback function for sanitizing taxonomy data saved from a meta box. If no callback is defined, an appropriate one is determined based on the value of `$meta_box_cb`.
* `capabilities`string[] Array of capabilities for this taxonomy.
+ `manage_terms`stringDefault `'manage_categories'`.
+ `edit_terms`stringDefault `'manage_categories'`.
+ `delete_terms`stringDefault `'manage_categories'`.
+ `assign_terms`stringDefault `'edit_posts'`.
+ `rewrite`bool|array Triggers the handling of rewrites for this taxonomy. Default true, using $taxonomy as slug. To prevent rewrite, set to false. To specify rewrite rules, an array can be passed with any of these keys:
- `slug`stringCustomize the permastruct slug. Default `$taxonomy` key.
- `with_front`boolShould the permastruct be prepended with WP\_Rewrite::$front. Default true.
- `hierarchical`boolEither hierarchical rewrite tag or not. Default false.
- `ep_mask`intAssign an endpoint mask. Default `EP_NONE`.
- `query_var`string|boolSets the query var key for this taxonomy. Default `$taxonomy` key. If false, a taxonomy cannot be loaded at `?{query_var}={term_slug}`. If a string, the query `?{query_var}={term_slug}` will be valid.
- `update_count_callback`callableWorks much like a hook, in that it will be called when the count is updated. Default [\_update\_post\_term\_count()](../functions/_update_post_term_count) for taxonomies attached to post types, which confirms that the objects are published before counting them. Default [\_update\_generic\_term\_count()](../functions/_update_generic_term_count) for taxonomies attached to other object types, such as users.
- `default_term`string|array Default term to be used for the taxonomy.
* `name`stringName of default term.
* `slug`stringSlug for default term.
* `description`stringDescription for default term.
* `sort`boolWhether terms in this taxonomy should be sorted in the order they are provided to `wp_set_object_terms()`. Default null which equates to false.
* `args`arrayArray of arguments to automatically use inside `wp_get_object_terms()` for this taxonomy.
* `_builtin`boolThis taxonomy is a "built-in" taxonomy. INTERNAL USE ONLY! Default false. `$taxonomy` string Taxonomy key. `$object_type` string[] Array of names of object types for the taxonomy. File: `wp-includes/class-wp-taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-taxonomy.php/)
```
$args = apply_filters( 'register_taxonomy_args', $args, $this->name, (array) $object_type );
```
| Used By | Description |
| --- | --- |
| [WP\_Taxonomy::set\_props()](../classes/wp_taxonomy/set_props) wp-includes/class-wp-taxonomy.php | Sets taxonomy properties. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'add_meta_boxes_link', object $link ) do\_action( 'add\_meta\_boxes\_link', object $link )
====================================================
Fires when link-specific meta boxes are added.
`$link` object Link object. File: `wp-admin/edit-link-form.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-link-form.php/)
```
do_action( 'add_meta_boxes_link', $link );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'wp_delete_nav_menu', int $term_id ) do\_action( 'wp\_delete\_nav\_menu', int $term\_id )
====================================================
Fires after a navigation menu has been successfully deleted.
`$term_id` int ID of the deleted menu. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
do_action( 'wp_delete_nav_menu', $menu->term_id );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_nav\_menu()](../functions/wp_delete_nav_menu) wp-includes/nav-menu.php | Deletes a navigation menu. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'wp_create_file_in_uploads', string $file, int $attachment_id ) do\_action( 'wp\_create\_file\_in\_uploads', string $file, int $attachment\_id )
================================================================================
Fires after the header image is set or an error is returned.
`$file` string Path to the file. `$attachment_id` int Attachment ID. File: `wp-admin/includes/class-custom-image-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-custom-image-header.php/)
```
do_action( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication.
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_crop\_image()](../functions/wp_ajax_crop_image) wp-admin/includes/ajax-actions.php | Ajax handler for cropping an image. |
| [Custom\_Image\_Header::ajax\_header\_crop()](../classes/custom_image_header/ajax_header_crop) wp-admin/includes/class-custom-image-header.php | Gets attachment uploaded by Media Manager, crops it, then saves it as a new object. Returns JSON-encoded object details. |
| [Custom\_Image\_Header::step\_2()](../classes/custom_image_header/step_2) wp-admin/includes/class-custom-image-header.php | Display second step of custom header image page. |
| [Custom\_Image\_Header::step\_3()](../classes/custom_image_header/step_3) wp-admin/includes/class-custom-image-header.php | Display third step of custom header image page. |
| [Custom\_Background::handle\_upload()](../classes/custom_background/handle_upload) wp-admin/includes/class-custom-background.php | Handles an Image upload for the background image. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'signup_header' ) do\_action( 'signup\_header' )
==============================
Fires within the head section of the site sign-up screen.
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
do_action( 'signup_header' );
```
| Used By | Description |
| --- | --- |
| [do\_signup\_header()](../functions/do_signup_header) wp-signup.php | Prints signup\_header via wp\_head. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'widget_meta_poweredby', string $html, array $instance ) apply\_filters( 'widget\_meta\_poweredby', string $html, array $instance )
==========================================================================
Filters the “WordPress.org” list item HTML in the Meta widget.
`$html` string Default HTML for the WordPress.org list item. `$instance` array Array of settings for the current widget. * The “`widget_meta_poweredby`” filter is part of the build in Meta widget. This filter allows you to alter the powered by link at the bottom of the widget. By default, this links to WordPress.org.
* Note that the filter function **must** return an value after it is finished processing or the result will be empty.
File: `wp-includes/widgets/class-wp-widget-meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-meta.php/)
```
echo apply_filters(
'widget_meta_poweredby',
sprintf(
'<li><a href="%1$s">%2$s</a></li>',
esc_url( __( 'https://wordpress.org/' ) ),
__( 'WordPress.org' )
),
$instance
);
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Meta::widget()](../classes/wp_widget_meta/widget) wp-includes/widgets/class-wp-widget-meta.php | Outputs the content for the current Meta widget instance. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( "the_author_{$field}", string $author_meta, int|false $user_id ) apply\_filters( "the\_author\_{$field}", string $author\_meta, int|false $user\_id )
====================================================================================
Filters the value of the requested user metadata.
The filter name is dynamic and depends on the $field parameter of the function.
`$author_meta` string The value of the metadata. `$user_id` int|false The user ID. File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
echo apply_filters( "the_author_{$field}", $author_meta, $user_id );
```
| Used By | Description |
| --- | --- |
| [the\_author\_meta()](../functions/the_author_meta) wp-includes/author-template.php | Outputs the field from the user’s DB object. Defaults to current post’s author. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'restrict_manage_comments' ) do\_action( 'restrict\_manage\_comments' )
==========================================
Fires just before the Filter submit button for comment types.
File: `wp-admin/includes/class-wp-comments-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-comments-list-table.php/)
```
do_action( 'restrict_manage_comments' );
```
| Used By | Description |
| --- | --- |
| [WP\_Comments\_List\_Table::extra\_tablenav()](../classes/wp_comments_list_table/extra_tablenav) wp-admin/includes/class-wp-comments-list-table.php | |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'update_attached_file', string $file, int $attachment_id ) apply\_filters( 'update\_attached\_file', string $file, int $attachment\_id )
=============================================================================
Filters the path to the attached file to update.
`$file` string Path to the attached file to update. `$attachment_id` int Attachment ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$file = apply_filters( 'update_attached_file', $file, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [update\_attached\_file()](../functions/update_attached_file) wp-includes/post.php | Updates attachment file path based on attachment ID. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action_ref_array( 'pre_ping', string[] $post_links, string[] $pung, int $post_id ) do\_action\_ref\_array( 'pre\_ping', string[] $post\_links, string[] $pung, int $post\_id )
===========================================================================================
Fires just before pinging back links found in a post.
`$post_links` string[] Array of link URLs to be checked (passed by reference). `$pung` string[] Array of link URLs already pinged (passed by reference). `$post_id` int The post ID. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action_ref_array( 'pre_ping', array( &$post_links, &$pung, $post->ID ) );
```
| Used By | Description |
| --- | --- |
| [pingback()](../functions/pingback) wp-includes/comment.php | Pings back the links found in a post. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( "{$option}", int $per_page ) apply\_filters( "{$option}", int $per\_page )
=============================================
Filters the number of items to be displayed on each page of the list table.
The dynamic hook name, `$option`, refers to the `per_page` option depending on the type of list table in use. Possible filter names include:
* `edit_comments_per_page`
* `sites_network_per_page`
* `site_themes_network_per_page`
* `themes_network_per_page'`
* `users_network_per_page`
* `edit_post_per_page`
* `edit_page_per_page'`
* `edit_{$post_type}_per_page`
* `edit_post_tag_per_page`
* `edit_category_per_page`
* `edit_{$taxonomy}_per_page`
* `site_users_network_per_page`
* `users_per_page`
`$per_page` int Number of items to be displayed. Default 20. File: `wp-admin/includes/class-wp-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-list-table.php/)
```
return (int) apply_filters( "{$option}", $per_page );
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::render\_per\_page\_options()](../classes/wp_screen/render_per_page_options) wp-admin/includes/class-wp-screen.php | Renders the items per page option. |
| [WP\_List\_Table::get\_items\_per\_page()](../classes/wp_list_table/get_items_per_page) wp-admin/includes/class-wp-list-table.php | Gets the number of items to display on a single page. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'network_edit_site_nav_links', array $links ) apply\_filters( 'network\_edit\_site\_nav\_links', array $links )
=================================================================
Filters the links that appear on site-editing network pages.
Default links: ‘site-info’, ‘site-users’, ‘site-themes’, and ‘site-settings’.
`$links` array An array of link data representing individual network admin pages.
* `link_slug`array An array of information about the individual link to a page.
$type string $label Label to use for the link.
$type string $url URL, relative to `network_admin_url()` to use for the link.
$type string $cap Capability required to see the link.
} File: `wp-admin/includes/ms.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ms.php/)
```
$links = apply_filters(
'network_edit_site_nav_links',
array(
'site-info' => array(
'label' => __( 'Info' ),
'url' => 'site-info.php',
'cap' => 'manage_sites',
),
'site-users' => array(
'label' => __( 'Users' ),
'url' => 'site-users.php',
'cap' => 'manage_sites',
),
'site-themes' => array(
'label' => __( 'Themes' ),
'url' => 'site-themes.php',
'cap' => 'manage_sites',
),
'site-settings' => array(
'label' => __( 'Settings' ),
'url' => 'site-settings.php',
'cap' => 'manage_sites',
),
)
);
```
| Used By | Description |
| --- | --- |
| [network\_edit\_site\_nav()](../functions/network_edit_site_nav) wp-admin/includes/ms.php | Outputs the HTML for a network’s “Edit Site” tabular interface. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( "manage_{$post_type}_posts_columns", string[] $post_columns ) apply\_filters( "manage\_{$post\_type}\_posts\_columns", string[] $post\_columns )
==================================================================================
Filters the columns displayed in the Posts list table for a specific post type.
The dynamic portion of the hook name, `$post_type`, refers to the post type slug.
Possible hook names include:
* `manage_post_posts_columns`
* `manage_page_posts_columns`
`$post_columns` string[] An associative array of column headings. $post\_columns is an associative array of “column name” ⇒ “label”. The “column name” is passed to callback functions to identify the column. The “label” is shown as the column header.
**Built-in Column Types**:
Note: Listed in order of appearance. By default, all columns [supported](../functions/post_type_supports) by the post type are shown.
**cb**: Checkbox for bulk [actions](https://wordpress.org/support/article/posts-screen/#actions).
**title**: Post title. Includes “edit”, “quick edit”, “trash” and “view” links. If $mode (set from $\_REQUEST[‘mode’]) is ‘excerpt’, a post excerpt is included between the title and links.
**author**: Post author.
**categories**: Categories the post belongs to.
**tags**: Tags for the post.
**comments**: Number of pending comments.
**date**: The date and publish status of the post.
File: `wp-admin/includes/class-wp-posts-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
```
return apply_filters( "manage_{$post_type}_posts_columns", $posts_columns );
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::get\_columns()](../classes/wp_posts_list_table/get_columns) wp-admin/includes/class-wp-posts-list-table.php | |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'term_link', string $termlink, WP_Term $term, string $taxonomy ) apply\_filters( 'term\_link', string $termlink, WP\_Term $term, string $taxonomy )
==================================================================================
Filters the term link.
`$termlink` string Term link URL. `$term` [WP\_Term](../classes/wp_term) Term object. `$taxonomy` string Taxonomy slug. This filter is applied to the link URL for a term prior to printing by the function [get\_term\_link()](../functions/get_term_link) .
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
return apply_filters( 'term_link', $termlink, $term, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [get\_term\_link()](../functions/get_term_link) wp-includes/taxonomy.php | Generates a permalink for a taxonomy term archive. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'enable_wp_debug_mode_checks', bool $enable_debug_mode ) apply\_filters( 'enable\_wp\_debug\_mode\_checks', bool $enable\_debug\_mode )
==============================================================================
Filters whether to allow the debug mode check to occur.
This filter runs before it can be used by plugins. It is designed for non-web runtimes. Returning false causes the `WP_DEBUG` and related constants to not be checked and the default PHP values for errors will be used unless you take care to update them yourself.
To use this filter you must define a `$wp_filter` global before WordPress loads, usually in `wp-config.php`.
Example:
```
$GLOBALS['wp_filter'] = array(
'enable_wp_debug_mode_checks' => array(
10 => array(
array(
'accepted_args' => 0,
'function' => function() {
return false;
},
),
),
),
);
```
`$enable_debug_mode` bool Whether to enable debug mode checks to occur. Default true. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
if ( ! apply_filters( 'enable_wp_debug_mode_checks', true ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_debug\_mode()](../functions/wp_debug_mode) wp-includes/load.php | Set PHP error reporting based on WordPress debug settings. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'the_editor_content', string $content, string $default_editor ) apply\_filters( 'the\_editor\_content', string $content, string $default\_editor )
==================================================================================
Filters the default editor content.
`$content` string Default editor content. `$default_editor` string The default editor for the current user.
Either `'html'` or `'tinymce'`. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$content = apply_filters( 'the_editor_content', $content, $default_editor );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Text::form()](../classes/wp_widget_text/form) wp-includes/widgets/class-wp-widget-text.php | Outputs the Text widget settings form. |
| [\_WP\_Editors::editor()](../classes/_wp_editors/editor) wp-includes/class-wp-editor.php | Outputs the HTML for a single instance of the editor. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'author_email', string $author_email, string $comment_ID ) apply\_filters( 'author\_email', string $author\_email, string $comment\_ID )
=============================================================================
Filters the comment author’s email for display.
`$author_email` string The comment author's email address. `$comment_ID` string The comment ID as a numeric string. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
echo apply_filters( 'author_email', $author_email, $comment->comment_ID );
```
| Used By | Description |
| --- | --- |
| [comment\_author\_email()](../functions/comment_author_email) wp-includes/comment-template.php | Displays the email of the author of the current global $comment. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$comment_ID` parameter was added. |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'excerpt_more', string $more_string ) apply\_filters( 'excerpt\_more', string $more\_string )
=======================================================
Filters the string in the “more” link displayed after a trimmed excerpt.
`$more_string` string The string shown within the more link. This filter is called by the [wp\_trim\_excerpt()](../functions/wp_trim_excerpt) function. By default, the filter is set to echo ‘[…]’ as the excerpt more string at the end of the excerpt.
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' );
```
| Used By | Description |
| --- | --- |
| [wp\_trim\_excerpt()](../functions/wp_trim_excerpt) wp-includes/formatting.php | Generates an excerpt from the content, if needed. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'get_footer', string|null $name, array $args ) do\_action( 'get\_footer', string|null $name, array $args )
===========================================================
Fires before the footer template file is loaded.
`$name` string|null Name of the specific footer file to use. Null for the default footer. `$args` array Additional arguments passed to the footer template. `get_footer` is a hook that gets run at the very start of the `get_footer()` function call. If you pass in the name for a specific footer file, like `get_footer( 'new' )`, the `do_action` will pass in the name as a parameter for the hook. This allows you to limit your `add_action` calls to specific templates if you wish. Actions added to this hook should be added to your functions.php file.
Note: This hook is best to use to set up and execute code that doesn’t get echoed to the browser until later in the page load. Anything you echo will show up before any of the markup is displayed.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'get_footer', $name, $args );
```
| Used By | Description |
| --- | --- |
| [get\_footer()](../functions/get_footer) wp-includes/general-template.php | Loads footer template. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$args` parameter was added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | The `$name` parameter was added. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_read_image_metadata_types', int[] $image_types ) apply\_filters( 'wp\_read\_image\_metadata\_types', int[] $image\_types )
=========================================================================
Filters the image types to check for exif data.
`$image_types` int[] Array of image types to check for exif data. Each value is usually one of the `IMAGETYPE_*` constants. File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
$exif_image_types = apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) );
```
| Used By | Description |
| --- | --- |
| [wp\_read\_image\_metadata()](../functions/wp_read_image_metadata) wp-admin/includes/image.php | Gets extended image metadata, exif or iptc as available. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_insert_term_data', array $data, string $taxonomy, array $args ) apply\_filters( 'wp\_insert\_term\_data', array $data, string $taxonomy, array $args )
======================================================================================
Filters term data before it is inserted into the database.
`$data` array Term data to be inserted. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_insert\_term()](../functions/wp_insert_term) . More Arguments from wp\_insert\_term( ... $args ) Array or query string of arguments for inserting a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$data = apply_filters( 'wp_insert_term_data', $data, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'admin_comment_types_dropdown', string[] $comment_types ) apply\_filters( 'admin\_comment\_types\_dropdown', string[] $comment\_types )
=============================================================================
Filters the comment types shown in the drop-down menu on the Comments list table.
`$comment_types` string[] Array of comment type labels keyed by their name. File: `wp-admin/includes/class-wp-comments-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-comments-list-table.php/)
```
$comment_types = apply_filters(
'admin_comment_types_dropdown',
array(
'comment' => __( 'Comments' ),
'pings' => __( 'Pings' ),
)
);
```
| Used By | Description |
| --- | --- |
| [WP\_Comments\_List\_Table::comment\_type\_dropdown()](../classes/wp_comments_list_table/comment_type_dropdown) wp-admin/includes/class-wp-comments-list-table.php | Displays a comment type drop-down for filtering on the Comments list table. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( "get_{$meta_type}_metadata", mixed $value, int $object_id, string $meta_key, bool $single, string $meta_type ) apply\_filters( "get\_{$meta\_type}\_metadata", mixed $value, int $object\_id, string $meta\_key, bool $single, string $meta\_type )
====================================================================================================================================
Short-circuits the return value of a meta field.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Returning a non-null value will effectively short-circuit the function.
Possible filter names include:
* `get_post_metadata`
* `get_comment_metadata`
* `get_term_metadata`
* `get_user_metadata`
`$value` mixed The value to return, either a single metadata value or an array of values depending on the value of `$single`. Default null. `$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$single` bool Whether to return only the first value of the specified `$meta_key`. `$meta_type` string Type of object metadata is for. Accepts `'post'`, `'comment'`, `'term'`, `'user'`, or any other object type with an associated meta table. The filter must return null if the data should be taken from the database. If it returns anything else, the [get\_metadata()](../functions/get_metadata) function (and therefore the `get_user_meta`) will return what the filter returns.
File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single, $meta_type );
```
| Used By | Description |
| --- | --- |
| [get\_metadata\_raw()](../functions/get_metadata_raw) wp-includes/meta.php | Retrieves raw metadata value for the specified object. |
| [metadata\_exists()](../functions/metadata_exists) wp-includes/meta.php | Determines if a meta field with the given key exists for the given object ID. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$meta_type` parameter. |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'salt', string $cached_salt, string $scheme ) apply\_filters( 'salt', string $cached\_salt, string $scheme )
==============================================================
Filters the WordPress salt.
`$cached_salt` string Cached salt for the given scheme. `$scheme` string Authentication scheme. Values include `'auth'`, `'secure_auth'`, `'logged_in'`, and `'nonce'`. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
```
| Used By | Description |
| --- | --- |
| [wp\_salt()](../functions/wp_salt) wp-includes/pluggable.php | Returns a salt to add to hashes. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( "pre_update_option_{$option}", mixed $value, mixed $old_value, string $option ) apply\_filters( "pre\_update\_option\_{$option}", mixed $value, mixed $old\_value, string $option )
===================================================================================================
Filters a specific option before its value is (maybe) serialized and updated.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$value` mixed The new, unserialized option value. `$old_value` mixed The old option value. `$option` string Option name. This filter is applied to the option value before being saved to the database; this allows the overriding value to be stored. To use this filter, you will need to add filters for specific options names, such as “`pre_update_option_foo`” to filter the option “`foo`“.
File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$value = apply_filters( "pre_update_option_{$option}", $value, $old_value, $option );
```
| Used By | Description |
| --- | --- |
| [update\_option()](../functions/update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$option` parameter was added. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'rest_post_dispatch', WP_HTTP_Response $result, WP_REST_Server $server, WP_REST_Request $request ) apply\_filters( 'rest\_post\_dispatch', WP\_HTTP\_Response $result, WP\_REST\_Server $server, WP\_REST\_Request $request )
==========================================================================================================================
Filters the REST API response.
Allows modification of the response before returning.
`$result` [WP\_HTTP\_Response](../classes/wp_http_response) Result to send to the client. Usually a `WP_REST_Response`. `$server` [WP\_REST\_Server](../classes/wp_rest_server) Server instance. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
$result = apply_filters( 'rest_post_dispatch', rest_ensure_response( $result ), $this, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::serve\_batch\_request\_v1()](../classes/wp_rest_server/serve_batch_request_v1) wp-includes/rest-api/class-wp-rest-server.php | Serves the batch/v1 request. |
| [rest\_preload\_api\_request()](../functions/rest_preload_api_request) wp-includes/rest-api.php | Append result of internal request to REST API for purpose of preloading data to be attached to a page. |
| [WP\_REST\_Server::serve\_request()](../classes/wp_rest_server/serve_request) wp-includes/rest-api/class-wp-rest-server.php | Handles serving a REST API request. |
| [WP\_REST\_Server::embed\_links()](../classes/wp_rest_server/embed_links) wp-includes/rest-api/class-wp-rest-server.php | Embeds the links from the data into the request. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Applied to embedded responses. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_auth_check_load', bool $show, WP_Screen $screen ) apply\_filters( 'wp\_auth\_check\_load', bool $show, WP\_Screen $screen )
=========================================================================
Filters whether to load the authentication check.
Returning a falsey value from the filter will effectively short-circuit loading the authentication check.
`$show` bool Whether to load the authentication check. `$screen` [WP\_Screen](../classes/wp_screen) The current screen object. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
if ( apply_filters( 'wp_auth_check_load', $show, $screen ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_auth\_check\_load()](../functions/wp_auth_check_load) wp-includes/functions.php | Loads the auth check for monitoring whether the user is still logged in. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( "update_plugins_{$hostname}", array|false $update, array $plugin_data, string $plugin_file, string[] $locales ) apply\_filters( "update\_plugins\_{$hostname}", array|false $update, array $plugin\_data, string $plugin\_file, string[] $locales )
===================================================================================================================================
Filters the update response for a given plugin hostname.
The dynamic portion of the hook name, `$hostname`, refers to the hostname of the URI specified in the `Update URI` header field.
`$update` array|false The plugin update data with the latest details. Default false.
* `id`stringOptional. ID of the plugin for update purposes, should be a URI specified in the `Update URI` header field.
* `slug`stringSlug of the plugin.
* `version`stringThe version of the plugin.
* `url`stringThe URL for details of the plugin.
* `package`stringOptional. The update ZIP for the plugin.
* `tested`stringOptional. The version of WordPress the plugin is tested against.
* `requires_php`stringOptional. The version of PHP which the plugin requires.
* `autoupdate`boolOptional. Whether the plugin should automatically update.
* `icons`arrayOptional. Array of plugin icons.
* `banners`arrayOptional. Array of plugin banners.
* `banners_rtl`arrayOptional. Array of plugin RTL banners.
* `translations`array Optional. List of translation updates for the plugin.
+ `language`stringThe language the translation update is for.
+ `version`stringThe version of the plugin this translation is for.
This is not the version of the language file.
+ `updated`stringThe update timestamp of the translation file.
Should be a date in the `YYYY-MM-DD HH:MM:SS` format.
+ `package`stringThe ZIP location containing the translation update.
+ `autoupdate`stringWhether the translation should be automatically installed. `$plugin_data` array Plugin headers. `$plugin_file` string Plugin filename. `$locales` string[] Installed locales to look up translations for. File: `wp-includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/update.php/)
```
$update = apply_filters( "update_plugins_{$hostname}", false, $plugin_data, $plugin_file, $locales );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_plugins()](../functions/wp_update_plugins) wp-includes/update.php | Checks for available updates to plugins based on the latest versions hosted on WordPress.org. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_posts_pre_max_num_pages', int|null $max_num_pages, string $post_type ) apply\_filters( 'wp\_sitemaps\_posts\_pre\_max\_num\_pages', int|null $max\_num\_pages, string $post\_type )
============================================================================================================
Filters the max number of pages before it is generated.
Passing a non-null value will short-circuit the generation, returning that value instead.
`$max_num_pages` int|null The maximum number of pages. Default null. `$post_type` string Post type name. File: `wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php/)
```
$max_num_pages = apply_filters( 'wp_sitemaps_posts_pre_max_num_pages', null, $post_type );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Posts::get\_max\_num\_pages()](../classes/wp_sitemaps_posts/get_max_num_pages) wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | Gets the max number of pages available for the object type. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'comment_class', string[] $classes, string[] $css_class, string $comment_id, WP_Comment $comment, int|WP_Post $post ) apply\_filters( 'comment\_class', string[] $classes, string[] $css\_class, string $comment\_id, WP\_Comment $comment, int|WP\_Post $post )
==========================================================================================================================================
Filters the returned CSS classes for the current comment.
`$classes` string[] An array of comment classes. `$css_class` string[] An array of additional classes added to the list. `$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The comment object. `$post` int|[WP\_Post](../classes/wp_post) The post ID or [WP\_Post](../classes/wp_post) object. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'comment_class', $classes, $css_class, $comment->comment_ID, $comment, $post );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_class()](../functions/get_comment_class) wp-includes/comment-template.php | Returns the classes for the comment div as an array. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'unload_textdomain', string $domain, bool $reloadable ) do\_action( 'unload\_textdomain', string $domain, bool $reloadable )
====================================================================
Fires before the text domain is unloaded.
`$domain` string Text domain. Unique identifier for retrieving translated strings. `$reloadable` bool Whether the text domain can be loaded just-in-time again. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
do_action( 'unload_textdomain', $domain, $reloadable );
```
| Used By | Description |
| --- | --- |
| [unload\_textdomain()](../functions/unload_textdomain) wp-includes/l10n.php | Unloads translations for a text domain. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Added the `$reloadable` parameter. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'sanitize_textarea_field', string $filtered, string $str ) apply\_filters( 'sanitize\_textarea\_field', string $filtered, string $str )
============================================================================
Filters a sanitized textarea field string.
`$filtered` string The sanitized string. `$str` string The string prior to being sanitized. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'sanitize_textarea_field', $filtered, $str );
```
| Used By | Description |
| --- | --- |
| [sanitize\_textarea\_field()](../functions/sanitize_textarea_field) wp-includes/formatting.php | Sanitizes a multiline string from user input or from the database. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'get_the_terms', WP_Term[]|WP_Error $terms, int $post_id, string $taxonomy ) apply\_filters( 'get\_the\_terms', WP\_Term[]|WP\_Error $terms, int $post\_id, string $taxonomy )
=================================================================================================
Filters the list of terms attached to the given post.
`$terms` [WP\_Term](../classes/wp_term)[]|[WP\_Error](../classes/wp_error) Array of attached terms, or [WP\_Error](../classes/wp_error) on failure. `$post_id` int Post ID. `$taxonomy` string Name of the taxonomy. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [get\_the\_terms()](../functions/get_the_terms) wp-includes/category-template.php | Retrieves the terms of the taxonomy that are attached to the post. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters_deprecated( 'media_buttons_context', string $string ) apply\_filters\_deprecated( 'media\_buttons\_context', string $string )
=======================================================================
This hook has been deprecated. Use [‘media\_buttons’](media_buttons) action instead.
Filters the legacy (pre-3.5.0) media buttons.
Use [‘media\_buttons’](media_buttons) action instead.
`$string` string Media buttons context. Default empty. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$legacy_filter = apply_filters_deprecated( 'media_buttons_context', array( '' ), '3.5.0', 'media_buttons' );
```
| Used By | Description |
| --- | --- |
| [media\_buttons()](../functions/media_buttons) wp-admin/includes/media.php | Adds the media button to the editor. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Use ['media\_buttons'](media_buttons) action instead. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'added_term_relationship', int $object_id, int $tt_id, string $taxonomy ) do\_action( 'added\_term\_relationship', int $object\_id, int $tt\_id, string $taxonomy )
=========================================================================================
Fires immediately after an object-term relationship is added.
`$object_id` int Object ID. `$tt_id` int Term taxonomy ID. `$taxonomy` string Taxonomy slug. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'added_term_relationship', $object_id, $tt_id, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_object\_terms()](../functions/wp_set_object_terms) wp-includes/taxonomy.php | Creates term and taxonomy relationships. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Added the `$taxonomy` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'validate_username', bool $valid, string $username ) apply\_filters( 'validate\_username', bool $valid, string $username )
=====================================================================
Filters whether the provided username is valid.
`$valid` bool Whether given username is valid. `$username` string Username to check. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'validate_username', $valid, $username );
```
| Used By | Description |
| --- | --- |
| [validate\_username()](../functions/validate_username) wp-includes/user.php | Checks whether a username is valid. |
| Version | Description |
| --- | --- |
| [2.0.1](https://developer.wordpress.org/reference/since/2.0.1/) | Introduced. |
wordpress apply_filters( 'disable_months_dropdown', bool $disable, string $post_type ) apply\_filters( 'disable\_months\_dropdown', bool $disable, string $post\_type )
================================================================================
Filters whether to remove the ‘Months’ drop-down from the post list table.
`$disable` bool Whether to disable the drop-down. Default false. `$post_type` string The post type. File: `wp-admin/includes/class-wp-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-list-table.php/)
```
if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_List\_Table::months\_dropdown()](../classes/wp_list_table/months_dropdown) wp-admin/includes/class-wp-list-table.php | Displays a dropdown for filtering items in the list table by month. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'lostpassword_url', string $lostpassword_url, string $redirect ) apply\_filters( 'lostpassword\_url', string $lostpassword\_url, string $redirect )
==================================================================================
Filters the Lost Password URL.
`$lostpassword_url` string The lost password page URL. `$redirect` string The path to redirect to on login. The filter is applied to the URL returned by the function [wp\_lostpassword\_url()](../functions/wp_lostpassword_url) , allowing the developer to have that function direct users to a specific (different) URL for retrieving a lost password.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
```
| Used By | Description |
| --- | --- |
| [wp\_lostpassword\_url()](../functions/wp_lostpassword_url) wp-includes/general-template.php | Returns the URL that allows the user to reset the lost password. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'new_network_admin_email_content', string $email_text, array $new_admin_email ) apply\_filters( 'new\_network\_admin\_email\_content', string $email\_text, array $new\_admin\_email )
======================================================================================================
Filters the text of the email sent when a change of network admin email address is attempted.
The following strings have a special meaning and will get replaced dynamically:
`$email_text` string Text in the email. `$new_admin_email` array Data relating to the new network admin email address.
* `hash`stringThe secure hash used in the confirmation link URL.
* `newemail`stringThe proposed new network admin email address.
File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$content = apply_filters( 'new_network_admin_email_content', $email_text, $new_admin_email );
```
| Used By | Description |
| --- | --- |
| [update\_network\_option\_new\_admin\_email()](../functions/update_network_option_new_admin_email) wp-includes/ms-functions.php | Sends a confirmation request email when a change of network admin email address is attempted. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'wp_mail_charset', string $charset ) apply\_filters( 'wp\_mail\_charset', string $charset )
======================================================
Filters the default [wp\_mail()](../functions/wp_mail) charset.
`$charset` string Default email charset. * The default character encoding for [wp\_mail()](../functions/wp_mail) is UTF-8. The character encoding can be changed using the `wp_mail_charset` filter.
* While the average user is unlikely to need to change the default character encoding for email, users who need to send email in different languages may find this filter useful.
* UTF-8 is still the recommended default character encoding to use since it’s backward compatible with ASCII and can represent nearly all languages. As a result, UTF-8 is the most ubiquitous character encoding being used on the web. Users/developers typically do not need to change the character encoding in order to read/write foreign langauges.
* As of [Version 3.5](https://wordpress.org/support/wordpress-version/version-3-5/), WordPress character encoding is no longer configurable from the Administration Panel and defaults to UTF-8.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
```
| Used By | Description |
| --- | --- |
| [wp\_mail()](../functions/wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'customize_dynamic_setting_args', false|array $setting_args, string $setting_id ) apply\_filters( 'customize\_dynamic\_setting\_args', false|array $setting\_args, string $setting\_id )
======================================================================================================
Filters a dynamic setting’s constructor args.
For a dynamic setting to be registered, this filter must be employed to override the default false value with an array of args to pass to the [WP\_Customize\_Setting](../classes/wp_customize_setting) constructor.
`$setting_args` false|array The arguments to the [WP\_Customize\_Setting](../classes/wp_customize_setting) constructor. `$setting_id` string ID for dynamic setting, usually coming from `$_POST['customized']`. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
$setting_args = apply_filters( 'customize_dynamic_setting_args', $setting_args, $setting_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::add\_dynamic\_settings()](../classes/wp_customize_manager/add_dynamic_settings) wp-includes/class-wp-customize-manager.php | Registers any dynamically-created settings, such as those from $\_POST[‘customized’] that have no corresponding setting created. |
| [WP\_Customize\_Manager::add\_setting()](../classes/wp_customize_manager/add_setting) wp-includes/class-wp-customize-manager.php | Adds a customize setting. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'rest_comment_query', array $prepared_args, WP_REST_Request $request ) apply\_filters( 'rest\_comment\_query', array $prepared\_args, WP\_REST\_Request $request )
===========================================================================================
Filters [WP\_Comment\_Query](../classes/wp_comment_query) arguments when querying comments via the REST API.
`$prepared_args` array Array of arguments for [WP\_Comment\_Query](../classes/wp_comment_query). `$request` [WP\_REST\_Request](../classes/wp_rest_request) The REST API request. File: `wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php/)
```
$prepared_args = apply_filters( 'rest_comment_query', $prepared_args, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::get\_items()](../classes/wp_rest_comments_controller/get_items) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Retrieves a list of comment items. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_default_editor', string $r ) apply\_filters( 'wp\_default\_editor', string $r )
==================================================
Filters which editor should be displayed by default.
`$r` string Which editor should be displayed by default. Either `'tinymce'`, `'html'`, or `'test'`. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'wp_default_editor', $r );
```
| Used By | Description |
| --- | --- |
| [wp\_default\_editor()](../functions/wp_default_editor) wp-includes/general-template.php | Finds out which editor should be displayed by default. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'comment_flood_message', string $comment_flood_message ) apply\_filters( 'comment\_flood\_message', string $comment\_flood\_message )
============================================================================
Filters the comment flood error message.
`$comment_flood_message` string Comment flood error message. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_check\_comment\_flood()](../functions/wp_check_comment_flood) wp-includes/comment.php | Checks whether comment flooding is occurring. |
| [wp\_allow\_comment()](../functions/wp_allow_comment) wp-includes/comment.php | Validates whether this comment is allowed to be made. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'postmeta_form_limit', int $limit ) apply\_filters( 'postmeta\_form\_limit', int $limit )
=====================================================
Filters the number of custom fields to retrieve for the drop-down in the Custom Fields meta box.
`$limit` int Number of custom fields to retrieve. Default 30. File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
$limit = apply_filters( 'postmeta_form_limit', 30 );
```
| Used By | Description |
| --- | --- |
| [meta\_form()](../functions/meta_form) wp-admin/includes/template.php | Prints the form in the Custom Fields meta box. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_prepare_themes_for_js', array $prepared_themes ) apply\_filters( 'wp\_prepare\_themes\_for\_js', array $prepared\_themes )
=========================================================================
Filters the themes prepared for JavaScript, for themes.php.
Could be useful for changing the order, which is by name by default.
`$prepared_themes` array Array of theme data. File: `wp-admin/includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
```
$prepared_themes = apply_filters( 'wp_prepare_themes_for_js', $prepared_themes );
```
| Used By | Description |
| --- | --- |
| [wp\_prepare\_themes\_for\_js()](../functions/wp_prepare_themes_for_js) wp-admin/includes/theme.php | Prepares themes for JavaScript. |
| Version | Description |
| --- | --- |
| [3.8.0](https://developer.wordpress.org/reference/since/3.8.0/) | Introduced. |
wordpress apply_filters( 'register', string $link ) apply\_filters( 'register', string $link )
==========================================
Filters the HTML link to the Registration or Admin page.
Users are sent to the admin page if logged-in, or the registration page if enabled and logged-out.
`$link` string The HTML code for the link to the Registration or Admin page. The hook filters the HTML link to the Registration or Admin page. Users are sent to the admin page if logged-in, or the registration page if enabled and logged-out.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$link = apply_filters( 'register', $link );
```
| Used By | Description |
| --- | --- |
| [wp\_register()](../functions/wp_register) wp-includes/general-template.php | Displays the Registration or Admin link. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( "edit_{$taxonomy}_{$field}", mixed $value, int $term_id ) apply\_filters( "edit\_{$taxonomy}\_{$field}", mixed $value, int $term\_id )
============================================================================
Filters the taxonomy field to edit before it is sanitized.
The dynamic portions of the filter name, `$taxonomy` and `$field`, refer to the taxonomy slug and taxonomy field, respectively.
`$value` mixed Value of the taxonomy field to edit. `$term_id` int Term ID. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$value = apply_filters( "edit_{$taxonomy}_{$field}", $value, $term_id );
```
| Used By | Description |
| --- | --- |
| [sanitize\_term\_field()](../functions/sanitize_term_field) wp-includes/taxonomy.php | Sanitizes the field value in the term based on the context. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'comment_on_password_protected', int $comment_post_id ) do\_action( 'comment\_on\_password\_protected', int $comment\_post\_id )
========================================================================
Fires when a comment is attempted on a password-protected post.
`$comment_post_id` int Post ID. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'comment_on_password_protected', $comment_post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_handle\_comment\_submission()](../functions/wp_handle_comment_submission) wp-includes/comment.php | Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'get_comment_text', string $comment_content, WP_Comment $comment, array $args ) apply\_filters( 'get\_comment\_text', string $comment\_content, WP\_Comment $comment, array $args )
===================================================================================================
Filters the text of a comment.
* [Walker\_Comment::comment()](../classes/walker_comment/comment)
`$comment_content` string Text of the comment. `$comment` [WP\_Comment](../classes/wp_comment) The comment object. `$args` array An array of arguments. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
return apply_filters( 'get_comment_text', $comment_content, $comment, $args );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_text()](../functions/get_comment_text) wp-includes/comment-template.php | Retrieves the text of the current comment. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( "set_screen_option_{$option}", mixed $screen_option, string $option, int $value ) apply\_filters( "set\_screen\_option\_{$option}", mixed $screen\_option, string $option, int $value )
=====================================================================================================
Filters a screen option value before it is set.
The dynamic portion of the hook name, `$option`, refers to the option name.
Returning false from the filter will skip saving the current option.
* [set\_screen\_options()](../functions/set_screen_options)
`$screen_option` mixed The value to save instead of the option value.
Default false (to skip saving the current option). `$option` string The option name. `$value` int The option value. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
$value = apply_filters( "set_screen_option_{$option}", $screen_option, $option, $value );
```
| Used By | Description |
| --- | --- |
| [set\_screen\_options()](../functions/set_screen_options) wp-admin/includes/misc.php | Saves option for number of rows when listing posts, pages, comments, etc. |
| Version | Description |
| --- | --- |
| [5.4.2](https://developer.wordpress.org/reference/since/5.4.2/) | Introduced. |
wordpress apply_filters( 'customize_dynamic_partial_class', string $partial_class, string $partial_id, array $partial_args ) apply\_filters( 'customize\_dynamic\_partial\_class', string $partial\_class, string $partial\_id, array $partial\_args )
=========================================================================================================================
Filters the class used to construct partials.
Allow non-statically created partials to be constructed with custom [WP\_Customize\_Partial](../classes/wp_customize_partial) subclass.
`$partial_class` string [WP\_Customize\_Partial](../classes/wp_customize_partial) or a subclass. `$partial_id` string ID for dynamic partial. `$partial_args` array The arguments to the [WP\_Customize\_Partial](../classes/wp_customize_partial) constructor. File: `wp-includes/customize/class-wp-customize-selective-refresh.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-selective-refresh.php/)
```
$partial_class = apply_filters( 'customize_dynamic_partial_class', $partial_class, $partial_id, $partial_args );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Selective\_Refresh::add\_dynamic\_partials()](../classes/wp_customize_selective_refresh/add_dynamic_partials) wp-includes/customize/class-wp-customize-selective-refresh.php | Registers dynamically-created partials. |
| [WP\_Customize\_Selective\_Refresh::add\_partial()](../classes/wp_customize_selective_refresh/add_partial) wp-includes/customize/class-wp-customize-selective-refresh.php | Adds a partial. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'single_tag_title', string $term_name ) apply\_filters( 'single\_tag\_title', string $term\_name )
==========================================================
Filters the tag archive page title.
`$term_name` string Tag name for archive being displayed. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$term_name = apply_filters( 'single_tag_title', $term->name );
```
| Used By | Description |
| --- | --- |
| [single\_term\_title()](../functions/single_term_title) wp-includes/general-template.php | Displays or retrieves page title for taxonomy term archive. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'get_post_time', string|int $time, string $format, bool $gmt ) apply\_filters( 'get\_post\_time', string|int $time, string $format, bool $gmt )
================================================================================
Filters the localized time a post was written.
`$time` string|int Formatted date string or Unix timestamp if `$format` is `'U'` or `'G'`. `$format` string Format to use for retrieving the time the post was written.
Accepts `'G'`, `'U'`, or PHP date format. `$gmt` bool Whether to retrieve the GMT time. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'get_post_time', $time, $format, $gmt );
```
| Used By | Description |
| --- | --- |
| [get\_post\_time()](../functions/get_post_time) wp-includes/general-template.php | Retrieves the time at which the post was written. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'wp_loaded' ) do\_action( 'wp\_loaded' )
==========================
This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for users not logged in.
AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for users not logged in.
The `wp_loaded` action fires after init but before `admin_init`.
Front-End: init -> widgets\_init -> wp\_loaded
Admin: init -> widgets\_init -> wp\_loaded -> admin\_menu -> admin\_init
File: `wp-settings.php`. [View all references](https://developer.wordpress.org/reference/files/wp-settings.php/)
```
do_action( 'wp_loaded' );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'update_feedback', string $feedback ) apply\_filters( 'update\_feedback', string $feedback )
======================================================
Filters feedback messages displayed during the core update process.
The filter is first evaluated after the zip file for the latest version has been downloaded and unzipped. It is evaluated five more times during the process:
1. Before WordPress begins the core upgrade process.
2. Before Maintenance Mode is enabled.
3. Before WordPress begins copying over the necessary files.
4. Before Maintenance Mode is disabled.
5. Before the database is upgraded.
`$feedback` string The core update feedback messages. File: `wp-admin/includes/update-core.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update-core.php/)
```
apply_filters( 'update_feedback', __( 'Verifying the unpacked files…' ) );
```
| Used By | Description |
| --- | --- |
| [Core\_Upgrader::upgrade()](../classes/core_upgrader/upgrade) wp-admin/includes/class-core-upgrader.php | Upgrade WordPress core. |
| [update\_core()](../functions/update_core) wp-admin/includes/update-core.php | Upgrades the core of WordPress. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_stylesheet_url', string $sitemap_url ) apply\_filters( 'wp\_sitemaps\_stylesheet\_url', string $sitemap\_url )
=======================================================================
Filters the URL for the sitemap stylesheet.
If a falsey value is returned, no stylesheet will be used and the "raw" XML of the sitemap will be displayed.
`$sitemap_url` string Full URL for the sitemaps XSL file. File: `wp-includes/sitemaps/class-wp-sitemaps-renderer.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/class-wp-sitemaps-renderer.php/)
```
return apply_filters( 'wp_sitemaps_stylesheet_url', $sitemap_url );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Renderer::get\_sitemap\_stylesheet\_url()](../classes/wp_sitemaps_renderer/get_sitemap_stylesheet_url) wp-includes/sitemaps/class-wp-sitemaps-renderer.php | Gets the URL for the sitemap stylesheet. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'get_search_query', mixed $search ) apply\_filters( 'get\_search\_query', mixed $search )
=====================================================
Filters the contents of the search query variable.
`$search` mixed Contents of the search query variable. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$query = apply_filters( 'get_search_query', get_query_var( 's' ) );
```
| Used By | Description |
| --- | --- |
| [get\_search\_query()](../functions/get_search_query) wp-includes/general-template.php | Retrieves the contents of the search WordPress query variable. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'attachment_updated', int $post_ID, WP_Post $post_after, WP_Post $post_before ) do\_action( 'attachment\_updated', int $post\_ID, WP\_Post $post\_after, WP\_Post $post\_before )
=================================================================================================
Fires once an existing attachment has been updated.
`$post_ID` int Post ID. `$post_after` [WP\_Post](../classes/wp_post) Post object following the update. `$post_before` [WP\_Post](../classes/wp_post) Post object before the update. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'attachment_updated', $post_ID, $post_after, $post_before );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( "user_{$field}", mixed $value, int $user_id, string $context ) apply\_filters( "user\_{$field}", mixed $value, int $user\_id, string $context )
================================================================================
Filters the value of a user field in a standard context.
The dynamic portion of the hook name, `$field`, refers to the prefixed user field being filtered, such as ‘user\_login’, ‘user\_email’, ‘first\_name’, etc.
`$value` mixed The user object value to sanitize. `$user_id` int User ID. `$context` string The context to filter within. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$value = apply_filters( "user_{$field}", $value, $user_id, $context );
```
| Used By | Description |
| --- | --- |
| [sanitize\_user\_field()](../functions/sanitize_user_field) wp-includes/user.php | Sanitizes user field based on context. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'site_status_persistent_object_cache_url', string $action_url ) apply\_filters( 'site\_status\_persistent\_object\_cache\_url', string $action\_url )
=====================================================================================
Filters the action URL for the persistent object cache health check.
`$action_url` string Learn more link for persistent object cache health check. File: `wp-admin/includes/class-wp-site-health.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-site-health.php/)
```
$action_url = apply_filters(
'site_status_persistent_object_cache_url',
/* translators: Localized Support reference. */
__( 'https://wordpress.org/support/article/optimization/#persistent-object-cache' )
);
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::get\_test\_persistent\_object\_cache()](../classes/wp_site_health/get_test_persistent_object_cache) wp-admin/includes/class-wp-site-health.php | Tests if the site uses persistent object cache and recommends to use it if not. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_nav_menu', string $nav_menu, stdClass $args ) apply\_filters( 'wp\_nav\_menu', string $nav\_menu, stdClass $args )
====================================================================
Filters the HTML content for navigation menus.
* [wp\_nav\_menu()](../functions/wp_nav_menu)
`$nav_menu` string The HTML content for the navigation menu. `$args` stdClass An object containing [wp\_nav\_menu()](../functions/wp_nav_menu) arguments. More Arguments from wp\_nav\_menu( ... $args ) Array of nav menu arguments.
* `menu`int|string|[WP\_Term](../classes/wp_term)Desired menu. Accepts a menu ID, slug, name, or object.
* `menu_class`stringCSS class to use for the ul element which forms the menu.
Default `'menu'`.
* `menu_id`stringThe ID that is applied to the ul element which forms the menu.
Default is the menu slug, incremented.
* `container`stringWhether to wrap the ul, and what to wrap it with.
Default `'div'`.
* `container_class`stringClass that is applied to the container.
Default 'menu-{menu slug}-container'.
* `container_id`stringThe ID that is applied to the container.
* `container_aria_label`stringThe aria-label attribute that is applied to the container when it's a nav element.
* `fallback_cb`callable|falseIf the menu doesn't exist, a callback function will fire.
Default is `'wp_page_menu'`. Set to false for no fallback.
* `before`stringText before the link markup.
* `after`stringText after the link markup.
* `link_before`stringText before the link text.
* `link_after`stringText after the link text.
* `echo`boolWhether to echo the menu or return it. Default true.
* `depth`intHow many levels of the hierarchy are to be included.
0 means all. Default 0.
Default 0.
* `walker`objectInstance of a custom walker class.
* `theme_location`stringTheme location to be used. Must be registered with [register\_nav\_menu()](../functions/register_nav_menu) in order to be selectable by the user.
* `items_wrap`stringHow the list items should be wrapped. Uses printf() format with numbered placeholders. Default is a ul with an id and class.
* `item_spacing`stringWhether to preserve whitespace within the menu's HTML.
Accepts `'preserve'` or `'discard'`. Default `'preserve'`.
File: `wp-includes/nav-menu-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu-template.php/)
```
$nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_nav\_menu()](../functions/wp_nav_menu) wp-includes/nav-menu-template.php | Displays a navigation menu. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'pre_remote_source', string $remote_source, string $pagelinkedto ) apply\_filters( 'pre\_remote\_source', string $remote\_source, string $pagelinkedto )
=====================================================================================
Filters the pingback remote source.
`$remote_source` string Response source for the page linked from. `$pagelinkedto` string URL of the page linked to. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
$remote_source = apply_filters( 'pre_remote_source', $remote_source, $pagelinkedto );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::pingback\_ping()](../classes/wp_xmlrpc_server/pingback_ping) wp-includes/class-wp-xmlrpc-server.php | Retrieves a pingback and registers it. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_edited_image_metadata', array $new_image_meta, int $new_attachment_id, int $attachment_id ) apply\_filters( 'wp\_edited\_image\_metadata', array $new\_image\_meta, int $new\_attachment\_id, int $attachment\_id )
=======================================================================================================================
Filters the meta data for the new image created by editing an existing image.
`$new_image_meta` array Meta data for the new image. `$new_attachment_id` int Attachment post ID for the new image. `$attachment_id` int Attachment post ID for the edited (parent) image. File: `wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php/)
```
$new_image_meta = apply_filters( 'wp_edited_image_metadata', $new_image_meta, $new_attachment_id, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Attachments\_Controller::edit\_media\_item()](../classes/wp_rest_attachments_controller/edit_media_item) wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Applies edits to a media item and creates a new attachment record. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'rest_after_insert_nav_menu_item', object $nav_menu_item, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_after\_insert\_nav\_menu\_item', object $nav\_menu\_item, WP\_REST\_Request $request, bool $creating )
=========================================================================================================================
Fires after a single menu item is completely created or updated via the REST API.
`$nav_menu_item` object Inserted or updated menu item object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating a menu item, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php/)
```
do_action( 'rest_after_insert_nav_menu_item', $nav_menu_item, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menu\_Items\_Controller::create\_item()](../classes/wp_rest_menu_items_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php | Creates a single post. |
| [WP\_REST\_Menu\_Items\_Controller::update\_item()](../classes/wp_rest_menu_items_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php | Updates a single nav menu item. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress do_action( 'sidebar_admin_setup' ) do\_action( 'sidebar\_admin\_setup' )
=====================================
Fires early before the Widgets administration screen loads, after scripts are enqueued.
File: `wp-admin/widgets-form.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/widgets-form.php/)
```
do_action( 'sidebar_admin_setup' );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_delete\_inactive\_widgets()](../functions/wp_ajax_delete_inactive_widgets) wp-admin/includes/ajax-actions.php | Ajax handler for removing inactive widgets. |
| [wp\_ajax\_save\_widget()](../functions/wp_ajax_save_widget) wp-admin/includes/ajax-actions.php | Ajax handler for saving a widget. |
| [WP\_Customize\_Widgets::wp\_ajax\_update\_widget()](../classes/wp_customize_widgets/wp_ajax_update_widget) wp-includes/class-wp-customize-widgets.php | Updates widget settings asynchronously. |
| [WP\_Customize\_Widgets::customize\_controls\_init()](../classes/wp_customize_widgets/customize_controls_init) wp-includes/class-wp-customize-widgets.php | Ensures all widgets get loaded into the Customizer. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'send_retrieve_password_email', bool $send, string $user_login, WP_User $user_data ) apply\_filters( 'send\_retrieve\_password\_email', bool $send, string $user\_login, WP\_User $user\_data )
==========================================================================================================
Filters whether to send the retrieve password email.
Return false to disable sending the email.
`$send` bool Whether to send the email. `$user_login` string The username for the user. `$user_data` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
if ( ! apply_filters( 'send_retrieve_password_email', true, $user_login, $user_data ) ) {
```
| Used By | Description |
| --- | --- |
| [retrieve\_password()](../functions/retrieve_password) wp-includes/user.php | Handles sending a password retrieval email to a user. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'comment_edit_pre', string $comment_content ) apply\_filters( 'comment\_edit\_pre', string $comment\_content )
================================================================
Filters the comment content before editing.
`$comment_content` string Comment content. File: `wp-admin/includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/comment.php/)
```
$comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content );
```
| Used By | Description |
| --- | --- |
| [WP\_Comments\_List\_Table::column\_comment()](../classes/wp_comments_list_table/column_comment) wp-admin/includes/class-wp-comments-list-table.php | |
| [get\_comment\_to\_edit()](../functions/get_comment_to_edit) wp-admin/includes/comment.php | Returns a [WP\_Comment](../classes/wp_comment) object based on comment ID. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters_deprecated( 'contextual_help_list', array $old_compat_help, WP_Screen $screen ) apply\_filters\_deprecated( 'contextual\_help\_list', array $old\_compat\_help, WP\_Screen $screen )
====================================================================================================
This hook has been deprecated. Use [get\_current\_screen()](../functions/get_current_screen) ->add\_help\_tab() or [get\_current\_screen()](../functions/get_current_screen) ->remove\_help\_tab() instead.
Filters the legacy contextual help list.
`$old_compat_help` array Old contextual help. `$screen` [WP\_Screen](../classes/wp_screen) Current [WP\_Screen](../classes/wp_screen) instance. File: `wp-admin/includes/class-wp-screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-screen.php/)
```
self::$_old_compat_help = apply_filters_deprecated(
'contextual_help_list',
array( self::$_old_compat_help, $this ),
'3.3.0',
'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
);
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::render\_screen\_meta()](../classes/wp_screen/render_screen_meta) wp-admin/includes/class-wp-screen.php | Renders the screen’s help section. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Use [get\_current\_screen()](../functions/get_current_screen) ->add\_help\_tab() or [get\_current\_screen()](../functions/get_current_screen) ->remove\_help\_tab() instead. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'the_permalink', string $permalink, int|WP_Post $post ) apply\_filters( 'the\_permalink', string $permalink, int|WP\_Post $post )
=========================================================================
Filters the display of the permalink for the current post.
`$permalink` string The permalink for the current post. `$post` int|[WP\_Post](../classes/wp_post) Post ID, [WP\_Post](../classes/wp_post) object, or 0. Default 0. `the_permalink` is a filter applied to the permalink URL for a post prior to printing by the function [the\_permalink()](../functions/the_permalink) .
Note: The output of the functions [get\_permalink()](../functions/get_permalink) or [get\_the\_permalink()](../functions/get_the_permalink) is not filtered.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
echo esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) );
```
| Used By | Description |
| --- | --- |
| [the\_permalink()](../functions/the_permalink) wp-includes/link-template.php | Displays the permalink for the current post. |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$post` parameter. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'personal_options', WP_User $profile_user ) do\_action( 'personal\_options', WP\_User $profile\_user )
==========================================================
Fires at the end of the ‘Personal Options’ settings table on the user editing screen.
`$profile_user` [WP\_User](../classes/wp_user) The current [WP\_User](../classes/wp_user) object. Hooks immediately after the “Show toolbar…” option on profile page (if current user). Any HTML output should take into account that this hook occurs within the “Personal Options” `<table>` element.
File: `wp-admin/user-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/user-edit.php/)
```
do_action( 'personal_options', $profile_user );
```
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'install_plugin_overwrite_comparison', string $table, array $current_plugin_data, array $new_plugin_data ) apply\_filters( 'install\_plugin\_overwrite\_comparison', string $table, array $current\_plugin\_data, array $new\_plugin\_data )
=================================================================================================================================
Filters the compare table output for overwriting a plugin package on upload.
`$table` string The output table with Name, Version, Author, RequiresWP, and RequiresPHP info. `$current_plugin_data` array Array with current plugin data. `$new_plugin_data` array Array with uploaded plugin data. File: `wp-admin/includes/class-plugin-installer-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-plugin-installer-skin.php/)
```
echo apply_filters( 'install_plugin_overwrite_comparison', $table, $current_plugin_data, $new_plugin_data );
```
| Used By | Description |
| --- | --- |
| [Plugin\_Installer\_Skin::do\_overwrite()](../classes/plugin_installer_skin/do_overwrite) wp-admin/includes/class-plugin-installer-skin.php | Check if the plugin can be overwritten and output the HTML for overwriting a plugin on upload. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'rest_allowed_cors_headers', string[] $allow_headers ) apply\_filters( 'rest\_allowed\_cors\_headers', string[] $allow\_headers )
==========================================================================
Filters the list of request headers that are allowed for REST API CORS requests.
The allowed headers are passed to the browser to specify which headers can be passed to the REST API. By default, we allow the Content-\* headers needed to upload files to the media endpoints.
As well as the Authorization and Nonce headers for allowing authentication.
`$allow_headers` string[] The list of request headers to allow. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
$allow_headers = apply_filters( 'rest_allowed_cors_headers', $allow_headers );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::serve\_request()](../classes/wp_rest_server/serve_request) wp-includes/rest-api/class-wp-rest-server.php | Handles serving a REST API request. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'customize_post_value_set', string $setting_id, mixed $value, WP_Customize_Manager $manager ) do\_action( 'customize\_post\_value\_set', string $setting\_id, mixed $value, WP\_Customize\_Manager $manager )
===============================================================================================================
Announces when any setting’s unsanitized post value has been set.
Fires when the [WP\_Customize\_Manager::set\_post\_value()](../classes/wp_customize_manager/set_post_value) method is called.
This is useful for `WP_Customize_Setting` instances to watch in order to update a cached previewed value.
`$setting_id` string Setting ID. `$value` mixed Unsanitized setting post value. `$manager` [WP\_Customize\_Manager](../classes/wp_customize_manager) [WP\_Customize\_Manager](../classes/wp_customize_manager) instance. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
do_action( 'customize_post_value_set', $setting_id, $value, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::set\_post\_value()](../classes/wp_customize_manager/set_post_value) wp-includes/class-wp-customize-manager.php | Overrides a setting’s value in the current customized state. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_get_nav_menu_name', string $menu_name, string $location ) apply\_filters( 'wp\_get\_nav\_menu\_name', string $menu\_name, string $location )
==================================================================================
Filters the navigation menu name being returned.
`$menu_name` string Menu name. `$location` string Menu location identifier. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
return apply_filters( 'wp_get_nav_menu_name', $menu_name, $location );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_nav\_menu\_name()](../functions/wp_get_nav_menu_name) wp-includes/nav-menu.php | Returns the name of a navigation menu. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_list_authors_post_counts_query', int[]|false $post_counts, array $parsed_args ) apply\_filters( 'pre\_wp\_list\_authors\_post\_counts\_query', int[]|false $post\_counts, array $parsed\_args )
===============================================================================================================
Filters whether to short-circuit performing the query for author post counts.
`$post_counts` int[]|false Array of post counts, keyed by author ID. `$parsed_args` array The arguments passed to [wp\_list\_authors()](../functions/wp_list_authors) combined with the defaults. More Arguments from wp\_list\_authors( ... $args ) Array or string of default arguments.
* `orderby`stringHow to sort the authors. Accepts `'nicename'`, `'email'`, `'url'`, `'registered'`, `'user_nicename'`, `'user_email'`, `'user_url'`, `'user_registered'`, `'name'`, `'display_name'`, `'post_count'`, `'ID'`, `'meta_value'`, `'user_login'`. Default `'name'`.
* `order`stringSorting direction for $orderby. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `number`intMaximum authors to return or display. Default empty (all authors).
* `optioncount`boolShow the count in parenthesis next to the author's name. Default false.
* `exclude_admin`boolWhether to exclude the `'admin'` account, if it exists. Default true.
* `show_fullname`boolWhether to show the author's full name. Default false.
* `hide_empty`boolWhether to hide any authors with no posts. Default true.
* `feed`stringIf not empty, show a link to the author's feed and use this text as the alt parameter of the link.
* `feed_image`stringIf not empty, show a link to the author's feed and use this image URL as clickable anchor.
* `feed_type`stringThe feed type to link to. Possible values include `'rss2'`, `'atom'`.
Default is the value of [get\_default\_feed()](../functions/get_default_feed) .
* `echo`boolWhether to output the result or instead return it. Default true.
* `style`stringIf `'list'`, each author is wrapped in an `<li>` element, otherwise the authors will be separated by commas.
* `html`boolWhether to list the items in HTML form or plaintext. Default true.
* `exclude`int[]|stringArray or comma/space-separated list of author IDs to exclude.
* `include`int[]|stringArray or comma/space-separated list of author IDs to include.
File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
$post_counts = apply_filters( 'pre_wp_list_authors_post_counts_query', false, $parsed_args );
```
| Used By | Description |
| --- | --- |
| [wp\_list\_authors()](../functions/wp_list_authors) wp-includes/author-template.php | Lists all the authors of the site, with several options available. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'term_id_filter', int $term_id, int $tt_id, array $args ) apply\_filters( 'term\_id\_filter', int $term\_id, int $tt\_id, array $args )
=============================================================================
Filters the term ID after a new term is created.
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$args` array Arguments passed to [wp\_insert\_term()](../functions/wp_insert_term) . More Arguments from wp\_insert\_term( ... $args ) Array or query string of arguments for inserting a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'rest_route_for_post_type_items', string $route, WP_Post_Type $post_type ) apply\_filters( 'rest\_route\_for\_post\_type\_items', string $route, WP\_Post\_Type $post\_type )
==================================================================================================
Filters the REST API route for a post type.
`$route` string The route path. `$post_type` [WP\_Post\_Type](../classes/wp_post_type) The post type object. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
return apply_filters( 'rest_route_for_post_type_items', $route, $post_type );
```
| Used By | Description |
| --- | --- |
| [rest\_get\_route\_for\_post\_type\_items()](../functions/rest_get_route_for_post_type_items) wp-includes/rest-api.php | Gets the REST API route for a post type. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress do_action( 'update_option', string $option, mixed $old_value, mixed $value ) do\_action( 'update\_option', string $option, mixed $old\_value, mixed $value )
===============================================================================
Fires immediately before an option value is updated.
`$option` string Name of the option to update. `$old_value` mixed The old option value. `$value` mixed The new option value. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'update_option', $option, $old_value, $value );
```
| Used By | Description |
| --- | --- |
| [update\_option()](../functions/update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'pre_option', mixed $pre_option, string $option, mixed $default ) apply\_filters( 'pre\_option', mixed $pre\_option, string $option, mixed $default )
===================================================================================
Filters the value of all existing options before it is retrieved.
Returning a truthy value from the filter will effectively short-circuit retrieval and return the passed value instead.
`$pre_option` mixed The value to return instead of the option value. This differs from `$default`, which is used as the fallback value in the event the option doesn't exist elsewhere in [get\_option()](../functions/get_option) .
Default false (to skip past the short-circuit). `$option` string Name of the option. `$default` mixed The fallback value to return if the option does not exist.
Default false. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$pre = apply_filters( 'pre_option', $pre, $option, $default );
```
| Used By | Description |
| --- | --- |
| [get\_option()](../functions/get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'update_custom_css_data', array $data, array $args ) apply\_filters( 'update\_custom\_css\_data', array $data, array $args )
=======================================================================
Filters the `css` (`post_content`) and `preprocessed` (`post_content_filtered`) args for a `custom_css` post being updated.
This filter can be used by plugin that offer CSS pre-processors, to store the original pre-processed CSS in `post_content_filtered` and then store processed CSS in `post_content`.
When used in this way, the `post_content_filtered` should be supplied as the setting value instead of `post_content` via a the `customize_value_custom_css` filter, for example:
```
add_filter( 'customize_value_custom_css', function( $value, $setting ) {
$post = wp_get_custom_css_post( $setting->stylesheet );
if ( $post && ! empty( $post->post_content_filtered ) ) {
$css = $post->post_content_filtered;
}
return $css;
}, 10, 2 );
```
`$data` array Custom CSS data.
* `css`stringCSS stored in `post_content`.
* `preprocessed`stringPre-processed CSS stored in `post_content_filtered`.
Normally empty string.
`$args` array The args passed into `wp_update_custom_css_post()` merged with defaults.
* `css`stringThe original CSS passed in to be updated.
* `preprocessed`stringThe original preprocessed CSS passed in to be updated.
* `stylesheet`stringThe stylesheet (theme) being updated.
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
$data = apply_filters( 'update_custom_css_data', $data, array_merge( $args, compact( 'css' ) ) );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_custom\_css\_post()](../functions/wp_update_custom_css_post) wp-includes/theme.php | Updates the `custom_css` post for a given theme. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters_ref_array( 'the_posts', WP_Post[] $posts, WP_Query $query ) apply\_filters\_ref\_array( 'the\_posts', WP\_Post[] $posts, WP\_Query $query )
===============================================================================
Filters the array of retrieved posts after they’ve been fetched and internally processed.
`$posts` [WP\_Post](../classes/wp_post)[] Array of post objects. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$this->posts = apply_filters_ref_array( 'the_posts', array( $this->posts, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'getimagesize_mimes_to_exts', array $mime_to_ext ) apply\_filters( 'getimagesize\_mimes\_to\_exts', array $mime\_to\_ext )
=======================================================================
Filters the list mapping image mime types to their respective extensions.
`$mime_to_ext` array Array of image mime types and their matching extensions. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$mime_to_ext = apply_filters(
'getimagesize_mimes_to_exts',
array(
'image/jpeg' => 'jpg',
'image/png' => 'png',
'image/gif' => 'gif',
'image/bmp' => 'bmp',
'image/tiff' => 'tif',
'image/webp' => 'webp',
)
);
```
| Used By | Description |
| --- | --- |
| [wp\_check\_filetype\_and\_ext()](../functions/wp_check_filetype_and_ext) wp-includes/functions.php | Attempts to determine the real file type of a file. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'the_weekday_date', string $the_weekday_date, string $before, string $after ) apply\_filters( 'the\_weekday\_date', string $the\_weekday\_date, string $before, string $after )
=================================================================================================
Filters the localized date on which the post was written, for display.
`$the_weekday_date` string The weekday on which the post was written. `$before` string The HTML to output before the date. `$after` string The HTML to output after the date. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
echo apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after );
```
| Used By | Description |
| --- | --- |
| [the\_weekday\_date()](../functions/the_weekday_date) wp-includes/general-template.php | Displays the weekday on which the post was written. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress apply_filters( 'found_sites_query', string $found_sites_query, WP_Site_Query $site_query ) apply\_filters( 'found\_sites\_query', string $found\_sites\_query, WP\_Site\_Query $site\_query )
==================================================================================================
Filters the query used to retrieve found site count.
`$found_sites_query` string SQL query. Default 'SELECT FOUND\_ROWS()'. `$site_query` [WP\_Site\_Query](../classes/wp_site_query) The `WP_Site_Query` instance. File: `wp-includes/class-wp-site-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-site-query.php/)
```
$found_sites_query = apply_filters( 'found_sites_query', 'SELECT FOUND_ROWS()', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Query::set\_found\_sites()](../classes/wp_site_query/set_found_sites) wp-includes/class-wp-site-query.php | Populates found\_sites and max\_num\_pages properties for the current query if the limit clause was used. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'wpmu_signup_user_notification_email', string $content, string $user_login, string $user_email, string $key, array $meta ) apply\_filters( 'wpmu\_signup\_user\_notification\_email', string $content, string $user\_login, string $user\_email, string $key, array $meta )
================================================================================================================================================
Filters the content of the notification email for new user sign-up.
Content should be formatted for transmission via [wp\_mail()](../functions/wp_mail) .
`$content` string Content of the notification email. `$user_login` string User login name. `$user_email` string User email address. `$key` string Activation key created in [wpmu\_signup\_user()](../functions/wpmu_signup_user) . `$meta` array Signup meta data. Default empty array. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
apply_filters(
'wpmu_signup_user_notification_email',
/* translators: New user notification email. %s: Activation URL. */
__( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login." ),
$user_login,
$user_email,
$key,
$meta
),
```
| Used By | Description |
| --- | --- |
| [wpmu\_signup\_user\_notification()](../functions/wpmu_signup_user_notification) wp-includes/ms-functions.php | Sends a confirmation request email to a user when they sign up for a new user account (without signing up for a site at the same time). The user account will not become active until the confirmation link is clicked. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_insert_comment', array|WP_Error $prepared_comment, WP_REST_Request $request ) apply\_filters( 'rest\_pre\_insert\_comment', array|WP\_Error $prepared\_comment, WP\_REST\_Request $request )
==============================================================================================================
Filters a comment before it is inserted via the REST API.
Allows modification of the comment right before it is inserted via [wp\_insert\_comment()](../functions/wp_insert_comment) .
Returning a [WP\_Error](../classes/wp_error) value from the filter will short-circuit insertion and allow skipping further processing.
`$prepared_comment` array|[WP\_Error](../classes/wp_error) The prepared comment data for [wp\_insert\_comment()](../functions/wp_insert_comment) . `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to insert the comment. File: `wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php/)
```
$prepared_comment = apply_filters( 'rest_pre_insert_comment', $prepared_comment, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::create\_item()](../classes/wp_rest_comments_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Creates a comment. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | `$prepared_comment` can now be a [WP\_Error](../classes/wp_error) to short-circuit insertion. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'unspammed_comment', string $comment_id, WP_Comment $comment ) do\_action( 'unspammed\_comment', string $comment\_id, WP\_Comment $comment )
=============================================================================
Fires immediately after a comment is unmarked as Spam.
`$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The comment unmarked as spam. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'unspammed_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_unspam\_comment()](../functions/wp_unspam_comment) wp-includes/comment.php | Removes a comment from the Spam. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$comment` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action_ref_array( 'generate_rewrite_rules', WP_Rewrite $wp_rewrite ) do\_action\_ref\_array( 'generate\_rewrite\_rules', WP\_Rewrite $wp\_rewrite )
==============================================================================
Fires after the rewrite rules are generated.
`$wp_rewrite` [WP\_Rewrite](../classes/wp_rewrite) Current [WP\_Rewrite](../classes/wp_rewrite) instance (passed by reference). Triggers after all rewrite rules have been created. The rewrite object is passed as argument by reference.
File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
do_action_ref_array( 'generate_rewrite_rules', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::rewrite\_rules()](../classes/wp_rewrite/rewrite_rules) wp-includes/class-wp-rewrite.php | Constructs rewrite matches and queries from permalink structure. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'heartbeat_send', array $response, string $screen_id ) apply\_filters( 'heartbeat\_send', array $response, string $screen\_id )
========================================================================
Filters the Heartbeat response sent.
`$response` array The Heartbeat response. `$screen_id` string The screen ID. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$response = apply_filters( 'heartbeat_send', $response, $screen_id );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_heartbeat()](../functions/wp_ajax_heartbeat) wp-admin/includes/ajax-actions.php | Ajax handler for the Heartbeat API. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'password_reset_key_expired', WP_Error $return, int $user_id ) apply\_filters( 'password\_reset\_key\_expired', WP\_Error $return, int $user\_id )
===================================================================================
Filters the return value of [check\_password\_reset\_key()](../functions/check_password_reset_key) when an old-style key is used.
`$return` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object denoting an expired key.
Return a [WP\_User](../classes/wp_user) object to validate the key. `$user_id` int The matched user ID. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'password_reset_key_expired', $return, $user_id );
```
| Used By | Description |
| --- | --- |
| [check\_password\_reset\_key()](../functions/check_password_reset_key) wp-includes/user.php | Retrieves a user row based on password reset key and login. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Previously key hashes were stored without an expiration time. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress do_action( 'password_reset', WP_User $user, string $new_pass ) do\_action( 'password\_reset', WP\_User $user, string $new\_pass )
==================================================================
Fires before the user’s password is reset.
`$user` [WP\_User](../classes/wp_user) The user. `$new_pass` string New user password. Runs after the user submits a new password during password reset but before the new password is actually set.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'password_reset', $user, $new_pass );
```
| Used By | Description |
| --- | --- |
| [reset\_password()](../functions/reset_password) wp-includes/user.php | Handles resetting the user’s password. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_post_revision_title_expanded', string $revision_date_author, WP_Post $revision, bool $link ) apply\_filters( 'wp\_post\_revision\_title\_expanded', string $revision\_date\_author, WP\_Post $revision, bool $link )
=======================================================================================================================
Filters the formatted author and date for a revision.
`$revision_date_author` string The formatted string. `$revision` [WP\_Post](../classes/wp_post) The revision object. `$link` bool Whether to link to the revisions page, as passed into [wp\_post\_revision\_title\_expanded()](../functions/wp_post_revision_title_expanded) . More Arguments from wp\_post\_revision\_title\_expanded( ... $link ) Whether to link to revision's page. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
return apply_filters( 'wp_post_revision_title_expanded', $revision_date_author, $revision, $link );
```
| Used By | Description |
| --- | --- |
| [wp\_post\_revision\_title\_expanded()](../functions/wp_post_revision_title_expanded) wp-includes/post-template.php | Retrieves formatted date timestamp of a revision (linked to that revisions’s page). |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters_ref_array( 'the_sites', WP_Site[] $_sites, WP_Site_Query $query ) apply\_filters\_ref\_array( 'the\_sites', WP\_Site[] $\_sites, WP\_Site\_Query $query )
=======================================================================================
Filters the site query results.
`$_sites` [WP\_Site](../classes/wp_site)[] An array of [WP\_Site](../classes/wp_site) objects. `$query` [WP\_Site\_Query](../classes/wp_site_query) Current instance of [WP\_Site\_Query](../classes/wp_site_query) (passed by reference). File: `wp-includes/class-wp-site-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-site-query.php/)
```
$_sites = apply_filters_ref_array( 'the_sites', array( $_sites, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Query::get\_sites()](../classes/wp_site_query/get_sites) wp-includes/class-wp-site-query.php | Retrieves a list of sites matching the query vars. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress do_action( 'clear_auth_cookie' ) do\_action( 'clear\_auth\_cookie' )
===================================
Fires just before the authentication cookies are cleared.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'clear_auth_cookie' );
```
| Used By | Description |
| --- | --- |
| [wp\_clear\_auth\_cookie()](../functions/wp_clear_auth_cookie) wp-includes/pluggable.php | Removes all of the cookies associated with authentication. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'human_time_diff', string $since, int $diff, int $from, int $to ) apply\_filters( 'human\_time\_diff', string $since, int $diff, int $from, int $to )
===================================================================================
Filters the human readable difference between two timestamps.
`$since` string The difference in human readable text. `$diff` int The difference in seconds. `$from` int Unix timestamp from which the difference begins. `$to` int Unix timestamp to end the time difference. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'human_time_diff', $since, $diff, $from, $to );
```
| Used By | Description |
| --- | --- |
| [human\_time\_diff()](../functions/human_time_diff) wp-includes/formatting.php | Determines the difference between two timestamps. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'wp_feed_cache_transient_lifetime', int $lifetime, string $filename ) apply\_filters( 'wp\_feed\_cache\_transient\_lifetime', int $lifetime, string $filename )
=========================================================================================
Filters the transient lifetime of the feed cache.
`$lifetime` int Cache duration in seconds. Default is 43200 seconds (12 hours). `$filename` string Unique identifier for the cache object. File: `wp-includes/class-wp-feed-cache-transient.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-feed-cache-transient.php/)
```
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );
```
| Used By | Description |
| --- | --- |
| [WP\_Feed\_Cache\_Transient::\_\_construct()](../classes/wp_feed_cache_transient/__construct) wp-includes/class-wp-feed-cache-transient.php | Constructor. |
| [fetch\_feed()](../functions/fetch_feed) wp-includes/feed.php | Builds SimplePie object based on RSS or Atom feed from URL. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_sprintf', string $fragment, string $arg ) apply\_filters( 'wp\_sprintf', string $fragment, string $arg )
==============================================================
Filters a fragment from the pattern passed to [wp\_sprintf()](../functions/wp_sprintf) .
If the fragment is unchanged, then sprintf() will be run on the fragment.
`$fragment` string A fragment from the pattern. `$arg` string The argument. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$_fragment = apply_filters( 'wp_sprintf', $fragment, $arg );
```
| Used By | Description |
| --- | --- |
| [wp\_sprintf()](../functions/wp_sprintf) wp-includes/formatting.php | WordPress implementation of PHP sprintf() with filters. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_nav_menu_args', array $args ) apply\_filters( 'wp\_nav\_menu\_args', array $args )
====================================================
Filters the arguments used to display a navigation menu.
* [wp\_nav\_menu()](../functions/wp_nav_menu)
`$args` array Array of [wp\_nav\_menu()](../functions/wp_nav_menu) arguments. More Arguments from wp\_nav\_menu( ... $args ) Array of nav menu arguments.
* `menu`int|string|[WP\_Term](../classes/wp_term)Desired menu. Accepts a menu ID, slug, name, or object.
* `menu_class`stringCSS class to use for the ul element which forms the menu.
Default `'menu'`.
* `menu_id`stringThe ID that is applied to the ul element which forms the menu.
Default is the menu slug, incremented.
* `container`stringWhether to wrap the ul, and what to wrap it with.
Default `'div'`.
* `container_class`stringClass that is applied to the container.
Default 'menu-{menu slug}-container'.
* `container_id`stringThe ID that is applied to the container.
* `container_aria_label`stringThe aria-label attribute that is applied to the container when it's a nav element.
* `fallback_cb`callable|falseIf the menu doesn't exist, a callback function will fire.
Default is `'wp_page_menu'`. Set to false for no fallback.
* `before`stringText before the link markup.
* `after`stringText after the link markup.
* `link_before`stringText before the link text.
* `link_after`stringText after the link text.
* `echo`boolWhether to echo the menu or return it. Default true.
* `depth`intHow many levels of the hierarchy are to be included.
0 means all. Default 0.
Default 0.
* `walker`objectInstance of a custom walker class.
* `theme_location`stringTheme location to be used. Must be registered with [register\_nav\_menu()](../functions/register_nav_menu) in order to be selectable by the user.
* `items_wrap`stringHow the list items should be wrapped. Uses printf() format with numbered placeholders. Default is a ul with an id and class.
* `item_spacing`stringWhether to preserve whitespace within the menu's HTML.
Accepts `'preserve'` or `'discard'`. Default `'preserve'`.
The “wp\_nav\_menu\_args” filter is applied to the arguments of the [wp\_nav\_menu()](../functions/wp_nav_menu) function **before** they are processed.
This filter can be used in **functions.php** of a [child theme](https://developer.wordpress.org/themes/advanced-topics/child-themes/) to add/remove/modify the arguments of a menu defined in the parent theme.
Also, plugins can use this filter to change menus by adding classes/IDs or using a custom walker object.
File: `wp-includes/nav-menu-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu-template.php/)
```
$args = apply_filters( 'wp_nav_menu_args', $args );
```
| Used By | Description |
| --- | --- |
| [wp\_nav\_menu()](../functions/wp_nav_menu) wp-includes/nav-menu-template.php | Displays a navigation menu. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action_ref_array( 'pre_get_comments', WP_Comment_Query $query ) do\_action\_ref\_array( 'pre\_get\_comments', WP\_Comment\_Query $query )
=========================================================================
Fires before comments are retrieved.
`$query` [WP\_Comment\_Query](../classes/wp_comment_query) Current instance of [WP\_Comment\_Query](../classes/wp_comment_query) (passed by reference). File: `wp-includes/class-wp-comment-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-comment-query.php/)
```
do_action_ref_array( 'pre_get_comments', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Comment\_Query::get\_comments()](../classes/wp_comment_query/get_comments) wp-includes/class-wp-comment-query.php | Get a list of comments matching the query vars. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'media_upload_form_url', string $form_action_url, string $type ) apply\_filters( 'media\_upload\_form\_url', string $form\_action\_url, string $type )
=====================================================================================
Filters the media upload form action URL.
`$form_action_url` string The media upload form action URL. `$type` string The type of media. Default `'file'`. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
```
| Used By | Description |
| --- | --- |
| [media\_upload\_type\_form()](../functions/media_upload_type_form) wp-admin/includes/media.php | Outputs the legacy media upload form for a given media type. |
| [media\_upload\_type\_url\_form()](../functions/media_upload_type_url_form) wp-admin/includes/media.php | Outputs the legacy media upload form for external media. |
| [media\_upload\_gallery\_form()](../functions/media_upload_gallery_form) wp-admin/includes/media.php | Adds gallery form to upload iframe. |
| [media\_upload\_library\_form()](../functions/media_upload_library_form) wp-admin/includes/media.php | Outputs the legacy media upload form for the media library. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_fields', string $fields, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_fields', string $fields, WP\_Query $query )
===============================================================================
Filters the SELECT clause of the query.
`$fields` string The SELECT clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( "set_transient_{$transient}", mixed $value, int $expiration, string $transient ) do\_action( "set\_transient\_{$transient}", mixed $value, int $expiration, string $transient )
==============================================================================================
Fires after the value for a specific transient has been set.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$value` mixed Transient value. `$expiration` int Time until expiration in seconds. `$transient` string The name of the transient. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( "set_transient_{$transient}", $value, $expiration, $transient );
```
| Used By | Description |
| --- | --- |
| [set\_transient()](../functions/set_transient) wp-includes/option.php | Sets/updates the value of a transient. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$transient` parameter was added. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | The `$value` and `$expiration` parameters were added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_link_pages_args', array $parsed_args ) apply\_filters( 'wp\_link\_pages\_args', array $parsed\_args )
==============================================================
Filters the arguments used in retrieving page links for paginated posts.
`$parsed_args` array An array of page link arguments. See [wp\_link\_pages()](../functions/wp_link_pages) for information on accepted arguments. More Arguments from wp\_link\_pages( ... $args ) Array or string of default arguments.
* `before`stringHTML or text to prepend to each link. Default is `<p> Pages:`.
* `after`stringHTML or text to append to each link. Default is `</p>`.
* `link_before`stringHTML or text to prepend to each link, inside the `<a>` tag.
Also prepended to the current item, which is not linked.
* `link_after`stringHTML or text to append to each Pages link inside the `<a>` tag.
Also appended to the current item, which is not linked.
* `aria_current`stringThe value for the aria-current attribute. Possible values are `'page'`, `'step'`, `'location'`, `'date'`, `'time'`, `'true'`, `'false'`. Default is `'page'`.
* `next_or_number`stringIndicates whether page numbers should be used. Valid values are number and next. Default is `'number'`.
* `separator`stringText between pagination links. Default is ' '.
* `nextpagelink`stringLink text for the next page link, if available. Default is 'Next Page'.
* `previouspagelink`stringLink text for the previous page link, if available. Default is 'Previous Page'.
* `pagelink`stringFormat string for page numbers. The % in the parameter string will be replaced with the page number, so 'Page %' generates "Page 1", "Page 2", etc.
Defaults to `'%'`, just the page number.
* `echo`int|boolWhether to echo or not. Accepts `1|true` or `0|false`. Default `1|true`.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$parsed_args = apply_filters( 'wp_link_pages_args', $parsed_args );
```
| Used By | Description |
| --- | --- |
| [wp\_link\_pages()](../functions/wp_link_pages) wp-includes/post-template.php | The formatted output of a list of pages. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'nonce_user_logged_out', int $uid, string|int $action ) apply\_filters( 'nonce\_user\_logged\_out', int $uid, string|int $action )
==========================================================================
Filters whether the user who generated the nonce is logged out.
`$uid` int ID of the nonce-owning user. `$action` string|int The nonce action, or -1 if none was provided. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
```
| Used By | Description |
| --- | --- |
| [wp\_verify\_nonce()](../functions/wp_verify_nonce) wp-includes/pluggable.php | Verifies that a correct security nonce was used with time limit. |
| [wp\_create\_nonce()](../functions/wp_create_nonce) wp-includes/pluggable.php | Creates a cryptographic token tied to a specific action, user, user session, and window of time. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'theme_scandir_exclusions', string[] $exclusions ) apply\_filters( 'theme\_scandir\_exclusions', string[] $exclusions )
====================================================================
Filters the array of excluded directories and files while scanning theme folder.
`$exclusions` string[] Array of excluded directories and files. File: `wp-includes/class-wp-theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme.php/)
```
$exclusions = (array) apply_filters( 'theme_scandir_exclusions', array( 'CVS', 'node_modules', 'vendor', 'bower_components' ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme::scandir()](../classes/wp_theme/scandir) wp-includes/class-wp-theme.php | Scans a directory for files of a certain extension. |
| Version | Description |
| --- | --- |
| [4.7.4](https://developer.wordpress.org/reference/since/4.7.4/) | Introduced. |
wordpress apply_filters( 'install_theme_overwrite_actions', string[] $install_actions, object $api, array $new_theme_data ) apply\_filters( 'install\_theme\_overwrite\_actions', string[] $install\_actions, object $api, array $new\_theme\_data )
========================================================================================================================
Filters the list of action links available following a single theme installation failure when overwriting is allowed.
`$install_actions` string[] Array of theme action links. `$api` object Object containing WordPress.org API theme data. `$new_theme_data` array Array with uploaded theme data. File: `wp-admin/includes/class-theme-installer-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-theme-installer-skin.php/)
```
$install_actions = apply_filters( 'install_theme_overwrite_actions', $install_actions, $this->api, $new_theme_data );
```
| Used By | Description |
| --- | --- |
| [Theme\_Installer\_Skin::do\_overwrite()](../classes/theme_installer_skin/do_overwrite) wp-admin/includes/class-theme-installer-skin.php | Check if the theme can be overwritten and output the HTML for overwriting a theme on upload. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters_ref_array( 'posts_join_paged', string $join, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_join\_paged', string $join, WP\_Query $query )
==================================================================================
Filters the JOIN clause of the query.
Specifically for manipulating paging queries.
`$join` string The JOIN clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'cron_unschedule_event_error', WP_Error $result, string $hook, array $v ) do\_action( 'cron\_unschedule\_event\_error', WP\_Error $result, string $hook, array $v )
=========================================================================================
Fires when an error happens unscheduling a cron event.
`$result` [WP\_Error](../classes/wp_error) The [WP\_Error](../classes/wp_error) object. `$hook` string Action hook to execute when the event is run. `$v` array Event data. File: `wp-cron.php`. [View all references](https://developer.wordpress.org/reference/files/wp-cron.php/)
```
do_action( 'cron_unschedule_event_error', $result, $hook, $v );
```
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'wp_opcache_invalidate_file', bool $will_invalidate, string $filepath ) apply\_filters( 'wp\_opcache\_invalidate\_file', bool $will\_invalidate, string $filepath )
===========================================================================================
Filters whether to invalidate a file from the opcode cache.
`$will_invalidate` bool Whether WordPress will invalidate `$filepath`. Default true. `$filepath` string The path to the PHP file to invalidate. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
if ( apply_filters( 'wp_opcache_invalidate_file', true, $filepath ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_opcache\_invalidate()](../functions/wp_opcache_invalidate) wp-admin/includes/file.php | Attempts to clear the opcode cache for an individual PHP file. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_wp_deleteCategory', int $category_id, array $args ) do\_action( 'xmlrpc\_call\_success\_wp\_deleteCategory', int $category\_id, array $args )
=========================================================================================
Fires after a category has been successfully deleted via XML-RPC.
`$category_id` int ID of the deleted category. `$args` array An array of arguments to delete the category. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
do_action( 'xmlrpc_call_success_wp_deleteCategory', $category_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_deleteCategory()](../classes/wp_xmlrpc_server/wp_deletecategory) wp-includes/class-wp-xmlrpc-server.php | Remove category. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters_deprecated( 'rewrite_rules', string $rules ) apply\_filters\_deprecated( 'rewrite\_rules', string $rules )
=============================================================
This hook has been deprecated. Use the [‘mod\_rewrite\_rules’](mod_rewrite_rules) filter instead.
Filters the list of rewrite rules formatted for output to an .htaccess file.
`$rules` string mod\_rewrite Rewrite rules formatted for .htaccess. File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
return apply_filters_deprecated( 'rewrite_rules', array( $rules ), '1.5.0', 'mod_rewrite_rules' );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::mod\_rewrite\_rules()](../classes/wp_rewrite/mod_rewrite_rules) wp-includes/class-wp-rewrite.php | Retrieves mod\_rewrite-formatted rewrite rules to write to .htaccess. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'tag_cloud_sort', WP_Term[] $tags, array $args ) apply\_filters( 'tag\_cloud\_sort', WP\_Term[] $tags, array $args )
===================================================================
Filters how the items in a tag cloud are sorted.
`$tags` [WP\_Term](../classes/wp_term)[] Ordered array of terms. `$args` array An array of tag cloud arguments. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$tags_sorted = apply_filters( 'tag_cloud_sort', $tags, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_generate\_tag\_cloud()](../functions/wp_generate_tag_cloud) wp-includes/category-template.php | Generates a tag cloud (heatmap) from provided data. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'oembed_fetch_url', string $provider, string $url, array $args ) apply\_filters( 'oembed\_fetch\_url', string $provider, string $url, array $args )
==================================================================================
Filters the oEmbed URL to be fetched.
`$provider` string URL of the oEmbed provider. `$url` string URL of the content to be embedded. `$args` array Additional arguments for retrieving embed HTML.
See [wp\_oembed\_get()](../functions/wp_oembed_get) for accepted arguments. Default empty. More Arguments from wp\_oembed\_get( ... $args ) Additional arguments for retrieving embed HTML.
* `width`int|stringOptional. The `maxwidth` value passed to the provider URL.
* `height`int|stringOptional. The `maxheight` value passed to the provider URL.
* `discover`boolOptional. Determines whether to attempt to discover link tags at the given URL for an oEmbed provider when the provider URL is not found in the built-in providers list. Default true.
File: `wp-includes/class-wp-oembed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed.php/)
```
$provider = apply_filters( 'oembed_fetch_url', $provider, $url, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed::fetch()](../classes/wp_oembed/fetch) wp-includes/class-wp-oembed.php | Connects to a oEmbed provider and returns the result. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `dnt` (Do Not Track) query parameter was added to all oEmbed provider URLs. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'lostpassword_errors', WP_Error $errors, WP_User|false $user_data ) apply\_filters( 'lostpassword\_errors', WP\_Error $errors, WP\_User|false $user\_data )
=======================================================================================
Filters the errors encountered on a password reset request.
The filtered [WP\_Error](../classes/wp_error) object may, for example, contain errors for an invalid username or email address. A [WP\_Error](../classes/wp_error) object should always be returned, but may or may not contain errors.
If any errors are present in $errors, this will abort the password reset request.
`$errors` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object containing any errors generated by using invalid credentials. `$user_data` [WP\_User](../classes/wp_user)|false [WP\_User](../classes/wp_user) object if found, false if the user does not exist. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$errors = apply_filters( 'lostpassword_errors', $errors, $user_data );
```
| Used By | Description |
| --- | --- |
| [retrieve\_password()](../functions/retrieve_password) wp-includes/user.php | Handles sending a password retrieval email to a user. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'category_css_class', string[] $css_classes, WP_Term $category, int $depth, array $args ) apply\_filters( 'category\_css\_class', string[] $css\_classes, WP\_Term $category, int $depth, array $args )
=============================================================================================================
Filters the list of CSS classes to include with each category in the list.
* [wp\_list\_categories()](../functions/wp_list_categories)
`$css_classes` string[] An array of CSS classes to be applied to each list item. `$category` [WP\_Term](../classes/wp_term) Category data object. `$depth` int Depth of page, used for padding. `$args` array An array of [wp\_list\_categories()](../functions/wp_list_categories) arguments. More Arguments from wp\_list\_categories( ... $args ) Array or string of arguments. See [WP\_Term\_Query::\_\_construct()](../classes/wp_term_query/__construct) for information on accepted arguments. File: `wp-includes/class-walker-category.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-category.php/)
```
$css_classes = implode( ' ', apply_filters( 'category_css_class', $css_classes, $category, $depth, $args ) );
```
| Used By | Description |
| --- | --- |
| [Walker\_Category::start\_el()](../classes/walker_category/start_el) wp-includes/class-walker-category.php | Starts the element output. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'navigation_markup_template', string $template, string $class ) apply\_filters( 'navigation\_markup\_template', string $template, string $class )
=================================================================================
Filters the navigation markup template.
Note: The filtered template HTML must contain specifiers for the navigation class (%1$s), the screen-reader-text value (%2$s), placement of the navigation links (%3$s), and ARIA label text if screen-reader-text does not fit that (%4$s):
```
<nav class="navigation %1$s" aria-label="%4$s">
<h2 class="screen-reader-text">%2$s</h2>
<div class="nav-links">%3$s</div>
</nav>
```
`$template` string The default template. `$class` string The class passed by the calling function. string Navigation template.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$template = apply_filters( 'navigation_markup_template', $template, $class );
```
| Used By | Description |
| --- | --- |
| [\_navigation\_markup()](../functions/_navigation_markup) wp-includes/link-template.php | Wraps passed links in navigational markup. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( "{$adjacent}_post_rel_link", string $link ) apply\_filters( "{$adjacent}\_post\_rel\_link", string $link )
==============================================================
Filters the adjacent post relational link.
The dynamic portion of the hook name, `$adjacent`, refers to the type of adjacency, ‘next’ or ‘previous’.
Possible hook names include:
* `next_post_rel_link`
* `previous_post_rel_link`
`$link` string The relational link. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( "{$adjacent}_post_rel_link", $link );
```
| Used By | Description |
| --- | --- |
| [get\_adjacent\_post\_rel\_link()](../functions/get_adjacent_post_rel_link) wp-includes/link-template.php | Retrieves the adjacent post relational link. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'map_meta_cap', string[] $caps, string $cap, int $user_id, array $args ) apply\_filters( 'map\_meta\_cap', string[] $caps, string $cap, int $user\_id, array $args )
===========================================================================================
Filters the primitive capabilities required of the given user to satisfy the capability being checked.
`$caps` string[] Primitive capabilities required of the user. `$cap` string Capability being checked. `$user_id` int The user ID. `$args` array Adds context to the capability check, typically starting with an object ID. File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
return apply_filters( 'map_meta_cap', $caps, $cap, $user_id, $args );
```
| Used By | Description |
| --- | --- |
| [map\_meta\_cap()](../functions/map_meta_cap) wp-includes/capabilities.php | Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( "delete_transient_{$transient}", string $transient ) do\_action( "delete\_transient\_{$transient}", string $transient )
==================================================================
Fires immediately before a specific transient is deleted.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$transient` string Transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( "delete_transient_{$transient}", $transient );
```
| Used By | Description |
| --- | --- |
| [delete\_transient()](../functions/delete_transient) wp-includes/option.php | Deletes a transient. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'type_url_form_media', string $form_html ) apply\_filters( 'type\_url\_form\_media', string $form\_html )
==============================================================
Filters the insert media from URL form HTML.
`$form_html` string The insert from URL form HTML. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) );
```
| Used By | Description |
| --- | --- |
| [media\_upload\_type\_url\_form()](../functions/media_upload_type_url_form) wp-admin/includes/media.php | Outputs the legacy media upload form for external media. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'deprecated_function_trigger_error', bool $trigger ) apply\_filters( 'deprecated\_function\_trigger\_error', bool $trigger )
=======================================================================
Filters whether to trigger an error for deprecated functions.
`$trigger` bool Whether to trigger the error for deprecated functions. Default true. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
```
| Used By | Description |
| --- | --- |
| [\_deprecated\_function()](../functions/_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'pre_get_lastpostmodified', string|false $lastpostmodified, string $timezone, string $post_type ) apply\_filters( 'pre\_get\_lastpostmodified', string|false $lastpostmodified, string $timezone, string $post\_type )
====================================================================================================================
Pre-filter the return value of [get\_lastpostmodified()](../functions/get_lastpostmodified) before the query is run.
`$lastpostmodified` string|false The most recent time that a post was modified, in 'Y-m-d H:i:s' format, or false. Returning anything other than false will short-circuit the function. `$timezone` string Location to use for getting the post modified date.
See [get\_lastpostdate()](../functions/get_lastpostdate) for accepted `$timezone` values. More Arguments from get\_lastpostdate( ... $timezone ) The timezone for the timestamp. Accepts `'server'`, `'blog'`, or `'gmt'`.
`'server'` uses the server's internal timezone.
`'blog'` uses the `post_date` field, which proxies to the timezone set for the site.
`'gmt'` uses the `post_date_gmt` field.
Default `'server'`. `$post_type` string The post type to check. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$lastpostmodified = apply_filters( 'pre_get_lastpostmodified', false, $timezone, $post_type );
```
| Used By | Description |
| --- | --- |
| [get\_lastpostmodified()](../functions/get_lastpostmodified) wp-includes/post.php | Gets the most recent time that a post on the site was modified. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action_deprecated( 'refresh_blog_details', int $blog_id ) do\_action\_deprecated( 'refresh\_blog\_details', int $blog\_id )
=================================================================
This hook has been deprecated. Use [‘clean\_site\_cache’](clean_site_cache) instead.
Fires after the blog details cache is cleared.
`$blog_id` int Blog ID. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action_deprecated( 'refresh_blog_details', array( $blog_id ), '4.9.0', 'clean_site_cache' );
```
| Used By | Description |
| --- | --- |
| [clean\_blog\_cache()](../functions/clean_blog_cache) wp-includes/ms-site.php | Clean the blog cache |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Use ['clean\_site\_cache'](clean_site_cache) instead. |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_is_php_version_acceptable', bool $is_acceptable, string $version ) apply\_filters( 'wp\_is\_php\_version\_acceptable', bool $is\_acceptable, string $version )
===========================================================================================
Filters whether the active PHP version is considered acceptable by WordPress.
Returning false will trigger a PHP version warning to show up in the admin dashboard to administrators.
This filter is only run if the wordpress.org Serve Happy API considers the PHP version acceptable, ensuring that this filter can only make this check stricter, but not loosen it.
`$is_acceptable` bool Whether the PHP version is considered acceptable. Default true. `$version` string PHP version checked. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
$response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version );
```
| Used By | Description |
| --- | --- |
| [wp\_check\_php\_version()](../functions/wp_check_php_version) wp-admin/includes/misc.php | Checks if the user needs to update PHP. |
| Version | Description |
| --- | --- |
| [5.1.1](https://developer.wordpress.org/reference/since/5.1.1/) | Introduced. |
wordpress apply_filters( 'pre_get_ready_cron_jobs', null|array[] $pre ) apply\_filters( 'pre\_get\_ready\_cron\_jobs', null|array[] $pre )
==================================================================
Filter to preflight or hijack retrieving ready cron jobs.
Returning an array will short-circuit the normal retrieval of ready cron jobs, causing the function to return the filtered value instead.
`$pre` null|array[] Array of ready cron tasks to return instead. Default null to continue using results from [\_get\_cron\_array()](../functions/_get_cron_array) . File: `wp-includes/cron.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/cron.php/)
```
$pre = apply_filters( 'pre_get_ready_cron_jobs', null );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_ready\_cron\_jobs()](../functions/wp_get_ready_cron_jobs) wp-includes/cron.php | Retrieve cron jobs ready to be run. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'bloginfo_url', string $output, string $show ) apply\_filters( 'bloginfo\_url', string $output, string $show )
===============================================================
Filters the URL returned by [get\_bloginfo()](../functions/get_bloginfo) .
`$output` string The URL returned by [bloginfo()](../functions/bloginfo) . `$show` string Type of information requested. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$output = apply_filters( 'bloginfo_url', $output, $show );
```
| Used By | Description |
| --- | --- |
| [get\_bloginfo()](../functions/get_bloginfo) wp-includes/general-template.php | Retrieves information about the current site. |
| Version | Description |
| --- | --- |
| [2.0.5](https://developer.wordpress.org/reference/since/2.0.5/) | Introduced. |
wordpress apply_filters( "rest_{$this->taxonomy}_query", array $prepared_args, WP_REST_Request $request ) apply\_filters( "rest\_{$this->taxonomy}\_query", array $prepared\_args, WP\_REST\_Request $request )
=====================================================================================================
Filters [get\_terms()](../functions/get_terms) arguments when querying terms via the REST API.
The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `rest_category_query`
* `rest_post_tag_query`
Enables adding extra arguments or setting defaults for a terms collection request.
`$prepared_args` array Array of arguments for [get\_terms()](../functions/get_terms) . More Arguments from get\_terms( ... $args ) Array or query string of term query parameters.
* `taxonomy`string|string[]Taxonomy name, or array of taxonomy names, to which results should be limited.
* `object_ids`int|int[]Object ID, or array of object IDs. Results will be limited to terms associated with these objects.
* `orderby`stringField(s) to order terms by. Accepts:
+ Term fields (`'name'`, `'slug'`, `'term_group'`, `'term_id'`, `'id'`, `'description'`, `'parent'`, `'term_order'`). Unless `$object_ids` is not empty, `'term_order'` is treated the same as `'term_id'`.
+ `'count'` to use the number of objects associated with the term.
+ `'include'` to match the `'order'` of the `$include` param.
+ `'slug__in'` to match the `'order'` of the `$slug` param.
+ `'meta_value'`
+ `'meta_value_num'`.
+ The value of `$meta_key`.
+ The array keys of `$meta_query`.
+ `'none'` to omit the ORDER BY clause. Default `'name'`.
* `order`stringWhether to order terms in ascending or descending order.
Accepts `'ASC'` (ascending) or `'DESC'` (descending).
Default `'ASC'`.
* `hide_empty`bool|intWhether to hide terms not assigned to any posts. Accepts `1|true` or `0|false`. Default `1|true`.
* `include`int[]|stringArray or comma/space-separated string of term IDs to include.
Default empty array.
* `exclude`int[]|stringArray or comma/space-separated string of term IDs to exclude.
If `$include` is non-empty, `$exclude` is ignored.
Default empty array.
* `exclude_tree`int[]|stringArray or comma/space-separated string of term IDs to exclude along with all of their descendant terms. If `$include` is non-empty, `$exclude_tree` is ignored. Default empty array.
* `number`int|stringMaximum number of terms to return. Accepts ``''`|0` (all) or any positive number. Default ``''`|0` (all). Note that `$number` may not return accurate results when coupled with `$object_ids`.
See #41796 for details.
* `offset`intThe number by which to offset the terms query.
* `fields`stringTerm fields to query for. Accepts:
+ `'all'` Returns an array of complete term objects (`WP_Term[]`).
+ `'all_with_object_id'` Returns an array of term objects with the `'object_id'` param (`WP_Term[]`). Works only when the `$object_ids` parameter is populated.
+ `'ids'` Returns an array of term IDs (`int[]`).
+ `'tt_ids'` Returns an array of term taxonomy IDs (`int[]`).
+ `'names'` Returns an array of term names (`string[]`).
+ `'slugs'` Returns an array of term slugs (`string[]`).
+ `'count'` Returns the number of matching terms (`int`).
+ `'id=>parent'` Returns an associative array of parent term IDs, keyed by term ID (`int[]`).
+ `'id=>name'` Returns an associative array of term names, keyed by term ID (`string[]`).
+ `'id=>slug'` Returns an associative array of term slugs, keyed by term ID (`string[]`). Default `'all'`.
* `count`boolWhether to return a term count. If true, will take precedence over `$fields`. Default false.
* `name`string|string[]Name or array of names to return term(s) for.
* `slug`string|string[]Slug or array of slugs to return term(s) for.
* `term_taxonomy_id`int|int[]Term taxonomy ID, or array of term taxonomy IDs, to match when querying terms.
* `hierarchical`boolWhether to include terms that have non-empty descendants (even if `$hide_empty` is set to true). Default true.
* `search`stringSearch criteria to match terms. Will be SQL-formatted with wildcards before and after.
* `name__like`stringRetrieve terms with criteria by which a term is LIKE `$name__like`.
* `description__like`stringRetrieve terms where the description is LIKE `$description__like`.
* `pad_counts`boolWhether to pad the quantity of a term's children in the quantity of each term's "count" object variable. Default false.
* `get`stringWhether to return terms regardless of ancestry or whether the terms are empty. Accepts `'all'` or `''` (disabled). Default `''`.
* `child_of`intTerm ID to retrieve child terms of. If multiple taxonomies are passed, `$child_of` is ignored. Default 0.
* `parent`intParent term ID to retrieve direct-child terms of.
* `childless`boolTrue to limit results to terms that have no children.
This parameter has no effect on non-hierarchical taxonomies.
Default false.
* `cache_domain`stringUnique cache key to be produced when this query is stored in an object cache. Default `'core'`.
* `update_term_meta_cache`boolWhether to prime meta caches for matched terms. Default true.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
`$request` [WP\_REST\_Request](../classes/wp_rest_request) The REST API request. File: `wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php/)
```
$prepared_args = apply_filters( "rest_{$this->taxonomy}_query", $prepared_args, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Terms\_Controller::get\_items()](../classes/wp_rest_terms_controller/get_items) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Retrieves terms associated with a taxonomy. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'auto_theme_update_send_email', bool $enabled, array $update_results ) apply\_filters( 'auto\_theme\_update\_send\_email', bool $enabled, array $update\_results )
===========================================================================================
Filters whether to send an email following an automatic background theme update.
`$enabled` bool True if theme update notifications are enabled, false otherwise. `$update_results` array The results of theme update tasks. File: `wp-admin/includes/class-wp-automatic-updater.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-automatic-updater.php/)
```
$notifications_enabled = apply_filters( 'auto_theme_update_send_email', true, $update_results['theme'] );
```
| Used By | Description |
| --- | --- |
| [WP\_Automatic\_Updater::after\_plugin\_theme\_update()](../classes/wp_automatic_updater/after_plugin_theme_update) wp-admin/includes/class-wp-automatic-updater.php | If we tried to perform plugin or theme updates, check if we should send an email. |
| Version | Description |
| --- | --- |
| [5.5.1](https://developer.wordpress.org/reference/since/5.5.1/) | Added the `$update_results` parameter. |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'tag_escape', string $safe_tag, string $tag_name ) apply\_filters( 'tag\_escape', string $safe\_tag, string $tag\_name )
=====================================================================
Filters a string cleaned and escaped for output as an HTML tag.
`$safe_tag` string The tag name after it has been escaped. `$tag_name` string The text before it was escaped. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'tag_escape', $safe_tag, $tag_name );
```
| Used By | Description |
| --- | --- |
| [tag\_escape()](../functions/tag_escape) wp-includes/formatting.php | Escapes an HTML tag name. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'self_link', string $feed_link ) apply\_filters( 'self\_link', string $feed\_link )
==================================================
Filters the current feed URL.
* [set\_url\_scheme()](../functions/set_url_scheme)
* [wp\_unslash()](../functions/wp_unslash)
`$feed_link` string The link for the feed with set URL scheme. The filter function **must** return a value after it is finished processing or the result will be empty.
File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
echo esc_url( apply_filters( 'self_link', get_self_link() ) );
```
| Used By | Description |
| --- | --- |
| [self\_link()](../functions/self_link) wp-includes/feed.php | Displays the link for the currently displayed feed in a XSS safe way. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'pre_get_avatar_data', array $args, mixed $id_or_email ) apply\_filters( 'pre\_get\_avatar\_data', array $args, mixed $id\_or\_email )
=============================================================================
Filters whether to retrieve the avatar URL early.
Passing a non-null value in the ‘url’ member of the return array will effectively short circuit [get\_avatar\_data()](../functions/get_avatar_data) , passing the value through the [‘get\_avatar\_data’](get_avatar_data) filter and returning early.
`$args` array Arguments passed to [get\_avatar\_data()](../functions/get_avatar_data) , after processing. More Arguments from get\_avatar\_data( ... $args ) Arguments to use instead of the default arguments.
* `size`intHeight and width of the avatar image file in pixels. Default 96.
* `height`intDisplay height of the avatar in pixels. Defaults to $size.
* `width`intDisplay width of the avatar in pixels. Defaults to $size.
* `default`stringURL for the default image or a default type. Accepts `'404'` (return a 404 instead of a default image), `'retro'` (8bit), `'monsterid'` (monster), `'wavatar'` (cartoon face), `'indenticon'` (the "quilt"), `'mystery'`, `'mm'`, or `'mysteryman'` (The Oyster Man), `'blank'` (transparent GIF), or `'gravatar_default'` (the Gravatar logo). Default is the value of the `'avatar_default'` option, with a fallback of `'mystery'`.
* `force_default`boolWhether to always show the default image, never the Gravatar. Default false.
* `rating`stringWhat rating to display avatars up to. Accepts `'G'`, `'PG'`, `'R'`, `'X'`, and are judged in that order. Default is the value of the `'avatar_rating'` option.
* `scheme`stringURL scheme to use. See [set\_url\_scheme()](../functions/set_url_scheme) for accepted values.
* `processed_args`arrayWhen the function returns, the value will be the processed/sanitized $args plus a "found\_avatar" guess. Pass as a reference.
* `extra_attr`stringHTML attributes to insert in the IMG element. Is not sanitized. Default empty.
`$id_or_email` mixed The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash, user email, [WP\_User](../classes/wp_user) object, [WP\_Post](../classes/wp_post) object, or [WP\_Comment](../classes/wp_comment) object. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email );
```
| Used By | Description |
| --- | --- |
| [get\_avatar\_data()](../functions/get_avatar_data) wp-includes/link-template.php | Retrieves default data about the avatar. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'plupload_init', array $plupload_init ) apply\_filters( 'plupload\_init', array $plupload\_init )
=========================================================
Filters the default Plupload settings.
`$plupload_init` array An array of default settings used by Plupload. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$plupload_init = apply_filters( 'plupload_init', $plupload_init );
```
| Used By | Description |
| --- | --- |
| [media\_upload\_form()](../functions/media_upload_form) wp-admin/includes/media.php | Outputs the legacy media upload form. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress do_action_deprecated( 'retreive_password', string $user_login ) do\_action\_deprecated( 'retreive\_password', string $user\_login )
===================================================================
This hook has been deprecated. Misspelled. Use [‘retrieve\_password’](retrieve_password) hook instead.
Fires before a new password is retrieved.
Use the [‘retrieve\_password’](retrieve_password) hook instead.
`$user_login` string The user login name. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action_deprecated( 'retreive_password', array( $user->user_login ), '1.5.1', 'retrieve_password' );
```
| Used By | Description |
| --- | --- |
| [get\_password\_reset\_key()](../functions/get_password_reset_key) wp-includes/user.php | Creates, stores, then returns a password reset key for user. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Misspelled. Use ['retrieve\_password'](retrieve_password) hook instead. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'rest_after_insert_comment', WP_Comment $comment, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_after\_insert\_comment', WP\_Comment $comment, WP\_REST\_Request $request, bool $creating )
==============================================================================================================
Fires completely after a comment is created or updated via the REST API.
`$comment` [WP\_Comment](../classes/wp_comment) Inserted or updated comment object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating a comment, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php/)
```
do_action( 'rest_after_insert_comment', $comment, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::update\_item()](../classes/wp_rest_comments_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Updates a comment. |
| [WP\_REST\_Comments\_Controller::create\_item()](../classes/wp_rest_comments_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Creates a comment. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'link_category', string $cat_name ) apply\_filters( 'link\_category', string $cat\_name )
=====================================================
Filters the category name.
`$cat_name` string The category name. File: `wp-includes/bookmark-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/bookmark-template.php/)
```
$catname = apply_filters( 'link_category', $cat->name );
```
| Used By | Description |
| --- | --- |
| [get\_links\_list()](../functions/get_links_list) wp-includes/deprecated.php | Output entire list of links by category. |
| [wp\_list\_bookmarks()](../functions/wp_list_bookmarks) wp-includes/bookmark-template.php | Retrieves or echoes all of the bookmarks. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'enable_loading_advanced_cache_dropin', bool $enable_advanced_cache ) apply\_filters( 'enable\_loading\_advanced\_cache\_dropin', bool $enable\_advanced\_cache )
===========================================================================================
Filters whether to enable loading of the advanced-cache.php drop-in.
This filter runs before it can be used by plugins. It is designed for non-web run-times. If false is returned, advanced-cache.php will never be loaded.
`$enable_advanced_cache` bool Whether to enable loading advanced-cache.php (if present).
Default true. File: `wp-settings.php`. [View all references](https://developer.wordpress.org/reference/files/wp-settings.php/)
```
if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) && file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::check\_for\_page\_caching()](../classes/wp_site_health/check_for_page_caching) wp-admin/includes/class-wp-site-health.php | Checks if site has page cache enabled or not. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'the_title', string $post_title, int $post_id ) apply\_filters( 'the\_title', string $post\_title, int $post\_id )
==================================================================
Filters the post title.
`$post_title` string The post title. `$post_id` int The post ID. `the_title` is a filter applied to the post title retrieved from the database, prior to printing on the screen. In some cases (such as when [the\_title](../functions/the_title) is used), the title can be suppressed by returning a false value (e.g. `NULL`, `FALSE` or the empty string) from the filter function.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
return apply_filters( 'the_title', $post_title, $post_id );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menu\_Items\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_menu_items_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php | Prepares a single post output for response. |
| [WP\_REST\_Templates\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_templates_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Prepare a single template output for response |
| [WP\_Customize\_Nav\_Menu\_Item\_Setting::get\_original\_title()](../classes/wp_customize_nav_menu_item_setting/get_original_title) wp-includes/customize/class-wp-customize-nav-menu-item-setting.php | Get original title. |
| [WP\_Posts\_List\_Table::column\_title()](../classes/wp_posts_list_table/column_title) wp-admin/includes/class-wp-posts-list-table.php | Handles the title column output. |
| [Walker\_Nav\_Menu\_Checklist::start\_el()](../classes/walker_nav_menu_checklist/start_el) wp-admin/includes/class-walker-nav-menu-checklist.php | Start the element output. |
| [wp\_get\_archives()](../functions/wp_get_archives) wp-includes/general-template.php | Displays archive links based on type and format. |
| [get\_boundary\_post\_rel\_link()](../functions/get_boundary_post_rel_link) wp-includes/deprecated.php | Get boundary post relational link. |
| [get\_parent\_post\_rel\_link()](../functions/get_parent_post_rel_link) wp-includes/deprecated.php | Get parent post relational link. |
| [previous\_post()](../functions/previous_post) wp-includes/deprecated.php | Prints a link to the previous post. |
| [next\_post()](../functions/next_post) wp-includes/deprecated.php | Prints link to the next post. |
| [get\_adjacent\_post\_link()](../functions/get_adjacent_post_link) wp-includes/link-template.php | Retrieves the adjacent post link. |
| [Walker\_Nav\_Menu::start\_el()](../classes/walker_nav_menu/start_el) wp-includes/class-walker-nav-menu.php | Starts the element output. |
| [Walker\_Page::start\_el()](../classes/walker_page/start_el) wp-includes/class-walker-page.php | Outputs the beginning of the current element in the tree. |
| [get\_the\_title()](../functions/get_the_title) wp-includes/post-template.php | Retrieves the post title. |
| [wp\_setup\_nav\_menu\_item()](../functions/wp_setup_nav_menu_item) wp-includes/nav-menu.php | Decorates a menu item object with the shared navigation menu item properties. |
| [do\_trackbacks()](../functions/do_trackbacks) wp-includes/comment.php | Performs trackbacks. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress apply_filters( 'dashboard_primary_title', string $title ) apply\_filters( 'dashboard\_primary\_title', string $title )
============================================================
Filters the primary link title for the ‘WordPress Events and News’ dashboard widget.
`$title` string Title attribute for the widget's primary link. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_primary()](../functions/wp_dashboard_primary) wp-admin/includes/dashboard.php | ‘WordPress Events and News’ dashboard widget. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'delete_site_option', string $option, int $network_id ) do\_action( 'delete\_site\_option', string $option, int $network\_id )
======================================================================
Fires after a network option has been deleted.
`$option` string Name of the network option. `$network_id` int ID of the network. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'delete_site_option', $option, $network_id );
```
| Used By | Description |
| --- | --- |
| [delete\_network\_option()](../functions/delete_network_option) wp-includes/option.php | Removes a network option by name. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | The `$network_id` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_dashboard_widgets', string[] $dashboard_widgets ) apply\_filters( 'wp\_dashboard\_widgets', string[] $dashboard\_widgets )
========================================================================
Filters the list of widgets to load for the admin dashboard.
`$dashboard_widgets` string[] An array of dashboard widget IDs. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
$dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_setup()](../functions/wp_dashboard_setup) wp-admin/includes/dashboard.php | Registers dashboard widgets. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wxr_export_skip_termmeta', bool $skip, string $meta_key, object $meta ) apply\_filters( 'wxr\_export\_skip\_termmeta', bool $skip, string $meta\_key, object $meta )
============================================================================================
Filters whether to selectively skip term meta used for WXR exports.
Returning a truthy value from the filter will skip the current meta object from being exported.
`$skip` bool Whether to skip the current piece of term meta. Default false. `$meta_key` string Current meta key. `$meta` object Current meta object. File: `wp-admin/includes/export.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/export.php/)
```
if ( ! apply_filters( 'wxr_export_skip_termmeta', false, $meta->meta_key, $meta ) ) {
```
| Used By | Description |
| --- | --- |
| [wxr\_term\_meta()](../functions/wxr_term_meta) wp-admin/includes/export.php | Outputs term meta XML tags for a given term object. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'recovery_mode_email', array $email, string $url ) apply\_filters( 'recovery\_mode\_email', array $email, string $url )
====================================================================
Filters the contents of the Recovery Mode email.
`$email` array Used to build a call to [wp\_mail()](../functions/wp_mail) .
* `to`string|arrayArray or comma-separated list of email addresses to send message.
* `subject`stringEmail subject
* `message`stringMessage contents
* `headers`string|arrayOptional. Additional headers.
* `attachments`string|arrayOptional. Files to attach.
`$url` string URL to enter recovery mode. File: `wp-includes/class-wp-recovery-mode-email-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-email-service.php/)
```
$email = apply_filters( 'recovery_mode_email', $email, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Email\_Service::send\_recovery\_mode\_email()](../classes/wp_recovery_mode_email_service/send_recovery_mode_email) wp-includes/class-wp-recovery-mode-email-service.php | Sends the Recovery Mode email to the site admin email address. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The `$email` argument includes the `attachments` key. |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action( 'automatic_updates_complete', array $update_results ) do\_action( 'automatic\_updates\_complete', array $update\_results )
====================================================================
Fires after all automatic updates have run.
`$update_results` array The results of all attempted updates. File: `wp-admin/includes/class-wp-automatic-updater.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-automatic-updater.php/)
```
do_action( 'automatic_updates_complete', $this->update_results );
```
| Used By | Description |
| --- | --- |
| [WP\_Automatic\_Updater::run()](../classes/wp_automatic_updater/run) wp-admin/includes/class-wp-automatic-updater.php | Kicks off the background update process, looping through all pending updates. |
| Version | Description |
| --- | --- |
| [3.8.0](https://developer.wordpress.org/reference/since/3.8.0/) | Introduced. |
wordpress apply_filters( 'site_status_available_object_cache_services', string[] $services ) apply\_filters( 'site\_status\_available\_object\_cache\_services', string[] $services )
========================================================================================
Filters the persistent object cache services available to the user.
This can be useful to hide or add services not included in the defaults.
`$services` string[] The list of available persistent object cache services. File: `wp-admin/includes/class-wp-site-health.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-site-health.php/)
```
return apply_filters( 'site_status_available_object_cache_services', $services );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::available\_object\_cache\_services()](../classes/wp_site_health/available_object_cache_services) wp-admin/includes/class-wp-site-health.php | Returns a list of available persistent object cache services. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'add_option', string $option, mixed $value ) do\_action( 'add\_option', string $option, mixed $value )
=========================================================
Fires before an option is added.
`$option` string Name of the option to add. `$value` mixed Value of the option. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'add_option', $option, $value );
```
| Used By | Description |
| --- | --- |
| [add\_option()](../functions/add_option) wp-includes/option.php | Adds a new option. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_get_nav_menu_object', WP_Term|false $menu_obj, int|string|WP_Term $menu ) apply\_filters( 'wp\_get\_nav\_menu\_object', WP\_Term|false $menu\_obj, int|string|WP\_Term $menu )
====================================================================================================
Filters the nav\_menu term retrieved for [wp\_get\_nav\_menu\_object()](../functions/wp_get_nav_menu_object) .
`$menu_obj` [WP\_Term](../classes/wp_term)|false Term from nav\_menu taxonomy, or false if nothing had been found. `$menu` int|string|[WP\_Term](../classes/wp_term) The menu ID, slug, name, or object passed to [wp\_get\_nav\_menu\_object()](../functions/wp_get_nav_menu_object) . More Arguments from wp\_get\_nav\_menu\_object( ... $menu ) Menu ID, slug, name, or object. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
return apply_filters( 'wp_get_nav_menu_object', $menu_obj, $menu );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_nav\_menu\_object()](../functions/wp_get_nav_menu_object) wp-includes/nav-menu.php | Returns a navigation menu object. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action( 'updated_option', string $option, mixed $old_value, mixed $value ) do\_action( 'updated\_option', string $option, mixed $old\_value, mixed $value )
================================================================================
Fires after the value of an option has been successfully updated.
`$option` string Name of the updated option. `$old_value` mixed The old option value. `$value` mixed The new option value. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'updated_option', $option, $old_value, $value );
```
| Used By | Description |
| --- | --- |
| [update\_option()](../functions/update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( "pre_user_{$field}", mixed $value ) apply\_filters( "pre\_user\_{$field}", mixed $value )
=====================================================
Filters the value of a user field in the ‘db’ context.
The dynamic portion of the hook name, `$field`, refers to the prefixed user field being filtered, such as ‘user\_login’, ‘user\_email’, ‘first\_name’, etc.
`$value` mixed Value of the prefixed user field. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$value = apply_filters( "pre_user_{$field}", $value );
```
| Used By | Description |
| --- | --- |
| [sanitize\_user\_field()](../functions/sanitize_user_field) wp-includes/user.php | Sanitizes user field based on context. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'rest_allow_anonymous_comments', bool $allow_anonymous, WP_REST_Request $request ) apply\_filters( 'rest\_allow\_anonymous\_comments', bool $allow\_anonymous, WP\_REST\_Request $request )
========================================================================================================
Filters whether comments can be created via the REST API without authentication.
Enables creating comments for anonymous users.
`$allow_anonymous` bool Whether to allow anonymous comments to be created. Default `false`. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php/)
```
$allow_anonymous = apply_filters( 'rest_allow_anonymous_comments', false, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::create\_item\_permissions\_check()](../classes/wp_rest_comments_controller/create_item_permissions_check) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Checks if a given request has access to create a comment. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'sanitize_text_field', string $filtered, string $str ) apply\_filters( 'sanitize\_text\_field', string $filtered, string $str )
========================================================================
Filters a sanitized text field string.
`$filtered` string The sanitized string. `$str` string The string prior to being sanitized. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'sanitize_text_field', $filtered, $str );
```
| Used By | Description |
| --- | --- |
| [sanitize\_text\_field()](../functions/sanitize_text_field) wp-includes/formatting.php | Sanitizes a string from user input or from the database. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'update_right_now_text', string $content ) apply\_filters( 'update\_right\_now\_text', string $content )
=============================================================
Filters the text displayed in the ‘At a Glance’ dashboard widget.
Prior to 3.8.0, the widget was named ‘Right Now’.
`$content` string Default text. File: `wp-admin/includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update.php/)
```
$content = apply_filters( 'update_right_now_text', $content );
```
| Used By | Description |
| --- | --- |
| [update\_right\_now\_message()](../functions/update_right_now_message) wp-admin/includes/update.php | Displays WordPress version and active theme in the ‘At a Glance’ dashboard widget. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'after_signup_user', string $user, string $user_email, string $key, array $meta ) do\_action( 'after\_signup\_user', string $user, string $user\_email, string $key, array $meta )
================================================================================================
Fires after a user’s signup information has been written to the database.
`$user` string The user's requested login name. `$user_email` string The user's email address. `$key` string The user's activation key. `$meta` array Signup meta data. Default empty array. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
do_action( 'after_signup_user', $user, $user_email, $key, $meta );
```
| Used By | Description |
| --- | --- |
| [wpmu\_signup\_user()](../functions/wpmu_signup_user) wp-includes/ms-functions.php | Records user signup information for future activation. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'get_custom_logo', string $html, int $blog_id ) apply\_filters( 'get\_custom\_logo', string $html, int $blog\_id )
==================================================================
Filters the custom logo output.
`$html` string Custom logo HTML output. `$blog_id` int ID of the blog to get the custom logo for. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'get_custom_logo', $html, $blog_id );
```
| Used By | Description |
| --- | --- |
| [get\_custom\_logo()](../functions/get_custom_logo) wp-includes/general-template.php | Returns a custom logo, linked to home unless the theme supports removing the link on the home page. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$blog_id` parameter. |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'http_headers_useragent', string $user_agent, string $url ) apply\_filters( 'http\_headers\_useragent', string $user\_agent, string $url )
==============================================================================
Filters the user agent value sent with an HTTP request.
`$user_agent` string WordPress user agent string. `$url` string The request URL. File: `wp-includes/class-wp-http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http.php/)
```
'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), $url ),
```
| Used By | Description |
| --- | --- |
| [WP\_Http::request()](../classes/wp_http/request) wp-includes/class-wp-http.php | Send an HTTP request to a URI. |
| [wp\_xmlrpc\_server::pingback\_ping()](../classes/wp_xmlrpc_server/pingback_ping) wp-includes/class-wp-xmlrpc-server.php | Retrieves a pingback and registers it. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | The `$url` parameter was added. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'attach_session_information', array $session, int $user_id ) apply\_filters( 'attach\_session\_information', array $session, int $user\_id )
===============================================================================
Filters the information attached to the newly created session.
Can be used to attach further information to a session.
`$session` array Array of extra data. `$user_id` int User ID. File: `wp-includes/class-wp-session-tokens.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-session-tokens.php/)
```
$session = apply_filters( 'attach_session_information', array(), $this->user_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Session\_Tokens::create()](../classes/wp_session_tokens/create) wp-includes/class-wp-session-tokens.php | Generates a session token and attaches session information to it. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( "customize_partial_render_{$partial->id}", string|array|false $rendered, WP_Customize_Partial $partial, array $container_context ) apply\_filters( "customize\_partial\_render\_{$partial->id}", string|array|false $rendered, WP\_Customize\_Partial $partial, array $container\_context )
========================================================================================================================================================
Filters partial rendering for a specific partial.
The dynamic portion of the hook name, `$partial->ID` refers to the partial ID.
`$rendered` string|array|false The partial value. Default false. `$partial` [WP\_Customize\_Partial](../classes/wp_customize_partial) [WP\_Customize\_Setting](../classes/wp_customize_setting) instance. `$container_context` array array of context data associated with the target container. File: `wp-includes/customize/class-wp-customize-partial.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-partial.php/)
```
$rendered = apply_filters( "customize_partial_render_{$partial->id}", $rendered, $partial, $container_context );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Partial::render()](../classes/wp_customize_partial/render) wp-includes/customize/class-wp-customize-partial.php | Renders the template partial involving the associated settings. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'wp_image_src_get_dimensions', array|false $dimensions, string $image_src, array $image_meta, int $attachment_id ) apply\_filters( 'wp\_image\_src\_get\_dimensions', array|false $dimensions, string $image\_src, array $image\_meta, int $attachment\_id )
=========================================================================================================================================
Filters the ‘wp\_image\_src\_get\_dimensions’ value.
`$dimensions` array|false Array with first element being the width and second element being the height, or false if dimensions could not be determined. `$image_src` string The image source file. `$image_meta` array The image meta data as returned by '[wp\_get\_attachment\_metadata()](../functions/wp_get_attachment_metadata) '. `$attachment_id` int The image attachment ID. Default 0. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_image_src_get_dimensions', $dimensions, $image_src, $image_meta, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_image\_src\_get\_dimensions()](../functions/wp_image_src_get_dimensions) wp-includes/media.php | Determines an image’s width and height dimensions based on the source file. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( "theme_action_links_{$stylesheet}", string[] $actions, WP_Theme $theme, string $context ) apply\_filters( "theme\_action\_links\_{$stylesheet}", string[] $actions, WP\_Theme $theme, string $context )
=============================================================================================================
Filters the action links of a specific theme in the Multisite themes list table.
The dynamic portion of the hook name, `$stylesheet`, refers to the directory name of the theme, which in most cases is synonymous with the template name.
`$actions` string[] An array of action links. `$theme` [WP\_Theme](../classes/wp_theme) The current [WP\_Theme](../classes/wp_theme) object. `$context` string Status of the theme, one of `'all'`, `'enabled'`, or `'disabled'`. File: `wp-admin/includes/class-wp-ms-themes-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-themes-list-table.php/)
```
$actions = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, $context );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Themes\_List\_Table::column\_name()](../classes/wp_ms_themes_list_table/column_name) wp-admin/includes/class-wp-ms-themes-list-table.php | Handles the name column output. |
| [WP\_Themes\_List\_Table::display\_rows()](../classes/wp_themes_list_table/display_rows) wp-admin/includes/class-wp-themes-list-table.php | |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'rest_save_sidebar', array $sidebar, WP_REST_Request $request ) do\_action( 'rest\_save\_sidebar', array $sidebar, WP\_REST\_Request $request )
===============================================================================
Fires after a sidebar is updated via the REST API.
`$sidebar` array The updated sidebar. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php/)
```
do_action( 'rest_save_sidebar', $sidebar, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Sidebars\_Controller::update\_item()](../classes/wp_rest_sidebars_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Updates a sidebar. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress do_action_ref_array( "requests-{$hook}", array $parameters, array $request, string $url ) do\_action\_ref\_array( "requests-{$hook}", array $parameters, array $request, string $url )
============================================================================================
Transforms a native Request hook to a WordPress action.
This action maps Requests internal hook to a native WordPress action.
* <https://github.com/WordPress/Requests/blob/master/docs/hooks.md>
`$parameters` array Parameters from Requests internal hook. `$request` array Request data in [WP\_Http](../classes/wp_http) format. `$url` string URL to request. File: `wp-includes/class-wp-http-requests-hooks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-requests-hooks.php/)
```
do_action_ref_array( "requests-{$hook}", $parameters, $this->request, $this->url ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [WP\_HTTP\_Requests\_Hooks::dispatch()](../classes/wp_http_requests_hooks/dispatch) wp-includes/class-wp-http-requests-hooks.php | Dispatch a Requests hook to a native WordPress action. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'wp_preload_resources', array $preload_resources ) apply\_filters( 'wp\_preload\_resources', array $preload\_resources )
=====================================================================
Filters domains and URLs for resource preloads.
`$preload_resources` array Array of resources and their attributes, or URLs to print for resource preloads.
* `...$0`array Array of resource attributes.
+ `href`stringURL to include in resource preloads. Required.
+ `as`stringHow the browser should treat the resource (`script`, `style`, `image`, `document`, etc).
+ `crossorigin`stringIndicates the CORS policy of the specified resource.
+ `type`stringType of the resource (`text/html`, `text/css`, etc).
+ `media`stringAccepts media types or media queries. Allows responsive preloading.
+ `imagesizes`stringResponsive source size to the source Set.
+ `imagesrcset`stringResponsive image sources to the source set. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$preload_resources = apply_filters( 'wp_preload_resources', array() );
```
| Used By | Description |
| --- | --- |
| [wp\_preload\_resources()](../functions/wp_preload_resources) wp-includes/general-template.php | Prints resource preloads directives to browsers. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( "rest_delete_{$this->post_type}", WP_Post $post, WP_REST_Response $response, WP_REST_Request $request ) do\_action( "rest\_delete\_{$this->post\_type}", WP\_Post $post, WP\_REST\_Response $response, WP\_REST\_Request $request )
===========================================================================================================================
Fires immediately after a single post is deleted or trashed via the REST API.
They dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
Possible hook names include:
* `rest_delete_post`
* `rest_delete_page`
* `rest_delete_attachment`
`$post` [WP\_Post](../classes/wp_post) The deleted or trashed post. `$response` [WP\_REST\_Response](../classes/wp_rest_response) The response data. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request sent to the API. File: `wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php/)
```
do_action( "rest_delete_{$this->post_type}", $post, $response, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::delete\_item()](../classes/wp_rest_posts_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Deletes a single post. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action_ref_array( 'admin_bar_menu', WP_Admin_Bar $wp_admin_bar ) do\_action\_ref\_array( 'admin\_bar\_menu', WP\_Admin\_Bar $wp\_admin\_bar )
============================================================================
Loads all necessary admin bar items.
This is the hook used to add, remove, or manipulate admin bar items.
`$wp_admin_bar` [WP\_Admin\_Bar](../classes/wp_admin_bar) The [WP\_Admin\_Bar](../classes/wp_admin_bar) instance, passed by reference. File: `wp-includes/admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
```
do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );
```
| Used By | Description |
| --- | --- |
| [wp\_admin\_bar\_render()](../functions/wp_admin_bar_render) wp-includes/admin-bar.php | Renders the admin bar to the page based on the $wp\_admin\_bar->menu member var. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_list_pages_excludes', string[] $exclude_array ) apply\_filters( 'wp\_list\_pages\_excludes', string[] $exclude\_array )
=======================================================================
Filters the array of pages to exclude from the pages list.
`$exclude_array` string[] An array of page IDs to exclude. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$parsed_args['exclude'] = implode( ',', apply_filters( 'wp_list_pages_excludes', $exclude_array ) );
```
| Used By | Description |
| --- | --- |
| [wp\_list\_pages()](../functions/wp_list_pages) wp-includes/post-template.php | Retrieves or displays a list of pages (or hierarchical post type items) in list (li) format. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'clean_post_cache', int $post_id, WP_Post $post ) do\_action( 'clean\_post\_cache', int $post\_id, WP\_Post $post )
=================================================================
Fires immediately after the given post’s cache is cleaned.
`$post_id` int Post ID. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'clean_post_cache', $post->ID, $post );
```
| Used By | Description |
| --- | --- |
| [clean\_post\_cache()](../functions/clean_post_cache) wp-includes/post.php | Will clean the post in the cache. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'customize_render_control', WP_Customize_Control $control ) do\_action( 'customize\_render\_control', WP\_Customize\_Control $control )
===========================================================================
Fires just before the current Customizer control is rendered.
`$control` [WP\_Customize\_Control](../classes/wp_customize_control) [WP\_Customize\_Control](../classes/wp_customize_control) instance. File: `wp-includes/class-wp-customize-control.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-control.php/)
```
do_action( 'customize_render_control', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Control::maybe\_render()](../classes/wp_customize_control/maybe_render) wp-includes/class-wp-customize-control.php | Check capabilities and render the control. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'comment_id_not_found', int $comment_post_id ) do\_action( 'comment\_id\_not\_found', int $comment\_post\_id )
===============================================================
Fires when a comment is attempted on a post that does not exist.
`$comment_post_id` int Post ID. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'comment_id_not_found', $comment_post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_handle\_comment\_submission()](../functions/wp_handle_comment_submission) wp-includes/comment.php | Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( "get_the_author_{$field}", string $value, int $user_id, int|false $original_user_id ) apply\_filters( "get\_the\_author\_{$field}", string $value, int $user\_id, int|false $original\_user\_id )
===========================================================================================================
Filters the value of the requested user metadata.
The filter name is dynamic and depends on the $field parameter of the function.
`$value` string The value of the metadata. `$user_id` int The user ID for the value. `$original_user_id` int|false The original user ID, as passed to the function. File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
return apply_filters( "get_the_author_{$field}", $value, $user_id, $original_user_id );
```
| Used By | Description |
| --- | --- |
| [get\_the\_author\_meta()](../functions/get_the_author_meta) wp-includes/author-template.php | Retrieves the requested data of the author of the current post. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | The `$original_user_id` parameter was added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'user_admin_url', string $url, string $path, string|null $scheme ) apply\_filters( 'user\_admin\_url', string $url, string $path, string|null $scheme )
====================================================================================
Filters the user admin URL for the current user.
`$url` string The complete URL including scheme and path. `$path` string Path relative to the URL. Blank string if no path is specified. `$scheme` string|null The scheme to use. Accepts `'http'`, `'https'`, `'admin'`, or null. Default is `'admin'`, which obeys [force\_ssl\_admin()](../functions/force_ssl_admin) and [is\_ssl()](../functions/is_ssl) . File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'user_admin_url', $url, $path, $scheme );
```
| Used By | Description |
| --- | --- |
| [user\_admin\_url()](../functions/user_admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for the current user. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | The `$scheme` parameter was added. |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'pre_comment_approved', int|string|WP_Error $approved, array $commentdata ) apply\_filters( 'pre\_comment\_approved', int|string|WP\_Error $approved, array $commentdata )
==============================================================================================
Filters a comment’s approval status before it is set.
`$approved` int|string|[WP\_Error](../classes/wp_error) The approval status. Accepts 1, 0, `'spam'`, `'trash'`, or [WP\_Error](../classes/wp_error). `$commentdata` array Comment data. * A filter hook called by the [wp\_allow\_comment()](../functions/wp_allow_comment) function prior to inserting a comment into the database. The filter is applied to the proposed comment’s approval status, allowing a plugin to override.
* [wp\_allow\_comment()](../functions/wp_allow_comment) handles the preliminary approval checking, and that approval status is passed through this filter before it returns.
* The `$commentdata` array contains the same indices as the array returned by [WP\_Comment\_Query::get\_comments()](../classes/wp_comment_query/get_comments), including:
`'comment_post_ID' - The post to which the comment will apply
'comment_author' - (may be empty)
'comment_author_email' - (may be empty)
'comment_author_url' - (may be empty)
'comment_author_IP' - IP address
'comment_agent' - e.g., "Mozilla/5.0..."
'comment_content' - The text of the proposed comment
'comment_type' - 'pingback', 'trackback', or empty for regular comments
'user_ID' - (empty if not logged in)`
* Return Values:
`0 (int) comment is marked for moderation as "Pending"
1 (int) comment is marked for immediate publication as "Approved"
'spam' (string) comment is marked as "Spam"
'trash' (string) comment is to be put in the Trash`
In all cases the comment is added to the database, even spam. Comments marked as spam will never be visible on the front end. Spam comments are kept for possible analysis by plugins.
* Prior to WP 3.1, the filter was not passed $comment\_data and instead was expected to use global variables such as *$comment\_ID* to access information about the comment. (see: <https://core.trac.wordpress.org/ticket/14802> )
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
return apply_filters( 'pre_comment_approved', $approved, $commentdata );
```
| Used By | Description |
| --- | --- |
| [wp\_allow\_comment()](../functions/wp_allow_comment) wp-includes/comment.php | Validates whether this comment is allowed to be made. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Returning a [WP\_Error](../classes/wp_error) value from the filter will short-circuit comment insertion and allow skipping further processing. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'the_permalink_rss', string $post_permalink ) apply\_filters( 'the\_permalink\_rss', string $post\_permalink )
================================================================
Filters the permalink to the post for use in feeds.
`$post_permalink` string The current post permalink. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
echo esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) );
```
| Used By | Description |
| --- | --- |
| [the\_permalink\_rss()](../functions/the_permalink_rss) wp-includes/feed.php | Displays the permalink to the post for use in feeds. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'nav_menu_item_id', string $menu_item_id, WP_Post $menu_item, stdClass $args, int $depth ) apply\_filters( 'nav\_menu\_item\_id', string $menu\_item\_id, WP\_Post $menu\_item, stdClass $args, int $depth )
=================================================================================================================
Filters the ID attribute applied to a menu item’s list item element.
`$menu_item_id` string The ID attribute applied to the menu item's `<li>` element. `$menu_item` [WP\_Post](../classes/wp_post) The current menu item. `$args` stdClass An object of [wp\_nav\_menu()](../functions/wp_nav_menu) arguments. More Arguments from wp\_nav\_menu( ... $args ) Array of nav menu arguments.
* `menu`int|string|[WP\_Term](../classes/wp_term)Desired menu. Accepts a menu ID, slug, name, or object.
* `menu_class`stringCSS class to use for the ul element which forms the menu.
Default `'menu'`.
* `menu_id`stringThe ID that is applied to the ul element which forms the menu.
Default is the menu slug, incremented.
* `container`stringWhether to wrap the ul, and what to wrap it with.
Default `'div'`.
* `container_class`stringClass that is applied to the container.
Default 'menu-{menu slug}-container'.
* `container_id`stringThe ID that is applied to the container.
* `container_aria_label`stringThe aria-label attribute that is applied to the container when it's a nav element.
* `fallback_cb`callable|falseIf the menu doesn't exist, a callback function will fire.
Default is `'wp_page_menu'`. Set to false for no fallback.
* `before`stringText before the link markup.
* `after`stringText after the link markup.
* `link_before`stringText before the link text.
* `link_after`stringText after the link text.
* `echo`boolWhether to echo the menu or return it. Default true.
* `depth`intHow many levels of the hierarchy are to be included.
0 means all. Default 0.
Default 0.
* `walker`objectInstance of a custom walker class.
* `theme_location`stringTheme location to be used. Must be registered with [register\_nav\_menu()](../functions/register_nav_menu) in order to be selectable by the user.
* `items_wrap`stringHow the list items should be wrapped. Uses printf() format with numbered placeholders. Default is a ul with an id and class.
* `item_spacing`stringWhether to preserve whitespace within the menu's HTML.
Accepts `'preserve'` or `'discard'`. Default `'preserve'`.
`$depth` int Depth of menu item. Used for padding. File: `wp-includes/class-walker-nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-nav-menu.php/)
```
$id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $menu_item->ID, $menu_item, $args, $depth );
```
| Used By | Description |
| --- | --- |
| [Walker\_Nav\_Menu::start\_el()](../classes/walker_nav_menu/start_el) wp-includes/class-walker-nav-menu.php | Starts the element output. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$depth` parameter was added. |
| [3.0.1](https://developer.wordpress.org/reference/since/3.0.1/) | Introduced. |
wordpress apply_filters( "auto_update_{$type}", bool|null $update, object $item ) apply\_filters( "auto\_update\_{$type}", bool|null $update, object $item )
==========================================================================
Filters whether to automatically update core, a plugin, a theme, or a language.
The dynamic portion of the hook name, `$type`, refers to the type of update being checked.
Possible hook names include:
* `auto_update_core`
* `auto_update_plugin`
* `auto_update_theme`
* `auto_update_translation`
Since WordPress 3.7, minor and development versions of core, and translations have been auto-updated by default. New installs on WordPress 5.6 or higher will also auto-update major versions by default. Starting in 5.6, older sites can opt-in to major version auto-updates, and auto-updates for plugins and themes.
See the [‘allow\_dev\_auto\_core\_updates’](allow_dev_auto_core_updates), [‘allow\_minor\_auto\_core\_updates’](allow_minor_auto_core_updates), and [‘allow\_major\_auto\_core\_updates’](allow_major_auto_core_updates) filters for a more straightforward way to adjust core updates.
`$update` bool|null Whether to update. The value of null is internally used to detect whether nothing has hooked into this filter. `$item` object The update offer. File: `wp-admin/includes/class-wp-automatic-updater.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-automatic-updater.php/)
```
$update = apply_filters( "auto_update_{$type}", $update, $item );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_auto\_update\_forced\_for\_item()](../functions/wp_is_auto_update_forced_for_item) wp-admin/includes/update.php | Checks whether auto-updates are forced for an item. |
| [WP\_Automatic\_Updater::should\_update()](../classes/wp_automatic_updater/should_update) wp-admin/includes/class-wp-automatic-updater.php | Tests to see if we can and should update a specific item. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$update` parameter accepts the value of null. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'core_version_check_locale', string $locale ) apply\_filters( 'core\_version\_check\_locale', string $locale )
================================================================
Filters the locale requested for WordPress core translations.
`$locale` string Current locale. File: `wp-includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/update.php/)
```
$locale = apply_filters( 'core_version_check_locale', get_locale() );
```
| Used By | Description |
| --- | --- |
| [wp\_version\_check()](../functions/wp_version_check) wp-includes/update.php | Checks WordPress version against the newest version. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( "render_block_{$this->name}", string $block_content, array $block, WP_Block $instance ) apply\_filters( "render\_block\_{$this->name}", string $block\_content, array $block, WP\_Block $instance )
===========================================================================================================
Filters the content of a single block.
The dynamic portion of the hook name, `$name`, refers to the block name, e.g. "core/paragraph".
`$block_content` string The block content. `$block` array The full block, including name and attributes. `$instance` [WP\_Block](../classes/wp_block) The block instance. File: `wp-includes/class-wp-block.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-block.php/)
```
$block_content = apply_filters( "render_block_{$this->name}", $block_content, $this->parsed_block, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Block::render()](../classes/wp_block/render) wp-includes/class-wp-block.php | Generates the render output for the block. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | The `$instance` parameter was added. |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'customize_refresh_nonces', string[] $nonces, WP_Customize_Manager $manager ) apply\_filters( 'customize\_refresh\_nonces', string[] $nonces, WP\_Customize\_Manager $manager )
=================================================================================================
Filters nonces for Customizer.
`$nonces` string[] Array of refreshed nonces for save and preview actions. `$manager` [WP\_Customize\_Manager](../classes/wp_customize_manager) [WP\_Customize\_Manager](../classes/wp_customize_manager) instance. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
$nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::get\_nonces()](../classes/wp_customize_manager/get_nonces) wp-includes/class-wp-customize-manager.php | Gets nonces for the Customizer. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress do_action_ref_array( 'the_post', WP_Post $post, WP_Query $query ) do\_action\_ref\_array( 'the\_post', WP\_Post $post, WP\_Query $query )
=======================================================================
Fires once the post data has been set up.
`$post` [WP\_Post](../classes/wp_post) The Post object (passed by reference). `$query` [WP\_Query](../classes/wp_query) The current Query object (passed by reference). The ‘the\_post’ action hook allows developers to modify the post object immediately after being queried and setup.
The post object is passed to this hook by reference so there is no need to return a value.
```
function my_the_post_action( $post_object ) {
// modify post object here
}
add_action( 'the_post', 'my_the_post_action' );
```
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
do_action_ref_array( 'the_post', array( &$post, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::setup\_postdata()](../classes/wp_query/setup_postdata) wp-includes/class-wp-query.php | Set up global post data. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced `$query` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'dynamic_sidebar_before', int|string $index, bool $has_widgets ) do\_action( 'dynamic\_sidebar\_before', int|string $index, bool $has\_widgets )
===============================================================================
Fires before widgets are rendered in a dynamic sidebar.
Note: The action also fires for empty sidebars, and on both the front end and back end, including the Inactive Widgets sidebar on the Widgets screen.
`$index` int|string Index, name, or ID of the dynamic sidebar. `$has_widgets` bool Whether the sidebar is populated with widgets.
Default true. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
do_action( 'dynamic_sidebar_before', $index, true );
```
| Used By | Description |
| --- | --- |
| [dynamic\_sidebar()](../functions/dynamic_sidebar) wp-includes/widgets.php | Display dynamic sidebar. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'wp_generate_attachment_metadata', array $metadata, int $attachment_id, string $context ) apply\_filters( 'wp\_generate\_attachment\_metadata', array $metadata, int $attachment\_id, string $context )
=============================================================================================================
Filters the generated attachment meta data.
`$metadata` array An array of attachment meta data. `$attachment_id` int Current attachment ID. `$context` string Additional context. Can be `'create'` when metadata was initially created for new attachment or `'update'` when the metadata was updated. File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id, 'create' );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_image\_subsizes()](../functions/wp_update_image_subsizes) wp-admin/includes/image.php | If any of the currently registered image sub-sizes are missing, create them and update the image meta data. |
| [wp\_generate\_attachment\_metadata()](../functions/wp_generate_attachment_metadata) wp-admin/includes/image.php | Generates attachment meta data and create image sub-sizes for images. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | The `$context` parameter was added. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'request_filesystem_credentials', mixed $credentials, string $form_post, string $type, bool|WP_Error $error, string $context, array $extra_fields, bool $allow_relaxed_file_ownership ) apply\_filters( 'request\_filesystem\_credentials', mixed $credentials, string $form\_post, string $type, bool|WP\_Error $error, string $context, array $extra\_fields, bool $allow\_relaxed\_file\_ownership )
===============================================================================================================================================================================================================
Filters the filesystem credentials.
Returning anything other than an empty string will effectively short-circuit output of the filesystem credentials form, returning that value instead.
A filter should return true if no filesystem credentials are required, false if they are required but have not been provided, or an array of credentials if they are required and have been provided.
`$credentials` mixed Credentials to return instead. Default empty string. `$form_post` string The URL to post the form to. `$type` string Chosen type of filesystem. `$error` bool|[WP\_Error](../classes/wp_error) Whether the current request has failed to connect, or an error object. `$context` string Full path to the directory that is tested for being writable. `$extra_fields` array Extra POST fields. `$allow_relaxed_file_ownership` bool Whether to allow Group/World writable. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$req_cred = apply_filters( 'request_filesystem_credentials', '', $form_post, $type, $error, $context, $extra_fields, $allow_relaxed_file_ownership );
```
| Used By | Description |
| --- | --- |
| [request\_filesystem\_credentials()](../functions/request_filesystem_credentials) wp-admin/includes/file.php | Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | The `$context` parameter default changed from `false` to an empty string. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'deprecated_constructor_run', string $class, string $version, string $parent_class ) do\_action( 'deprecated\_constructor\_run', string $class, string $version, string $parent\_class )
===================================================================================================
Fires when a deprecated constructor is called.
`$class` string The class containing the deprecated constructor. `$version` string The version of WordPress that deprecated the function. `$parent_class` string The parent class calling the deprecated constructor. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
do_action( 'deprecated_constructor_run', $class, $version, $parent_class );
```
| Used By | Description |
| --- | --- |
| [\_deprecated\_constructor()](../functions/_deprecated_constructor) wp-includes/functions.php | Marks a constructor as deprecated and informs when it has been used. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Added the `$parent_class` parameter. |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_is_site_initialized', bool|null $pre, int $site_id ) apply\_filters( 'pre\_wp\_is\_site\_initialized', bool|null $pre, int $site\_id )
=================================================================================
Filters the check for whether a site is initialized before the database is accessed.
Returning a non-null value will effectively short-circuit the function, returning that value instead.
`$pre` bool|null The value to return instead. Default null to continue with the check. `$site_id` int The site ID that is being checked. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
$pre = apply_filters( 'pre_wp_is_site_initialized', null, $site_id );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_site\_initialized()](../functions/wp_is_site_initialized) wp-includes/ms-site.php | Checks whether a site is initialized. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'wp_search_stopwords', string[] $stopwords ) apply\_filters( 'wp\_search\_stopwords', string[] $stopwords )
==============================================================
Filters stopwords used when parsing search terms.
`$stopwords` string[] Array of stopwords. File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$this->stopwords = apply_filters( 'wp_search_stopwords', $stopwords );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_search\_stopwords()](../classes/wp_query/get_search_stopwords) wp-includes/class-wp-query.php | Retrieve stopwords used when parsing search terms. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'get_avatar_url', string $url, mixed $id_or_email, array $args ) apply\_filters( 'get\_avatar\_url', string $url, mixed $id\_or\_email, array $args )
====================================================================================
Filters the avatar URL.
`$url` string The URL of the avatar. `$id_or_email` mixed The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash, user email, [WP\_User](../classes/wp_user) object, [WP\_Post](../classes/wp_post) object, or [WP\_Comment](../classes/wp_comment) object. `$args` array Arguments passed to [get\_avatar\_data()](../functions/get_avatar_data) , after processing. More Arguments from get\_avatar\_data( ... $args ) Arguments to use instead of the default arguments.
* `size`intHeight and width of the avatar image file in pixels. Default 96.
* `height`intDisplay height of the avatar in pixels. Defaults to $size.
* `width`intDisplay width of the avatar in pixels. Defaults to $size.
* `default`stringURL for the default image or a default type. Accepts `'404'` (return a 404 instead of a default image), `'retro'` (8bit), `'monsterid'` (monster), `'wavatar'` (cartoon face), `'indenticon'` (the "quilt"), `'mystery'`, `'mm'`, or `'mysteryman'` (The Oyster Man), `'blank'` (transparent GIF), or `'gravatar_default'` (the Gravatar logo). Default is the value of the `'avatar_default'` option, with a fallback of `'mystery'`.
* `force_default`boolWhether to always show the default image, never the Gravatar. Default false.
* `rating`stringWhat rating to display avatars up to. Accepts `'G'`, `'PG'`, `'R'`, `'X'`, and are judged in that order. Default is the value of the `'avatar_rating'` option.
* `scheme`stringURL scheme to use. See [set\_url\_scheme()](../functions/set_url_scheme) for accepted values.
* `processed_args`arrayWhen the function returns, the value will be the processed/sanitized $args plus a "found\_avatar" guess. Pass as a reference.
* `extra_attr`stringHTML attributes to insert in the IMG element. Is not sanitized. Default empty.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$args['url'] = apply_filters( 'get_avatar_url', $url, $id_or_email, $args );
```
| Used By | Description |
| --- | --- |
| [get\_avatar\_data()](../functions/get_avatar_data) wp-includes/link-template.php | Retrieves default data about the avatar. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'determine_locale', string $locale ) apply\_filters( 'determine\_locale', string $locale )
=====================================================
Filters the locale for the current request.
`$locale` string The locale. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
return apply_filters( 'determine_locale', $determined_locale );
```
| Used By | Description |
| --- | --- |
| [determine\_locale()](../functions/determine_locale) wp-includes/l10n.php | Determines the current locale desired for the request. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'content_url', string $url, string $path ) apply\_filters( 'content\_url', string $url, string $path )
===========================================================
Filters the URL to the content directory.
`$url` string The complete URL to the content directory including scheme and path. `$path` string Path relative to the URL to the content directory. Blank string if no path is specified. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'content_url', $url, $path );
```
| Used By | Description |
| --- | --- |
| [content\_url()](../functions/content_url) wp-includes/link-template.php | Retrieves the URL to the content directory. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'rightnow_end' ) do\_action( 'rightnow\_end' )
=============================
Fires at the end of the ‘At a Glance’ dashboard widget.
Prior to 3.8.0, the widget was named ‘Right Now’.
File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
do_action( 'rightnow_end' );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_right\_now()](../functions/wp_dashboard_right_now) wp-admin/includes/dashboard.php | Dashboard widget that displays some basic stats about the site. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'transition_comment_status', int|string $new_status, int|string $old_status, WP_Comment $comment ) do\_action( 'transition\_comment\_status', int|string $new\_status, int|string $old\_status, WP\_Comment $comment )
===================================================================================================================
Fires when the comment status is in transition.
`$new_status` int|string The new comment status. `$old_status` int|string The old comment status. `$comment` [WP\_Comment](../classes/wp_comment) Comment object. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'transition_comment_status', $new_status, $old_status, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_transition\_comment\_status()](../functions/wp_transition_comment_status) wp-includes/comment.php | Calls hooks for when a comment status transition occurs. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'wp_calculate_image_sizes', string $sizes, string|int[] $size, string|null $image_src, array|null $image_meta, int $attachment_id ) apply\_filters( 'wp\_calculate\_image\_sizes', string $sizes, string|int[] $size, string|null $image\_src, array|null $image\_meta, int $attachment\_id )
=========================================================================================================================================================
Filters the output of ‘[wp\_calculate\_image\_sizes()](../functions/wp_calculate_image_sizes) ’.
`$sizes` string A source size value for use in a `'sizes'` attribute. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). `$image_src` string|null The URL to the image file or null. `$image_meta` array|null The image meta data as returned by [wp\_get\_attachment\_metadata()](../functions/wp_get_attachment_metadata) or null. `$attachment_id` int Image attachment ID of the original image or 0. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_calculate_image_sizes', $sizes, $size, $image_src, $image_meta, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_calculate\_image\_sizes()](../functions/wp_calculate_image_sizes) wp-includes/media.php | Creates a ‘sizes’ attribute value for an image. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_die_jsonp_handler', callable $callback ) apply\_filters( 'wp\_die\_jsonp\_handler', callable $callback )
===============================================================
Filters the callback for killing WordPress execution for JSONP REST requests.
`$callback` callable Callback function name. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$callback = apply_filters( 'wp_die_jsonp_handler', '_jsonp_wp_die_handler' );
```
| Used By | Description |
| --- | --- |
| [wp\_die()](../functions/wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'get_users_drafts', string $query ) apply\_filters( 'get\_users\_drafts', string $query )
=====================================================
Filters the user’s drafts query string.
`$query` string The user's drafts query string. File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
$query = apply_filters( 'get_users_drafts', $query );
```
| Used By | Description |
| --- | --- |
| [get\_users\_drafts()](../functions/get_users_drafts) wp-admin/includes/user.php | Retrieve the user’s drafts. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'pingback_ping_source_uri', string $pagelinkedfrom, string $pagelinkedto ) apply\_filters( 'pingback\_ping\_source\_uri', string $pagelinkedfrom, string $pagelinkedto )
=============================================================================================
Filters the pingback source URI.
`$pagelinkedfrom` string URI of the page linked from. `$pagelinkedto` string URI of the page linked to. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
$pagelinkedfrom = apply_filters( 'pingback_ping_source_uri', $pagelinkedfrom, $pagelinkedto );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::pingback\_ping()](../classes/wp_xmlrpc_server/pingback_ping) wp-includes/class-wp-xmlrpc-server.php | Retrieves a pingback and registers it. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress do_action_ref_array( 'wp_default_styles', WP_Styles $wp_styles ) do\_action\_ref\_array( 'wp\_default\_styles', WP\_Styles $wp\_styles )
=======================================================================
Fires when the [WP\_Styles](../classes/wp_styles) instance is initialized.
`$wp_styles` [WP\_Styles](../classes/wp_styles) [WP\_Styles](../classes/wp_styles) instance (passed by reference). File: `wp-includes/class-wp-styles.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes_class-wp-styles-php-2/)
```
do_action_ref_array( 'wp_default_styles', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Styles::\_\_construct()](../classes/wp_styles/__construct) wp-includes/class-wp-styles.php | Constructor. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'wp_count_posts', stdClass $counts, string $type, string $perm ) apply\_filters( 'wp\_count\_posts', stdClass $counts, string $type, string $perm )
==================================================================================
Modifies returned post counts by status for the current post type.
`$counts` stdClass An object containing the current post\_type's post counts by status. `$type` string Post type. `$perm` string The permission to determine if the posts are `'readable'` by the current user. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'wp_count_posts', $counts, $type, $perm );
```
| Used By | Description |
| --- | --- |
| [wp\_count\_posts()](../functions/wp_count_posts) wp-includes/post.php | Counts number of posts of a post type and if user has permissions to view. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'oembed_ttl', int $time, string $url, array $attr, int $post_ID ) apply\_filters( 'oembed\_ttl', int $time, string $url, array $attr, int $post\_ID )
===================================================================================
Filters the oEmbed TTL value (time to live).
`$time` int Time to live (in seconds). `$url` string The attempted embed URL. `$attr` array An array of shortcode attributes. `$post_ID` int Post ID. File: `wp-includes/class-wp-embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-embed.php/)
```
$ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_ID );
```
| Used By | Description |
| --- | --- |
| [WP\_Embed::shortcode()](../classes/wp_embed/shortcode) wp-includes/class-wp-embed.php | The [do\_shortcode()](../functions/do_shortcode) callback function. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress do_action( 'edit_term_taxonomy', int $tt_id, string $taxonomy, array $args ) do\_action( 'edit\_term\_taxonomy', int $tt\_id, string $taxonomy, array $args )
================================================================================
Fires immediate before a term-taxonomy relationship is updated.
`$tt_id` int Term taxonomy ID. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'edit_term_taxonomy', $tt_id, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [\_update\_post\_term\_count()](../functions/_update_post_term_count) wp-includes/taxonomy.php | Updates term count based on object types of the current taxonomy. |
| [\_update\_generic\_term\_count()](../functions/_update_generic_term_count) wp-includes/taxonomy.php | Updates term count based on number of objects. |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'lostpassword_user_data', WP_User|false $user_data, WP_Error $errors ) apply\_filters( 'lostpassword\_user\_data', WP\_User|false $user\_data, WP\_Error $errors )
===========================================================================================
Filters the user data during a password reset request.
Allows, for example, custom validation using data other than username or email address.
`$user_data` [WP\_User](../classes/wp_user)|false [WP\_User](../classes/wp_user) object if found, false if the user does not exist. `$errors` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object containing any errors generated by using invalid credentials. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$user_data = apply_filters( 'lostpassword_user_data', $user_data, $errors );
```
| Used By | Description |
| --- | --- |
| [retrieve\_password()](../functions/retrieve_password) wp-includes/user.php | Handles sending a password retrieval email to a user. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'user_request_action_description', string $description, string $action_name ) apply\_filters( 'user\_request\_action\_description', string $description, string $action\_name )
=================================================================================================
Filters the user action description.
`$description` string The default description. `$action_name` string The name of the request. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'user_request_action_description', $description, $action_name );
```
| Used By | Description |
| --- | --- |
| [wp\_user\_request\_action\_description()](../functions/wp_user_request_action_description) wp-includes/user.php | Gets action description from the name and return a string. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'getarchives_where', string $sql_where, array $parsed_args ) apply\_filters( 'getarchives\_where', string $sql\_where, array $parsed\_args )
===============================================================================
Filters the SQL WHERE clause for retrieving archives.
`$sql_where` string Portion of SQL query containing the WHERE clause. `$parsed_args` array An array of default arguments. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$where = apply_filters( 'getarchives_where', $sql_where, $parsed_args );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_archives()](../functions/wp_get_archives) wp-includes/general-template.php | Displays archive links based on type and format. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action( 'custom_header_options' ) do\_action( 'custom\_header\_options' )
=======================================
Fires just before the submit button in the custom header options form.
File: `wp-admin/includes/class-custom-image-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-custom-image-header.php/)
```
do_action( 'custom_header_options' );
```
| Used By | Description |
| --- | --- |
| [Custom\_Image\_Header::step\_1()](../classes/custom_image_header/step_1) wp-admin/includes/class-custom-image-header.php | Display first step of custom header image page. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'image_get_intermediate_size', array $data, int $post_id, string|int[] $size ) apply\_filters( 'image\_get\_intermediate\_size', array $data, int $post\_id, string|int[] $size )
==================================================================================================
Filters the output of [image\_get\_intermediate\_size()](../functions/image_get_intermediate_size)
* [image\_get\_intermediate\_size()](../functions/image_get_intermediate_size)
`$data` array Array of file relative path, width, and height on success. May also include file absolute path and URL. `$post_id` int The ID of the image attachment. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size );
```
| Used By | Description |
| --- | --- |
| [image\_get\_intermediate\_size()](../functions/image_get_intermediate_size) wp-includes/media.php | Retrieves the image’s intermediate size (resized) path, width, and height. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( "added_{$meta_type}_meta", int $mid, int $object_id, string $meta_key, mixed $_meta_value ) do\_action( "added\_{$meta\_type}\_meta", int $mid, int $object\_id, string $meta\_key, mixed $\_meta\_value )
==============================================================================================================
Fires immediately after meta of a specific type is added.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Possible hook names include:
* `added_post_meta`
* `added_comment_meta`
* `added_term_meta`
* `added_user_meta`
`$mid` int The meta ID after successful update. `$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$_meta_value` mixed Metadata value. This hook is called at the end of [add\_metadata()](../functions/add_metadata) function.
File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value );
```
| Used By | Description |
| --- | --- |
| [add\_metadata()](../functions/add_metadata) wp-includes/meta.php | Adds metadata for the specified object. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'make_spam_blog', int $site_id ) do\_action( 'make\_spam\_blog', int $site\_id )
===============================================
Fires when the ‘spam’ status is added to a site.
`$site_id` int Site ID. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'make_spam_blog', $site_id );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_transition\_site\_statuses\_on\_update()](../functions/wp_maybe_transition_site_statuses_on_update) wp-includes/ms-site.php | Triggers actions on site status updates. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'get_categories_taxonomy', string $taxonomy, array $args ) apply\_filters( 'get\_categories\_taxonomy', string $taxonomy, array $args )
============================================================================
Filters the taxonomy used to retrieve terms when calling [get\_categories()](../functions/get_categories) .
`$taxonomy` string Taxonomy to retrieve terms from. `$args` array An array of arguments. See [get\_terms()](../functions/get_terms) . More Arguments from get\_terms( ... $args ) Array or query string of term query parameters.
* `taxonomy`string|string[]Taxonomy name, or array of taxonomy names, to which results should be limited.
* `object_ids`int|int[]Object ID, or array of object IDs. Results will be limited to terms associated with these objects.
* `orderby`stringField(s) to order terms by. Accepts:
+ Term fields (`'name'`, `'slug'`, `'term_group'`, `'term_id'`, `'id'`, `'description'`, `'parent'`, `'term_order'`). Unless `$object_ids` is not empty, `'term_order'` is treated the same as `'term_id'`.
+ `'count'` to use the number of objects associated with the term.
+ `'include'` to match the `'order'` of the `$include` param.
+ `'slug__in'` to match the `'order'` of the `$slug` param.
+ `'meta_value'`
+ `'meta_value_num'`.
+ The value of `$meta_key`.
+ The array keys of `$meta_query`.
+ `'none'` to omit the ORDER BY clause. Default `'name'`.
* `order`stringWhether to order terms in ascending or descending order.
Accepts `'ASC'` (ascending) or `'DESC'` (descending).
Default `'ASC'`.
* `hide_empty`bool|intWhether to hide terms not assigned to any posts. Accepts `1|true` or `0|false`. Default `1|true`.
* `include`int[]|stringArray or comma/space-separated string of term IDs to include.
Default empty array.
* `exclude`int[]|stringArray or comma/space-separated string of term IDs to exclude.
If `$include` is non-empty, `$exclude` is ignored.
Default empty array.
* `exclude_tree`int[]|stringArray or comma/space-separated string of term IDs to exclude along with all of their descendant terms. If `$include` is non-empty, `$exclude_tree` is ignored. Default empty array.
* `number`int|stringMaximum number of terms to return. Accepts ``''`|0` (all) or any positive number. Default ``''`|0` (all). Note that `$number` may not return accurate results when coupled with `$object_ids`.
See #41796 for details.
* `offset`intThe number by which to offset the terms query.
* `fields`stringTerm fields to query for. Accepts:
+ `'all'` Returns an array of complete term objects (`WP_Term[]`).
+ `'all_with_object_id'` Returns an array of term objects with the `'object_id'` param (`WP_Term[]`). Works only when the `$object_ids` parameter is populated.
+ `'ids'` Returns an array of term IDs (`int[]`).
+ `'tt_ids'` Returns an array of term taxonomy IDs (`int[]`).
+ `'names'` Returns an array of term names (`string[]`).
+ `'slugs'` Returns an array of term slugs (`string[]`).
+ `'count'` Returns the number of matching terms (`int`).
+ `'id=>parent'` Returns an associative array of parent term IDs, keyed by term ID (`int[]`).
+ `'id=>name'` Returns an associative array of term names, keyed by term ID (`string[]`).
+ `'id=>slug'` Returns an associative array of term slugs, keyed by term ID (`string[]`). Default `'all'`.
* `count`boolWhether to return a term count. If true, will take precedence over `$fields`. Default false.
* `name`string|string[]Name or array of names to return term(s) for.
* `slug`string|string[]Slug or array of slugs to return term(s) for.
* `term_taxonomy_id`int|int[]Term taxonomy ID, or array of term taxonomy IDs, to match when querying terms.
* `hierarchical`boolWhether to include terms that have non-empty descendants (even if `$hide_empty` is set to true). Default true.
* `search`stringSearch criteria to match terms. Will be SQL-formatted with wildcards before and after.
* `name__like`stringRetrieve terms with criteria by which a term is LIKE `$name__like`.
* `description__like`stringRetrieve terms where the description is LIKE `$description__like`.
* `pad_counts`boolWhether to pad the quantity of a term's children in the quantity of each term's "count" object variable. Default false.
* `get`stringWhether to return terms regardless of ancestry or whether the terms are empty. Accepts `'all'` or `''` (disabled). Default `''`.
* `child_of`intTerm ID to retrieve child terms of. If multiple taxonomies are passed, `$child_of` is ignored. Default 0.
* `parent`intParent term ID to retrieve direct-child terms of.
* `childless`boolTrue to limit results to terms that have no children.
This parameter has no effect on non-hierarchical taxonomies.
Default false.
* `cache_domain`stringUnique cache key to be produced when this query is stored in an object cache. Default `'core'`.
* `update_term_meta_cache`boolWhether to prime meta caches for matched terms. Default true.
* `meta_key`string|string[]Meta key or keys to filter by.
* `meta_value`string|string[]Meta value or values to filter by.
* `meta_compare`stringMySQL operator used for comparing the meta value.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_compare_key`stringMySQL operator used for comparing the meta key.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type`stringMySQL data type that the meta\_value column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_type_key`stringMySQL data type that the meta\_key column will be CAST to for comparisons.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values and default value.
* `meta_query`arrayAn associative array of [WP\_Meta\_Query](../classes/wp_meta_query) arguments.
See [WP\_Meta\_Query::\_\_construct()](../classes/wp_meta_query/__construct) for accepted values.
File: `wp-includes/category.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category.php/)
```
$args['taxonomy'] = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args );
```
| Used By | Description |
| --- | --- |
| [get\_categories()](../functions/get_categories) wp-includes/category.php | Retrieves a list of category objects. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( "admin_print_scripts-{$hook_suffix}" ) do\_action( "admin\_print\_scripts-{$hook\_suffix}" )
=====================================================
Fires when scripts are printed for a specific admin page based on $hook\_suffix.
File: `wp-admin/admin-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-header.php/)
```
do_action( "admin_print_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [iframe\_header()](../functions/iframe_header) wp-admin/includes/template.php | Generic Iframe header for use with Thickbox. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_image_maybe_exif_rotate', int $orientation, string $file ) apply\_filters( 'wp\_image\_maybe\_exif\_rotate', int $orientation, string $file )
==================================================================================
Filters the `$orientation` value to correct it before rotating or to prevent rotating the image.
`$orientation` int EXIF Orientation value as retrieved from the image file. `$file` string Path to the image file. File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
$orientation = apply_filters( 'wp_image_maybe_exif_rotate', $orientation, $this->file );
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor::maybe\_exif\_rotate()](../classes/wp_image_editor/maybe_exif_rotate) wp-includes/class-wp-image-editor.php | Check if a JPEG image has EXIF Orientation tag and rotate it if needed. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress do_action_ref_array( 'wp', WP $wp ) do\_action\_ref\_array( 'wp', WP $wp )
======================================
Fires once the WordPress environment has been set up.
`$wp` WP Current WordPress environment instance (passed by reference). The $wp object is passed to the hooked function as a reference (no return is necessary).
This hook is one effective place to perform any high-level filtering or validation, following queries, but before WordPress does any routing, processing, or handling. It is run in the [main()](../classes/wp/main) WP method in which the $query\_args are passed to [parse\_request()](../classes/wp/parse_request), as well as when [send\_headers()](../classes/wp/send_headers) , [query\_posts()](../functions/query_posts) , [handle\_404()](../classes/wp/handle_404), and [register\_globals()](../classes/wp/register_globals) are setup.
File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
do_action_ref_array( 'wp', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP::main()](../classes/wp/main) wp-includes/class-wp.php | Sets up all of the variables required by the WordPress environment. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'attribute_escape', string $safe_text, string $text ) apply\_filters( 'attribute\_escape', string $safe\_text, string $text )
=======================================================================
Filters a string cleaned and escaped for output in an HTML attribute.
Text passed to [esc\_attr()](../functions/esc_attr) is stripped of invalid or special characters before output.
`$safe_text` string The text after it has been escaped. `$text` string The text prior to being escaped. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'attribute_escape', $safe_text, $text );
```
| Used By | Description |
| --- | --- |
| [esc\_attr()](../functions/esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| Version | Description |
| --- | --- |
| [2.0.6](https://developer.wordpress.org/reference/since/2.0.6/) | Introduced. |
wordpress apply_filters( 'pre_user_id', int $user_id ) apply\_filters( 'pre\_user\_id', int $user\_id )
================================================
Filters the comment author’s user ID before it is set.
The first time this filter is evaluated, `user_ID` is checked (for back-compat), followed by the standard `user_id` value.
`$user_id` int The comment author's user ID. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$commentdata['user_id'] = apply_filters( 'pre_user_id', $commentdata['user_ID'] );
```
| Used By | Description |
| --- | --- |
| [wp\_filter\_comment()](../functions/wp_filter_comment) wp-includes/comment.php | Filters and sanitizes comment data. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'pre_get_block_templates', WP_Block_Template[]|null $block_templates, array $query, string $template_type ) apply\_filters( 'pre\_get\_block\_templates', WP\_Block\_Template[]|null $block\_templates, array $query, string $template\_type )
==================================================================================================================================
Filters the block templates array before the query takes place.
Return a non-null value to bypass the WordPress queries.
`$block_templates` [WP\_Block\_Template](../classes/wp_block_template)[]|null Return an array of block templates to short-circuit the default query, or null to allow WP to run it's normal queries. `$query` array Arguments to retrieve templates.
* `slug__in`arrayList of slugs to include.
* `wp_id`intPost ID of customized template.
* `post_type`stringPost type to get the templates for.
`$template_type` string wp\_template or wp\_template\_part. File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
$templates = apply_filters( 'pre_get_block_templates', null, $query, $template_type );
```
| Used By | Description |
| --- | --- |
| [get\_block\_templates()](../functions/get_block_templates) wp-includes/block-template-utils.php | Retrieves a list of unified template objects based on a query. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'minimum_site_name_length', int $length ) apply\_filters( 'minimum\_site\_name\_length', int $length )
============================================================
Filters the minimum site name length required when validating a site signup.
`$length` int The minimum site name length. Default 4. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$minimum_site_name_length = apply_filters( 'minimum_site_name_length', 4 );
```
| Used By | Description |
| --- | --- |
| [wpmu\_validate\_blog\_signup()](../functions/wpmu_validate_blog_signup) wp-includes/ms-functions.php | Processes new site registrations. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( "get_object_subtype_{$object_type}", string $object_subtype, int $object_id ) apply\_filters( "get\_object\_subtype\_{$object\_type}", string $object\_subtype, int $object\_id )
===================================================================================================
Filters the object subtype identifier for a non-standard object type.
The dynamic portion of the hook name, `$object_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Possible hook names include:
* `get_object_subtype_post`
* `get_object_subtype_comment`
* `get_object_subtype_term`
* `get_object_subtype_user`
`$object_subtype` string Empty string to override. `$object_id` int ID of the object to get the subtype for. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
return apply_filters( "get_object_subtype_{$object_type}", $object_subtype, $object_id );
```
| Used By | Description |
| --- | --- |
| [get\_object\_subtype()](../functions/get_object_subtype) wp-includes/meta.php | Returns the object subtype for a given object ID of a specific type. |
| Version | Description |
| --- | --- |
| [4.9.8](https://developer.wordpress.org/reference/since/4.9.8/) | Introduced. |
wordpress apply_filters( 'wpmu_delete_blog_upload_dir', string $basedir, int $site_id ) apply\_filters( 'wpmu\_delete\_blog\_upload\_dir', string $basedir, int $site\_id )
===================================================================================
Filters the upload base directory to delete when the site is deleted.
`$basedir` string Uploads path without subdirectory. @see [wp\_upload\_dir()](../functions/wp_upload_dir) `$site_id` int The site ID. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
$dir = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $site->id );
```
| Used By | Description |
| --- | --- |
| [wp\_uninitialize\_site()](../functions/wp_uninitialize_site) wp-includes/ms-site.php | Runs the uninitialization routine for a given site. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'comment_notification_recipients', string[] $emails, string $comment_id ) apply\_filters( 'comment\_notification\_recipients', string[] $emails, string $comment\_id )
============================================================================================
Filters the list of email addresses to receive a comment notification.
By default, only post authors are notified of comments. This filter allows others to be added.
`$emails` string[] An array of email addresses to receive a comment notification. `$comment_id` string The comment ID as a numeric string. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );
```
| Used By | Description |
| --- | --- |
| [wp\_notify\_postauthor()](../functions/wp_notify_postauthor) wp-includes/pluggable.php | Notifies an author (and/or others) of a comment/trackback/pingback on a post. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'privacy_on_link_title', string $title ) apply\_filters( 'privacy\_on\_link\_title', string $title )
===========================================================
Filters the link title attribute for the ‘Search engines discouraged’ message displayed in the ‘At a Glance’ dashboard widget.
Prior to 3.8.0, the widget was named ‘Right Now’.
`$title` string Default attribute text. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
$title = apply_filters( 'privacy_on_link_title', '' );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_right\_now()](../functions/wp_dashboard_right_now) wp-admin/includes/dashboard.php | Dashboard widget that displays some basic stats about the site. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The default for `$title` was updated to an empty string. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'widget_pages_args', array $args, array $instance ) apply\_filters( 'widget\_pages\_args', array $args, array $instance )
=====================================================================
Filters the arguments for the Pages widget.
* [wp\_list\_pages()](../functions/wp_list_pages)
`$args` array An array of arguments to retrieve the pages list. `$instance` array Array of settings for the current widget. File: `wp-includes/widgets/class-wp-widget-pages.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-pages.php/)
```
apply_filters(
'widget_pages_args',
array(
'title_li' => '',
'echo' => 0,
'sort_column' => $sortby,
'exclude' => $exclude,
),
$instance
)
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Pages::widget()](../classes/wp_widget_pages/widget) wp-includes/widgets/class-wp-widget-pages.php | Outputs the content for the current Pages widget instance. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_default_post_fields', array $fields, string $method ) apply\_filters( 'xmlrpc\_default\_post\_fields', array $fields, string $method )
================================================================================
Filters the list of post query fields used by the given XML-RPC method.
`$fields` array Array of post fields. Default array contains `'post'`, `'terms'`, and `'custom_fields'`. `$method` string Method name. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
$fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPost' );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_getPosts()](../classes/wp_xmlrpc_server/wp_getposts) wp-includes/class-wp-xmlrpc-server.php | Retrieve posts. |
| [wp\_xmlrpc\_server::wp\_getPost()](../classes/wp_xmlrpc_server/wp_getpost) wp-includes/class-wp-xmlrpc-server.php | Retrieve a post. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'got_url_rewrite', bool $got_url_rewrite ) apply\_filters( 'got\_url\_rewrite', bool $got\_url\_rewrite )
==============================================================
Filters whether URL rewriting is available.
`$got_url_rewrite` bool Whether URL rewriting is available. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
return apply_filters( 'got_url_rewrite', $got_url_rewrite );
```
| Used By | Description |
| --- | --- |
| [got\_url\_rewrite()](../functions/got_url_rewrite) wp-admin/includes/misc.php | Returns whether the server supports URL rewriting. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress do_action( 'wp_insert_comment', int $id, WP_Comment $comment ) do\_action( 'wp\_insert\_comment', int $id, WP\_Comment $comment )
==================================================================
Fires immediately after a comment is inserted into the database.
`$id` int The comment ID. `$comment` [WP\_Comment](../classes/wp_comment) Comment object. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'wp_insert_comment', $id, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_comment()](../functions/wp_insert_comment) wp-includes/comment.php | Inserts a comment into the database. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_enabled', bool $is_enabled ) apply\_filters( 'wp\_sitemaps\_enabled', bool $is\_enabled )
============================================================
Filters whether XML Sitemaps are enabled or not.
When XML Sitemaps are disabled via this filter, rewrite rules are still in place to ensure a 404 is returned.
* [WP\_Sitemaps::register\_rewrites()](../classes/wp_sitemaps/register_rewrites)
`$is_enabled` bool Whether XML Sitemaps are enabled or not. Defaults to true for public sites. File: `wp-includes/sitemaps/class-wp-sitemaps.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/class-wp-sitemaps.php/)
```
return (bool) apply_filters( 'wp_sitemaps_enabled', $is_enabled );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps::sitemaps\_enabled()](../classes/wp_sitemaps/sitemaps_enabled) wp-includes/sitemaps/class-wp-sitemaps.php | Determines whether sitemaps are enabled or not. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( "customize_preview_{$this->type}", WP_Customize_Setting $setting ) do\_action( "customize\_preview\_{$this->type}", WP\_Customize\_Setting $setting )
==================================================================================
Fires when the [WP\_Customize\_Setting::preview()](../classes/wp_customize_setting/preview) method is called for settings not handled as theme\_mods or options.
The dynamic portion of the hook name, `$this->type`, refers to the setting type.
`$setting` [WP\_Customize\_Setting](../classes/wp_customize_setting) [WP\_Customize\_Setting](../classes/wp_customize_setting) instance. File: `wp-includes/class-wp-customize-setting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-setting.php/)
```
do_action( "customize_preview_{$this->type}", $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Setting::preview()](../classes/wp_customize_setting/preview) wp-includes/class-wp-customize-setting.php | Add filters to supply the setting’s value when accessed. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'get_edit_bookmark_link', string $location, int $link_id ) apply\_filters( 'get\_edit\_bookmark\_link', string $location, int $link\_id )
==============================================================================
Filters the bookmark edit link.
`$location` string The edit link. `$link_id` int Bookmark ID. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'get_edit_bookmark_link', $location, $link->link_id );
```
| Used By | Description |
| --- | --- |
| [get\_edit\_bookmark\_link()](../functions/get_edit_bookmark_link) wp-includes/link-template.php | Displays the edit bookmark link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'wp_enqueue_editor', array $to_load ) do\_action( 'wp\_enqueue\_editor', array $to\_load )
====================================================
Fires when scripts and styles are enqueued for the editor.
`$to_load` array An array containing boolean values whether TinyMCE and Quicktags are being loaded. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
do_action(
'wp_enqueue_editor',
array(
'tinymce' => ( $default_scripts || self::$has_tinymce ),
'quicktags' => ( $default_scripts || self::$has_quicktags ),
)
);
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::enqueue\_scripts()](../classes/_wp_editors/enqueue_scripts) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'feed_content_type', string $content_type, string $type ) apply\_filters( 'feed\_content\_type', string $content\_type, string $type )
============================================================================
Filters the content type for a specific feed type.
`$content_type` string Content type indicating the type of data that a feed contains. `$type` string Type of feed. Possible values include `'rss'`, rss2', `'atom'`, and `'rdf'`. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
return apply_filters( 'feed_content_type', $content_type, $type );
```
| Used By | Description |
| --- | --- |
| [feed\_content\_type()](../functions/feed_content_type) wp-includes/feed.php | Returns the content type for specified feed type. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_update_comment_data', array|WP_Error $data, array $comment, array $commentarr ) apply\_filters( 'wp\_update\_comment\_data', array|WP\_Error $data, array $comment, array $commentarr )
=======================================================================================================
Filters the comment data immediately before it is updated in the database.
Note: data being passed to the filter is already unslashed.
`$data` array|[WP\_Error](../classes/wp_error) The new, processed comment data, or [WP\_Error](../classes/wp_error). `$comment` array The old, unslashed comment data. `$commentarr` array The new, raw comment data. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$data = apply_filters( 'wp_update_comment_data', $data, $comment, $commentarr );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_comment()](../functions/wp_update_comment) wp-includes/comment.php | Updates an existing comment in the database. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Returning a [WP\_Error](../classes/wp_error) value from the filter will short-circuit comment update and allow skipping further processing. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'media_upload_tabs', string[] $_default_tabs ) apply\_filters( 'media\_upload\_tabs', string[] $\_default\_tabs )
==================================================================
Filters the available tabs in the legacy (pre-3.5.0) media popup.
`$_default_tabs` string[] An array of media tabs. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
return apply_filters( 'media_upload_tabs', $_default_tabs );
```
| Used By | Description |
| --- | --- |
| [media\_upload\_tabs()](../functions/media_upload_tabs) wp-admin/includes/media.php | Defines the default media upload tabs. |
| [wp\_enqueue\_media()](../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( "delete_{$meta_type}_metadata", null|bool $delete, int $object_id, string $meta_key, mixed $meta_value, bool $delete_all ) apply\_filters( "delete\_{$meta\_type}\_metadata", null|bool $delete, int $object\_id, string $meta\_key, mixed $meta\_value, bool $delete\_all )
=================================================================================================================================================
Short-circuits deleting metadata of a specific type.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
* `delete_post_metadata`
* `delete_comment_metadata`
* `delete_term_metadata`
* `delete_user_metadata`
`$delete` null|bool Whether to allow metadata deletion of the given type. `$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$meta_value` mixed Metadata value. Must be serializable if non-scalar. `$delete_all` bool Whether to delete the matching metadata entries for all objects, ignoring the specified $object\_id.
Default false. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
$check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all );
```
| Used By | Description |
| --- | --- |
| [delete\_metadata()](../functions/delete_metadata) wp-includes/meta.php | Deletes metadata for the specified object. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'oembed_endpoint_url', string $url, string $permalink, string $format ) apply\_filters( 'oembed\_endpoint\_url', string $url, string $permalink, string $format )
=========================================================================================
Filters the oEmbed endpoint URL.
`$url` string The URL to the oEmbed endpoint. `$permalink` string The permalink used for the `url` query arg. `$format` string The requested response format. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
return apply_filters( 'oembed_endpoint_url', $url, $permalink, $format );
```
| Used By | Description |
| --- | --- |
| [get\_oembed\_endpoint\_url()](../functions/get_oembed_endpoint_url) wp-includes/embed.php | Retrieves the oEmbed endpoint URL for a given permalink. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'revoked_super_admin', int $user_id ) do\_action( 'revoked\_super\_admin', int $user\_id )
====================================================
Fires after the user’s Super Admin privileges are revoked.
`$user_id` int ID of the user Super Admin privileges were revoked from. File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
do_action( 'revoked_super_admin', $user_id );
```
| Used By | Description |
| --- | --- |
| [revoke\_super\_admin()](../functions/revoke_super_admin) wp-includes/capabilities.php | Revokes Super Admin privileges. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'post_mime_types', array $post_mime_types ) apply\_filters( 'post\_mime\_types', array $post\_mime\_types )
===============================================================
Filters the default list of post mime types.
`$post_mime_types` array Default list of post mime types. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'post_mime_types', $post_mime_types );
```
| Used By | Description |
| --- | --- |
| [get\_post\_mime\_types()](../functions/get_post_mime_types) wp-includes/post.php | Gets default post mime types. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'locale_stylesheet_uri', string $stylesheet_uri, string $stylesheet_dir_uri ) apply\_filters( 'locale\_stylesheet\_uri', string $stylesheet\_uri, string $stylesheet\_dir\_uri )
==================================================================================================
Filters the localized stylesheet URI.
`$stylesheet_uri` string Localized stylesheet URI. `$stylesheet_dir_uri` string Stylesheet directory URI. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'locale_stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );
```
| Used By | Description |
| --- | --- |
| [get\_locale\_stylesheet\_uri()](../functions/get_locale_stylesheet_uri) wp-includes/theme.php | Retrieves the localized stylesheet URI. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'allowed_themes', string[] $allowed_themes ) apply\_filters( 'allowed\_themes', string[] $allowed\_themes )
==============================================================
Filters the array of themes allowed on the network.
`$allowed_themes` string[] An array of theme stylesheet names. File: `wp-includes/class-wp-theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme.php/)
```
$allowed_themes = apply_filters( 'allowed_themes', $allowed_themes );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme::get\_allowed\_on\_network()](../classes/wp_theme/get_allowed_on_network) wp-includes/class-wp-theme.php | Returns array of stylesheet names of themes allowed on the network. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'the_terms', string $term_list, string $taxonomy, string $before, string $sep, string $after ) apply\_filters( 'the\_terms', string $term\_list, string $taxonomy, string $before, string $sep, string $after )
================================================================================================================
Filters the list of terms to display.
`$term_list` string List of terms to display. `$taxonomy` string The taxonomy name. `$before` string String to use before the terms. `$sep` string String to use between the terms. `$after` string String to use after the terms. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
echo apply_filters( 'the_terms', $term_list, $taxonomy, $before, $sep, $after );
```
| Used By | Description |
| --- | --- |
| [the\_terms()](../functions/the_terms) wp-includes/category-template.php | Displays the terms for a post in a list. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'rest_preprocess_comment', array $prepared_comment, WP_REST_Request $request ) apply\_filters( 'rest\_preprocess\_comment', array $prepared\_comment, WP\_REST\_Request $request )
===================================================================================================
Filters a comment added via the REST API after it is prepared for insertion into the database.
Allows modification of the comment right after it is prepared for the database.
`$prepared_comment` array The prepared comment data for `wp_insert_comment`. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The current request. File: `wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php/)
```
return apply_filters( 'rest_preprocess_comment', $prepared_comment, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::prepare\_item\_for\_database()](../classes/wp_rest_comments_controller/prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Prepares a single comment to be inserted into the database. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'wp_signature_softfail', bool $signature_softfail, string $url ) apply\_filters( 'wp\_signature\_softfail', bool $signature\_softfail, string $url )
===================================================================================
Filters whether Signature Verification failures should be allowed to soft fail.
WARNING: This may be removed from a future release.
`$signature_softfail` bool If a softfail is allowed. `$url` string The url being accessed. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
apply_filters( 'wp_signature_softfail', true, $url )
```
| Used By | Description |
| --- | --- |
| [download\_url()](../functions/download_url) wp-admin/includes/file.php | Downloads a URL to a local temporary file using the WordPress HTTP API. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action( 'after_switch_theme', string $old_name, WP_Theme $old_theme ) do\_action( 'after\_switch\_theme', string $old\_name, WP\_Theme $old\_theme )
==============================================================================
Fires on the first WP load after a theme switch if the old theme still exists.
This action fires multiple times and the parameters differs according to the context, if the old theme exists or not.
If the old theme is missing, the parameter will be the slug of the old theme.
`$old_name` string Old theme name. `$old_theme` [WP\_Theme](../classes/wp_theme) [WP\_Theme](../classes/wp_theme) instance of the old theme. Callback functions attached to this hook are only triggered in the theme (and/or child theme) being activated. To do things when your theme is deactivated, use <switch_theme>.
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme );
```
| Used By | Description |
| --- | --- |
| [check\_theme\_switched()](../functions/check_theme_switched) wp-includes/theme.php | Checks if a theme has been changed and runs ‘after\_switch\_theme’ hook on the next WP load. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'page_attributes_dropdown_pages_args', array $dropdown_args, WP_Post $post ) apply\_filters( 'page\_attributes\_dropdown\_pages\_args', array $dropdown\_args, WP\_Post $post )
==================================================================================================
Filters the arguments used to generate a Pages drop-down element.
* [wp\_dropdown\_pages()](../functions/wp_dropdown_pages)
`$dropdown_args` array Array of arguments used to generate the pages drop-down. `$post` [WP\_Post](../classes/wp_post) The current post. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
$dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
```
| Used By | Description |
| --- | --- |
| [page\_attributes\_meta\_box()](../functions/page_attributes_meta_box) wp-admin/includes/meta-boxes.php | Displays page attributes form fields. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'revision_text_diff_options', array $args, string $field, WP_Post $compare_from, WP_Post $compare_to ) apply\_filters( 'revision\_text\_diff\_options', array $args, string $field, WP\_Post $compare\_from, WP\_Post $compare\_to )
=============================================================================================================================
Filters revisions text diff options.
Filters the options passed to [wp\_text\_diff()](../functions/wp_text_diff) when viewing a post revision.
`$args` array Associative array of options to pass to [wp\_text\_diff()](../functions/wp_text_diff) .
* `show_split_view`boolTrue for split view (two columns), false for un-split view (single column). Default true.
More Arguments from wp\_text\_diff( ... $args ) Associative array of options to pass to [WP\_Text\_Diff\_Renderer\_Table](../classes/wp_text_diff_renderer_table)().
* `title`stringTitles the diff in a manner compatible with the output. Default empty.
* `title_left`stringChange the HTML to the left of the title.
Default empty.
* `title_right`stringChange the HTML to the right of the title.
Default empty.
* `show_split_view`boolTrue for split view (two columns), false for un-split view (single column). Default true.
`$field` string The current revision field. `$compare_from` [WP\_Post](../classes/wp_post) The revision post to compare from. `$compare_to` [WP\_Post](../classes/wp_post) The revision post to compare to. File: `wp-admin/includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/revision.php/)
```
$args = apply_filters( 'revision_text_diff_options', $args, $field, $compare_from, $compare_to );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_revision\_ui\_diff()](../functions/wp_get_revision_ui_diff) wp-admin/includes/revision.php | Get the revision UI diff. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress do_action( 'admin_head' ) do\_action( 'admin\_head' )
===========================
Fires in head section for all admin pages.
The common usage is to include CSS (external via <link> or inline via <style>) or JS (external and inline via <script>).
File: `wp-admin/admin-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-header.php/)
```
do_action( 'admin_head' );
```
| Used By | Description |
| --- | --- |
| [iframe\_header()](../functions/iframe_header) wp-admin/includes/template.php | Generic Iframe header for use with Thickbox. |
| [wp\_iframe()](../functions/wp_iframe) wp-admin/includes/media.php | Outputs the iframe to display the media upload page. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'mce_buttons_2', array $mce_buttons_2, string $editor_id ) apply\_filters( 'mce\_buttons\_2', array $mce\_buttons\_2, string $editor\_id )
===============================================================================
Filters the second-row list of TinyMCE buttons (Visual tab).
`$mce_buttons_2` array Second-row list of buttons. `$editor_id` string Unique editor identifier, e.g. `'content'`. Accepts `'classic-block'` when called from block editor's Classic block. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mce_buttons_2 = apply_filters( 'mce_buttons_2', $mce_buttons_2, $editor_id );
```
| Used By | Description |
| --- | --- |
| [wp\_tinymce\_inline\_scripts()](../functions/wp_tinymce_inline_scripts) wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | The `$editor_id` parameter was added. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress do_action( 'customize_register', WP_Customize_Manager $manager ) do\_action( 'customize\_register', WP\_Customize\_Manager $manager )
====================================================================
Fires once WordPress has loaded, allowing scripts and styles to be initialized.
`$manager` [WP\_Customize\_Manager](../classes/wp_customize_manager) [WP\_Customize\_Manager](../classes/wp_customize_manager) instance. The ‘customize\_register‘ action hook is used to customize and manipulate the Theme Customization admin screen introduced in WordPress [Version 3.4](https://wordpress.org/support/wordpress-version/version-3-4/). This hook is a component of the [Theme Customization API](https://developer.wordpress.org/themes/customize-api/).
This hook gives you access to the $wp\_customize object, which is an instance of the [WP\_Customize\_Manager](../classes/wp_customize_manager) class. It is this class object that controls the Theme Customizer screen.
Generally, there are only 4 methods of the $wp\_customize object that you will need to interact with inside the customize\_register hook.
[WP\_Customize\_Manager::add\_setting()](../classes/wp_customize_manager/add_setting) *This adds a new setting to the database.* [WP\_Customize\_Manager::add\_section()](../classes/wp_customize_manager/add_section) This adds a new *section* (i.e. category/group) to the Theme Customizer page. [WP\_Customize\_Manager::add\_control()](../classes/wp_customize_manager/add_control) This creates an HTML control that admins can use to change settings. This is also where you choose a section for the control to appear in. [WP\_Customize\_Manager::get\_setting()](../classes/wp_customize_manager/get_setting) This can be used to fetch any existing setting, in the event you need to modify something (like one of WordPress’s default settings). **Example: Customizer with basic controls sample**
```
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'description' => '',
'priority' => 120,
));
// =============================
// = Text Input =
// =============================
$wp_customize->add_setting('themename_theme_options[text_test]', array(
'default' => 'value_xyz',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control('themename_text_test', array(
'label' => __('Text Test', 'themename'),
'section' => 'themename_color_scheme',
'settings' => 'themename_theme_options[text_test]',
));
// =============================
// = Radio Input =
// =============================
$wp_customize->add_setting('themename_theme_options[color_scheme]', array(
'default' => 'value2',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control('themename_color_scheme', array(
'label' => __('Color Scheme', 'themename'),
'section' => 'themename_color_scheme',
'settings' => 'themename_theme_options[color_scheme]',
'type' => 'radio',
'choices' => array(
'value1' => 'Choice 1',
'value2' => 'Choice 2',
'value3' => 'Choice 3',
),
));
// =============================
// = Checkbox =
// =============================
$wp_customize->add_setting('themename_theme_options[checkbox_test]', array(
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control('display_header_text', array(
'settings' => 'themename_theme_options[checkbox_test]',
'label' => __('Display Header Text'),
'section' => 'themename_color_scheme',
'type' => 'checkbox',
));
// =============================
// = Select Box =
// =============================
$wp_customize->add_setting('themename_theme_options[header_select]', array(
'default' => 'value2',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control( 'example_select_box', array(
'settings' => 'themename_theme_options[header_select]',
'label' => 'Select Something:',
'section' => 'themename_color_scheme',
'type' => 'select',
'choices' => array(
'value1' => 'Choice 1',
'value2' => 'Choice 2',
'value3' => 'Choice 3',
),
));
// =============================
// = Image Upload =
// =============================
$wp_customize->add_setting('themename_theme_options[image_upload_test]', array(
'default' => 'image.jpg',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'image_upload_test', array(
'label' => __('Image Upload Test', 'themename'),
'section' => 'themename_color_scheme',
'settings' => 'themename_theme_options[image_upload_test]',
)));
// =============================
// = File Upload =
// =============================
$wp_customize->add_setting('themename_theme_options[upload_test]', array(
'default' => 'arse',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control( new WP_Customize_Upload_Control($wp_customize, 'upload_test', array(
'label' => __('Upload Test', 'themename'),
'section' => 'themename_color_scheme',
'settings' => 'themename_theme_options[upload_test]',
)));
// =============================
// = Color Picker =
// =============================
$wp_customize->add_setting('themename_theme_options[link_color]', array(
'default' => '#000',
'sanitize_callback' => 'sanitize_hex_color',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'link_color', array(
'label' => __('Link Color', 'themename'),
'section' => 'themename_color_scheme',
'settings' => 'themename_theme_options[link_color]',
)));
// =============================
// = Page Dropdown =
// =============================
$wp_customize->add_setting('themename_theme_options[page_test]', array(
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control('themename_page_test', array(
'label' => __('Page Test', 'themename'),
'section' => 'themename_color_scheme',
'type' => 'dropdown-pages',
'settings' => 'themename_theme_options[page_test]',
));
// =====================
// = Category Dropdown =
// =====================
$categories = get_categories();
$cats = array();
$i = 0;
foreach($categories as $category){
if($i==0){
$default = $category->slug;
$i++;
}
$cats[$category->slug] = $category->name;
}
$wp_customize->add_setting('_s_f_slide_cat', array(
'default' => $default
));
$wp_customize->add_control( 'cat_select_box', array(
'settings' => '_s_f_slide_cat',
'label' => 'Select Category:',
'section' => '_s_f_home_slider',
'type' => 'select',
'choices' => $cats,
));
}
add_action('customize_register', 'themename_customize_register');
```
File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
do_action( 'customize_register', $this );
```
| Used By | Description |
| --- | --- |
| [\_wp\_customize\_publish\_changeset()](../functions/_wp_customize_publish_changeset) wp-includes/theme.php | Publishes a snapshot’s changes. |
| [WP\_Customize\_Manager::wp\_loaded()](../classes/wp_customize_manager/wp_loaded) wp-includes/class-wp-customize-manager.php | Registers styles/scripts and initialize the preview of each setting |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'browse-happy-notice', string $notice, array|false $response ) apply\_filters( 'browse-happy-notice', string $notice, array|false $response )
==============================================================================
Filters the notice output for the ‘Browse Happy’ nag meta box.
`$notice` string The notice content. `$response` array|false An array containing web browser information, or false on failure. See [wp\_check\_browser\_version()](../functions/wp_check_browser_version) . File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
echo apply_filters( 'browse-happy-notice', $notice, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_browser\_nag()](../functions/wp_dashboard_browser_nag) wp-admin/includes/dashboard.php | Displays the browser update nag. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'quicktags_settings', array $qtInit, string $editor_id ) apply\_filters( 'quicktags\_settings', array $qtInit, string $editor\_id )
==========================================================================
Filters the Quicktags settings.
`$qtInit` array Quicktags settings. `$editor_id` string Unique editor identifier, e.g. `'content'`. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'block_local_requests', bool $block ) apply\_filters( 'block\_local\_requests', bool $block )
=======================================================
Filters whether to block local HTTP API requests.
A local request is one to `localhost` or to the same host as the site itself.
`$block` bool Whether to block local requests. Default false. File: `wp-includes/class-wp-http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http.php/)
```
return apply_filters( 'block_local_requests', false );
```
| Used By | Description |
| --- | --- |
| [WP\_Http::block\_request()](../classes/wp_http/block_request) wp-includes/class-wp-http.php | Determines whether an HTTP API request to the given URL should be blocked. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'edit_terms', int $term_id, string $taxonomy, array $args ) do\_action( 'edit\_terms', int $term\_id, string $taxonomy, array $args )
=========================================================================
Fires immediately before the given terms are edited.
`$term_id` int Term ID. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
The `edit_terms` action is used to hook into code **before** a term is updated in the database.
A plugin (or theme) can register an action hook from the example below.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'edit_terms', $term_id, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_attachment', WP_REST_Response $response, WP_Post $post, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_attachment', WP\_REST\_Response $response, WP\_Post $post, WP\_REST\_Request $request )
=======================================================================================================================
Filters an attachment returned from the REST API.
Allows modification of the attachment right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$post` [WP\_Post](../classes/wp_post) The original attachment post. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php/)
```
return apply_filters( 'rest_prepare_attachment', $response, $post, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Attachments\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_attachments_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Prepares a single attachment output for response. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( "{$field_no_prefix}_save_pre", mixed $value ) apply\_filters( "{$field\_no\_prefix}\_save\_pre", mixed $value )
=================================================================
Filters the value of a specific field before saving.
The dynamic portion of the hook name, `$field_no_prefix`, refers to the post field name.
`$value` mixed Value of the post field. The filter callback function **must** return a post field value after it is finished processing or the content will be empty.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$value = apply_filters( "{$field_no_prefix}_save_pre", $value );
```
| Used By | Description |
| --- | --- |
| [sanitize\_post\_field()](../functions/sanitize_post_field) wp-includes/post.php | Sanitizes a post field based on context. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'document_title_separator', string $sep ) apply\_filters( 'document\_title\_separator', string $sep )
===========================================================
Filters the separator for the document title.
`$sep` string Document title separator. Default `'-'`. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$sep = apply_filters( 'document_title_separator', '-' );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_document\_title()](../functions/wp_get_document_title) wp-includes/general-template.php | Returns document title for the current page. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'post_submitbox_misc_actions', WP_Post $post ) do\_action( 'post\_submitbox\_misc\_actions', WP\_Post $post )
==============================================================
Fires after the post time/date setting in the Publish meta box.
`$post` [WP\_Post](../classes/wp_post) [WP\_Post](../classes/wp_post) object for the current post. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
do_action( 'post_submitbox_misc_actions', $post );
```
| Used By | Description |
| --- | --- |
| [post\_submit\_meta\_box()](../functions/post_submit_meta_box) wp-admin/includes/meta-boxes.php | Displays post submit form fields. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$post` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'media_library_show_audio_playlist', bool|null $show ) apply\_filters( 'media\_library\_show\_audio\_playlist', bool|null $show )
==========================================================================
Allows showing or hiding the “Create Audio Playlist” button in the media library.
By default, the "Create Audio Playlist" button will always be shown in the media library. If this filter returns `null`, a query will be run to determine whether the media library contains any audio items. This was the default behavior prior to version 4.8.0, but this query is expensive for large media libraries.
`$show` bool|null Whether to show the button, or `null` to decide based on whether any audio files exist in the media library. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$show_audio_playlist = apply_filters( 'media_library_show_audio_playlist', true );
```
| Used By | Description |
| --- | --- |
| [wp\_enqueue\_media()](../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | The filter's default value is `true` rather than `null`. |
| [4.7.4](https://developer.wordpress.org/reference/since/4.7.4/) | Introduced. |
wordpress apply_filters( 'rest_envelope_response', array $envelope, WP_REST_Response $response ) apply\_filters( 'rest\_envelope\_response', array $envelope, WP\_REST\_Response $response )
===========================================================================================
Filters the enveloped form of a REST API response.
`$envelope` array Envelope data.
* `body`arrayResponse data.
* `status`intThe 3-digit HTTP status code.
* `headers`arrayMap of header name to header value.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) Original response data. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
$envelope = apply_filters( 'rest_envelope_response', $envelope, $response );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::envelope\_response()](../classes/wp_rest_server/envelope_response) wp-includes/rest-api/class-wp-rest-server.php | Wraps the response in an envelope. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'blog_redirect_404', string $no_blog_redirect ) apply\_filters( 'blog\_redirect\_404', string $no\_blog\_redirect )
===================================================================
Filters the redirect URL for 404s on the main site.
The filter is only evaluated if the NOBLOGREDIRECT constant is defined.
`$no_blog_redirect` string The redirect URL defined in NOBLOGREDIRECT. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT );
```
| Used By | Description |
| --- | --- |
| [maybe\_redirect\_404()](../functions/maybe_redirect_404) wp-includes/ms-functions.php | Corrects 404 redirects when NOBLOGREDIRECT is defined. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'get_header', string|null $name, array $args ) do\_action( 'get\_header', string|null $name, array $args )
===========================================================
Fires before the header template file is loaded.
`$name` string|null Name of the specific header file to use. Null for the default header. `$args` array Additional arguments passed to the header template. `get_header` is a hook that gets run at the very start of the `get_header` function call. If you pass in the name for a specific header file into the function `get_header()`, like `get_header( 'new' )`, the `do_action` will pass in the same name as a parameter for the hook. This allows you to limit your `add_action` calls to specific templates if you wish. Actions added to this hook should be added to your functions.php file.
Note: This hook is best to use to set up and execute code that doesn’t get echoed to the browser until later in the page load. Anything you echo will show up before any of the markups is displayed.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'get_header', $name, $args );
```
| Used By | Description |
| --- | --- |
| [get\_header()](../functions/get_header) wp-includes/general-template.php | Loads header template. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$args` parameter was added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | The `$name` parameter was added. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_should_upgrade_global_tables', bool $should_upgrade ) apply\_filters( 'wp\_should\_upgrade\_global\_tables', bool $should\_upgrade )
==============================================================================
Filters if upgrade routines should be run on global tables.
`$should_upgrade` bool Whether to run the upgrade routines on global tables. File: `wp-admin/includes/upgrade.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/upgrade.php/)
```
return apply_filters( 'wp_should_upgrade_global_tables', $should_upgrade );
```
| Used By | Description |
| --- | --- |
| [wp\_should\_upgrade\_global\_tables()](../functions/wp_should_upgrade_global_tables) wp-admin/includes/upgrade.php | Determine if global tables should be upgraded. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'content_pagination', string[] $pages, WP_Post $post ) apply\_filters( 'content\_pagination', string[] $pages, WP\_Post $post )
========================================================================
Filters the “pages” derived from splitting the post content.
"Pages" are determined by splitting the post content based on the presence of `<!-- nextpage -->` tags.
`$pages` string[] Array of "pages" from the post content split by `<!-- nextpage -->` tags. `$post` [WP\_Post](../classes/wp_post) Current post object. File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$pages = apply_filters( 'content_pagination', $pages, $post );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::generate\_postdata()](../classes/wp_query/generate_postdata) wp-includes/class-wp-query.php | Generate post data. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'got_rewrite', bool $got_rewrite ) apply\_filters( 'got\_rewrite', bool $got\_rewrite )
====================================================
Filters whether Apache and mod\_rewrite are present.
This filter was previously used to force URL rewriting for other servers, like nginx. Use the [‘got\_url\_rewrite’](got_url_rewrite) filter in [got\_url\_rewrite()](../functions/got_url_rewrite) instead.
* [got\_url\_rewrite()](../functions/got_url_rewrite)
`$got_rewrite` bool Whether Apache and mod\_rewrite are present. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
return apply_filters( 'got_rewrite', $got_rewrite );
```
| Used By | Description |
| --- | --- |
| [got\_mod\_rewrite()](../functions/got_mod_rewrite) wp-admin/includes/misc.php | Returns whether the server is running Apache with the mod\_rewrite module loaded. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_admin_css', string $stylesheet_link, string $file ) apply\_filters( 'wp\_admin\_css', string $stylesheet\_link, string $file )
==========================================================================
Filters the stylesheet link to the specified CSS file.
If the site is set to display right-to-left, the RTL stylesheet link will be used instead.
`$stylesheet_link` string HTML link element for the stylesheet. `$file` string Style handle name or filename (without ".css" extension) relative to wp-admin/. Defaults to `'wp-admin'`. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
echo apply_filters( 'wp_admin_css', $stylesheet_link, $file );
```
| Used By | Description |
| --- | --- |
| [wp\_admin\_css()](../functions/wp_admin_css) wp-includes/general-template.php | Enqueues or directly prints a stylesheet link to the specified CSS file. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'the_generator', string $generator_type, string $type ) apply\_filters( 'the\_generator', string $generator\_type, string $type )
=========================================================================
Filters the output of the XHTML generator tag for display.
`$generator_type` string The generator output. `$type` string The type of generator to output. Accepts `'html'`, `'xhtml'`, `'atom'`, `'rss2'`, `'rdf'`, `'comment'`, `'export'`. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
echo apply_filters( 'the_generator', get_the_generator( $type ), $type ) . "\n";
```
| Used By | Description |
| --- | --- |
| [the\_generator()](../functions/the_generator) wp-includes/general-template.php | Displays the generator XML or Comment for RSS, ATOM, etc. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'get_sample_permalink', array $permalink, int $post_id, string $title, string $name, WP_Post $post ) apply\_filters( 'get\_sample\_permalink', array $permalink, int $post\_id, string $title, string $name, WP\_Post $post )
========================================================================================================================
Filters the sample permalink.
`$permalink` array Array containing the sample permalink with placeholder for the post name, and the post name.
* stringThe permalink with placeholder for the post name.
* `1`stringThe post name.
`$post_id` int Post ID. `$title` string Post title. `$name` string Post name (slug). `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
return apply_filters( 'get_sample_permalink', $permalink, $post->ID, $title, $name, $post );
```
| Used By | Description |
| --- | --- |
| [get\_sample\_permalink()](../functions/get_sample_permalink) wp-admin/includes/post.php | Returns a sample permalink based on the post name. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'deprecated_file_trigger_error', bool $trigger ) apply\_filters( 'deprecated\_file\_trigger\_error', bool $trigger )
===================================================================
Filters whether to trigger an error for deprecated files.
`$trigger` bool Whether to trigger the error for deprecated files. Default true. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
```
| Used By | Description |
| --- | --- |
| [\_deprecated\_file()](../functions/_deprecated_file) wp-includes/functions.php | Marks a file as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'comment_max_links_url', int $num_links, string $url, string $comment ) apply\_filters( 'comment\_max\_links\_url', int $num\_links, string $url, string $comment )
===========================================================================================
Filters the number of links found in a comment.
`$num_links` int The number of links found. `$url` string Comment author's URL. Included in allowed links total. `$comment` string Content of the comment. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$num_links = apply_filters( 'comment_max_links_url', $num_links, $url, $comment );
```
| Used By | Description |
| --- | --- |
| [check\_comment()](../functions/check_comment) wp-includes/comment.php | Checks whether a comment passes internal checks to be allowed to add. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Added the `$comment` parameter. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'wp_creating_autosave', array $new_autosave ) do\_action( 'wp\_creating\_autosave', array $new\_autosave )
============================================================
Fires before an autosave is stored.
`$new_autosave` array Post array - the autosave that is about to be saved. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
do_action( 'wp_creating_autosave', $new_autosave );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Autosaves\_Controller::create\_post\_autosave()](../classes/wp_rest_autosaves_controller/create_post_autosave) wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php | Creates autosave for the specified post. |
| [wp\_create\_post\_autosave()](../functions/wp_create_post_autosave) wp-admin/includes/post.php | Creates autosave data for the specified post from `$_POST` data. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress do_action( 'edited_term_taxonomies', array $edit_tt_ids ) do\_action( 'edited\_term\_taxonomies', array $edit\_tt\_ids )
==============================================================
Fires immediately after a term to delete’s children are reassigned a parent.
`$edit_tt_ids` array An array of term taxonomy IDs for the given term. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'edited_term_taxonomies', $edit_tt_ids );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_term()](../functions/wp_delete_term) wp-includes/taxonomy.php | Removes a term from the database. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'comment_on_draft', int $comment_post_id ) do\_action( 'comment\_on\_draft', int $comment\_post\_id )
==========================================================
Fires when a comment is attempted on a post in draft mode.
`$comment_post_id` int Post ID. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'comment_on_draft', $comment_post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_handle\_comment\_submission()](../functions/wp_handle_comment_submission) wp-includes/comment.php | Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters_deprecated( 'tagsperpage', int $tags_per_page ) apply\_filters\_deprecated( 'tagsperpage', int $tags\_per\_page )
=================================================================
This hook has been deprecated. Use [‘edit\_tags\_per\_page’](edit_tags_per_page) instead.
Filters the number of terms displayed per page for the Tags list table.
`$tags_per_page` int Number of tags to be displayed. Default 20. File: `wp-admin/includes/class-wp-terms-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-terms-list-table.php/)
```
$tags_per_page = apply_filters_deprecated( 'tagsperpage', array( $tags_per_page ), '2.8.0', 'edit_tags_per_page' );
```
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::prepare\_items()](../classes/wp_terms_list_table/prepare_items) wp-admin/includes/class-wp-terms-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Use ['edit\_tags\_per\_page'](edit_tags_per_page) instead. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'wp_privacy_personal_data_export_file', int $request_id ) do\_action( 'wp\_privacy\_personal\_data\_export\_file', int $request\_id )
===========================================================================
Generate the export file from the collected, grouped personal data.
`$request_id` int The export request ID. File: `wp-admin/includes/privacy-tools.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/privacy-tools.php/)
```
do_action( 'wp_privacy_personal_data_export_file', $request_id );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_process\_personal\_data\_export\_page()](../functions/wp_privacy_process_personal_data_export_page) wp-admin/includes/privacy-tools.php | Intercept personal data exporter page Ajax responses in order to assemble the personal data export file. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'the_password_form', string $output, WP_Post $post ) apply\_filters( 'the\_password\_form', string $output, WP\_Post $post )
=======================================================================
Filters the HTML output for the protected post password form.
If modifying the password field, please note that the core database schema limits the password field to 20 characters regardless of the value of the size attribute in the form input.
`$output` string The password form HTML output. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
return apply_filters( 'the_password_form', $output, $post );
```
| Used By | Description |
| --- | --- |
| [get\_the\_password\_form()](../functions/get_the_password_form) wp-includes/post-template.php | Retrieves protected post password form content. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Added the `$post` parameter. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'media_view_settings', array $settings, WP_Post $post ) apply\_filters( 'media\_view\_settings', array $settings, WP\_Post $post )
==========================================================================
Filters the media view settings.
`$settings` array List of media view settings. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$settings = apply_filters( 'media_view_settings', $settings, $post );
```
| Used By | Description |
| --- | --- |
| [wp\_enqueue\_media()](../functions/wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'wp_get_current_commenter', array $comment_author_data ) apply\_filters( 'wp\_get\_current\_commenter', array $comment\_author\_data )
=============================================================================
Filters the current commenter’s name, email, and URL.
`$comment_author_data` array An array of current commenter variables.
* `comment_author`stringThe name of the current commenter, or an empty string.
* `comment_author_email`stringThe email address of the current commenter, or an empty string.
* `comment_author_url`stringThe URL address of the current commenter, or an empty string.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
return apply_filters( 'wp_get_current_commenter', compact( 'comment_author', 'comment_author_email', 'comment_author_url' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_current\_commenter()](../functions/wp_get_current_commenter) wp-includes/comment.php | Gets current commenter’s name, email, and URL. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'oembed_dataparse', string $return, object $data, string $url ) apply\_filters( 'oembed\_dataparse', string $return, object $data, string $url )
================================================================================
Filters the returned oEmbed HTML.
Use this filter to add support for custom data types, or to filter the result.
`$return` string The returned oEmbed HTML. `$data` object A data object result from an oEmbed provider. `$url` string The URL of the content to be embedded. File: `wp-includes/class-wp-oembed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed.php/)
```
return apply_filters( 'oembed_dataparse', $return, $data, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed::data2html()](../classes/wp_oembed/data2html) wp-includes/class-wp-oembed.php | Converts a data object from [WP\_oEmbed::fetch()](../classes/wp_oembed/fetch) and returns the HTML. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'wp_insert_site', WP_Site $new_site ) do\_action( 'wp\_insert\_site', WP\_Site $new\_site )
=====================================================
Fires once a site has been inserted into the database.
`$new_site` [WP\_Site](../classes/wp_site) New site object. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'wp_insert_site', $new_site );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_site()](../functions/wp_insert_site) wp-includes/ms-site.php | Inserts a new site into the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters_deprecated( 'default_contextual_help', string $old_help_default ) apply\_filters\_deprecated( 'default\_contextual\_help', string $old\_help\_default )
=====================================================================================
This hook has been deprecated. Use [get\_current\_screen()](../functions/get_current_screen) ->add\_help\_tab() or [get\_current\_screen()](../functions/get_current_screen) ->remove\_help\_tab() instead.
Filters the default legacy contextual help text.
`$old_help_default` string Default contextual help text. File: `wp-admin/includes/class-wp-screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-screen.php/)
```
$default_help = apply_filters_deprecated(
'default_contextual_help',
array( '' ),
'3.3.0',
'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
);
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::render\_screen\_meta()](../classes/wp_screen/render_screen_meta) wp-admin/includes/class-wp-screen.php | Renders the screen’s help section. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Use [get\_current\_screen()](../functions/get_current_screen) ->add\_help\_tab() or [get\_current\_screen()](../functions/get_current_screen) ->remove\_help\_tab() instead. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'deleted_postmeta', string[] $meta_ids ) do\_action( 'deleted\_postmeta', string[] $meta\_ids )
======================================================
Fires immediately after deleting metadata for a post.
`$meta_ids` string[] An array of metadata entry IDs to delete. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
do_action( 'deleted_postmeta', $meta_ids );
```
| Used By | Description |
| --- | --- |
| [delete\_metadata()](../functions/delete_metadata) wp-includes/meta.php | Deletes metadata for the specified object. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'get_the_time', string|int $the_time, string $format, WP_Post $post ) apply\_filters( 'get\_the\_time', string|int $the\_time, string $format, WP\_Post $post )
=========================================================================================
Filters the time a post was written.
`$the_time` string|int Formatted date string or Unix timestamp if `$format` is `'U'` or `'G'`. `$format` string Format to use for retrieving the time the post was written. Accepts `'G'`, `'U'`, or PHP date format. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'get_the_time', $the_time, $format, $post );
```
| Used By | Description |
| --- | --- |
| [get\_the\_time()](../functions/get_the_time) wp-includes/general-template.php | Retrieves the time at which the post was written. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_direct_php_update_url', string $direct_update_url ) apply\_filters( 'wp\_direct\_php\_update\_url', string $direct\_update\_url )
=============================================================================
Filters the URL for directly updating the PHP version the site is running on from the host.
`$direct_update_url` string URL for directly updating PHP. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$direct_update_url = apply_filters( 'wp_direct_php_update_url', $direct_update_url );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_direct\_php\_update\_url()](../functions/wp_get_direct_php_update_url) wp-includes/functions.php | Gets the URL for directly updating the PHP version the site is running on. |
| Version | Description |
| --- | --- |
| [5.1.1](https://developer.wordpress.org/reference/since/5.1.1/) | Introduced. |
wordpress do_action( "get_template_part_{$slug}", string $slug, string|null $name, array $args ) do\_action( "get\_template\_part\_{$slug}", string $slug, string|null $name, array $args )
==========================================================================================
Fires before the specified template part file is loaded.
The dynamic portion of the hook name, `$slug`, refers to the slug name for the generic template part.
`$slug` string The slug name for the generic template. `$name` string|null The name of the specialized template. `$args` array Additional arguments passed to the template. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( "get_template_part_{$slug}", $slug, $name, $args );
```
| Used By | Description |
| --- | --- |
| [get\_template\_part()](../functions/get_template_part) wp-includes/general-template.php | Loads a template part into a template. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$args` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( "blog_option_{$option}", string $value, int $id ) apply\_filters( "blog\_option\_{$option}", string $value, int $id )
===================================================================
Filters a blog option value.
The dynamic portion of the hook name, `$option`, refers to the blog option name.
`$value` string The option value. `$id` int Blog ID. File: `wp-includes/ms-blogs.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-blogs.php/)
```
return apply_filters( "blog_option_{$option}", $value, $id );
```
| Used By | Description |
| --- | --- |
| [get\_blog\_option()](../functions/get_blog_option) wp-includes/ms-blogs.php | Retrieve option value for a given blog id based on name of option. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'auth_cookie_expiration', int $length, int $user_id, bool $remember ) apply\_filters( 'auth\_cookie\_expiration', int $length, int $user\_id, bool $remember )
========================================================================================
Filters the duration of the authentication cookie expiration period.
`$length` int Duration of the expiration period in seconds. `$user_id` int User ID. `$remember` bool Whether to remember the user login. Default false. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$expiration = time() + apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_auth\_cookie()](../functions/wp_set_auth_cookie) wp-includes/pluggable.php | Sets the authentication cookies based on user ID. |
| [wp\_update\_user()](../functions/wp_update_user) wp-includes/user.php | Updates a user in the database. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'posts_request_ids', string $request, WP_Query $query ) apply\_filters( 'posts\_request\_ids', string $request, WP\_Query $query )
==========================================================================
Filters the Post IDs SQL request before sending.
`$request` string The post ID request. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance. File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$this->request = apply_filters( 'posts_request_ids', $this->request, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'pre_get_document_title', string $title ) apply\_filters( 'pre\_get\_document\_title', string $title )
============================================================
Filters the document title before it is generated.
Passing a non-empty value will short-circuit [wp\_get\_document\_title()](../functions/wp_get_document_title) , returning that value instead.
`$title` string The document title. Default empty string. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$title = apply_filters( 'pre_get_document_title', '' );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_document\_title()](../functions/wp_get_document_title) wp-includes/general-template.php | Returns document title for the current page. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( "nav_menu_items_{$post_type_name}", object[] $posts, array $args, WP_Post_Type $post_type ) apply\_filters( "nav\_menu\_items\_{$post\_type\_name}", object[] $posts, array $args, WP\_Post\_Type $post\_type )
===================================================================================================================
Filters the posts displayed in the ‘View All’ tab of the current post type’s menu items meta box.
The dynamic portion of the hook name, `$post_type_name`, refers to the slug of the current post type.
Possible hook names include:
* `nav_menu_items_post`
* `nav_menu_items_page`
* [WP\_Query::query()](../classes/wp_query/query)
`$posts` object[] The posts for the current post type. Mostly `WP_Post` objects, but can also contain "fake" post objects to represent other menu items. `$args` array An array of `WP_Query` arguments. `$post_type` [WP\_Post\_Type](../classes/wp_post_type) The current post type object for this menu item meta box. File: `wp-admin/includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/nav-menu.php/)
```
$posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type );
```
| Used By | Description |
| --- | --- |
| [wp\_nav\_menu\_item\_post\_type\_meta\_box()](../functions/wp_nav_menu_item_post_type_meta_box) wp-admin/includes/nav-menu.php | Displays a meta box for a post type menu item. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Converted the `$post_type` parameter to accept a [WP\_Post\_Type](../classes/wp_post_type) object. |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'wp_mail_from_name', string $from_name ) apply\_filters( 'wp\_mail\_from\_name', string $from\_name )
============================================================
Filters the name to associate with the “from” email address.
`$from_name` string Name associated with the "from" email address. * The filter modifies the “from name” used in an email sent using the [wp\_mail()](../functions/wp_mail) function. When used together with the ‘<wp_mail_from>‘ filter, it creates a from address like “Name <[email protected]>”. The filter should return a string.
* If you apply your filter using an anonymous function, you cannot remove it using [remove\_filter()](../functions/remove_filter) .
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$from_name = apply_filters( 'wp_mail_from_name', $from_name );
```
| Used By | Description |
| --- | --- |
| [wp\_mail()](../functions/wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( "theme_mod_{$name}", mixed $current_mod ) apply\_filters( "theme\_mod\_{$name}", mixed $current\_mod )
============================================================
Filters the theme modification, or ‘theme\_mod’, value.
The dynamic portion of the hook name, `$name`, refers to the key name of the modification array. For example, ‘header\_textcolor’, ‘header\_image’, and so on depending on the theme options.
`$current_mod` mixed The value of the active theme modification. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( "theme_mod_{$name}", $mods[ $name ] );
```
| Used By | Description |
| --- | --- |
| [get\_theme\_mod()](../functions/get_theme_mod) wp-includes/theme.php | Retrieves theme modification value for the active theme. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action( 'remove_user_role', int $user_id, string $role ) do\_action( 'remove\_user\_role', int $user\_id, string $role )
===============================================================
Fires immediately after a role as been removed from a user.
`$user_id` int The user ID. `$role` string The removed role. File: `wp-includes/class-wp-user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-user.php/)
```
do_action( 'remove_user_role', $this->ID, $role );
```
| Used By | Description |
| --- | --- |
| [WP\_User::remove\_role()](../classes/wp_user/remove_role) wp-includes/class-wp-user.php | Removes role from user. |
| [WP\_User::set\_role()](../classes/wp_user/set_role) wp-includes/class-wp-user.php | Sets the role of the user. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action( 'rest_delete_widget', string $widget_id, string $sidebar_id, WP_REST_Response|WP_Error $response, WP_REST_Request $request ) do\_action( 'rest\_delete\_widget', string $widget\_id, string $sidebar\_id, WP\_REST\_Response|WP\_Error $response, WP\_REST\_Request $request )
=================================================================================================================================================
Fires after a widget is deleted via the REST API.
`$widget_id` string ID of the widget marked for deletion. `$sidebar_id` string ID of the sidebar the widget was deleted from. `$response` [WP\_REST\_Response](../classes/wp_rest_response)|[WP\_Error](../classes/wp_error) The response data, or [WP\_Error](../classes/wp_error) object on failure. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request sent to the API. File: `wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php/)
```
do_action( 'rest_delete_widget', $widget_id, $sidebar_id, $response, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widgets\_Controller::delete\_item()](../classes/wp_rest_widgets_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php | Deletes a widget. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( "{$type}_send_to_editor_url", string $html, string $src, string $title ) apply\_filters( "{$type}\_send\_to\_editor\_url", string $html, string $src, string $title )
============================================================================================
Filters the URL sent to the editor for a specific media type.
The dynamic portion of the hook name, `$type`, refers to the type of media being sent.
Possible hook names include:
* `audio_send_to_editor_url`
* `file_send_to_editor_url`
* `video_send_to_editor_url`
`$html` string HTML markup sent to the editor. `$src` string Media source URL. `$title` string Media title. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$html = apply_filters( "{$type}_send_to_editor_url", $html, sanitize_url( $src ), $title );
```
| Used By | Description |
| --- | --- |
| [wp\_media\_upload\_handler()](../functions/wp_media_upload_handler) wp-admin/includes/media.php | Handles the process of uploading media. |
| [wp\_ajax\_send\_link\_to\_editor()](../functions/wp_ajax_send_link_to_editor) wp-admin/includes/ajax-actions.php | Ajax handler for sending a link to the editor. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'install_plugin_overwrite_actions', string[] $install_actions, object $api, array $new_plugin_data ) apply\_filters( 'install\_plugin\_overwrite\_actions', string[] $install\_actions, object $api, array $new\_plugin\_data )
==========================================================================================================================
Filters the list of action links available following a single plugin installation failure when overwriting is allowed.
`$install_actions` string[] Array of plugin action links. `$api` object Object containing WordPress.org API plugin data. `$new_plugin_data` array Array with uploaded plugin data. File: `wp-admin/includes/class-plugin-installer-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-plugin-installer-skin.php/)
```
$install_actions = apply_filters( 'install_plugin_overwrite_actions', $install_actions, $this->api, $new_plugin_data );
```
| Used By | Description |
| --- | --- |
| [Plugin\_Installer\_Skin::do\_overwrite()](../classes/plugin_installer_skin/do_overwrite) wp-admin/includes/class-plugin-installer-skin.php | Check if the plugin can be overwritten and output the HTML for overwriting a plugin on upload. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'widgets.php' ) do\_action( 'widgets.php' )
===========================
Fires early when editing the widgets displayed in sidebars.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_delete\_inactive\_widgets()](../functions/wp_ajax_delete_inactive_widgets) wp-admin/includes/ajax-actions.php | Ajax handler for removing inactive widgets. |
| [wp\_ajax\_save\_widget()](../functions/wp_ajax_save_widget) wp-admin/includes/ajax-actions.php | Ajax handler for saving a widget. |
| [WP\_Customize\_Widgets::wp\_ajax\_update\_widget()](../classes/wp_customize_widgets/wp_ajax_update_widget) wp-includes/class-wp-customize-widgets.php | Updates widget settings asynchronously. |
| [WP\_Customize\_Widgets::customize\_controls\_init()](../classes/wp_customize_widgets/customize_controls_init) wp-includes/class-wp-customize-widgets.php | Ensures all widgets get loaded into the Customizer. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'dashboard_recent_drafts_query_args', array $query_args ) apply\_filters( 'dashboard\_recent\_drafts\_query\_args', array $query\_args )
==============================================================================
Filters the post query arguments for the ‘Recent Drafts’ dashboard widget.
`$query_args` array The query arguments for the 'Recent Drafts' dashboard widget. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
$query_args = apply_filters( 'dashboard_recent_drafts_query_args', $query_args );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_recent\_drafts()](../functions/wp_dashboard_recent_drafts) wp-admin/includes/dashboard.php | Show recent drafts of the user on the dashboard. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'sanitize_key', string $sanitized_key, string $key ) apply\_filters( 'sanitize\_key', string $sanitized\_key, string $key )
======================================================================
Filters a sanitized key string.
`$sanitized_key` string Sanitized key. `$key` string The key prior to sanitization. * By default, [sanitize\_key()](../functions/sanitize_key) function sanitize a string key, which is used as internal identifiers, into lowercase alphanumeric, dashes, and underscores characters. After [sanitize\_key()](../functions/sanitize_key) function has done its work, it passes the sanitized key through this `sanitize_key` filter.
* The filter passes $key and $raw\_key as parameters, which allows the user of this filter to perform additional sanitization based on these two keys.
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'sanitize_key', $sanitized_key, $key );
```
| Used By | Description |
| --- | --- |
| [sanitize\_key()](../functions/sanitize_key) wp-includes/formatting.php | Sanitizes a string key. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'close_comments_for_post_types', string[] $post_types ) apply\_filters( 'close\_comments\_for\_post\_types', string[] $post\_types )
============================================================================
Filters the list of post types to automatically close comments for.
`$post_types` string[] An array of post type names. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
```
| Used By | Description |
| --- | --- |
| [\_close\_comments\_for\_old\_posts()](../functions/_close_comments_for_old_posts) wp-includes/comment.php | Closes comments on old posts on the fly, without any extra DB queries. Hooked to the\_posts. |
| [\_close\_comments\_for\_old\_post()](../functions/_close_comments_for_old_post) wp-includes/comment.php | Closes comments on an old post. Hooked to comments\_open and pings\_open. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'set-screen-option', mixed $screen_option, string $option, int $value ) apply\_filters( 'set-screen-option', mixed $screen\_option, string $option, int $value )
========================================================================================
Filters a screen option value before it is set.
The filter can also be used to modify non-standard [items]\_per\_page settings. See the parent function for a full list of standard options.
Returning false from the filter will skip saving the current option.
* [set\_screen\_options()](../functions/set_screen_options)
`$screen_option` mixed The value to save instead of the option value.
Default false (to skip saving the current option). `$option` string The option name. `$value` int The option value. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
$screen_option = apply_filters( 'set-screen-option', $screen_option, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [set\_screen\_options()](../functions/set_screen_options) wp-admin/includes/misc.php | Saves option for number of rows when listing posts, pages, comments, etc. |
| Version | Description |
| --- | --- |
| [5.4.2](https://developer.wordpress.org/reference/since/5.4.2/) | Only applied to options ending with `'_page'`, or the `'layout_columns'` option. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'xmlrpc_publish_post', int $post_id ) do\_action( 'xmlrpc\_publish\_post', int $post\_id )
====================================================
Fires when [\_publish\_post\_hook()](../functions/_publish_post_hook) is called during an XML-RPC request.
`$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'xmlrpc_publish_post', $post_id );
```
| Used By | Description |
| --- | --- |
| [\_publish\_post\_hook()](../functions/_publish_post_hook) wp-includes/post.php | Hook to schedule pings and enclosures when a post is published. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'get_pagenum_link', string $result, int $pagenum ) apply\_filters( 'get\_pagenum\_link', string $result, int $pagenum )
====================================================================
Filters the page number link for the current request.
`$result` string The page number link. `$pagenum` int The page number. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$result = apply_filters( 'get_pagenum_link', $result, $pagenum );
```
| Used By | Description |
| --- | --- |
| [get\_pagenum\_link()](../functions/get_pagenum_link) wp-includes/link-template.php | Retrieves the link for a page number. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Added the `$pagenum` argument. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters_deprecated( 'user_erasure_complete_email_subject', string $subject, string $sitename, array $email_data ) apply\_filters\_deprecated( 'user\_erasure\_complete\_email\_subject', string $subject, string $sitename, array $email\_data )
==============================================================================================================================
This hook has been deprecated. Use [‘user\_erasure\_fulfillment\_email\_subject’](user_erasure_fulfillment_email_subject) instead.
Filters the subject of the email sent when an erasure request is completed.
`$subject` string The email subject. `$sitename` string The name of the site. `$email_data` array Data relating to the account action email.
* `request`[WP\_User\_Request](../classes/wp_user_request)User request object.
* `message_recipient`stringThe address that the email will be sent to. Defaults to the value of `$request->email`, but can be changed by the `user_erasure_fulfillment_email_to` filter.
* `privacy_policy_url`stringPrivacy policy URL.
* `sitename`stringThe site name sending the mail.
* `siteurl`stringThe site URL sending the mail.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$subject = apply_filters_deprecated(
'user_erasure_complete_email_subject',
array( $subject, $email_data['sitename'], $email_data ),
'5.8.0',
'user_erasure_fulfillment_email_subject'
);
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_send\_erasure\_fulfillment\_notification()](../functions/_wp_privacy_send_erasure_fulfillment_notification) wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Use ['user\_erasure\_fulfillment\_email\_subject'](user_erasure_fulfillment_email_subject) instead. |
| [4.9.8](https://developer.wordpress.org/reference/since/4.9.8/) | Introduced. |
| programming_docs |
wordpress do_action( 'customize_save_after', WP_Customize_Manager $manager ) do\_action( 'customize\_save\_after', WP\_Customize\_Manager $manager )
=======================================================================
Fires after Customize settings have been saved.
`$manager` [WP\_Customize\_Manager](../classes/wp_customize_manager) [WP\_Customize\_Manager](../classes/wp_customize_manager) instance. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
do_action( 'customize_save_after', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::\_publish\_changeset\_values()](../classes/wp_customize_manager/_publish_changeset_values) wp-includes/class-wp-customize-manager.php | Publishes the values of a changeset. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'document_title', string $title ) apply\_filters( 'document\_title', string $title )
==================================================
Filters the document title.
`$title` string Document title. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$title = apply_filters( 'document_title', $title );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_document\_title()](../functions/wp_get_document_title) wp-includes/general-template.php | Returns document title for the current page. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress do_action( 'wp_update_site', WP_Site $new_site, WP_Site $old_site ) do\_action( 'wp\_update\_site', WP\_Site $new\_site, WP\_Site $old\_site )
==========================================================================
Fires once a site has been updated in the database.
`$new_site` [WP\_Site](../classes/wp_site) New site object. `$old_site` [WP\_Site](../classes/wp_site) Old site object. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'wp_update_site', $new_site, $old_site );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_site()](../functions/wp_update_site) wp-includes/ms-site.php | Updates a site in the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'get_header_image_tag_attributes', array $attr, object $header ) apply\_filters( 'get\_header\_image\_tag\_attributes', array $attr, object $header )
====================================================================================
Filters the list of header image attributes.
`$attr` array Array of the attributes for the image tag. `$header` object The custom header object returned by '[get\_custom\_header()](../functions/get_custom_header) '. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
$attr = apply_filters( 'get_header_image_tag_attributes', $attr, $header );
```
| Used By | Description |
| --- | --- |
| [get\_header\_image\_tag()](../functions/get_header_image_tag) wp-includes/theme.php | Creates image tag markup for a custom header image. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'wp_image_file_matches_image_meta', bool $match, string $image_location, array $image_meta, int $attachment_id ) apply\_filters( 'wp\_image\_file\_matches\_image\_meta', bool $match, string $image\_location, array $image\_meta, int $attachment\_id )
========================================================================================================================================
Filters whether an image path or URI matches image meta.
`$match` bool Whether the image relative path from the image meta matches the end of the URI or path to the image file. `$image_location` string Full path or URI to the tested image file. `$image_meta` array The image meta data as returned by '[wp\_get\_attachment\_metadata()](../functions/wp_get_attachment_metadata) '. `$attachment_id` int The image attachment ID or 0 if not supplied. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_image_file_matches_image_meta', $match, $image_location, $image_meta, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_image\_file\_matches\_image\_meta()](../functions/wp_image_file_matches_image_meta) wp-includes/media.php | Determines if the image meta data is for the image source file. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'wp_playlist_scripts', string $type, string $style ) do\_action( 'wp\_playlist\_scripts', string $type, string $style )
==================================================================
Prints and enqueues playlist scripts, styles, and JavaScript templates.
`$type` string Type of playlist. Possible values are `'audio'` or `'video'`. `$style` string The `'theme'` for the playlist. Core provides `'light'` and `'dark'`. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
do_action( 'wp_playlist_scripts', $atts['type'], $atts['style'] );
```
| Used By | Description |
| --- | --- |
| [wp\_playlist\_shortcode()](../functions/wp_playlist_shortcode) wp-includes/media.php | Builds the Playlist shortcode output. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'newblogname', string $blogname ) apply\_filters( 'newblogname', string $blogname )
=================================================
Filters the new site name during registration.
The name is the site’s subdomain or the site’s subdirectory path depending on the network settings.
`$blogname` string Site name. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$blogname = apply_filters( 'newblogname', $blogname );
```
| Used By | Description |
| --- | --- |
| [wpmu\_validate\_blog\_signup()](../functions/wpmu_validate_blog_signup) wp-includes/ms-functions.php | Processes new site registrations. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'dashboard_glance_items', string[] $items ) apply\_filters( 'dashboard\_glance\_items', string[] $items )
=============================================================
Filters the array of extra elements to list in the ‘At a Glance’ dashboard widget.
Prior to 3.8.0, the widget was named ‘Right Now’. Each element is wrapped in list-item tags on output.
`$items` string[] Array of extra 'At a Glance' widget items. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
$elements = apply_filters( 'dashboard_glance_items', array() );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_right\_now()](../functions/wp_dashboard_right_now) wp-admin/includes/dashboard.php | Dashboard widget that displays some basic stats about the site. |
| Version | Description |
| --- | --- |
| [3.8.0](https://developer.wordpress.org/reference/since/3.8.0/) | Introduced. |
wordpress do_action( 'login_header' ) do\_action( 'login\_header' )
=============================
Fires in the login page header after the body tag is opened.
File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
do_action( 'login_header' );
```
| Used By | Description |
| --- | --- |
| [login\_header()](../functions/login_header) wp-login.php | Output the login page header. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress do_action( 'wp_privacy_personal_data_erased', int $request_id ) do\_action( 'wp\_privacy\_personal\_data\_erased', int $request\_id )
=====================================================================
Fires immediately after a personal data erasure request has been marked completed.
`$request_id` int The privacy request post ID associated with this request. File: `wp-admin/includes/privacy-tools.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/privacy-tools.php/)
```
do_action( 'wp_privacy_personal_data_erased', $request_id );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_process\_personal\_data\_erasure\_page()](../functions/wp_privacy_process_personal_data_erasure_page) wp-admin/includes/privacy-tools.php | Mark erasure requests as completed after processing is finished. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress do_action( 'update_blog_public', int $site_id, string $value ) do\_action( 'update\_blog\_public', int $site\_id, string $value )
==================================================================
Fires after the current blog’s ‘public’ setting is updated.
`$site_id` int Site ID. `$value` string The value of the site status. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'update_blog_public', $site_id, $new_site->public );
```
| Used By | Description |
| --- | --- |
| [wp\_maybe\_transition\_site\_statuses\_on\_update()](../functions/wp_maybe_transition_site_statuses_on_update) wp-includes/ms-site.php | Triggers actions on site status updates. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress do_action( 'registered_taxonomy_for_object_type', string $taxonomy, string $object_type ) do\_action( 'registered\_taxonomy\_for\_object\_type', string $taxonomy, string $object\_type )
===============================================================================================
Fires after a taxonomy is registered for an object type.
`$taxonomy` string Taxonomy name. `$object_type` string Name of the object type. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'registered_taxonomy_for_object_type', $taxonomy, $object_type );
```
| Used By | Description |
| --- | --- |
| [register\_taxonomy\_for\_object\_type()](../functions/register_taxonomy_for_object_type) wp-includes/taxonomy.php | Adds an already registered taxonomy to an object type. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'attachment_url_to_postid', int|null $post_id, string $url ) apply\_filters( 'attachment\_url\_to\_postid', int|null $post\_id, string $url )
================================================================================
Filters an attachment ID found by URL.
`$post_id` int|null The post\_id (if any) found by the function. `$url` string The URL being looked up. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return (int) apply_filters( 'attachment_url_to_postid', $post_id, $url );
```
| Used By | Description |
| --- | --- |
| [attachment\_url\_to\_postid()](../functions/attachment_url_to_postid) wp-includes/media.php | Tries to convert an attachment URL into a post ID. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress do_action( 'page_attributes_meta_box_template', string|false $template, WP_Post $post ) do\_action( 'page\_attributes\_meta\_box\_template', string|false $template, WP\_Post $post )
=============================================================================================
Fires immediately after the label inside the ‘Template’ section of the ‘Page Attributes’ meta box.
`$template` string|false The template used for the current post. `$post` [WP\_Post](../classes/wp_post) The current post. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
do_action( 'page_attributes_meta_box_template', $template, $post );
```
| Used By | Description |
| --- | --- |
| [page\_attributes\_meta\_box()](../functions/page_attributes_meta_box) wp-admin/includes/meta-boxes.php | Displays page attributes form fields. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'network_site_url', string $url, string $path, string|null $scheme ) apply\_filters( 'network\_site\_url', string $url, string $path, string|null $scheme )
======================================================================================
Filters the network site URL.
`$url` string The complete network site URL including scheme and path. `$path` string Path relative to the network site URL. Blank string if no path is specified. `$scheme` string|null Scheme to give the URL context. Accepts `'http'`, `'https'`, `'relative'` or null. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'network_site_url', $url, $path, $scheme );
```
| Used By | Description |
| --- | --- |
| [network\_site\_url()](../functions/network_site_url) wp-includes/link-template.php | Retrieves the site URL for the current network. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_dropdown_cats', string $output, array $parsed_args ) apply\_filters( 'wp\_dropdown\_cats', string $output, array $parsed\_args )
===========================================================================
Filters the taxonomy drop-down output.
`$output` string HTML output. `$parsed_args` array Arguments used to build the drop-down. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$output = apply_filters( 'wp_dropdown_cats', $output, $parsed_args );
```
| Used By | Description |
| --- | --- |
| [wp\_dropdown\_categories()](../functions/wp_dropdown_categories) wp-includes/category-template.php | Displays or retrieves the HTML dropdown list of categories. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( "deleted_{$meta_type}_meta", string[] $meta_ids, int $object_id, string $meta_key, mixed $_meta_value ) do\_action( "deleted\_{$meta\_type}\_meta", string[] $meta\_ids, int $object\_id, string $meta\_key, mixed $\_meta\_value )
===========================================================================================================================
Fires immediately after deleting metadata of a specific type.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Possible hook names include:
* `deleted_post_meta`
* `deleted_comment_meta`
* `deleted_term_meta`
* `deleted_user_meta`
`$meta_ids` string[] An array of metadata entry IDs to delete. `$object_id` int ID of the object metadata is for. `$meta_key` string Metadata key. `$_meta_value` mixed Metadata value. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
```
| Used By | Description |
| --- | --- |
| [delete\_metadata()](../functions/delete_metadata) wp-includes/meta.php | Deletes metadata for the specified object. |
| [delete\_metadata\_by\_mid()](../functions/delete_metadata_by_mid) wp-includes/meta.php | Deletes metadata by meta ID. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'gettext_with_context', string $translation, string $text, string $context, string $domain ) apply\_filters( 'gettext\_with\_context', string $translation, string $text, string $context, string $domain )
==============================================================================================================
Filters text with its translation based on context information.
`$translation` string Translated text. `$text` string Text to translate. `$context` string Context information for the translators. `$domain` string Text domain. Unique identifier for retrieving translated strings. This filter hook is applied to the translated text by the internationalization function that handle contexts (`[\_x()](../functions/_x)`, `[\_ex()](../functions/_ex)`, [`esc_attr_x()`](../functions/esc_attr_x) and `[esc\_html\_x()](../functions/esc_html_x)`).
**IMPORTANT:** This filter is always applied even if internationalization is not in effect, and if the text domain has not been loaded. If there are functions hooked to this filter, they will always run. This could lead to a performance problem.
For regular translation functions such as `[\_e()](../functions/_e)`, and for examples on usage, see `[gettext()](gettext)`.
For singular/plural aware translation functions such as `[\_n()](../functions/_n)`, see `[ngettext()](ngettext)`.
For context-specific translation functions that also handle plurals such as `[\_nx()](../functions/_nx)`, see filter hook `[ngettext\_with\_context()](ngettext_with_context)`.
File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$translation = apply_filters( 'gettext_with_context', $translation, $text, $context, $domain );
```
| Used By | Description |
| --- | --- |
| [translate\_with\_gettext\_context()](../functions/translate_with_gettext_context) wp-includes/l10n.php | Retrieves the translation of $text in the context defined in $context. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'comment_form_after_fields' ) do\_action( 'comment\_form\_after\_fields' )
============================================
Fires after the comment fields in the comment form, excluding the textarea.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
do_action( 'comment_form_after_fields' );
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'manage_sites_extra_tablenav', string $which ) do\_action( 'manage\_sites\_extra\_tablenav', string $which )
=============================================================
Fires immediately following the closing “actions” div in the tablenav for the MS sites list table.
`$which` string The location of the extra table nav markup: `'top'` or `'bottom'`. File: `wp-admin/includes/class-wp-ms-sites-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-sites-list-table.php/)
```
do_action( 'manage_sites_extra_tablenav', $which );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Sites\_List\_Table::extra\_tablenav()](../classes/wp_ms_sites_list_table/extra_tablenav) wp-admin/includes/class-wp-ms-sites-list-table.php | Extra controls to be displayed between bulk actions and pagination. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress do_action( 'deleted_user', int $id, int|null $reassign, WP_User $user ) do\_action( 'deleted\_user', int $id, int|null $reassign, WP\_User $user )
==========================================================================
Fires immediately after a user is deleted from the database.
`$id` int ID of the deleted user. `$reassign` int|null ID of the user to reassign posts and links to.
Default null, for no reassignment. `$user` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object of the deleted user. The deleted\_user action/hook can be used to perform additional actions after a user is deleted. For example, you can delete rows from custom tables created by a plugin.
This hook runs after a user is deleted. The hook delete\_user (delete vs deleted) runs before a user is deleted. Choose the appropriate hook for your needs. If you need access to user meta or fields from the user table, use delete\_user.
File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
do_action( 'deleted_user', $id, $reassign, $user );
```
| Used By | Description |
| --- | --- |
| [wpmu\_delete\_user()](../functions/wpmu_delete_user) wp-admin/includes/ms.php | Delete a user from the network and remove from all sites. |
| [wp\_delete\_user()](../functions/wp_delete_user) wp-admin/includes/user.php | Remove user and optionally reassign posts and links to another user. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$user` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_update_term_data', array $data, int $term_id, string $taxonomy, array $args ) apply\_filters( 'wp\_update\_term\_data', array $data, int $term\_id, string $taxonomy, array $args )
=====================================================================================================
Filters term data before it is updated in the database.
`$data` array Term data to be updated. `$term_id` int Term ID. `$taxonomy` string Taxonomy slug. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$data = apply_filters( 'wp_update_term_data', $data, $term_id, $taxonomy, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'wxr_export_skip_commentmeta', bool $skip, string $meta_key, object $meta ) apply\_filters( 'wxr\_export\_skip\_commentmeta', bool $skip, string $meta\_key, object $meta )
===============================================================================================
Filters whether to selectively skip comment meta used for WXR exports.
Returning a truthy value from the filter will skip the current meta object from being exported.
`$skip` bool Whether to skip the current comment meta. Default false. `$meta_key` string Current meta key. `$meta` object Current meta object. File: `wp-admin/includes/export.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/export.php/)
```
if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
```
| Used By | Description |
| --- | --- |
| [export\_wp()](../functions/export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'meta_query_find_compatible_table_alias', string|false $alias, array $clause, array $parent_query, WP_Meta_Query $query ) apply\_filters( 'meta\_query\_find\_compatible\_table\_alias', string|false $alias, array $clause, array $parent\_query, WP\_Meta\_Query $query )
=================================================================================================================================================
Filters the table alias identified as compatible with the current clause.
`$alias` string|false Table alias, or false if none was found. `$clause` array First-order query clause. `$parent_query` array Parent of $clause. `$query` [WP\_Meta\_Query](../classes/wp_meta_query) [WP\_Meta\_Query](../classes/wp_meta_query) object. File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::find\_compatible\_table\_alias()](../classes/wp_meta_query/find_compatible_table_alias) wp-includes/class-wp-meta-query.php | Identify an existing table alias that is compatible with the current query clause. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_prepare_media_item', array $_media_item, WP_Post $media_item, string $thumbnail_size ) apply\_filters( 'xmlrpc\_prepare\_media\_item', array $\_media\_item, WP\_Post $media\_item, string $thumbnail\_size )
======================================================================================================================
Filters XML-RPC-prepared data for the given media item.
`$_media_item` array An array of media item data. `$media_item` [WP\_Post](../classes/wp_post) Media item object. `$thumbnail_size` string Image size. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
return apply_filters( 'xmlrpc_prepare_media_item', $_media_item, $media_item, $thumbnail_size );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_prepare\_media\_item()](../classes/wp_xmlrpc_server/_prepare_media_item) wp-includes/class-wp-xmlrpc-server.php | Prepares media item data for return in an XML-RPC object. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'https_local_ssl_verify', bool $ssl_verify, string $url ) apply\_filters( 'https\_local\_ssl\_verify', bool $ssl\_verify, string $url )
=============================================================================
Filters whether SSL should be verified for local HTTP API requests.
`$ssl_verify` bool Whether to verify the SSL connection. Default true. `$url` string The request URL. File: `wp-includes/class-wp-http-streams.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-streams.php/)
```
$ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::check\_for\_page\_caching()](../classes/wp_site_health/check_for_page_caching) wp-admin/includes/class-wp-site-health.php | Checks if site has page cache enabled or not. |
| [WP\_Site\_Health::get\_test\_rest\_availability()](../classes/wp_site_health/get_test_rest_availability) wp-admin/includes/class-wp-site-health.php | Tests if the REST API is accessible. |
| [WP\_Site\_Health::can\_perform\_loopback()](../classes/wp_site_health/can_perform_loopback) wp-admin/includes/class-wp-site-health.php | Runs a loopback test on the site. |
| [wp\_edit\_theme\_plugin\_file()](../functions/wp_edit_theme_plugin_file) wp-admin/includes/file.php | Attempts to edit a file for a theme or plugin. |
| [spawn\_cron()](../functions/spawn_cron) wp-includes/cron.php | Sends a request to run cron through HTTP request that doesn’t halt page loading. |
| [WP\_Http\_Streams::request()](../classes/wp_http_streams/request) wp-includes/class-wp-http-streams.php | Send a HTTP request to a URI using PHP Streams. |
| [WP\_Http\_Curl::request()](../classes/wp_http_curl/request) wp-includes/class-wp-http-curl.php | Send a HTTP request to a URI using cURL extension. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | The `$url` parameter was added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'image_editor_output_format', string[] $output_format, string $filename, string $mime_type ) apply\_filters( 'image\_editor\_output\_format', string[] $output\_format, string $filename, string $mime\_type )
=================================================================================================================
Filters the image editor output format mapping.
Enables filtering the mime type used to save images. By default, the mapping array is empty, so the mime type matches the source image.
* [WP\_Image\_Editor::get\_output\_format()](../classes/wp_image_editor/get_output_format)
`$output_format` string[] An array of mime type mappings. Maps a source mime type to a new destination mime type. Default empty array.
* `...$0`stringThe new mime type.
`$filename` string Path to the image. `$mime_type` string The source image mime type. File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
$output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );
```
| Used By | Description |
| --- | --- |
| [wp\_unique\_filename()](../functions/wp_unique_filename) wp-includes/functions.php | Gets a filename that is sanitized and unique for the given directory. |
| [WP\_Image\_Editor::get\_output\_format()](../classes/wp_image_editor/get_output_format) wp-includes/class-wp-image-editor.php | Returns preferred mime-type and extension based on provided file’s extension and mime, or current file’s extension and mime. |
| [wp\_get\_image\_editor()](../functions/wp_get_image_editor) wp-includes/media.php | Returns a [WP\_Image\_Editor](../classes/wp_image_editor) instance and loads file into it. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress do_action( 'manage_media_custom_column', string $column_name, int $post_id ) do\_action( 'manage\_media\_custom\_column', string $column\_name, int $post\_id )
==================================================================================
Fires for each custom column in the Media list table.
Custom columns are registered using the [‘manage\_media\_columns’](manage_media_columns) filter.
`$column_name` string Name of the custom column. `$post_id` int Attachment ID. File: `wp-admin/includes/class-wp-media-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-media-list-table.php/)
```
do_action( 'manage_media_custom_column', $column_name, $post->ID );
```
| Used By | Description |
| --- | --- |
| [WP\_Media\_List\_Table::column\_default()](../classes/wp_media_list_table/column_default) wp-admin/includes/class-wp-media-list-table.php | Handles output for the default column. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'posts_search_orderby', string $search_orderby, WP_Query $query ) apply\_filters( 'posts\_search\_orderby', string $search\_orderby, WP\_Query $query )
=====================================================================================
Filters the ORDER BY used when ordering search results.
`$search_orderby` string The ORDER BY clause. `$query` [WP\_Query](../classes/wp_query) The current [WP\_Query](../classes/wp_query) instance. File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$search_orderby = apply_filters( 'posts_search_orderby', $search_orderby, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'clean_url', string $good_protocol_url, string $original_url, string $_context ) apply\_filters( 'clean\_url', string $good\_protocol\_url, string $original\_url, string $\_context )
=====================================================================================================
Filters a string cleaned and escaped for output as a URL.
`$good_protocol_url` string The cleaned URL to be returned. `$original_url` string The URL prior to cleaning. `$_context` string If `'display'`, replace ampersands and single quotes only. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'clean_url', $good_protocol_url, $original_url, $_context );
```
| Used By | Description |
| --- | --- |
| [esc\_url()](../functions/esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( "do_feed_{$feed}", bool $is_comment_feed, string $feed ) do\_action( "do\_feed\_{$feed}", bool $is\_comment\_feed, string $feed )
========================================================================
Fires once the given feed is loaded.
The dynamic portion of the hook name, `$feed`, refers to the feed template name.
Possible hook names include:
* `do_feed_atom`
* `do_feed_rdf`
* `do_feed_rss`
* `do_feed_rss2`
`$is_comment_feed` bool Whether the feed is a comment feed. `$feed` string The feed name. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
do_action( "do_feed_{$feed}", $wp_query->is_comment_feed, $feed );
```
| Used By | Description |
| --- | --- |
| [do\_feed()](../functions/do_feed) wp-includes/functions.php | Loads the feed template from the use of an action hook. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$feed` parameter was added. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'tiny_mce_before_init', array $mceInit, string $editor_id ) apply\_filters( 'tiny\_mce\_before\_init', array $mceInit, string $editor\_id )
===============================================================================
Filters the TinyMCE config before init.
`$mceInit` array An array with TinyMCE config. `$editor_id` string Unique editor identifier, e.g. `'content'`. Accepts `'classic-block'` when called from block editor's Classic block. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mceInit = apply_filters( 'tiny_mce_before_init', $mceInit, $editor_id );
```
| Used By | Description |
| --- | --- |
| [wp\_tinymce\_inline\_scripts()](../functions/wp_tinymce_inline_scripts) wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | The `$editor_id` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'use_streams_transport', bool $use_class, array $args ) apply\_filters( 'use\_streams\_transport', bool $use\_class, array $args )
==========================================================================
Filters whether streams can be used as a transport for retrieving a URL.
`$use_class` bool Whether the class can be used. Default true. `$args` array Request arguments. File: `wp-includes/class-wp-http-streams.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-streams.php/)
```
return apply_filters( 'use_streams_transport', true, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_Http\_Streams::test()](../classes/wp_http_streams/test) wp-includes/class-wp-http-streams.php | Determines whether this class can be used for retrieving a URL. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'network_home_url', string $url, string $path, string|null $orig_scheme ) apply\_filters( 'network\_home\_url', string $url, string $path, string|null $orig\_scheme )
============================================================================================
Filters the network home URL.
`$url` string The complete network home URL including scheme and path. `$path` string Path relative to the network home URL. Blank string if no path is specified. `$orig_scheme` string|null Scheme to give the URL context. Accepts `'http'`, `'https'`, `'relative'` or null. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'network_home_url', $url, $path, $orig_scheme );
```
| Used By | Description |
| --- | --- |
| [network\_home\_url()](../functions/network_home_url) wp-includes/link-template.php | Retrieves the home URL for the current network. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'post_locked_dialog', WP_Post $post, WP_User $user ) do\_action( 'post\_locked\_dialog', WP\_Post $post, WP\_User $user )
====================================================================
Fires inside the post locked dialog before the buttons are displayed.
`$post` [WP\_Post](../classes/wp_post) Post object. `$user` [WP\_User](../classes/wp_user) The user with the lock for the post. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
do_action( 'post_locked_dialog', $post, $user );
```
| Used By | Description |
| --- | --- |
| [\_admin\_notice\_post\_locked()](../functions/_admin_notice_post_locked) wp-admin/includes/post.php | Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | The $user parameter was added. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'is_wide_widget_in_customizer', bool $is_wide, string $widget_id ) apply\_filters( 'is\_wide\_widget\_in\_customizer', bool $is\_wide, string $widget\_id )
========================================================================================
Filters whether the given widget is considered “wide”.
`$is_wide` bool Whether the widget is wide, Default false. `$widget_id` string Widget ID. File: `wp-includes/class-wp-customize-widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-widgets.php/)
```
return apply_filters( 'is_wide_widget_in_customizer', $is_wide, $widget_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Widgets::is\_wide\_widget()](../classes/wp_customize_widgets/is_wide_widget) wp-includes/class-wp-customize-widgets.php | Determines whether the widget is considered “wide”. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters_ref_array( 'get_meta_sql', string[] $sql, array $queries, string $type, string $primary_table, string $primary_id_column, object $context ) apply\_filters\_ref\_array( 'get\_meta\_sql', string[] $sql, array $queries, string $type, string $primary\_table, string $primary\_id\_column, object $context )
=================================================================================================================================================================
Filters the meta query’s generated SQL.
`$sql` string[] Array containing the query's JOIN and WHERE clauses. `$queries` array Array of meta queries. `$type` string Type of meta. Possible values include but are not limited to `'post'`, `'comment'`, `'blog'`, `'term'`, and `'user'`. `$primary_table` string Primary table. `$primary_id_column` string Primary column ID. `$context` object The main query object that corresponds to the type, for example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`. File: `wp-includes/class-wp-meta-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-meta-query.php/)
```
return apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Meta\_Query::get\_sql()](../classes/wp_meta_query/get_sql) wp-includes/class-wp-meta-query.php | Generates SQL clauses to be appended to a main query. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'plugins_url', string $url, string $path, string $plugin ) apply\_filters( 'plugins\_url', string $url, string $path, string $plugin )
===========================================================================
Filters the URL to the plugins directory.
`$url` string The complete URL to the plugins directory including scheme and path. `$path` string Path relative to the URL to the plugins directory. Blank string if no path is specified. `$plugin` string The plugin file path to be relative to. Blank string if no plugin is specified. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'plugins_url', $url, $path, $plugin );
```
| Used By | Description |
| --- | --- |
| [plugins\_url()](../functions/plugins_url) wp-includes/link-template.php | Retrieves a URL within the plugins or mu-plugins directory. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'nav_menu_item_args', stdClass $args, WP_Post $menu_item, int $depth ) apply\_filters( 'nav\_menu\_item\_args', stdClass $args, WP\_Post $menu\_item, int $depth )
===========================================================================================
Filters the arguments for a single nav menu item.
`$args` stdClass An object of [wp\_nav\_menu()](../functions/wp_nav_menu) arguments. More Arguments from wp\_nav\_menu( ... $args ) Array of nav menu arguments.
* `menu`int|string|[WP\_Term](../classes/wp_term)Desired menu. Accepts a menu ID, slug, name, or object.
* `menu_class`stringCSS class to use for the ul element which forms the menu.
Default `'menu'`.
* `menu_id`stringThe ID that is applied to the ul element which forms the menu.
Default is the menu slug, incremented.
* `container`stringWhether to wrap the ul, and what to wrap it with.
Default `'div'`.
* `container_class`stringClass that is applied to the container.
Default 'menu-{menu slug}-container'.
* `container_id`stringThe ID that is applied to the container.
* `container_aria_label`stringThe aria-label attribute that is applied to the container when it's a nav element.
* `fallback_cb`callable|falseIf the menu doesn't exist, a callback function will fire.
Default is `'wp_page_menu'`. Set to false for no fallback.
* `before`stringText before the link markup.
* `after`stringText after the link markup.
* `link_before`stringText before the link text.
* `link_after`stringText after the link text.
* `echo`boolWhether to echo the menu or return it. Default true.
* `depth`intHow many levels of the hierarchy are to be included.
0 means all. Default 0.
Default 0.
* `walker`objectInstance of a custom walker class.
* `theme_location`stringTheme location to be used. Must be registered with [register\_nav\_menu()](../functions/register_nav_menu) in order to be selectable by the user.
* `items_wrap`stringHow the list items should be wrapped. Uses printf() format with numbered placeholders. Default is a ul with an id and class.
* `item_spacing`stringWhether to preserve whitespace within the menu's HTML.
Accepts `'preserve'` or `'discard'`. Default `'preserve'`.
`$menu_item` [WP\_Post](../classes/wp_post) Menu item data object. `$depth` int Depth of menu item. Used for padding. File: `wp-includes/class-walker-nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-nav-menu.php/)
```
$args = apply_filters( 'nav_menu_item_args', $args, $menu_item, $depth );
```
| Used By | Description |
| --- | --- |
| [Walker\_Nav\_Menu::start\_el()](../classes/walker_nav_menu/start_el) wp-includes/class-walker-nav-menu.php | Starts the element output. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'check_password', bool $check, string $password, string $hash, string|int $user_id ) apply\_filters( 'check\_password', bool $check, string $password, string $hash, string|int $user\_id )
======================================================================================================
Filters whether the plaintext password matches the encrypted password.
`$check` bool Whether the passwords match. `$password` string The plaintext password. `$hash` string The hashed password. `$user_id` string|int User ID. Can be empty. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
return apply_filters( 'check_password', $check, $password, $hash, $user_id );
```
| Used By | Description |
| --- | --- |
| [wp\_check\_password()](../functions/wp_check_password) wp-includes/pluggable.php | Checks the plaintext password against the encrypted Password. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_pre_query', WP_Post[]|int[]|null $posts, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_pre\_query', WP\_Post[]|int[]|null $posts, WP\_Query $query )
=================================================================================================
Filters the posts array before the query takes place.
Return a non-null value to bypass WordPress’ default post queries.
Filtering functions that require pagination information are encouraged to set the `found_posts` and `max_num_pages` properties of the [WP\_Query](../classes/wp_query) object, passed to the filter by reference. If [WP\_Query](../classes/wp_query) does not perform a database query, it will not have enough information to generate these values itself.
`$posts` [WP\_Post](../classes/wp_post)[]|int[]|null Return an array of post data to short-circuit WP's query, or null to allow WP to run its normal queries. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$this->posts = apply_filters_ref_array( 'posts_pre_query', array( null, &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress do_action( 'enqueue_embed_scripts' ) do\_action( 'enqueue\_embed\_scripts' )
=======================================
Fires when scripts and styles are enqueued for the embed iframe.
File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
do_action( 'enqueue_embed_scripts' );
```
| Used By | Description |
| --- | --- |
| [enqueue\_embed\_scripts()](../functions/enqueue_embed_scripts) wp-includes/embed.php | Enqueues embed iframe default CSS and JS. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'user_admin_menu', string $context ) do\_action( 'user\_admin\_menu', string $context )
==================================================
Fires before the administration menu loads in the User Admin.
`$context` string Empty context. File: `wp-admin/includes/menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/menu.php/)
```
do_action( 'user_admin_menu', '' );
```
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'auth_redirect_scheme', string $scheme ) apply\_filters( 'auth\_redirect\_scheme', string $scheme )
==========================================================
Filters the authentication redirect scheme.
`$scheme` string Authentication redirect scheme. Default empty. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$scheme = apply_filters( 'auth_redirect_scheme', '' );
```
| Used By | Description |
| --- | --- |
| [auth\_redirect()](../functions/auth_redirect) wp-includes/pluggable.php | Checks if a user is logged in, if not it redirects them to the login page. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'print_default_editor_scripts' ) do\_action( 'print\_default\_editor\_scripts' )
===============================================
Fires when the editor scripts are loaded for later initialization, after all scripts and settings are printed.
File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
do_action( 'print_default_editor_scripts' );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::print\_default\_editor\_scripts()](../classes/_wp_editors/print_default_editor_scripts) wp-includes/class-wp-editor.php | Print (output) all editor scripts and default settings. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress do_action( 'attachment_submitbox_misc_actions', WP_Post $post ) do\_action( 'attachment\_submitbox\_misc\_actions', WP\_Post $post )
====================================================================
Fires after the ‘Uploaded on’ section of the Save meta box in the attachment editing screen.
`$post` [WP\_Post](../classes/wp_post) [WP\_Post](../classes/wp_post) object for the current attachment. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
do_action( 'attachment_submitbox_misc_actions', $post );
```
| Used By | Description |
| --- | --- |
| [attachment\_submit\_meta\_box()](../functions/attachment_submit_meta_box) wp-admin/includes/meta-boxes.php | Displays attachment submit form fields. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$post` parameter. |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_prepare_page', array $_page, WP_Post $page ) apply\_filters( 'xmlrpc\_prepare\_page', array $\_page, WP\_Post $page )
========================================================================
Filters XML-RPC-prepared data for the given page.
`$_page` array An array of page data. `$page` [WP\_Post](../classes/wp_post) Page object. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
return apply_filters( 'xmlrpc_prepare_page', $_page, $page );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_prepare\_page()](../classes/wp_xmlrpc_server/_prepare_page) wp-includes/class-wp-xmlrpc-server.php | Prepares page data for return in an XML-RPC object. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'wp_php_error_args', array $args, array $error ) apply\_filters( 'wp\_php\_error\_args', array $args, array $error )
===================================================================
Filters the arguments passed to {@see [wp\_die()](../functions/wp_die) } for the default PHP error template.
`$args` array Associative array of arguments passed to `wp_die()`. By default these contain a `'response'` key, and optionally `'link_url'` and `'link_text'` keys. `$error` array Error information retrieved from `error_get_last()`. File: `wp-includes/class-wp-fatal-error-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-fatal-error-handler.php/)
```
$args = apply_filters( 'wp_php_error_args', $args, $error );
```
| Used By | Description |
| --- | --- |
| [WP\_Fatal\_Error\_Handler::display\_default\_error\_template()](../classes/wp_fatal_error_handler/display_default_error_template) wp-includes/class-wp-fatal-error-handler.php | Displays the default PHP error template. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'media_embedded_in_content_allowed_types', string[] $allowed_media_types ) apply\_filters( 'media\_embedded\_in\_content\_allowed\_types', string[] $allowed\_media\_types )
=================================================================================================
Filters the embedded media types that are allowed to be returned from the content blob.
`$allowed_media_types` string[] An array of allowed media types. Default media types are `'audio'`, `'video'`, `'object'`, `'embed'`, and `'iframe'`. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$allowed_media_types = apply_filters( 'media_embedded_in_content_allowed_types', array( 'audio', 'video', 'object', 'embed', 'iframe' ) );
```
| Used By | Description |
| --- | --- |
| [get\_media\_embedded\_in\_content()](../functions/get_media_embedded_in_content) wp-includes/media.php | Checks the HTML content for a audio, video, object, embed, or iframe tags. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'pre_do_shortcode_tag', false|string $return, string $tag, array|string $attr, array $m ) apply\_filters( 'pre\_do\_shortcode\_tag', false|string $return, string $tag, array|string $attr, array $m )
============================================================================================================
Filters whether to call a shortcode callback.
Returning a non-false value from filter will short-circuit the shortcode generation process, returning that value instead.
`$return` false|string Short-circuit return value. Either false or the value to replace the shortcode with. `$tag` string Shortcode name. `$attr` array|string Shortcode attributes array or empty string. `$m` array Regular expression match array. File: `wp-includes/shortcodes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/shortcodes.php/)
```
$return = apply_filters( 'pre_do_shortcode_tag', false, $tag, $attr, $m );
```
| Used By | Description |
| --- | --- |
| [do\_shortcode\_tag()](../functions/do_shortcode_tag) wp-includes/shortcodes.php | Regular Expression callable for [do\_shortcode()](../functions/do_shortcode) for calling shortcode hook. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'plugin_files_exclusions', string[] $exclusions ) apply\_filters( 'plugin\_files\_exclusions', string[] $exclusions )
===================================================================
Filters the array of excluded directories and files while scanning the folder.
`$exclusions` string[] Array of excluded directories and files. File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
$exclusions = (array) apply_filters( 'plugin_files_exclusions', array( 'CVS', 'node_modules', 'vendor', 'bower_components' ) );
```
| Used By | Description |
| --- | --- |
| [get\_plugin\_files()](../functions/get_plugin_files) wp-admin/includes/plugin.php | Gets a list of a plugin’s files. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'getarchives_join', string $sql_join, array $parsed_args ) apply\_filters( 'getarchives\_join', string $sql\_join, array $parsed\_args )
=============================================================================
Filters the SQL JOIN clause for retrieving archives.
`$sql_join` string Portion of SQL query containing JOIN clause. `$parsed_args` array An array of default arguments. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$join = apply_filters( 'getarchives_join', '', $parsed_args );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_archives()](../functions/wp_get_archives) wp-includes/general-template.php | Displays archive links based on type and format. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'get_the_modified_time', string|int|false $the_time, string $format, WP_Post|null $post ) apply\_filters( 'get\_the\_modified\_time', string|int|false $the\_time, string $format, WP\_Post|null $post )
==============================================================================================================
Filters the localized time a post was last modified.
`$the_time` string|int|false The formatted time or false if no post is found. `$format` string Format to use for retrieving the time the post was modified. Accepts `'G'`, `'U'`, or PHP date format. `$post` [WP\_Post](../classes/wp_post)|null [WP\_Post](../classes/wp_post) object or null if no post is found. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'get_the_modified_time', $the_time, $format, $post );
```
| Used By | Description |
| --- | --- |
| [get\_the\_modified\_time()](../functions/get_the_modified_time) wp-includes/general-template.php | Retrieves the time at which the post was last modified. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$post` parameter. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'ajax_query_attachments_args', array $query ) apply\_filters( 'ajax\_query\_attachments\_args', array $query )
================================================================
Filters the arguments passed to [WP\_Query](../classes/wp_query) during an Ajax call for querying attachments.
* [WP\_Query::parse\_query()](../classes/wp_query/parse_query)
`$query` array An array of query variables. The `ajax_query_attachments_args` filter is used to filter the query that fetches the attachments displayed in the media library modal on the post edit screen.
The filter is used like this
```
add_filter( 'ajax_query_attachments_args', 'filter_function_name', 10, 1 )
```
Where `filter_function_name()` is the function WordPress should call when the query is being modified. Note that the filter function **must** return the query array after it is finished processing, or the query will be empty and no attachments will be shown.
`filter_function_name()` should be a unique function name. It cannot match any other function name already declared.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$query = apply_filters( 'ajax_query_attachments_args', $query );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_query\_attachments()](../functions/wp_ajax_query_attachments) wp-admin/includes/ajax-actions.php | Ajax handler for querying attachments. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'allow_subdirectory_install', bool $allow ) apply\_filters( 'allow\_subdirectory\_install', bool $allow )
=============================================================
Filters whether to enable the subdirectory installation feature in Multisite.
`$allow` bool Whether to enable the subdirectory installation feature in Multisite.
Default false. File: `wp-admin/includes/network.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/network.php/)
```
if ( apply_filters( 'allow_subdirectory_install', false ) ) {
```
| Used By | Description |
| --- | --- |
| [allow\_subdirectory\_install()](../functions/allow_subdirectory_install) wp-admin/includes/network.php | Allow subdirectory installation. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'get_ancestors', int[] $ancestors, int $object_id, string $object_type, string $resource_type ) apply\_filters( 'get\_ancestors', int[] $ancestors, int $object\_id, string $object\_type, string $resource\_type )
===================================================================================================================
Filters a given object’s ancestors.
`$ancestors` int[] An array of IDs of object ancestors. `$object_id` int Object ID. `$object_type` string Type of object. `$resource_type` string Type of resource $object\_type is. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type );
```
| Used By | Description |
| --- | --- |
| [get\_ancestors()](../functions/get_ancestors) wp-includes/taxonomy.php | Gets an array of ancestor IDs for a given object. |
| Version | Description |
| --- | --- |
| [4.1.1](https://developer.wordpress.org/reference/since/4.1.1/) | Introduced the `$resource_type` parameter. |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'enable_loading_object_cache_dropin', bool $enable_object_cache ) apply\_filters( 'enable\_loading\_object\_cache\_dropin', bool $enable\_object\_cache )
=======================================================================================
Filters whether to enable loading of the object-cache.php drop-in.
This filter runs before it can be used by plugins. It is designed for non-web runtimes. If false is returned, object-cache.php will never be loaded.
`$enable_object_cache` bool Whether to enable loading object-cache.php (if present).
Default true. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
if ( $first_init && apply_filters( 'enable_loading_object_cache_dropin', true ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_start\_object\_cache()](../functions/wp_start_object_cache) wp-includes/load.php | Start the WordPress object cache. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'login_form_bottom', string $content, array $args ) apply\_filters( 'login\_form\_bottom', string $content, array $args )
=====================================================================
Filters content to display at the bottom of the login form.
The filter evaluates just preceding the closing form tag element.
`$content` string Content to display. Default empty. `$args` array Array of login form arguments. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$login_form_bottom = apply_filters( 'login_form_bottom', '', $args );
```
| Used By | Description |
| --- | --- |
| [wp\_login\_form()](../functions/wp_login_form) wp-includes/general-template.php | Provides a simple login form for use anywhere within WordPress. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_serve_request', bool $served, WP_HTTP_Response $result, WP_REST_Request $request, WP_REST_Server $server ) apply\_filters( 'rest\_pre\_serve\_request', bool $served, WP\_HTTP\_Response $result, WP\_REST\_Request $request, WP\_REST\_Server $server )
=============================================================================================================================================
Filters whether the REST API request has already been served.
Allow sending the request manually – by returning true, the API result will not be sent to the client.
`$served` bool Whether the request has already been served.
Default false. `$result` [WP\_HTTP\_Response](../classes/wp_http_response) Result to send to the client. Usually a `WP_REST_Response`. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. `$server` [WP\_REST\_Server](../classes/wp_rest_server) Server instance. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
$served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::serve\_request()](../classes/wp_rest_server/serve_request) wp-includes/rest-api/class-wp-rest-server.php | Handles serving a REST API request. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'dashboard_primary_link', string $link ) apply\_filters( 'dashboard\_primary\_link', string $link )
==========================================================
Filters the primary link URL for the ‘WordPress Events and News’ dashboard widget.
`$link` string The widget's primary link URL. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
'link' => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_primary()](../functions/wp_dashboard_primary) wp-admin/includes/dashboard.php | ‘WordPress Events and News’ dashboard widget. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'wpmublogsaction', int $blog_id ) do\_action( 'wpmublogsaction', int $blog\_id )
==============================================
Fires inside the auxiliary ‘Actions’ column of the Sites list table.
By default this column is hidden unless something is hooked to the action.
`$blog_id` int The site ID. File: `wp-admin/includes/class-wp-ms-sites-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-sites-list-table.php/)
```
do_action( 'wpmublogsaction', $blog['blog_id'] );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Sites\_List\_Table::column\_plugins()](../classes/wp_ms_sites_list_table/column_plugins) wp-admin/includes/class-wp-ms-sites-list-table.php | Handles the plugins column output. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_prepare_taxonomy', array $_taxonomy, WP_Taxonomy $taxonomy, array $fields ) apply\_filters( 'xmlrpc\_prepare\_taxonomy', array $\_taxonomy, WP\_Taxonomy $taxonomy, array $fields )
=======================================================================================================
Filters XML-RPC-prepared data for the given taxonomy.
`$_taxonomy` array An array of taxonomy data. `$taxonomy` [WP\_Taxonomy](../classes/wp_taxonomy) Taxonomy object. `$fields` array The subset of taxonomy fields to return. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
return apply_filters( 'xmlrpc_prepare_taxonomy', $_taxonomy, $taxonomy, $fields );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_prepare\_taxonomy()](../classes/wp_xmlrpc_server/_prepare_taxonomy) wp-includes/class-wp-xmlrpc-server.php | Prepares taxonomy data for return in an XML-RPC object. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'notify_post_author', bool $maybe_notify, int $comment_ID ) apply\_filters( 'notify\_post\_author', bool $maybe\_notify, int $comment\_ID )
===============================================================================
Filters whether to send the post author new comment notification emails, overriding the site setting.
`$maybe_notify` bool Whether to notify the post author about the new comment. `$comment_ID` int The ID of the comment for the notification. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_ID );
```
| Used By | Description |
| --- | --- |
| [wp\_new\_comment\_notify\_postauthor()](../functions/wp_new_comment_notify_postauthor) wp-includes/comment.php | Sends a notification of a new comment to the post author. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_audio_shortcode_library', string $library ) apply\_filters( 'wp\_audio\_shortcode\_library', string $library )
==================================================================
Filters the media library used for the audio shortcode.
`$library` string Media library used for the audio shortcode. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$library = apply_filters( 'wp_audio_shortcode_library', 'mediaelement' );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Media\_Audio::enqueue\_preview\_scripts()](../classes/wp_widget_media_audio/enqueue_preview_scripts) wp-includes/widgets/class-wp-widget-media-audio.php | Enqueue preview scripts. |
| [wp\_audio\_shortcode()](../functions/wp_audio_shortcode) wp-includes/media.php | Builds the Audio shortcode output. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'image_editor_save_pre', WP_Image_Editor $image, int $attachment_id ) apply\_filters( 'image\_editor\_save\_pre', WP\_Image\_Editor $image, int $attachment\_id )
===========================================================================================
Filters the [WP\_Image\_Editor](../classes/wp_image_editor) instance for the image to be streamed to the browser.
`$image` [WP\_Image\_Editor](../classes/wp_image_editor) The image editor instance. `$attachment_id` int The attachment post ID. File: `wp-admin/includes/image-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image-edit.php/)
```
$image = apply_filters( 'image_editor_save_pre', $image, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_save\_image\_file()](../functions/wp_save_image_file) wp-admin/includes/image-edit.php | Saves image to file. |
| [wp\_stream\_image()](../functions/wp_stream_image) wp-admin/includes/image-edit.php | Streams image in [WP\_Image\_Editor](../classes/wp_image_editor) to browser. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_unique_filename_file_list', array|null $files, string $dir, string $filename ) apply\_filters( 'pre\_wp\_unique\_filename\_file\_list', array|null $files, string $dir, string $filename )
===========================================================================================================
Filters the file list used for calculating a unique filename for a newly added file.
Returning an array from the filter will effectively short-circuit retrieval from the filesystem and return the passed value instead.
`$files` array|null The list of files to use for filename comparisons.
Default null (to retrieve the list from the filesystem). `$dir` string The directory for the new file. `$filename` string The proposed filename for the new file. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$files = apply_filters( 'pre_wp_unique_filename_file_list', null, $dir, $filename );
```
| Used By | Description |
| --- | --- |
| [wp\_unique\_filename()](../functions/wp_unique_filename) wp-includes/functions.php | Gets a filename that is sanitized and unique for the given directory. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_taxonomies_pre_url_list', array[]|null $url_list, string $taxonomy, int $page_num ) apply\_filters( 'wp\_sitemaps\_taxonomies\_pre\_url\_list', array[]|null $url\_list, string $taxonomy, int $page\_num )
=======================================================================================================================
Filters the taxonomies URL list before it is generated.
Returning a non-null value will effectively short-circuit the generation, returning that value instead.
`$url_list` array[]|null The URL list. Default null. `$taxonomy` string Taxonomy name. `$page_num` int Page of results. File: `wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php/)
```
$url_list = apply_filters(
'wp_sitemaps_taxonomies_pre_url_list',
null,
$taxonomy,
$page_num
);
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Taxonomies::get\_url\_list()](../classes/wp_sitemaps_taxonomies/get_url_list) wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php | Gets a URL list for a taxonomy sitemap. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_prepare_attachment_for_js', array $response, WP_Post $attachment, array|false $meta ) apply\_filters( 'wp\_prepare\_attachment\_for\_js', array $response, WP\_Post $attachment, array|false $meta )
==============================================================================================================
Filters the attachment data prepared for JavaScript.
`$response` array Array of prepared attachment data. @see [wp\_prepare\_attachment\_for\_js()](../functions/wp_prepare_attachment_for_js) . `$attachment` [WP\_Post](../classes/wp_post) Attachment object. `$meta` array|false Array of attachment meta data, or false if there is none. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );
```
| Used By | Description |
| --- | --- |
| [wp\_prepare\_attachment\_for\_js()](../functions/wp_prepare_attachment_for_js) wp-includes/media.php | Prepares an attachment post object for JS, where it is expected to be JSON-encoded and fit into an Attachment model. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'oembed_request_post_id', int $post_id, string $url ) apply\_filters( 'oembed\_request\_post\_id', int $post\_id, string $url )
=========================================================================
Filters the determined post ID.
`$post_id` int The post ID. `$url` string The requested URL. File: `wp-includes/class-wp-oembed-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed-controller.php/)
```
$post_id = apply_filters( 'oembed_request_post_id', $post_id, $request['url'] );
```
| Used By | Description |
| --- | --- |
| [get\_oembed\_response\_data\_for\_url()](../functions/get_oembed_response_data_for_url) wp-includes/embed.php | Retrieves the oEmbed response data for a given URL. |
| [WP\_oEmbed\_Controller::get\_item()](../classes/wp_oembed_controller/get_item) wp-includes/class-wp-oembed-controller.php | Callback for the embed API endpoint. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'recovery_mode_begin_url', string $url, string $token, string $key ) apply\_filters( 'recovery\_mode\_begin\_url', string $url, string $token, string $key )
=======================================================================================
Filters the URL to begin recovery mode.
`$url` string The generated recovery mode begin URL. `$token` string The token used to identify the key. `$key` string The recovery mode key. File: `wp-includes/class-wp-recovery-mode-link-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-link-service.php/)
```
return apply_filters( 'recovery_mode_begin_url', $url, $token, $key );
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Link\_Service::get\_recovery\_mode\_begin\_url()](../classes/wp_recovery_mode_link_service/get_recovery_mode_begin_url) wp-includes/class-wp-recovery-mode-link-service.php | Gets a URL to begin recovery mode. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'excerpt_allowed_blocks', string[] $allowed_blocks ) apply\_filters( 'excerpt\_allowed\_blocks', string[] $allowed\_blocks )
=======================================================================
Filters the list of blocks that can contribute to the excerpt.
If a dynamic block is added to this list, it must not generate another excerpt, as this will cause an infinite loop to occur.
`$allowed_blocks` string[] The list of names of allowed blocks. File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
$allowed_blocks = apply_filters( 'excerpt_allowed_blocks', $allowed_blocks );
```
| Used By | Description |
| --- | --- |
| [excerpt\_remove\_blocks()](../functions/excerpt_remove_blocks) wp-includes/blocks.php | Parses blocks out of a content string, and renders those appropriate for the excerpt. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'dashboard_secondary_link', string $link ) apply\_filters( 'dashboard\_secondary\_link', string $link )
============================================================
Filters the secondary link URL for the ‘WordPress Events and News’ dashboard widget.
`$link` string The widget's secondary link URL. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
'link' => apply_filters( 'dashboard_secondary_link', __( 'https://planet.wordpress.org/' ) ),
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_primary()](../functions/wp_dashboard_primary) wp-admin/includes/dashboard.php | ‘WordPress Events and News’ dashboard widget. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'application_password_failed_authentication', WP_Error $error ) do\_action( 'application\_password\_failed\_authentication', WP\_Error $error )
===============================================================================
Fires when an application password failed to authenticate the user.
`$error` [WP\_Error](../classes/wp_error) The authentication error. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'application_password_failed_authentication', $error );
```
| Used By | Description |
| --- | --- |
| [wp\_authenticate\_application\_password()](../functions/wp_authenticate_application_password) wp-includes/user.php | Authenticates the user using an application password. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( 'restrict_manage_users', string $which ) do\_action( 'restrict\_manage\_users', string $which )
======================================================
Fires just before the closing div containing the bulk role-change controls in the Users list table.
`$which` string The location of the extra table nav markup: `'top'` or `'bottom'`. File: `wp-admin/includes/class-wp-users-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-users-list-table.php/)
```
do_action( 'restrict_manage_users', $which );
```
| Used By | Description |
| --- | --- |
| [WP\_Users\_List\_Table::extra\_tablenav()](../classes/wp_users_list_table/extra_tablenav) wp-admin/includes/class-wp-users-list-table.php | Output the controls to allow user roles to be changed in bulk. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | The `$which` parameter was added. |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'the_feed_link', string $link, string $feed ) apply\_filters( 'the\_feed\_link', string $link, string $feed )
===============================================================
Filters the feed link anchor tag.
`$link` string The complete anchor tag for a feed link. `$feed` string The feed type. Possible values include `'rss2'`, `'atom'`, or an empty string for the default feed type. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
echo apply_filters( 'the_feed_link', $link, $feed );
```
| Used By | Description |
| --- | --- |
| [the\_feed\_link()](../functions/the_feed_link) wp-includes/link-template.php | Displays the permalink for the feed type. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'pre_uninstall_plugin', string $plugin, array $uninstallable_plugins ) do\_action( 'pre\_uninstall\_plugin', string $plugin, array $uninstallable\_plugins )
=====================================================================================
Fires in [uninstall\_plugin()](../functions/uninstall_plugin) immediately before the plugin is uninstalled.
`$plugin` string Path to the plugin file relative to the plugins directory. `$uninstallable_plugins` array Uninstallable plugins. File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
do_action( 'pre_uninstall_plugin', $plugin, $uninstallable_plugins );
```
| Used By | Description |
| --- | --- |
| [uninstall\_plugin()](../functions/uninstall_plugin) wp-admin/includes/plugin.php | Uninstalls a single plugin. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_max_urls', int $max_urls, string $object_type ) apply\_filters( 'wp\_sitemaps\_max\_urls', int $max\_urls, string $object\_type )
=================================================================================
Filters the maximum number of URLs displayed on a sitemap.
`$max_urls` int The maximum number of URLs included in a sitemap. Default 2000. `$object_type` string Object type for sitemap to be filtered (e.g. `'post'`, `'term'`, `'user'`). File: `wp-includes/sitemaps.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps.php/)
```
return apply_filters( 'wp_sitemaps_max_urls', 2000, $object_type );
```
| Used By | Description |
| --- | --- |
| [wp\_sitemaps\_get\_max\_urls()](../functions/wp_sitemaps_get_max_urls) wp-includes/sitemaps.php | Gets the maximum number of URLs for a sitemap. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'setted_site_transient', string $transient, mixed $value, int $expiration ) do\_action( 'setted\_site\_transient', string $transient, mixed $value, int $expiration )
=========================================================================================
Fires after the value for a site transient has been set.
`$transient` string The name of the site transient. `$value` mixed Site transient value. `$expiration` int Time until expiration in seconds. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( 'setted_site_transient', $transient, $value, $expiration );
```
| Used By | Description |
| --- | --- |
| [set\_site\_transient()](../functions/set_site_transient) wp-includes/option.php | Sets/updates the value of a site transient. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'the_category_list', WP_Term[] $categories, int|false $post_id ) apply\_filters( 'the\_category\_list', WP\_Term[] $categories, int|false $post\_id )
====================================================================================
Filters the categories before building the category list.
`$categories` [WP\_Term](../classes/wp_term)[] An array of the post's categories. `$post_id` int|false ID of the post to retrieve categories for.
When `false`, defaults to the current post in the loop. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$categories = apply_filters( 'the_category_list', get_the_category( $post_id ), $post_id );
```
| Used By | Description |
| --- | --- |
| [get\_the\_category\_list()](../functions/get_the_category_list) wp-includes/category-template.php | Retrieves category list for a post in either HTML list or custom format. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_should_handle_php_error', bool $should_handle_error, array $error ) apply\_filters( 'wp\_should\_handle\_php\_error', bool $should\_handle\_error, array $error )
=============================================================================================
Filters whether a given thrown error should be handled by the fatal error handler.
This filter is only fired if the error is not already configured to be handled by WordPress core. As such, it exclusively allows adding further rules for which errors should be handled, but not removing existing ones.
`$should_handle_error` bool Whether the error should be handled by the fatal error handler. `$error` array Error information retrieved from `error_get_last()`. File: `wp-includes/class-wp-fatal-error-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-fatal-error-handler.php/)
```
return (bool) apply_filters( 'wp_should_handle_php_error', false, $error );
```
| Used By | Description |
| --- | --- |
| [WP\_Fatal\_Error\_Handler::should\_handle\_error()](../classes/wp_fatal_error_handler/should_handle_error) wp-includes/class-wp-fatal-error-handler.php | Determines whether we are dealing with an error that WordPress should handle in order to protect the admin backend against WSODs. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'iis7_url_rewrite_rules', string $rules ) apply\_filters( 'iis7\_url\_rewrite\_rules', string $rules )
============================================================
Filters the list of rewrite rules formatted for output to a web.config.
`$rules` string Rewrite rules formatted for IIS web.config. File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
return apply_filters( 'iis7_url_rewrite_rules', $rules );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::iis7\_url\_rewrite\_rules()](../classes/wp_rewrite/iis7_url_rewrite_rules) wp-includes/class-wp-rewrite.php | Retrieves IIS7 URL Rewrite formatted rewrite rules to write to web.config file. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'post-plupload-upload-ui' ) do\_action( 'post-plupload-upload-ui' )
=======================================
Fires after the upload interface loads.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [media\_upload\_form()](../functions/media_upload_form) wp-admin/includes/media.php | Outputs the legacy media upload form. |
| [wp\_print\_media\_templates()](../functions/wp_print_media_templates) wp-includes/media-template.php | Prints the templates used in the media manager. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'pre_delete_attachment', WP_Post|false|null $delete, WP_Post $post, bool $force_delete ) apply\_filters( 'pre\_delete\_attachment', WP\_Post|false|null $delete, WP\_Post $post, bool $force\_delete )
=============================================================================================================
Filters whether an attachment deletion should take place.
`$delete` [WP\_Post](../classes/wp_post)|false|null Whether to go forward with deletion. `$post` [WP\_Post](../classes/wp_post) Post object. `$force_delete` bool Whether to bypass the Trash. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$check = apply_filters( 'pre_delete_attachment', null, $post, $force_delete );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_attachment()](../functions/wp_delete_attachment) wp-includes/post.php | Trashes or deletes an attachment. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'comment_author', string $author, string $comment_ID ) apply\_filters( 'comment\_author', string $author, string $comment\_ID )
========================================================================
Filters the comment author’s name for display.
`$author` string The comment author's username. `$comment_ID` string The comment ID as a numeric string. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
echo apply_filters( 'comment_author', $author, $comment->comment_ID );
```
| Used By | Description |
| --- | --- |
| [comment\_author()](../functions/comment_author) wp-includes/comment-template.php | Displays the author of the current comment. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$comment_ID` parameter was added. |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'get_block_templates', WP_Block_Template[] $query_result, array $query, string $template_type ) apply\_filters( 'get\_block\_templates', WP\_Block\_Template[] $query\_result, array $query, string $template\_type )
=====================================================================================================================
Filters the array of queried block templates array after they’ve been fetched.
`$query_result` [WP\_Block\_Template](../classes/wp_block_template)[] Array of found block templates. `$query` array Arguments to retrieve templates.
* `slug__in`arrayList of slugs to include.
* `wp_id`intPost ID of customized template.
`$template_type` string wp\_template or wp\_template\_part. File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
return apply_filters( 'get_block_templates', $query_result, $query, $template_type );
```
| Used By | Description |
| --- | --- |
| [get\_block\_templates()](../functions/get_block_templates) wp-includes/block-template-utils.php | Retrieves a list of unified template objects based on a query. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'post_rewrite_rules', string[] $post_rewrite ) apply\_filters( 'post\_rewrite\_rules', string[] $post\_rewrite )
=================================================================
Filters rewrite rules used for “post” archives.
`$post_rewrite` string[] Array of rewrite rules for posts, keyed by their regex pattern. This post will only affect content of the post type ‘posts’.
File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
$post_rewrite = apply_filters( 'post_rewrite_rules', $post_rewrite );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::rewrite\_rules()](../classes/wp_rewrite/rewrite_rules) wp-includes/class-wp-rewrite.php | Constructs rewrite matches and queries from permalink structure. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( "add_meta_boxes_{$post_type}", WP_Post $post ) do\_action( "add\_meta\_boxes\_{$post\_type}", WP\_Post $post )
===============================================================
Fires after all built-in meta boxes have been added, contextually for the given post type.
The dynamic portion of the hook name, `$post_type`, refers to the post type of the post.
Possible hook names include:
* `add_meta_boxes_post`
* `add_meta_boxes_page`
* `add_meta_boxes_attachment`
`$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
do_action( "add_meta_boxes_{$post_type}", $post );
```
| Used By | Description |
| --- | --- |
| [register\_and\_do\_post\_meta\_boxes()](../functions/register_and_do_post_meta_boxes) wp-admin/includes/meta-boxes.php | Registers the default post meta boxes, and runs the `do_meta_boxes` actions. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( "edit_user_{$field}", mixed $value, int $user_id ) apply\_filters( "edit\_user\_{$field}", mixed $value, int $user\_id )
=====================================================================
Filters a user field value in the ‘edit’ context.
The dynamic portion of the hook name, `$field`, refers to the prefixed user field being filtered, such as ‘user\_login’, ‘user\_email’, ‘first\_name’, etc.
`$value` mixed Value of the prefixed user field. `$user_id` int User ID. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$value = apply_filters( "edit_user_{$field}", $value, $user_id );
```
| Used By | Description |
| --- | --- |
| [sanitize\_user\_field()](../functions/sanitize_user_field) wp-includes/user.php | Sanitizes user field based on context. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'block_parser_class', string $parser_class ) apply\_filters( 'block\_parser\_class', string $parser\_class )
===============================================================
Filter to allow plugins to replace the server-side block parser.
`$parser_class` string Name of block parser class. File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
$parser_class = apply_filters( 'block_parser_class', 'WP_Block_Parser' );
```
| Used By | Description |
| --- | --- |
| [parse\_blocks()](../functions/parse_blocks) wp-includes/blocks.php | Parses blocks out of a content string. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'rest_route_for_post', string $route, WP_Post $post ) apply\_filters( 'rest\_route\_for\_post', string $route, WP\_Post $post )
=========================================================================
Filters the REST API route for a post.
`$route` string The route path. `$post` [WP\_Post](../classes/wp_post) The post object. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
return apply_filters( 'rest_route_for_post', $route, $post );
```
| Used By | Description |
| --- | --- |
| [rest\_get\_route\_for\_post()](../functions/rest_get_route_for_post) wp-includes/rest-api.php | Gets the REST API route for a post. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'fs_ftp_connection_types', string[] $types, array $credentials, string $type, bool|WP_Error $error, string $context ) apply\_filters( 'fs\_ftp\_connection\_types', string[] $types, array $credentials, string $type, bool|WP\_Error $error, string $context )
=========================================================================================================================================
Filters the connection types to output to the filesystem credentials form.
`$types` string[] Types of connections. `$credentials` array Credentials to connect with. `$type` string Chosen filesystem method. `$error` bool|[WP\_Error](../classes/wp_error) Whether the current request has failed to connect, or an error object. `$context` string Full path to the directory that is tested for being writable. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context );
```
| Used By | Description |
| --- | --- |
| [request\_filesystem\_credentials()](../functions/request_filesystem_credentials) wp-admin/includes/file.php | Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | The `$context` parameter default changed from `false` to an empty string. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'new_user_email_content', string $email_text, array $new_user_email ) apply\_filters( 'new\_user\_email\_content', string $email\_text, array $new\_user\_email )
===========================================================================================
Filters the text of the email sent when a change of user email address is attempted.
The following strings have a special meaning and will get replaced dynamically:
*
*
*
*
*
`$email_text` string Text in the email. `$new_user_email` array Data relating to the new user email address.
* `hash`stringThe secure hash used in the confirmation link URL.
* `newemail`stringThe proposed new email address.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$content = apply_filters( 'new_user_email_content', $email_text, $new_user_email );
```
| Used By | Description |
| --- | --- |
| [send\_confirmation\_on\_profile\_email()](../functions/send_confirmation_on_profile_email) wp-includes/user.php | Sends a confirmation request email when a change of user email address is attempted. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | MU (3.0.0) |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_menu_location', WP_REST_Response $response, object $location, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_menu\_location', WP\_REST\_Response $response, object $location, WP\_REST\_Request $request )
=============================================================================================================================
Filters menu location data returned from the REST API.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$location` object The original location object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-menu-locations-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-menu-locations-controller.php/)
```
return apply_filters( 'rest_prepare_menu_location', $response, $location, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menu\_Locations\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_menu_locations_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-menu-locations-controller.php | Prepares a menu location object for serialization. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'editor_stylesheets', string[] $stylesheets ) apply\_filters( 'editor\_stylesheets', string[] $stylesheets )
==============================================================
Filters the array of URLs of stylesheets applied to the editor.
`$stylesheets` string[] Array of URLs of stylesheets to be applied to the editor. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'editor_stylesheets', $stylesheets );
```
| Used By | Description |
| --- | --- |
| [get\_editor\_stylesheets()](../functions/get_editor_stylesheets) wp-includes/theme.php | Retrieves any registered editor stylesheet URLs. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'rest_namespace_index', WP_REST_Response $response, WP_REST_Request $request ) apply\_filters( 'rest\_namespace\_index', WP\_REST\_Response $response, WP\_REST\_Request $request )
====================================================================================================
Filters the REST API namespace index data.
This typically is just the route data for the namespace, but you can add any data you’d like here.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) Response data. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request data. The namespace is passed as the `'namespace'` parameter. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
return apply_filters( 'rest_namespace_index', $response, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::get\_namespace\_index()](../classes/wp_rest_server/get_namespace_index) wp-includes/rest-api/class-wp-rest-server.php | Retrieves the index for a namespace. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'site_icon_attachment_metadata', array $metadata ) apply\_filters( 'site\_icon\_attachment\_metadata', array $metadata )
=====================================================================
Filters the site icon attachment metadata.
* [wp\_generate\_attachment\_metadata()](../functions/wp_generate_attachment_metadata)
`$metadata` array Attachment metadata. File: `wp-admin/includes/class-wp-site-icon.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-site-icon.php/)
```
$metadata = apply_filters( 'site_icon_attachment_metadata', $metadata );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Icon::insert\_attachment()](../classes/wp_site_icon/insert_attachment) wp-admin/includes/class-wp-site-icon.php | Inserts an attachment. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'widget_update_callback', array $instance, array $new_instance, array $old_instance, WP_Widget $widget ) apply\_filters( 'widget\_update\_callback', array $instance, array $new\_instance, array $old\_instance, WP\_Widget $widget )
=============================================================================================================================
Filters a widget’s settings before saving.
Returning false will effectively short-circuit the widget’s ability to update settings.
`$instance` array The current widget instance's settings. `$new_instance` array Array of new widget settings. `$old_instance` array Array of old widget settings. `$widget` [WP\_Widget](../classes/wp_widget) The current widget instance. File: `wp-includes/class-wp-widget.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-widget.php/)
```
$instance = apply_filters( 'widget_update_callback', $instance, $new_instance, $old_instance, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::encode\_form\_data()](../classes/wp_rest_widget_types_controller/encode_form_data) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | An RPC-style endpoint which can be used by clients to turn user input in a widget admin form into an encoded instance object. |
| [WP\_Widget::update\_callback()](../classes/wp_widget/update_callback) wp-includes/class-wp-widget.php | Handles changed settings (Do NOT override). |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'the_shortlink', string $link, string $shortlink, string $text, string $title ) apply\_filters( 'the\_shortlink', string $link, string $shortlink, string $text, string $title )
================================================================================================
Filters the short link anchor tag for a post.
`$link` string Shortlink anchor tag. `$shortlink` string Shortlink URL. `$text` string Shortlink's text. `$title` string Shortlink's title attribute. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title );
```
| Used By | Description |
| --- | --- |
| [the\_shortlink()](../functions/the_shortlink) wp-includes/link-template.php | Displays the shortlink for a post. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( '_wp_relative_upload_path', string $new_path, string $path ) apply\_filters( '\_wp\_relative\_upload\_path', string $new\_path, string $path )
=================================================================================
Filters the relative path to an uploaded file.
`$new_path` string Relative path to the file. `$path` string Full path to the file. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( '_wp_relative_upload_path', $new_path, $path );
```
| Used By | Description |
| --- | --- |
| [\_wp\_relative\_upload\_path()](../functions/_wp_relative_upload_path) wp-includes/post.php | Returns relative path to an uploaded file. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'preprocess_comment', array $commentdata ) apply\_filters( 'preprocess\_comment', array $commentdata )
===========================================================
Filters a comment’s data before it is sanitized and inserted into the database.
`$commentdata` array Comment data. The `$commentdata` array contains the following indices:
`'comment_post_ID' - The post to which the comment will apply
'comment_author' - (may be empty)
'comment_author_email' - (may be empty)
'comment_author_url' - (may be empty)
'comment_content' - The text of the proposed comment
'comment_type' - 'pingback', 'trackback', or empty for regular comments
'user_ID' - (empty if not logged in)`
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$commentdata = apply_filters( 'preprocess_comment', $commentdata );
```
| Used By | Description |
| --- | --- |
| [wp\_new\_comment()](../functions/wp_new_comment) wp-includes/comment.php | Adds a new comment to the database. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Comment data includes the `comment_agent` and `comment_author_IP` values. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'is_active_sidebar', bool $is_active_sidebar, int|string $index ) apply\_filters( 'is\_active\_sidebar', bool $is\_active\_sidebar, int|string $index )
=====================================================================================
Filters whether a dynamic sidebar is considered “active”.
`$is_active_sidebar` bool Whether or not the sidebar should be considered "active".
In other words, whether the sidebar contains any widgets. `$index` int|string Index, name, or ID of the dynamic sidebar. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
return apply_filters( 'is_active_sidebar', $is_active_sidebar, $index );
```
| Used By | Description |
| --- | --- |
| [is\_active\_sidebar()](../functions/is_active_sidebar) wp-includes/widgets.php | Determines whether a sidebar contains widgets. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'the_date', string $the_date, string $format, string $before, string $after ) apply\_filters( 'the\_date', string $the\_date, string $format, string $before, string $after )
===============================================================================================
Filters the date a post was published for display.
`$the_date` string The formatted date string. `$format` string PHP date format. `$before` string HTML output before the date. `$after` string HTML output after the date. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$the_date = apply_filters( 'the_date', $the_date, $format, $before, $after );
```
| Used By | Description |
| --- | --- |
| [the\_date()](../functions/the_date) wp-includes/general-template.php | Displays or retrieves the date the current post was written (once per date) |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress do_action_ref_array( 'loop_start', WP_Query $query ) do\_action\_ref\_array( 'loop\_start', WP\_Query $query )
=========================================================
Fires once the loop is started.
`$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
do_action_ref_array( 'loop_start', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::the\_post()](../classes/wp_query/the_post) wp-includes/class-wp-query.php | Sets up the current post. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( "comment_form_field_{$name}", string $field ) apply\_filters( "comment\_form\_field\_{$name}", string $field )
================================================================
Filters a comment form field for display.
The dynamic portion of the hook name, `$name`, refers to the name of the comment form field.
Possible hook names include:
* `comment_form_field_comment`
* `comment_form_field_author`
* `comment_form_field_email`
* `comment_form_field_url`
* `comment_form_field_cookies`
`$field` string The HTML-formatted output of the comment form field. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
```
| Used By | Description |
| --- | --- |
| [comment\_form()](../functions/comment_form) wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'plugins_api_result', object|WP_Error $res, string $action, object $args ) apply\_filters( 'plugins\_api\_result', object|WP\_Error $res, string $action, object $args )
=============================================================================================
Filters the Plugin Installation API response results.
`$res` object|[WP\_Error](../classes/wp_error) Response object or [WP\_Error](../classes/wp_error). `$action` string The type of information being requested from the Plugin Installation API. `$args` object Plugin API arguments. File: `wp-admin/includes/plugin-install.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin-install.php/)
```
return apply_filters( 'plugins_api_result', $res, $action, $args );
```
| Used By | Description |
| --- | --- |
| [plugins\_api()](../functions/plugins_api) wp-admin/includes/plugin-install.php | Retrieves plugin installer pages from the WordPress.org Plugins API. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'post_link_category', WP_Term $cat, array $cats, WP_Post $post ) apply\_filters( 'post\_link\_category', WP\_Term $cat, array $cats, WP\_Post $post )
====================================================================================
Filters the category that gets used in the %category% permalink token.
`$cat` [WP\_Term](../classes/wp_term) The category to use in the permalink. `$cats` array Array of all categories ([WP\_Term](../classes/wp_term) objects) associated with the post. `$post` [WP\_Post](../classes/wp_post) The post in question. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );
```
| Used By | Description |
| --- | --- |
| [get\_permalink()](../functions/get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'pre_prepare_themes_for_js', array $prepared_themes, WP_Theme[]|null $themes, string $current_theme ) apply\_filters( 'pre\_prepare\_themes\_for\_js', array $prepared\_themes, WP\_Theme[]|null $themes, string $current\_theme )
============================================================================================================================
Filters theme data before it is prepared for JavaScript.
Passing a non-empty array will result in [wp\_prepare\_themes\_for\_js()](../functions/wp_prepare_themes_for_js) returning early with that value instead.
`$prepared_themes` array An associative array of theme data. Default empty array. `$themes` [WP\_Theme](../classes/wp_theme)[]|null An array of theme objects to prepare, if any. `$current_theme` string The active theme slug. File: `wp-admin/includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
```
$prepared_themes = (array) apply_filters( 'pre_prepare_themes_for_js', array(), $themes, $current_theme );
```
| Used By | Description |
| --- | --- |
| [wp\_prepare\_themes\_for\_js()](../functions/wp_prepare_themes_for_js) wp-admin/includes/theme.php | Prepares themes for JavaScript. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress do_action( "rest_after_insert_{$this->taxonomy}", WP_Term $term, WP_REST_Request $request, bool $creating ) do\_action( "rest\_after\_insert\_{$this->taxonomy}", WP\_Term $term, WP\_REST\_Request $request, bool $creating )
==================================================================================================================
Fires after a single term is completely created or updated via the REST API.
The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `rest_after_insert_category`
* `rest_after_insert_post_tag`
`$term` [WP\_Term](../classes/wp_term) Inserted or updated term object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$creating` bool True when creating a term, false when updating. File: `wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php/)
```
do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menus\_Controller::create\_item()](../classes/wp_rest_menus_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Creates a single term in a taxonomy. |
| [WP\_REST\_Menus\_Controller::update\_item()](../classes/wp_rest_menus_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Updates a single term from a taxonomy. |
| [WP\_REST\_Terms\_Controller::create\_item()](../classes/wp_rest_terms_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Creates a single term in a taxonomy. |
| [WP\_REST\_Terms\_Controller::update\_item()](../classes/wp_rest_terms_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Updates a single term from a taxonomy. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'enqueue_block_editor_assets' ) do\_action( 'enqueue\_block\_editor\_assets' )
==============================================
Fires after block assets have been enqueued for the editing interface.
Call `add_action` on any hook before ‘admin\_enqueue\_scripts’.
In the function call you supply, simply use `wp_enqueue_script` and `wp_enqueue_style` to add your functionality to the block editor.
File: `wp-admin/edit-form-blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-form-blocks.php/)
```
do_action( 'enqueue_block_editor_assets' );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Widgets::enqueue\_scripts()](../classes/wp_customize_widgets/enqueue_scripts) wp-includes/class-wp-customize-widgets.php | Enqueues scripts and styles for Customizer panel and export data to JavaScript. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'admin_print_scripts-media-upload-popup' ) do\_action( 'admin\_print\_scripts-media-upload-popup' )
========================================================
Fires when admin scripts enqueued for the legacy (pre-3.5.0) media upload popup are printed.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'admin_print_scripts-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [wp\_iframe()](../functions/wp_iframe) wp-admin/includes/media.php | Outputs the iframe to display the media upload page. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_wp_insert_post_data', array $post_data, array $content_struct ) apply\_filters( 'xmlrpc\_wp\_insert\_post\_data', array $post\_data, array $content\_struct )
=============================================================================================
Filters post data array to be inserted via XML-RPC.
`$post_data` array Parsed array of post data. `$content_struct` array Post data array. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
$post_data = apply_filters( 'xmlrpc_wp_insert_post_data', $post_data, $content_struct );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_insert\_post()](../classes/wp_xmlrpc_server/_insert_post) wp-includes/class-wp-xmlrpc-server.php | Helper method for wp\_newPost() and wp\_editPost(), containing shared logic. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'manage_taxonomies_for_attachment_columns', string[] $taxonomies, string $post_type ) apply\_filters( 'manage\_taxonomies\_for\_attachment\_columns', string[] $taxonomies, string $post\_type )
==========================================================================================================
Filters the taxonomy columns for attachments in the Media list table.
`$taxonomies` string[] An array of registered taxonomy names to show for attachments. `$post_type` string The post type. Default `'attachment'`. File: `wp-admin/includes/class-wp-media-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-media-list-table.php/)
```
$taxonomies = apply_filters( 'manage_taxonomies_for_attachment_columns', $taxonomies, 'attachment' );
```
| Used By | Description |
| --- | --- |
| [WP\_Media\_List\_Table::get\_columns()](../classes/wp_media_list_table/get_columns) wp-admin/includes/class-wp-media-list-table.php | |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'wp_mediaelement_fallback', string $output, string $url ) apply\_filters( 'wp\_mediaelement\_fallback', string $output, string $url )
===========================================================================
Filters the Mediaelement fallback output for no-JS.
`$output` string Fallback output for no-JS. `$url` string Media file URL. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_mediaelement_fallback', sprintf( '<a href="%1$s">%1$s</a>', esc_url( $url ) ), $url );
```
| Used By | Description |
| --- | --- |
| [wp\_mediaelement\_fallback()](../functions/wp_mediaelement_fallback) wp-includes/media.php | Provides a No-JS Flash fallback as a last resort for audio / video. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'post_thumbnail_id', int|false $thumbnail_id, int|WP_Post|null $post ) apply\_filters( 'post\_thumbnail\_id', int|false $thumbnail\_id, int|WP\_Post|null $post )
==========================================================================================
Filters the post thumbnail ID.
`$thumbnail_id` int|false Post thumbnail ID or false if the post does not exist. `$post` int|[WP\_Post](../classes/wp_post)|null Post ID or [WP\_Post](../classes/wp_post) object. Default is global `$post`. File: `wp-includes/post-thumbnail-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-thumbnail-template.php/)
```
return (int) apply_filters( 'post_thumbnail_id', $thumbnail_id, $post );
```
| Used By | Description |
| --- | --- |
| [get\_post\_thumbnail\_id()](../functions/get_post_thumbnail_id) wp-includes/post-thumbnail-template.php | Retrieves the post thumbnail ID. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'get_image_tag_class', string $class, int $id, string $align, string|int[] $size ) apply\_filters( 'get\_image\_tag\_class', string $class, int $id, string $align, string|int[] $size )
=====================================================================================================
Filters the value of the attachment’s image tag class attribute.
`$class` string CSS class name or space-separated list of classes. `$id` int Attachment ID. `$align` string Part of the class name for aligning the image. `$size` string|int[] Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );
```
| Used By | Description |
| --- | --- |
| [get\_image\_tag()](../functions/get_image_tag) wp-includes/media.php | Gets an img tag for an image attachment, scaling it down if requested. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'populate_network_meta', array $sitemeta, int $network_id ) apply\_filters( 'populate\_network\_meta', array $sitemeta, int $network\_id )
==============================================================================
Filters meta for a network on creation.
`$sitemeta` array Associative array of network meta keys and values to be inserted. `$network_id` int ID of network to populate. File: `wp-admin/includes/schema.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/schema.php/)
```
$sitemeta = apply_filters( 'populate_network_meta', $sitemeta, $network_id );
```
| Used By | Description |
| --- | --- |
| [populate\_network\_meta()](../functions/populate_network_meta) wp-admin/includes/schema.php | Creates WordPress network meta and sets the default values. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'get_site_icon_url', string $url, int $size, int $blog_id ) apply\_filters( 'get\_site\_icon\_url', string $url, int $size, int $blog\_id )
===============================================================================
Filters the site icon URL.
`$url` string Site icon URL. `$size` int Size of the site icon. `$blog_id` int ID of the blog to get the site icon for. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'get_site_icon_url', $url, $size, $blog_id );
```
| Used By | Description |
| --- | --- |
| [get\_site\_icon\_url()](../functions/get_site_icon_url) wp-includes/general-template.php | Returns the Site Icon URL. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'wp_after_insert_post', int $post_id, WP_Post $post, bool $update, null|WP_Post $post_before ) do\_action( 'wp\_after\_insert\_post', int $post\_id, WP\_Post $post, bool $update, null|WP\_Post $post\_before )
=================================================================================================================
Fires once a post, its terms and meta data has been saved.
`$post_id` int Post ID. `$post` [WP\_Post](../classes/wp_post) Post object. `$update` bool Whether this is an existing post being updated. `$post_before` null|[WP\_Post](../classes/wp_post) Null for new posts, the [WP\_Post](../classes/wp_post) object prior to the update for updated posts. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'wp_after_insert_post', $post_id, $post, $update, $post_before );
```
| Used By | Description |
| --- | --- |
| [wp\_after\_insert\_post()](../functions/wp_after_insert_post) wp-includes/post.php | Fires actions after a post, its terms and meta data has been saved. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'should_load_block_editor_scripts_and_styles', bool $is_block_editor_screen ) apply\_filters( 'should\_load\_block\_editor\_scripts\_and\_styles', bool $is\_block\_editor\_screen )
======================================================================================================
Filters the flag that decides whether or not block editor scripts and styles are going to be enqueued on the current screen.
`$is_block_editor_screen` bool Current value of the flag. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
return apply_filters( 'should_load_block_editor_scripts_and_styles', $is_block_editor_screen );
```
| Used By | Description |
| --- | --- |
| [wp\_should\_load\_block\_editor\_scripts\_and\_styles()](../functions/wp_should_load_block_editor_scripts_and_styles) wp-includes/script-loader.php | Checks if the editor scripts and styles for all registered block types should be enqueued on the current screen. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'admin_viewport_meta', string $viewport_meta ) apply\_filters( 'admin\_viewport\_meta', string $viewport\_meta )
=================================================================
Filters the viewport meta in the admin.
`$viewport_meta` string The viewport meta. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
$viewport_meta = apply_filters( 'admin_viewport_meta', 'width=device-width,initial-scale=1.0' );
```
| Used By | Description |
| --- | --- |
| [wp\_admin\_viewport\_meta()](../functions/wp_admin_viewport_meta) wp-admin/includes/misc.php | Displays the viewport meta in the admin. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action_ref_array( 'loop_end', WP_Query $query ) do\_action\_ref\_array( 'loop\_end', WP\_Query $query )
=======================================================
Fires once the loop has ended.
`$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
do_action_ref_array( 'loop_end', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::have\_posts()](../classes/wp_query/have_posts) wp-includes/class-wp-query.php | Determines whether there are more posts available in the loop. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'sanitize_mime_type', string $sani_mime_type, string $mime_type ) apply\_filters( 'sanitize\_mime\_type', string $sani\_mime\_type, string $mime\_type )
======================================================================================
Filters a mime type following sanitization.
`$sani_mime_type` string The sanitized mime type. `$mime_type` string The mime type prior to sanitization. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
```
| Used By | Description |
| --- | --- |
| [sanitize\_mime\_type()](../functions/sanitize_mime_type) wp-includes/formatting.php | Sanitizes a mime type |
| Version | Description |
| --- | --- |
| [3.1.3](https://developer.wordpress.org/reference/since/3.1.3/) | Introduced. |
wordpress apply_filters( 'wp_die_xml_handler', callable $callback ) apply\_filters( 'wp\_die\_xml\_handler', callable $callback )
=============================================================
Filters the callback for killing WordPress execution for XML requests.
`$callback` callable Callback function name. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$callback = apply_filters( 'wp_die_xml_handler', '_xml_wp_die_handler' );
```
| Used By | Description |
| --- | --- |
| [wp\_die()](../functions/wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'print_styles_array', string[] $to_do ) apply\_filters( 'print\_styles\_array', string[] $to\_do )
==========================================================
Filters the array of enqueued styles before processing for output.
`$to_do` string[] The list of enqueued style handles about to be processed. File: `wp-includes/class-wp-styles.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes_class-wp-styles-php-2/)
```
$this->to_do = apply_filters( 'print_styles_array', $this->to_do );
```
| Used By | Description |
| --- | --- |
| [WP\_Styles::all\_deps()](../classes/wp_styles/all_deps) wp-includes/class-wp-styles.php | Determines style dependencies. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'pre_get_search_form', array $args ) do\_action( 'pre\_get\_search\_form', array $args )
===================================================
Fires before the search form is retrieved, at the start of [get\_search\_form()](../functions/get_search_form) .
`$args` array The array of arguments for building the search form.
See [get\_search\_form()](../functions/get_search_form) for information on accepted arguments. More Arguments from get\_search\_form( ... $args ) Array of display arguments.
* `echo`boolWhether to echo or return the form. Default true.
* `aria_label`stringARIA label for the search form. Useful to distinguish multiple search forms on the same page and improve accessibility.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'pre_get_search_form', $args );
```
| Used By | Description |
| --- | --- |
| [get\_search\_form()](../functions/get_search_form) wp-includes/general-template.php | Displays search form. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$args` parameter was added. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'manage_link_custom_column', string $column_name, int $link_id ) do\_action( 'manage\_link\_custom\_column', string $column\_name, int $link\_id )
=================================================================================
Fires for each registered custom link column.
`$column_name` string Name of the custom column. `$link_id` int Link ID. File: `wp-admin/includes/class-wp-links-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-links-list-table.php/)
```
do_action( 'manage_link_custom_column', $column_name, $item->link_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Links\_List\_Table::column\_default()](../classes/wp_links_list_table/column_default) wp-admin/includes/class-wp-links-list-table.php | Handles the default column output. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_generate_tag_cloud', string[]|string $return, WP_Term[] $tags, array $args ) apply\_filters( 'wp\_generate\_tag\_cloud', string[]|string $return, WP\_Term[] $tags, array $args )
====================================================================================================
Filters the generated output of a tag cloud.
The filter is only evaluated if a true value is passed to the $filter argument in [wp\_generate\_tag\_cloud()](../functions/wp_generate_tag_cloud) .
* [wp\_generate\_tag\_cloud()](../functions/wp_generate_tag_cloud)
`$return` string[]|string String containing the generated HTML tag cloud output or an array of tag links if the `'format'` argument equals `'array'`. `$tags` [WP\_Term](../classes/wp_term)[] An array of terms used in the tag cloud. `$args` array An array of [wp\_generate\_tag\_cloud()](../functions/wp_generate_tag_cloud) arguments. More Arguments from wp\_generate\_tag\_cloud( ... $args ) Array or string of arguments for generating a tag cloud.
* `smallest`intSmallest font size used to display tags. Paired with the value of `$unit`, to determine CSS text size unit. Default 8 (pt).
* `largest`intLargest font size used to display tags. Paired with the value of `$unit`, to determine CSS text size unit. Default 22 (pt).
* `unit`stringCSS text size unit to use with the `$smallest` and `$largest` values. Accepts any valid CSS text size unit. Default `'pt'`.
* `number`intThe number of tags to return. Accepts any positive integer or zero to return all.
Default 0.
* `format`stringFormat to display the tag cloud in. Accepts `'flat'` (tags separated with spaces), `'list'` (tags displayed in an unordered list), or `'array'` (returns an array).
Default `'flat'`.
* `separator`stringHTML or text to separate the tags. Default "n" (newline).
* `orderby`stringValue to order tags by. Accepts `'name'` or `'count'`.
Default `'name'`. The ['tag\_cloud\_sort'](tag_cloud_sort) filter can also affect how tags are sorted.
* `order`stringHow to order the tags. Accepts `'ASC'` (ascending), `'DESC'` (descending), or `'RAND'` (random). Default `'ASC'`.
* `filter`int|boolWhether to enable filtering of the final output via ['wp\_generate\_tag\_cloud'](wp_generate_tag_cloud). Default 1.
* `topic_count_text`arrayNooped plural text from [\_n\_noop()](../functions/_n_noop) to supply to tag counts. Default null.
* `topic_count_text_callback`callableCallback used to generate nooped plural text for tag counts based on the count. Default null.
* `topic_count_scale_callback`callableCallback used to determine the tag count scaling value. Default [default\_topic\_count\_scale()](../functions/default_topic_count_scale) .
* `show_count`bool|intWhether to display the tag counts. Default 0. Accepts 0, 1, or their bool equivalents.
File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_generate\_tag\_cloud()](../functions/wp_generate_tag_cloud) wp-includes/category-template.php | Generates a tag cloud (heatmap) from provided data. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'load_script_textdomain_relative_path', string|false $relative, string $src ) apply\_filters( 'load\_script\_textdomain\_relative\_path', string|false $relative, string $src )
=================================================================================================
Filters the relative path of scripts used for finding translation files.
`$relative` string|false The relative path of the script. False if it could not be determined. `$src` string The full source URL of the script. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$relative = apply_filters( 'load_script_textdomain_relative_path', $relative, $src );
```
| Used By | Description |
| --- | --- |
| [load\_script\_textdomain()](../functions/load_script_textdomain) wp-includes/l10n.php | Loads the script translated strings. |
| Version | Description |
| --- | --- |
| [5.0.2](https://developer.wordpress.org/reference/since/5.0.2/) | Introduced. |
wordpress do_action_ref_array( 'wp_default_scripts', WP_Scripts $wp_scripts ) do\_action\_ref\_array( 'wp\_default\_scripts', WP\_Scripts $wp\_scripts )
==========================================================================
Fires when the [WP\_Scripts](../classes/wp_scripts) instance is initialized.
`$wp_scripts` [WP\_Scripts](../classes/wp_scripts) [WP\_Scripts](../classes/wp_scripts) instance (passed by reference). File: `wp-includes/class-wp-scripts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes_class-wp-scripts-php-2/)
```
do_action_ref_array( 'wp_default_scripts', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Scripts::init()](../classes/wp_scripts/init) wp-includes/class-wp-scripts.php | Initialize the class. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'after_plugin_row', string $plugin_file, array $plugin_data, string $status ) do\_action( 'after\_plugin\_row', string $plugin\_file, array $plugin\_data, string $status )
=============================================================================================
Fires after each row in the Plugins list table.
`$plugin_file` string Path to the plugin file relative to the plugins directory. `$plugin_data` array An array of plugin data. See [get\_plugin\_data()](../functions/get_plugin_data) and the ['plugin\_row\_meta'](plugin_row_meta) filter for the list of possible values. `$status` string Status filter currently applied to the plugin list.
Possible values are: `'all'`, `'active'`, `'inactive'`, `'recently_activated'`, `'upgrade'`, `'mustuse'`, `'dropins'`, `'search'`, `'paused'`, `'auto-update-enabled'`, `'auto-update-disabled'`. File: `wp-admin/includes/class-wp-plugins-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-plugins-list-table.php/)
```
do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugins\_List\_Table::single\_row()](../classes/wp_plugins_list_table/single_row) wp-admin/includes/class-wp-plugins-list-table.php | |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added `'auto-update-enabled'` and `'auto-update-disabled'` to possible values for `$status`. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'loop_no_results', WP_Query $query ) do\_action( 'loop\_no\_results', WP\_Query $query )
===================================================
Fires if no results are found in a post query.
`$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance. File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
do_action( 'loop_no_results', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::have\_posts()](../classes/wp_query/have_posts) wp-includes/class-wp-query.php | Determines whether there are more posts available in the loop. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", bool $allowed, string $meta_key, int $object_id, int $user_id, string $cap, string[] $caps ) apply\_filters( "auth\_{$object\_type}\_meta\_{$meta\_key}\_for\_{$object\_subtype}", bool $allowed, string $meta\_key, int $object\_id, int $user\_id, string $cap, string[] $caps )
=====================================================================================================================================================================================
Filters whether the user is allowed to edit a specific meta key of a specific object type and subtype.
The dynamic portions of the hook name, `$object_type`, `$meta_key`, and `$object_subtype`, refer to the metadata object type (comment, post, term or user), the meta key value, and the object subtype respectively.
`$allowed` bool Whether the user can add the object meta. Default false. `$meta_key` string The meta key. `$object_id` int Object ID. `$user_id` int User ID. `$cap` string Capability name. `$caps` string[] Array of the user's capabilities. File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
$allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );
```
| Used By | Description |
| --- | --- |
| [map\_meta\_cap()](../functions/map_meta_cap) wp-includes/capabilities.php | Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked. |
| Version | Description |
| --- | --- |
| [4.9.8](https://developer.wordpress.org/reference/since/4.9.8/) | Introduced. |
wordpress apply_filters( 'rest_request_before_callbacks', WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response, array $handler, WP_REST_Request $request ) apply\_filters( 'rest\_request\_before\_callbacks', WP\_REST\_Response|WP\_HTTP\_Response|WP\_Error|mixed $response, array $handler, WP\_REST\_Request $request )
=================================================================================================================================================================
Filters the response before executing any REST API callbacks.
Allows plugins to perform additional validation after a request is initialized and matched to a registered route, but before it is executed.
Note that this filter will not be called for requests that fail to authenticate or match to a registered route.
`$response` [WP\_REST\_Response](../classes/wp_rest_response)|[WP\_HTTP\_Response](../classes/wp_http_response)|[WP\_Error](../classes/wp_error)|mixed Result to send to the client.
Usually a [WP\_REST\_Response](../classes/wp_rest_response) or [WP\_Error](../classes/wp_error). `$handler` array Route handler used for the request. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
$response = apply_filters( 'rest_request_before_callbacks', $response, $handler, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::respond\_to\_request()](../classes/wp_rest_server/respond_to_request) wp-includes/rest-api/class-wp-rest-server.php | Dispatches the request to the callback handler. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'pre_months_dropdown_query', object[]|false $months, string $post_type ) apply\_filters( 'pre\_months\_dropdown\_query', object[]|false $months, string $post\_type )
============================================================================================
Filters whether to short-circuit performing the months dropdown query.
`$months` object[]|false `'Months'` drop-down results. Default false. `$post_type` string The post type. File: `wp-admin/includes/class-wp-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-list-table.php/)
```
$months = apply_filters( 'pre_months_dropdown_query', false, $post_type );
```
| Used By | Description |
| --- | --- |
| [WP\_List\_Table::months\_dropdown()](../classes/wp_list_table/months_dropdown) wp-admin/includes/class-wp-list-table.php | Displays a dropdown for filtering items in the list table by month. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'image_add_caption_text', string $caption, int $id ) apply\_filters( 'image\_add\_caption\_text', string $caption, int $id )
=======================================================================
Filters the caption text.
Note: If the caption text is empty, the caption shortcode will not be appended to the image HTML when inserted into the editor.
Passing an empty value also prevents the [‘image\_add\_caption\_shortcode’](image_add_caption_shortcode) Filters from being evaluated at the end of [image\_add\_caption()](../functions/image_add_caption) .
`$caption` string The original caption text. `$id` int The attachment ID. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$caption = apply_filters( 'image_add_caption_text', $caption, $id );
```
| Used By | Description |
| --- | --- |
| [image\_add\_caption()](../functions/image_add_caption) wp-admin/includes/media.php | Adds image shortcode with caption to editor. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'get_edit_term_link', string $location, int $term_id, string $taxonomy, string $object_type ) apply\_filters( 'get\_edit\_term\_link', string $location, int $term\_id, string $taxonomy, string $object\_type )
==================================================================================================================
Filters the edit link for a term.
`$location` string The edit link. `$term_id` int Term ID. `$taxonomy` string Taxonomy name. `$object_type` string The object type. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'get_edit_term_link', $location, $term_id, $taxonomy, $object_type );
```
| Used By | Description |
| --- | --- |
| [get\_edit\_term\_link()](../functions/get_edit_term_link) wp-includes/link-template.php | Retrieves the URL for editing a given term. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'default_feed', string $feed_type ) apply\_filters( 'default\_feed', string $feed\_type )
=====================================================
Filters the default feed type.
`$feed_type` string Type of default feed. Possible values include `'rss2'`, `'atom'`.
Default `'rss2'`. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
$default_feed = apply_filters( 'default_feed', 'rss2' );
```
| Used By | Description |
| --- | --- |
| [get\_default\_feed()](../functions/get_default_feed) wp-includes/feed.php | Retrieves the default feed. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'redirect_post_location', string $location, int $post_id ) apply\_filters( 'redirect\_post\_location', string $location, int $post\_id )
=============================================================================
Filters the post redirect destination URL.
`$location` string The destination URL. `$post_id` int The post ID. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
```
| Used By | Description |
| --- | --- |
| [redirect\_post()](../functions/redirect_post) wp-admin/includes/post.php | Redirects to previous page. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress do_action_ref_array( 'parse_request', WP $wp ) do\_action\_ref\_array( 'parse\_request', WP $wp )
==================================================
Fires once all query variables for the current request have been parsed.
`$wp` WP Current WordPress environment instance (passed by reference). This action hook is executed at the end of WordPress’s built-in request parsing method in the main [WP()](../functions/wp) class.
Attention! The parse\_request hook affects only the main query and not queries made with wp\_query, for example.
File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
do_action_ref_array( 'parse_request', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP::parse\_request()](../classes/wp/parse_request) wp-includes/class-wp.php | Parses the request to find the correct WordPress query. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( "edit_{$taxonomy}", int $term_id, int $tt_id, array $args ) do\_action( "edit\_{$taxonomy}", int $term\_id, int $tt\_id, array $args )
==========================================================================
Fires after a term in a specific taxonomy has been updated, but before the term cache has been cleaned.
The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `edit_category`
* `edit_post_tag`
`$term_id` int Term ID. `$tt_id` int Term taxonomy ID. `$args` array Arguments passed to [wp\_update\_term()](../functions/wp_update_term) . More Arguments from wp\_update\_term( ... $args ) Array of arguments for updating a term.
* `alias_of`stringSlug of the term to make this term an alias of.
Default empty string. Accepts a term slug.
* `description`stringThe term description. Default empty string.
* `parent`intThe id of the parent term. Default 0.
* `slug`stringThe term slug to use. Default empty string.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( "edit_{$taxonomy}", $term_id, $tt_id, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_term()](../functions/wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'rest_json_encode_options', int $options, WP_REST_Request $request ) apply\_filters( 'rest\_json\_encode\_options', int $options, WP\_REST\_Request $request )
=========================================================================================
Filters the JSON encoding options used to send the REST API response.
`$options` int JSON encoding options [json\_encode()](../functions/json_encode). `$request` [WP\_REST\_Request](../classes/wp_rest_request) Current request object. File: `wp-includes/rest-api/class-wp-rest-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
```
return apply_filters( 'rest_json_encode_options', $options, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::get\_json\_encode\_options()](../classes/wp_rest_server/get_json_encode_options) wp-includes/rest-api/class-wp-rest-server.php | Gets the encoding options passed to {@see wp\_json\_encode}. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_default_taxonomy_fields', array $fields, string $method ) apply\_filters( 'xmlrpc\_default\_taxonomy\_fields', array $fields, string $method )
====================================================================================
Filters the taxonomy query fields used by the given XML-RPC method.
`$fields` array An array of taxonomy fields to retrieve. `$method` string The method name. File: `wp-includes/class-wp-xmlrpc-server.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-xmlrpc-server.php/)
```
$fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomy' );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_getTaxonomy()](../classes/wp_xmlrpc_server/wp_gettaxonomy) wp-includes/class-wp-xmlrpc-server.php | Retrieve a taxonomy. |
| [wp\_xmlrpc\_server::wp\_getTaxonomies()](../classes/wp_xmlrpc_server/wp_gettaxonomies) wp-includes/class-wp-xmlrpc-server.php | Retrieve all taxonomies. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'wp_mail', array $args ) apply\_filters( 'wp\_mail', array $args )
=========================================
Filters the [wp\_mail()](../functions/wp_mail) arguments.
`$args` array Array of the `wp_mail()` arguments.
* `to`string|string[]Array or comma-separated list of email addresses to send message.
* `subject`stringEmail subject.
* `message`stringMessage contents.
* `headers`string|string[]Additional headers.
* `attachments`string|string[]Paths to files to attach.
* The wp\_mail filter hook allows you to filter the arguments that are passed to the [wp\_mail()](../functions/wp_mail) function. The arguments for [wp\_mail()](../functions/wp_mail) are passed through the filter as an array.
* $attachments should be an array. If it is not, it will be converted to one by the wp\_mail function after the filter.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_mail()](../functions/wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action( 'add_inline_data', WP_Post $post, WP_Post_Type $post_type_object ) do\_action( 'add\_inline\_data', WP\_Post $post, WP\_Post\_Type $post\_type\_object )
=====================================================================================
Fires after outputting the fields for the inline editor for posts and pages.
`$post` [WP\_Post](../classes/wp_post) The current post object. `$post_type_object` [WP\_Post\_Type](../classes/wp_post_type) The current post's post type object. File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
do_action( 'add_inline_data', $post, $post_type_object );
```
| Used By | Description |
| --- | --- |
| [get\_inline\_data()](../functions/get_inline_data) wp-admin/includes/template.php | Adds hidden fields with the data for use in the inline editor for posts and pages. |
| Version | Description |
| --- | --- |
| [4.9.8](https://developer.wordpress.org/reference/since/4.9.8/) | Introduced. |
wordpress apply_filters( 'sanitize_html_class', string $sanitized, string $class, string $fallback ) apply\_filters( 'sanitize\_html\_class', string $sanitized, string $class, string $fallback )
=============================================================================================
Filters a sanitized HTML class string.
`$sanitized` string The sanitized HTML class. `$class` string HTML class before sanitization. `$fallback` string The fallback string. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback );
```
| Used By | Description |
| --- | --- |
| [sanitize\_html\_class()](../functions/sanitize_html_class) wp-includes/formatting.php | Sanitizes an HTML classname to ensure it only contains valid characters. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'pre_user_nicename', string $user_nicename ) apply\_filters( 'pre\_user\_nicename', string $user\_nicename )
===============================================================
Filters a user’s nicename before the user is created or updated.
`$user_nicename` string The user's nicename. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$user_nicename = apply_filters( 'pre_user_nicename', $user_nicename );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [2.0.3](https://developer.wordpress.org/reference/since/2.0.3/) | Introduced. |
wordpress apply_filters( 'dynamic_sidebar_has_widgets', bool $did_one, int|string $index ) apply\_filters( 'dynamic\_sidebar\_has\_widgets', bool $did\_one, int|string $index )
=====================================================================================
Filters whether a sidebar has widgets.
Note: The filter is also evaluated for empty sidebars, and on both the front end and back end, including the Inactive Widgets sidebar on the Widgets screen.
`$did_one` bool Whether at least one widget was rendered in the sidebar.
Default false. `$index` int|string Index, name, or ID of the dynamic sidebar. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
return apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index );
```
| Used By | Description |
| --- | --- |
| [dynamic\_sidebar()](../functions/dynamic_sidebar) wp-includes/widgets.php | Display dynamic sidebar. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'is_protected_meta', bool $protected, string $meta_key, string $meta_type ) apply\_filters( 'is\_protected\_meta', bool $protected, string $meta\_key, string $meta\_type )
===============================================================================================
Filters whether a meta key is considered protected.
`$protected` bool Whether the key is considered protected. `$meta_key` string Metadata key. `$meta_type` string Type of object metadata is for. Accepts `'post'`, `'comment'`, `'term'`, `'user'`, or any other object type with an associated meta table. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type );
```
| Used By | Description |
| --- | --- |
| [is\_protected\_meta()](../functions/is_protected_meta) wp-includes/meta.php | Determines whether a meta key is considered protected. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'wp_tag_cloud', string|string[] $return, array $args ) apply\_filters( 'wp\_tag\_cloud', string|string[] $return, array $args )
========================================================================
Filters the tag cloud output.
`$return` string|string[] Tag cloud as a string or an array, depending on `'format'` argument. `$args` array An array of tag cloud arguments. See [wp\_tag\_cloud()](../functions/wp_tag_cloud) for information on accepted arguments. More Arguments from wp\_tag\_cloud( ... $args ) Array or string of arguments for generating a tag cloud.
* `smallest`intSmallest font size used to display tags. Paired with the value of `$unit`, to determine CSS text size unit. Default 8 (pt).
* `largest`intLargest font size used to display tags. Paired with the value of `$unit`, to determine CSS text size unit. Default 22 (pt).
* `unit`stringCSS text size unit to use with the `$smallest` and `$largest` values. Accepts any valid CSS text size unit. Default `'pt'`.
* `number`intThe number of tags to return. Accepts any positive integer or zero to return all.
Default 0.
* `format`stringFormat to display the tag cloud in. Accepts `'flat'` (tags separated with spaces), `'list'` (tags displayed in an unordered list), or `'array'` (returns an array).
Default `'flat'`.
* `separator`stringHTML or text to separate the tags. Default "n" (newline).
* `orderby`stringValue to order tags by. Accepts `'name'` or `'count'`.
Default `'name'`. The ['tag\_cloud\_sort'](tag_cloud_sort) filter can also affect how tags are sorted.
* `order`stringHow to order the tags. Accepts `'ASC'` (ascending), `'DESC'` (descending), or `'RAND'` (random). Default `'ASC'`.
* `filter`int|boolWhether to enable filtering of the final output via ['wp\_generate\_tag\_cloud'](wp_generate_tag_cloud). Default 1.
* `topic_count_text`arrayNooped plural text from [\_n\_noop()](../functions/_n_noop) to supply to tag counts. Default null.
* `topic_count_text_callback`callableCallback used to generate nooped plural text for tag counts based on the count. Default null.
* `topic_count_scale_callback`callableCallback used to determine the tag count scaling value. Default [default\_topic\_count\_scale()](../functions/default_topic_count_scale) .
* `show_count`bool|intWhether to display the tag counts. Default 0. Accepts 0, 1, or their bool equivalents.
File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$return = apply_filters( 'wp_tag_cloud', $return, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_tag\_cloud()](../functions/wp_tag_cloud) wp-includes/category-template.php | Displays a tag cloud. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'wp_code_editor_settings', array $settings, array $args ) apply\_filters( 'wp\_code\_editor\_settings', array $settings, array $args )
============================================================================
Filters settings that are passed into the code editor.
Returning a falsey value will disable the syntax-highlighting code editor.
`$settings` array The array of settings passed to the code editor.
A falsey value disables the editor. `$args` array Args passed when calling `get_code_editor_settings()`.
* `type`stringThe MIME type of the file to be edited.
* `file`stringFilename being edited.
* `theme`[WP\_Theme](../classes/wp_theme)Theme being edited when on the theme file editor.
* `plugin`stringPlugin being edited when on the plugin file editor.
* `codemirror`arrayAdditional CodeMirror setting overrides.
* `csslint`arrayCSSLint rule overrides.
* `jshint`arrayJSHint rule overrides.
* `htmlhint`arrayHTMLHint rule overrides.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'wp_code_editor_settings', $settings, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_code\_editor\_settings()](../functions/wp_get_code_editor_settings) wp-includes/general-template.php | Generates and returns code editor settings. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'get_wp_title_rss', string $title, string $deprecated ) apply\_filters( 'get\_wp\_title\_rss', string $title, string $deprecated )
==========================================================================
Filters the blog title for use as the feed title.
`$title` string The current blog title. `$deprecated` string Unused. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
return apply_filters( 'get_wp_title_rss', wp_get_document_title(), $deprecated );
```
| Used By | Description |
| --- | --- |
| [get\_wp\_title\_rss()](../functions/get_wp_title_rss) wp-includes/feed.php | Retrieves the blog title for the feed title. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$sep` parameter was deprecated and renamed to `$deprecated`. |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action( 'admin_xml_ns' ) do\_action( 'admin\_xml\_ns' )
==============================
Fires inside the HTML tag in the admin header.
File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
do_action( 'admin_xml_ns' );
```
| Used By | Description |
| --- | --- |
| [\_wp\_admin\_html\_begin()](../functions/_wp_admin_html_begin) wp-admin/includes/template.php | Prints out the beginning of the admin HTML header. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'wp_send_new_user_notification_to_admin', bool $send, WP_User $user ) apply\_filters( 'wp\_send\_new\_user\_notification\_to\_admin', bool $send, WP\_User $user )
============================================================================================
Filters whether the admin is notified of a new user registration.
`$send` bool Whether to send the email. Default true. `$user` [WP\_User](../classes/wp_user) User object for new user. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$send_notification_to_admin = apply_filters( 'wp_send_new_user_notification_to_admin', true, $user );
```
| Used By | Description |
| --- | --- |
| [wp\_new\_user\_notification()](../functions/wp_new_user_notification) wp-includes/pluggable.php | Emails login credentials to a newly-registered user. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'header_video_settings', array $settings ) apply\_filters( 'header\_video\_settings', array $settings )
============================================================
Filters header video settings.
`$settings` array An array of header video settings. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'header_video_settings', $settings );
```
| Used By | Description |
| --- | --- |
| [get\_header\_video\_settings()](../functions/get_header_video_settings) wp-includes/theme.php | Retrieves header video settings. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'pre_user_description', string $description ) apply\_filters( 'pre\_user\_description', string $description )
===============================================================
Filters a user’s description before the user is created or updated.
`$description` string The user's description. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$meta['description'] = apply_filters( 'pre_user_description', $description );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [2.0.3](https://developer.wordpress.org/reference/since/2.0.3/) | Introduced. |
| programming_docs |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.