code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
wordpress do_action( 'wpmuadminresult' ) do\_action( 'wpmuadminresult' )
===============================
Fires in the Network Admin ‘Right Now’ dashboard widget just before the user and site search form fields.
File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
do_action( 'wpmuadminresult' );
```
| Used By | Description |
| --- | --- |
| [wp\_network\_dashboard\_right\_now()](../functions/wp_network_dashboard_right_now) wp-admin/includes/dashboard.php | |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'is_header_video_active', bool $show_video ) apply\_filters( 'is\_header\_video\_active', bool $show\_video )
================================================================
Filters whether the custom header video is eligible to show on the current page.
`$show_video` bool Whether the custom header video should be shown. Returns the value of the theme setting for the `custom-header`'s `video-active-callback`.
If no callback is set, the default value is that of `is_front_page()`. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'is_header_video_active', $show_video );
```
| Used By | Description |
| --- | --- |
| [is\_header\_video\_active()](../functions/is_header_video_active) wp-includes/theme.php | Checks whether the custom header video is eligible to show on the current page. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'cron_request', array $cron_request_array, string $doing_wp_cron ) apply\_filters( 'cron\_request', array $cron\_request\_array, string $doing\_wp\_cron )
=======================================================================================
Filters the cron request arguments.
`$cron_request_array` array An array of cron request URL arguments.
* `url`stringThe cron request URL.
* `key`intThe 22 digit GMT microtime.
* `args`array An array of cron request arguments.
+ `timeout`intThe request timeout in seconds. Default .01 seconds.
+ `blocking`boolWhether to set blocking for the request. Default false.
+ `sslverify`boolWhether SSL should be verified for the request. Default false. `$doing_wp_cron` string The unix timestamp of the cron lock. File: `wp-includes/cron.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/cron.php/)
```
$cron_request = apply_filters(
'cron_request',
array(
'url' => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ),
'key' => $doing_wp_cron,
'args' => array(
'timeout' => 0.01,
'blocking' => false,
/** This filter is documented in wp-includes/class-wp-http-streams.php */
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
),
),
$doing_wp_cron
);
```
| Used By | Description |
| --- | --- |
| [spawn\_cron()](../functions/spawn_cron) wp-includes/cron.php | Sends a request to run cron through HTTP request that doesn’t halt page loading. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The `$doing_wp_cron` parameter was added. |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'attachment_fields_to_save', array $post, array $attachment ) apply\_filters( 'attachment\_fields\_to\_save', array $post, array $attachment )
================================================================================
Filters the attachment fields to be saved.
* [wp\_get\_attachment\_metadata()](../functions/wp_get_attachment_metadata)
`$post` array An array of post data. `$attachment` array An array of attachment metadata. The `attachment_fields_to_save` filter is used to filter the associated data of images.
By default, it receives the input from the Media Upload screen and provides default values to the `post_title`, in case the user hasn’t done so.
It returns the `$post` array to be handled by the `media_upload_form_handler` function.
A plugin (or theme) can register as a content filter with the code:
`<?php add_filter( 'attachment_fields_to_save', 'filter_function_name', 10, 2 ) ?>`
Where ‘filter\_function\_name’ is the function WordPress should call when an attachment is being saved.
Note that the filter function **must** return the `$post` array after it is finished processing.
**NOTE:** per [ticket #30687](https://core.trac.wordpress.org/ticket/30687), any validation errors passed in via `$post['errors']` array are silently unset and the attachment is processed without notifying the user
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$post = apply_filters( 'attachment_fields_to_save', $post, $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. |
| [edit\_post()](../functions/edit_post) wp-admin/includes/post.php | Updates an existing post with values provided in `$_POST`. |
| [wp\_ajax\_save\_attachment\_compat()](../functions/wp_ajax_save_attachment_compat) wp-admin/includes/ajax-actions.php | Ajax handler for saving backward compatible attachment attributes. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'rest_authentication_errors', WP_Error|null|true $errors ) apply\_filters( 'rest\_authentication\_errors', WP\_Error|null|true $errors )
=============================================================================
Filters REST API authentication errors.
This is used to pass a [WP\_Error](../classes/wp_error) from an authentication method back to the API.
Authentication methods should check first if they’re being used, as multiple authentication methods can be enabled on a site (cookies, HTTP basic auth, OAuth). If the authentication method hooked in is not actually being attempted, null should be returned to indicate another authentication method should check instead. Similarly, callbacks should ensure the value is `null` before checking for errors.
A [WP\_Error](../classes/wp_error) instance can be returned if an error occurs, and this should match the format used by API methods internally (that is, the `status` data should be used). A callback can return `true` to indicate that the authentication method was used, and it succeeded.
`$errors` [WP\_Error](../classes/wp_error)|null|true [WP\_Error](../classes/wp_error) if authentication error, null if authentication method wasn't used, true if authentication succeeded. 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_authentication_errors', null );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::check\_authentication()](../classes/wp_rest_server/check_authentication) wp-includes/rest-api/class-wp-rest-server.php | Checks the authentication headers if supplied. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_list_table_class_name', string $class_name, array $args ) apply\_filters( 'wp\_list\_table\_class\_name', string $class\_name, array $args )
==================================================================================
Filters the list table class to instantiate.
`$class_name` string The list table class to use. `$args` array An array containing [\_get\_list\_table()](../functions/_get_list_table) arguments. More Arguments from \_get\_list\_table( ... $args ) Arguments to pass to the class. Accepts `'screen'`. File: `wp-admin/includes/list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/list-table.php/)
```
$custom_class_name = apply_filters( 'wp_list_table_class_name', $class_name, $args );
```
| Used By | Description |
| --- | --- |
| [\_get\_list\_table()](../functions/_get_list_table) wp-admin/includes/list-table.php | Fetches an instance of a [WP\_List\_Table](../classes/wp_list_table) class. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'start_previewing_theme', WP_Customize_Manager $manager ) do\_action( 'start\_previewing\_theme', WP\_Customize\_Manager $manager )
=========================================================================
Fires once the Customizer theme preview has started.
`$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( 'start_previewing_theme', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::start\_previewing\_theme()](../classes/wp_customize_manager/start_previewing_theme) wp-includes/class-wp-customize-manager.php | If the theme to be previewed isn’t the active theme, add filter callbacks to swap it out at runtime. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'all_plugins', array $all_plugins ) apply\_filters( 'all\_plugins', array $all\_plugins )
=====================================================
Filters the full array of plugins to list in the Plugins list table.
* [get\_plugins()](../functions/get_plugins)
`$all_plugins` array An array of plugins to display in the list table. 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/)
```
$all_plugins = apply_filters( 'all_plugins', get_plugins() );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_toggle\_auto\_updates()](../functions/wp_ajax_toggle_auto_updates) wp-admin/includes/ajax-actions.php | Ajax handler to enable or disable plugin and theme auto-updates. |
| [WP\_Plugins\_List\_Table::prepare\_items()](../classes/wp_plugins_list_table/prepare_items) wp-admin/includes/class-wp-plugins-list-table.php | |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'theme_root', string $theme_root ) apply\_filters( 'theme\_root', string $theme\_root )
====================================================
Filters the absolute path to the themes directory.
`$theme_root` string Absolute path to themes directory. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'theme_root', $theme_root );
```
| Used By | Description |
| --- | --- |
| [get\_theme\_root()](../functions/get_theme_root) wp-includes/theme.php | Retrieves path to themes directory. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_video_shortcode_override', string $html, array $attr, string $content, int $instance ) apply\_filters( 'wp\_video\_shortcode\_override', string $html, array $attr, string $content, int $instance )
=============================================================================================================
Filters the default video shortcode output.
If the filtered output isn’t empty, it will be used instead of generating the default video template.
* [wp\_video\_shortcode()](../functions/wp_video_shortcode)
`$html` string Empty variable to be replaced with shortcode markup. `$attr` array Attributes of the shortcode. @see [wp\_video\_shortcode()](../functions/wp_video_shortcode) More Arguments from wp\_video\_shortcode( ... $attr ) Attributes of the shortcode.
* `src`stringURL to the source of the video file. Default empty.
* `height`intHeight of the video embed in pixels. Default 360.
* `width`intWidth of the video embed in pixels. Default $content\_width or 640.
* `poster`stringThe `'poster'` attribute for the `<video>` element. Default empty.
* `loop`stringThe `'loop'` attribute for the `<video>` element. Default empty.
* `autoplay`stringThe `'autoplay'` attribute for the `<video>` element. Default empty.
* `muted`stringThe `'muted'` attribute for the `<video>` element. Default false.
* `preload`stringThe `'preload'` attribute for the `<video>` element.
Default `'metadata'`.
* `class`stringThe `'class'` attribute for the `<video>` element.
Default `'wp-video-shortcode'`.
`$content` string Video shortcode content. `$instance` int Unique numeric ID of this video shortcode instance. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instance );
```
| Used By | Description |
| --- | --- |
| [wp\_video\_shortcode()](../functions/wp_video_shortcode) wp-includes/media.php | Builds the Video shortcode output. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_blogger_newPost', int $post_ID, array $args ) do\_action( 'xmlrpc\_call\_success\_blogger\_newPost', int $post\_ID, array $args )
===================================================================================
Fires after a new post has been successfully created via the XML-RPC Blogger API.
`$post_ID` int ID of the new post. `$args` array An array of new post 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_blogger_newPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::blogger\_newPost()](../classes/wp_xmlrpc_server/blogger_newpost) wp-includes/class-wp-xmlrpc-server.php | Creates new post. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'get_usernumposts', int $count, int $userid, string|array $post_type, bool $public_only ) apply\_filters( 'get\_usernumposts', int $count, int $userid, string|array $post\_type, bool $public\_only )
============================================================================================================
Filters the number of posts a user has written.
`$count` int The user's post count. `$userid` int User ID. `$post_type` string|array Single post type or array of post types to count the number of posts for. `$public_only` bool Whether to limit counted posts to public posts. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'get_usernumposts', $count, $userid, $post_type, $public_only );
```
| Used By | Description |
| --- | --- |
| [count\_user\_posts()](../functions/count_user_posts) wp-includes/user.php | Gets the number of posts a user has written. |
| Version | Description |
| --- | --- |
| [4.3.1](https://developer.wordpress.org/reference/since/4.3.1/) | Added `$public_only` argument. |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Added `$post_type` argument. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'set_current_user' ) do\_action( 'set\_current\_user' )
==================================
Fires after the current user is set.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'set_current_user' );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_current\_user()](../functions/wp_set_current_user) wp-includes/pluggable.php | Changes the current user by ID or name. |
| Version | Description |
| --- | --- |
| [2.0.1](https://developer.wordpress.org/reference/since/2.0.1/) | Introduced. |
wordpress apply_filters( 'comments_rewrite_rules', string[] $comments_rewrite ) apply\_filters( 'comments\_rewrite\_rules', string[] $comments\_rewrite )
=========================================================================
Filters rewrite rules used for comment feed archives.
Likely comments feed archives include `/comments/feed/` and `/comments/feed/atom/`.
`$comments_rewrite` string[] Array of rewrite rules for the site-wide comments feeds, 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/)
```
$comments_rewrite = apply_filters( 'comments_rewrite_rules', $comments_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( 'clean_user_cache', int $user_id, WP_User $user ) do\_action( 'clean\_user\_cache', int $user\_id, WP\_User $user )
=================================================================
Fires immediately after the given user’s cache is cleaned.
`$user_id` int User ID. `$user` [WP\_User](../classes/wp_user) User object. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'clean_user_cache', $user->ID, $user );
```
| Used By | Description |
| --- | --- |
| [clean\_user\_cache()](../functions/clean_user_cache) wp-includes/user.php | Cleans all user caches. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'widget_comments_args', array $comment_args, array $instance ) apply\_filters( 'widget\_comments\_args', array $comment\_args, array $instance )
=================================================================================
Filters the arguments for the Recent Comments widget.
* [WP\_Comment\_Query::query()](../classes/wp_comment_query/query): for information on accepted arguments.
`$comment_args` array An array of arguments used to retrieve the recent comments. `$instance` array Array of settings for the current widget. 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(
'widget_comments_args',
array(
'number' => $number,
'status' => 'approve',
'post_status' => 'publish',
),
$instance
)
```
| Used By | Description |
| --- | --- |
| [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. |
| 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. |
| programming_docs |
wordpress apply_filters( 'comments_open', bool $open, int $post_id ) apply\_filters( 'comments\_open', bool $open, int $post\_id )
=============================================================
Filters whether the current post is open for comments.
`$open` bool Whether the current post is open for comments. `$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( 'comments_open', $open, $post_id );
```
| Used By | Description |
| --- | --- |
| [comments\_open()](../functions/comments_open) wp-includes/comment-template.php | Determines whether the current post is open for comments. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_taxonomies_entry', array $sitemap_entry, int $term_id, string $taxonomy, WP_Term $term ) apply\_filters( 'wp\_sitemaps\_taxonomies\_entry', array $sitemap\_entry, int $term\_id, string $taxonomy, WP\_Term $term )
===========================================================================================================================
Filters the sitemap entry for an individual term.
`$sitemap_entry` array Sitemap entry for the term. `$term_id` int Term ID. `$taxonomy` string Taxonomy name. `$term` [WP\_Term](../classes/wp_term) Term object. 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/)
```
$sitemap_entry = apply_filters( 'wp_sitemaps_taxonomies_entry', $sitemap_entry, $term->term_id, $taxonomy, $term );
```
| 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 |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Added `$term` argument containing the term object. |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_prepare_post', array $_post, array $post, array $fields ) apply\_filters( 'xmlrpc\_prepare\_post', array $\_post, array $post, array $fields )
====================================================================================
Filters XML-RPC-prepared date for the given post.
`$_post` array An array of modified post data. `$post` array An array of post data. `$fields` array An array of post fields. 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', $_post, $post, $fields );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_prepare\_post()](../classes/wp_xmlrpc_server/_prepare_post) wp-includes/class-wp-xmlrpc-server.php | Prepares post 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_admin_css_uri', string $_file, string $file ) apply\_filters( 'wp\_admin\_css\_uri', string $\_file, string $file )
=====================================================================
Filters the URI of a WordPress admin CSS file.
`$_file` string Relative path to the file with query arguments attached. `$file` string Relative path to the file, minus its ".css" extension. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'wp_admin_css_uri', $_file, $file );
```
| Used By | Description |
| --- | --- |
| [wp\_admin\_css\_uri()](../functions/wp_admin_css_uri) wp-includes/general-template.php | Displays the URL of a WordPress admin CSS file. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'rss2_head' ) do\_action( 'rss2\_head' )
==========================
Fires at the end of the RSS2 Feed Header.
File: `wp-includes/feed-rss2.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed-rss2.php/)
```
do_action( 'rss2_head' );
```
| Used By | Description |
| --- | --- |
| [export\_wp()](../functions/export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters_ref_array( 'comment_feed_join', string $cjoin, WP_Query $query ) apply\_filters\_ref\_array( 'comment\_feed\_join', string $cjoin, WP\_Query $query )
====================================================================================
Filters the JOIN clause of the comments feed query before sending.
`$cjoin` 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/)
```
$cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$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.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'has_post_thumbnail', bool $has_thumbnail, int|WP_Post|null $post, int|false $thumbnail_id ) apply\_filters( 'has\_post\_thumbnail', bool $has\_thumbnail, int|WP\_Post|null $post, int|false $thumbnail\_id )
=================================================================================================================
Filters whether a post has a post thumbnail.
`$has_thumbnail` bool true if the post has a post thumbnail, otherwise false. `$post` int|[WP\_Post](../classes/wp_post)|null Post ID or [WP\_Post](../classes/wp_post) object. Default is global `$post`. `$thumbnail_id` int|false Post thumbnail ID or false if the post does not exist. File: `wp-includes/post-thumbnail-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-thumbnail-template.php/)
```
return (bool) apply_filters( 'has_post_thumbnail', $has_thumbnail, $post, $thumbnail_id );
```
| Used By | Description |
| --- | --- |
| [has\_post\_thumbnail()](../functions/has_post_thumbnail) wp-includes/post-thumbnail-template.php | Determines whether a post has an image attached. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", mixed $meta_value, string $meta_key, string $object_type ) apply\_filters( "sanitize\_{$object\_type}\_meta\_{$meta\_key}", mixed $meta\_value, string $meta\_key, string $object\_type )
==============================================================================================================================
Filters the sanitization of a specific meta key of a specific meta type.
The dynamic portions of the hook name, `$meta_type`, and `$meta_key`, refer to the metadata object type (comment, post, term, or user) and the meta key value, respectively.
`$meta_value` mixed Metadata value to sanitize. `$meta_key` string Metadata key. `$object_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( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type );
```
| Used By | Description |
| --- | --- |
| [sanitize\_meta()](../functions/sanitize_meta) wp-includes/meta.php | Sanitizes meta value. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress do_action( 'check_comment_flood', string $comment_author_ip, string $comment_author_email, string $comment_date_gmt, bool $wp_error ) do\_action( 'check\_comment\_flood', string $comment\_author\_ip, string $comment\_author\_email, string $comment\_date\_gmt, bool $wp\_error )
===============================================================================================================================================
Fires immediately before a comment is marked approved.
Allows checking for comment flooding.
`$comment_author_ip` string Comment author's IP address. `$comment_author_email` string Comment author's email. `$comment_date_gmt` string GMT date the comment was posted. `$wp_error` bool Whether to return a [WP\_Error](../classes/wp_error) object instead of executing [wp\_die()](../functions/wp_die) or die() if a comment flood is occurring. More Arguments from wp\_die( ... $args ) Arguments to control behavior. If `$args` is an integer, then it is treated as the response code.
* `response`intThe HTTP response code. Default 200 for Ajax requests, 500 otherwise.
* `link_url`stringA URL to include a link to. Only works in combination with $link\_text.
Default empty string.
* `link_text`stringA label for the link to include. Only works in combination with $link\_url.
Default empty string.
* `back_link`boolWhether to include a link to go back. Default false.
* `text_direction`stringThe text direction. This is only useful internally, when WordPress is still loading and the site's locale is not set up yet. Accepts `'rtl'` and `'ltr'`.
Default is the value of [is\_rtl()](../functions/is_rtl) .
* `charset`stringCharacter set of the HTML output. Default `'utf-8'`.
* `code`stringError code to use. Default is `'wp_die'`, or the main error code if $message is a [WP\_Error](../classes/wp_error).
* `exit`boolWhether to exit the process after completion. Default true.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action(
'check_comment_flood',
$commentdata['comment_author_IP'],
$commentdata['comment_author_email'],
$commentdata['comment_date_gmt'],
$wp_error
);
```
| 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 |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$avoid_die` parameter was renamed to `$wp_error`. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | The `$avoid_die` parameter was added. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'wp_setup_nav_menu_item', object $menu_item ) apply\_filters( 'wp\_setup\_nav\_menu\_item', object $menu\_item )
==================================================================
Filters a navigation menu item object.
`$menu_item` object The menu item 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_setup_nav_menu_item', $menu_item );
```
| 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( 'wxr_export_skip_postmeta', bool $skip, string $meta_key, object $meta ) apply\_filters( 'wxr\_export\_skip\_postmeta', bool $skip, string $meta\_key, object $meta )
============================================================================================
Filters whether to selectively skip post 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 post 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_postmeta', 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 |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress do_action( 'delete_term_taxonomy', int $tt_id ) do\_action( 'delete\_term\_taxonomy', int $tt\_id )
===================================================
Fires immediately before a term taxonomy ID is deleted.
`$tt_id` int Term taxonomy ID. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'delete_term_taxonomy', $tt_id );
```
| 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 apply_filters( 'pre_cache_alloptions', array $alloptions ) apply\_filters( 'pre\_cache\_alloptions', array $alloptions )
=============================================================
Filters all options before caching them.
`$alloptions` array Array with all options. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
$alloptions = apply_filters( 'pre_cache_alloptions', $alloptions );
```
| Used By | Description |
| --- | --- |
| [wp\_load\_alloptions()](../functions/wp_load_alloptions) wp-includes/option.php | Loads and caches all autoloaded options, if available or all options. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'export_wp_filename', string $wp_filename, string $sitename, string $date ) apply\_filters( 'export\_wp\_filename', string $wp\_filename, string $sitename, string $date )
==============================================================================================
Filters the export filename.
`$wp_filename` string The name of the file for download. `$sitename` string The site name. `$date` string Today's date, formatted. File: `wp-admin/includes/export.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/export.php/)
```
$filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );
```
| Used By | Description |
| --- | --- |
| [export\_wp()](../functions/export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'the_excerpt_rss', string $output ) apply\_filters( 'the\_excerpt\_rss', string $output )
=====================================================
Filters the post excerpt for a feed.
`$output` string The current post excerpt. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
echo apply_filters( 'the_excerpt_rss', $output );
```
| Used By | Description |
| --- | --- |
| [the\_excerpt\_rss()](../functions/the_excerpt_rss) wp-includes/feed.php | Displays the post excerpt for the feed. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'edit_post_link', string $link, int $post_id, string $text ) apply\_filters( 'edit\_post\_link', string $link, int $post\_id, string $text )
===============================================================================
Filters the post edit link anchor tag.
`$link` string Anchor tag for the edit link. `$post_id` int Post ID. `$text` string Anchor text. 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_post_link', $link, $post->ID, $text ) . $after;
```
| Used By | Description |
| --- | --- |
| [edit\_post\_link()](../functions/edit_post_link) wp-includes/link-template.php | Displays the edit post link for post. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'previous_posts_link_attributes', string $attributes ) apply\_filters( 'previous\_posts\_link\_attributes', string $attributes )
=========================================================================
Filters the anchor tag attributes for the previous posts 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/)
```
$attr = apply_filters( 'previous_posts_link_attributes', '' );
```
| Used By | Description |
| --- | --- |
| [get\_previous\_posts\_link()](../functions/get_previous_posts_link) wp-includes/link-template.php | Retrieves the previous posts page link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'rewrite_rules_array', string[] $rules ) apply\_filters( 'rewrite\_rules\_array', string[] $rules )
==========================================================
Filters the full set of generated rewrite rules.
`$rules` string[] The compiled array of rewrite rules, keyed by their regex pattern. * This filter hook can be used to any rule in the rewrite rules array.
* Since rewrite rules are saved to the database, *you must flush/update your rules from your admin under Settings > Permalinks before your changes will take effect*. You can also use the [flush\_rules()](../classes/wp_rewrite/flush_rules) function to do this programmatically.
* Make sure you return the $rules array or very bad things will happen.
File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
$this->rules = apply_filters( 'rewrite_rules_array', $this->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 |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", mixed $meta_value, string $meta_key, string $object_type, string $object_subtype ) apply\_filters( "sanitize\_{$object\_type}\_meta\_{$meta\_key}\_for\_{$object\_subtype}", mixed $meta\_value, string $meta\_key, string $object\_type, string $object\_subtype )
================================================================================================================================================================================
Filters the sanitization of a specific meta key of a specific meta 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.
`$meta_value` mixed Metadata value to sanitize. `$meta_key` string Metadata key. `$object_type` string Type of object metadata is for. Accepts `'post'`, `'comment'`, `'term'`, `'user'`, or any other object type with an associated meta table. `$object_subtype` string Object subtype. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $meta_value, $meta_key, $object_type, $object_subtype );
```
| Used By | Description |
| --- | --- |
| [sanitize\_meta()](../functions/sanitize_meta) wp-includes/meta.php | Sanitizes meta value. |
| Version | Description |
| --- | --- |
| [4.9.8](https://developer.wordpress.org/reference/since/4.9.8/) | Introduced. |
wordpress apply_filters( 'attachment_link', string $link, int $post_id ) apply\_filters( 'attachment\_link', string $link, int $post\_id )
=================================================================
Filters the permalink for an attachment.
`$link` string The attachment's permalink. `$post_id` int Attachment ID. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'attachment_link', $link, $post->ID );
```
| Used By | Description |
| --- | --- |
| [get\_attachment\_link()](../functions/get_attachment_link) wp-includes/link-template.php | Retrieves the permalink for an attachment. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Providing an empty string will now disable the view attachment page link on the media modal. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'theme_file_path', string $path, string $file ) apply\_filters( 'theme\_file\_path', string $path, string $file )
=================================================================
Filters the path to a file in the 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( 'theme_file_path', $path, $file );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme::get\_file\_path()](../classes/wp_theme/get_file_path) wp-includes/class-wp-theme.php | Retrieves the path of a file in the theme. |
| [get\_theme\_file\_path()](../functions/get_theme_file_path) wp-includes/link-template.php | Retrieves the path of a file in the theme. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_default_posttype_fields', array $fields, string $method ) apply\_filters( 'xmlrpc\_default\_posttype\_fields', array $fields, string $method )
====================================================================================
Filters the default query fields used by the given XML-RPC method.
`$fields` array An array of post type query fields for the given method. `$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_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_getPostType()](../classes/wp_xmlrpc_server/wp_getposttype) wp-includes/class-wp-xmlrpc-server.php | Retrieves a post type |
| [wp\_xmlrpc\_server::wp\_getPostTypes()](../classes/wp_xmlrpc_server/wp_getposttypes) wp-includes/class-wp-xmlrpc-server.php | Retrieves a post types |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( "delete_site_option_{$option}", string $option, int $network_id ) do\_action( "delete\_site\_option\_{$option}", string $option, int $network\_id )
=================================================================================
Fires after a specific network option has been deleted.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$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}", $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/) | |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'image_make_intermediate_size', string $filename ) apply\_filters( 'image\_make\_intermediate\_size', string $filename )
=====================================================================
Filters the name of the saved image file.
`$filename` string Name of the file. File: `wp-includes/class-wp-image-editor-gd.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor-gd.php/)
```
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor\_Imagick::\_save()](../classes/wp_image_editor_imagick/_save) wp-includes/class-wp-image-editor-imagick.php | |
| [WP\_Image\_Editor\_GD::\_save()](../classes/wp_image_editor_gd/_save) wp-includes/class-wp-image-editor-gd.php | |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'blog_privacy_selector' ) do\_action( 'blog\_privacy\_selector' )
=======================================
Enables the legacy ‘Site visibility’ privacy options.
By default the privacy options form displays a single checkbox to ‘discourage’ search engines from indexing the site. Hooking to this action serves a dual purpose:
1. Disable the single checkbox in favor of a multiple-choice list of radio buttons.
2. Open the door to adding additional radio button choices to the list.
Hooking to this action also converts the ‘Search engine visibility’ heading to the more open-ended ‘Site visibility’ heading.
File: `wp-admin/options-reading.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/options-reading.php/)
```
do_action( 'blog_privacy_selector' );
```
| Used By | Description |
| --- | --- |
| [display\_setup\_form()](../functions/display_setup_form) wp-admin/install.php | Displays installer setup form. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'wp_roles_init', WP_Roles $wp_roles ) do\_action( 'wp\_roles\_init', WP\_Roles $wp\_roles )
=====================================================
Fires after the roles have been initialized, allowing plugins to add their own roles.
`$wp_roles` [WP\_Roles](../classes/wp_roles) A reference to the [WP\_Roles](../classes/wp_roles) object. File: `wp-includes/class-wp-roles.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-roles.php/)
```
do_action( 'wp_roles_init', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Roles::init\_roles()](../classes/wp_roles/init_roles) wp-includes/class-wp-roles.php | Initializes all of the available roles. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'mature_blog', int $site_id ) do\_action( 'mature\_blog', int $site\_id )
===========================================
Fires when the ‘mature’ 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( 'mature_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 do_action( 'retrieve_password_key', string $user_login, string $key ) do\_action( 'retrieve\_password\_key', string $user\_login, string $key )
=========================================================================
Fires when a password reset key is generated.
`$user_login` string The username for the user. `$key` string The generated password reset key. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'retrieve_password_key', $user->user_login, $key );
```
| 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.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'install_themes_table_header' ) do\_action( 'install\_themes\_table\_header' )
==============================================
Fires in the Install Themes list table header.
File: `wp-admin/includes/class-wp-theme-install-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-theme-install-list-table.php/)
```
do_action( 'install_themes_table_header' );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme\_Install\_List\_Table::display()](../classes/wp_theme_install_list_table/display) wp-admin/includes/class-wp-theme-install-list-table.php | Displays the theme install table. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'activate_wp_head' ) do\_action( 'activate\_wp\_head' )
==================================
Fires before the Site Activation page is loaded.
Fires on the [‘wp\_head’](wp_head) action.
File: `wp-activate.php`. [View all references](https://developer.wordpress.org/reference/files/wp-activate.php/)
```
do_action( 'activate_wp_head' );
```
| Used By | Description |
| --- | --- |
| [do\_activate\_header()](../functions/do_activate_header) wp-activate.php | Adds an action hook specific to this page. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'wp_insert_post', int $post_ID, WP_Post $post, bool $update ) do\_action( 'wp\_insert\_post', int $post\_ID, WP\_Post $post, bool $update )
=============================================================================
Fires once a post 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. The `wp_insert_post` action fires once a post has been saved. You have the ability to set it to only fire on new posts or on all save actions using the parameters. Please see [Plugin\_API/Action\_Reference/save\_post](save_post) for more information. Keep in mind that this action is called both for actions in the admin as well as anytime the [wp\_insert\_post()](../functions/wp_insert_post) function is invoked.
This action can be replicated by creating a conditional in a <save_post> action that excludes certain post statuses.
An important distinction of `wp_insert_post` action is that it is fired after `update_post_meta` has been called.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'wp_insert_post', $post_ID, $post, $update );
```
| 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. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'wp_theme_json_get_style_nodes', array $nodes ) apply\_filters( 'wp\_theme\_json\_get\_style\_nodes', array $nodes )
====================================================================
Filters the list of style nodes with metadata.
This allows for things like loading block CSS independently.
`$nodes` array Style nodes with metadata. File: `wp-includes/class-wp-theme-json.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme-json.php/)
```
return apply_filters( 'wp_theme_json_get_style_nodes', $nodes );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme\_JSON::get\_style\_nodes()](../classes/wp_theme_json/get_style_nodes) wp-includes/class-wp-theme-json.php | Builds metadata for the style nodes, which returns in the form of: |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'rest_delete_comment', WP_Comment $comment, WP_REST_Response $response, WP_REST_Request $request ) do\_action( 'rest\_delete\_comment', WP\_Comment $comment, WP\_REST\_Response $response, WP\_REST\_Request $request )
=====================================================================================================================
Fires after a comment is deleted via the REST API.
`$comment` [WP\_Comment](../classes/wp_comment) The deleted comment 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-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_delete_comment', $comment, $response, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::delete\_item()](../classes/wp_rest_comments_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Deletes a comment. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'unregistered_taxonomy', string $taxonomy ) do\_action( 'unregistered\_taxonomy', string $taxonomy )
========================================================
Fires after a taxonomy is unregistered.
`$taxonomy` string Taxonomy name. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'unregistered_taxonomy', $taxonomy );
```
| Used By | Description |
| --- | --- |
| [unregister\_taxonomy()](../functions/unregister_taxonomy) wp-includes/taxonomy.php | Unregisters a taxonomy. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress do_action( 'wp_print_footer_scripts' ) do\_action( 'wp\_print\_footer\_scripts' )
==========================================
Fires when footer scripts are printed.
This hook print the scripts and styles in the footer.
The **wp\_print\_footer\_scripts action** is triggered inside the **wp\_footer action**.
This hook provides no parameters. Your functions shouldn’t return, and shouldn’t take any parameters.
File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
do_action( 'wp_print_footer_scripts' );
```
| Used By | Description |
| --- | --- |
| [wp\_print\_footer\_scripts()](../functions/wp_print_footer_scripts) wp-includes/script-loader.php | Hooks to print the scripts and styles in the footer. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'pre_clear_scheduled_hook', null|int|false|WP_Error $pre, string $hook, array $args, bool $wp_error ) apply\_filters( 'pre\_clear\_scheduled\_hook', null|int|false|WP\_Error $pre, string $hook, array $args, bool $wp\_error )
==========================================================================================================================
Filter to preflight or hijack clearing a scheduled hook.
Returning a non-null value will short-circuit the normal unscheduling process, causing the function to return the filtered value instead.
For plugins replacing wp-cron, return the number of events successfully unscheduled (zero if no events were registered with the hook) or false or a [WP\_Error](../classes/wp_error) if unscheduling one or more events fails.
`$pre` null|int|false|[WP\_Error](../classes/wp_error) Value to return instead. Default null to continue unscheduling the event. `$hook` string Action hook, the execution of which will be unscheduled. `$args` array Arguments to pass to the hook's callback function. `$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_clear_scheduled_hook', null, $hook, $args, $wp_error );
```
| Used By | Description |
| --- | --- |
| [wp\_clear\_scheduled\_hook()](../functions/wp_clear_scheduled_hook) wp-includes/cron.php | Unschedules all events attached to the hook with the specified arguments. |
| 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. |
| programming_docs |
wordpress do_action( 'pre_delete_term', int $term, string $taxonomy ) do\_action( 'pre\_delete\_term', int $term, string $taxonomy )
==============================================================
Fires when deleting a term, before any modifications are made to posts or terms.
`$term` int Term ID. `$taxonomy` string Taxonomy name. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'pre_delete_term', $term, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_term()](../functions/wp_delete_term) wp-includes/taxonomy.php | Removes a term from the database. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'widget_nav_menu_args', array $nav_menu_args, WP_Term $nav_menu, array $args, array $instance ) apply\_filters( 'widget\_nav\_menu\_args', array $nav\_menu\_args, WP\_Term $nav\_menu, array $args, array $instance )
======================================================================================================================
Filters the arguments for the Navigation Menu widget.
`$nav_menu_args` array An array of arguments passed to [wp\_nav\_menu()](../functions/wp_nav_menu) to retrieve a navigation menu.
* `fallback_cb`callable|boolCallback to fire if the menu doesn't exist. Default empty.
* `menu`mixedMenu ID, slug, or name.
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'`.
`$nav_menu` [WP\_Term](../classes/wp_term) Nav menu object for the current menu. `$args` array Display arguments for the current widget. `$instance` array Array of settings for the current widget. 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/)
```
wp_nav_menu( apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args, $instance ) );
```
| 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. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$instance` parameter. |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'rest_post_format_search_query', array $query_args, WP_REST_Request $request ) apply\_filters( 'rest\_post\_format\_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 format 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-format-search-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php/)
```
$query_args = apply_filters( 'rest_post_format_search_query', $query_args, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Post\_Format\_Search\_Handler::search\_items()](../classes/wp_rest_post_format_search_handler/search_items) wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php | Searches the object type content for a given search request. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'taxonomy_feed_link', string $link, string $feed, string $taxonomy ) apply\_filters( 'taxonomy\_feed\_link', string $link, string $feed, string $taxonomy )
======================================================================================
Filters the feed link for a taxonomy other than ‘category’ or ‘post\_tag’.
`$link` string The taxonomy feed link. `$feed` string Feed type. Possible values include `'rss2'`, `'atom'`. `$taxonomy` string The taxonomy name. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy );
```
| 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 |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'quick_edit_show_taxonomy', bool $show_in_quick_edit, string $taxonomy_name, string $post_type ) apply\_filters( 'quick\_edit\_show\_taxonomy', bool $show\_in\_quick\_edit, string $taxonomy\_name, string $post\_type )
========================================================================================================================
Filters whether the current taxonomy should be shown in the Quick Edit panel.
`$show_in_quick_edit` bool Whether to show the current taxonomy in Quick Edit. `$taxonomy_name` string Taxonomy name. `$post_type` string Post type of current Quick Edit 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/)
```
if ( ! apply_filters( 'quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_inline\_save()](../functions/wp_ajax_inline_save) wp-admin/includes/ajax-actions.php | Ajax handler for Quick Edit saving a post from a list table. |
| [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.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress do_action( "registered_post_type_{$post_type}", string $post_type, WP_Post_Type $post_type_object ) do\_action( "registered\_post\_type\_{$post\_type}", string $post\_type, WP\_Post\_Type $post\_type\_object )
=============================================================================================================
Fires after a specific post type is registered.
The dynamic portion of the filter name, `$post_type`, refers to the post type key.
Possible hook names include:
* `registered_post_type_post`
* `registered_post_type_page`
`$post_type` string Post type. `$post_type_object` [WP\_Post\_Type](../classes/wp_post_type) Arguments used to register the post type. 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, $post_type_object );
```
| Used By | Description |
| --- | --- |
| [register\_post\_type()](../functions/register_post_type) wp-includes/post.php | Registers a post type. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'wp_doing_ajax', bool $wp_doing_ajax ) apply\_filters( 'wp\_doing\_ajax', bool $wp\_doing\_ajax )
==========================================================
Filters whether the current request is a WordPress Ajax request.
`$wp_doing_ajax` bool Whether the current request is a WordPress Ajax request. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
```
| Used By | Description |
| --- | --- |
| [wp\_doing\_ajax()](../functions/wp_doing_ajax) wp-includes/load.php | Determines whether the current request is a WordPress Ajax request. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'add_signup_meta', array $meta ) apply\_filters( 'add\_signup\_meta', array $meta )
==================================================
Filters the new default site meta variables.
`$meta` array An array of default site meta variables.
* `lang_id`intThe language ID.
* `blog_public`intWhether search engines should be discouraged from indexing the site. 1 for true, 0 for false.
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
$meta = apply_filters( 'add_signup_meta', $meta_defaults );
```
| 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. |
| [validate\_user\_signup()](../functions/validate_user_signup) wp-signup.php | Validates the new user sign-up. |
| [validate\_blog\_signup()](../functions/validate_blog_signup) wp-signup.php | Validates new site signup. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'notify_moderator', bool $maybe_notify, int $comment_ID ) apply\_filters( 'notify\_moderator', bool $maybe\_notify, int $comment\_ID )
============================================================================
Filters whether to send the site moderator email notifications, overriding the site setting.
`$maybe_notify` bool Whether to notify blog moderator. `$comment_ID` int The id of the comment for the notification. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_new\_comment\_notify\_moderator()](../functions/wp_new_comment_notify_moderator) wp-includes/comment.php | Sends a comment moderation notification to the comment moderator. |
| [wp\_notify\_moderator()](../functions/wp_notify_moderator) wp-includes/pluggable.php | Notifies the moderator of the site about a new comment that is awaiting approval. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'search_form_args', array $args ) apply\_filters( 'search\_form\_args', array $args )
===================================================
Filters the array of arguments used when generating the 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/)
```
$args = apply_filters( 'search_form_args', $args );
```
| Used By | Description |
| --- | --- |
| [get\_search\_form()](../functions/get_search_form) wp-includes/general-template.php | Displays search form. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'widget_block_dynamic_classname', string $classname, string $block_name ) apply\_filters( 'widget\_block\_dynamic\_classname', string $classname, string $block\_name )
=============================================================================================
The classname used in the block widget’s container HTML.
This can be set according to the name of the block contained by the block widget.
`$classname` string The classname to be used in the block widget's container HTML, e.g. 'widget\_block widget\_text'. `$block_name` string The name of the block contained by the block widget, e.g. `'core/paragraph'`. 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/)
```
return apply_filters( 'widget_block_dynamic_classname', $classname, $block_name );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Block::get\_dynamic\_classname()](../classes/wp_widget_block/get_dynamic_classname) wp-includes/widgets/class-wp-widget-block.php | Calculates the classname to use in the block widget’s container HTML. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_users_pre_max_num_pages', int|null $max_num_pages ) apply\_filters( 'wp\_sitemaps\_users\_pre\_max\_num\_pages', int|null $max\_num\_pages )
========================================================================================
Filters the max number of pages for a user sitemap before it is generated.
Returning a non-null value will effectively short-circuit the generation, returning that value instead.
`$max_num_pages` int|null The maximum number of pages. Default null. 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/)
```
$max_num_pages = apply_filters( 'wp_sitemaps_users_pre_max_num_pages', null );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Users::get\_max\_num\_pages()](../classes/wp_sitemaps_users/get_max_num_pages) wp-includes/sitemaps/providers/class-wp-sitemaps-users.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_ref_array( 'the_comments', WP_Comment[] $_comments, WP_Comment_Query $query ) apply\_filters\_ref\_array( 'the\_comments', WP\_Comment[] $\_comments, WP\_Comment\_Query $query )
===================================================================================================
Filters the comment query results.
`$_comments` [WP\_Comment](../classes/wp_comment)[] An array of comments. `$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/)
```
$_comments = apply_filters_ref_array( 'the_comments', array( $_comments, &$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( 'locale', string $locale ) apply\_filters( 'locale', string $locale )
==========================================
Filters the locale ID of the WordPress installation.
`$locale` string The locale ID. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
return apply_filters( 'locale', $locale );
```
| Used By | Description |
| --- | --- |
| [get\_locale()](../functions/get_locale) wp-includes/l10n.php | Retrieves the current locale. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action_ref_array( 'check_passwords', string $user_login, string $pass1, string $pass2 ) do\_action\_ref\_array( 'check\_passwords', string $user\_login, string $pass1, string $pass2 )
===============================================================================================
Fires before the password and confirm password fields are checked for congruity.
`$user_login` string The username. `$pass1` string The password (passed by reference). `$pass2` string The confirmed password (passed by reference). File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
do_action_ref_array( 'check_passwords', array( $user->user_login, &$pass1, &$pass2 ) );
```
| Used By | Description |
| --- | --- |
| [edit\_user()](../functions/edit_user) wp-admin/includes/user.php | Edit user settings based on contents of $\_POST |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'paginate_links', string $link ) apply\_filters( 'paginate\_links', string $link )
=================================================
Filters the paginated links for the given archive pages.
`$link` string The paginated link URL. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
esc_url( apply_filters( 'paginate_links', $link ) ),
```
| Used By | Description |
| --- | --- |
| [paginate\_links()](../functions/paginate_links) wp-includes/general-template.php | Retrieves paginated links for archive post pages. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'wp_restore_post_revision', int $post_id, int $revision_id ) do\_action( 'wp\_restore\_post\_revision', int $post\_id, int $revision\_id )
=============================================================================
Fires after a post revision has been restored.
`$post_id` int Post ID. `$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_restore_post_revision', $post_id, $revision['ID'] );
```
| Used By | Description |
| --- | --- |
| [wp\_restore\_post\_revision()](../functions/wp_restore_post_revision) wp-includes/revision.php | Restores a post to the specified revision. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'use_block_editor_for_post_type', bool $use_block_editor, string $post_type ) apply\_filters( 'use\_block\_editor\_for\_post\_type', bool $use\_block\_editor, string $post\_type )
=====================================================================================================
Filters whether a post is able to be edited in the block editor.
`$use_block_editor` bool Whether the post type can be edited or not. Default true. `$post_type` string The post type being checked. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'use_block_editor_for_post_type', true, $post_type );
```
| Used By | Description |
| --- | --- |
| [use\_block\_editor\_for\_post\_type()](../functions/use_block_editor_for_post_type) wp-includes/post.php | Returns whether a post type is compatible with the block editor. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'plugin_action_links', string[] $actions, string $plugin_file, array $plugin_data, string $context ) apply\_filters( 'plugin\_action\_links', string[] $actions, string $plugin\_file, array $plugin\_data, string $context )
========================================================================================================================
Filters the action links displayed for each plugin in the Plugins list table.
`$actions` string[] An array of plugin action links. By default this can include `'activate'`, `'deactivate'`, and `'delete'`. With Multisite active this can also include `'network_active'` and `'network_only'` items. `$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( '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 |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `'Edit'` link was removed from the list of action links. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | The `$context` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'debug_information', array $args ) apply\_filters( 'debug\_information', array $args )
===================================================
Filters the debug information shown on the Tools -> Site Health -> Info screen.
Plugin or themes may wish to introduce their own debug information without creating additional admin pages. They can utilize this filter to introduce their own sections or add more data to existing sections.
Array keys for sections added by core are all prefixed with `wp-`. Plugins and themes should use their own slug as a prefix, both for consistency as well as avoiding key collisions. Note that the array keys are used as labels for the copied data.
All strings are expected to be plain text except `$description` that can contain inline HTML tags (see below).
`$args` array The debug information to be added to the core information page.
This is an associative multi-dimensional array, up to three levels deep.
The topmost array holds the sections, keyed by section ID.
* `...$0`array Each section has a `$fields` associative array (see below), and each `$value` in `$fields` can be another associative array of name/value pairs when there is more structured data to display.
+ `label`stringRequired. The title for this section of the debug output.
+ `description`stringOptional. A description for your information section which may contain basic HTML markup, inline tags only as it is outputted in a paragraph.
+ `show_count`boolOptional. If set to `true`, the amount of fields will be included in the title for this section. Default false.
+ `private`boolOptional. If set to `true`, the section and all associated fields will be excluded from the copied data. Default false.
+ `fields`array Required. An associative array containing the fields to be displayed in the section, keyed by field ID.
- `...$0`array An associative array containing the data to be displayed for the field.
* `label`stringRequired. The label for this piece of information.
* `value`mixedRequired. The output that is displayed for this field.
Text should be translated. Can be an associative array that is displayed as name/value pairs.
Accepted types: `string|int|float|(string|int|float)[]`.
* `debug`stringOptional. The output that is used for this field when the user copies the data. It should be more concise and not translated. If not set, the content of `$value` is used. Note that the array keys are used as labels for the copied data.
* `private`boolOptional. If set to `true`, the field will be excluded from the copied data, allowing you to show, for example, API keys here. Default false.
} } File: `wp-admin/includes/class-wp-debug-data.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-debug-data.php/)
```
$info = apply_filters( 'debug_information', $info );
```
| Used By | Description |
| --- | --- |
| [WP\_Debug\_Data::debug\_data()](../classes/wp_debug_data/debug_data) wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'has_nav_menu', bool $has_nav_menu, string $location ) apply\_filters( 'has\_nav\_menu', bool $has\_nav\_menu, string $location )
==========================================================================
Filters whether a nav menu is assigned to the specified location.
`$has_nav_menu` bool Whether there is a menu assigned to a location. `$location` string Menu location. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
return apply_filters( 'has_nav_menu', $has_nav_menu, $location );
```
| Used By | Description |
| --- | --- |
| [has\_nav\_menu()](../functions/has_nav_menu) wp-includes/nav-menu.php | Determines whether a registered nav menu location has a menu assigned to it. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action( 'save_post', int $post_ID, WP_Post $post, bool $update ) do\_action( 'save\_post', int $post\_ID, WP\_Post $post, bool $update )
=======================================================================
Fires once a post 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. `save_post` is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. The data for the post is stored in `$_POST`, `$_GET` or the global `$post_data`, depending on how the post was edited. For example, quick edits use `$_POST`.
Since this action is triggered right after the post has been saved, you can easily access this post object by using `get_post($post_id);`.
**NOTE:** As of WP 3.7, an alternative action has been introduced, which is called for specific post types: `[save\_post\_{post\_type}](save_post_post-post_type)`. Hooking to this action prevents your callback to be unnecessarily triggered.
If you are calling a function such as [`wp_update_post`](../functions/wp_update_post) that includes the `save_post` hook, your hooked function will create an infinite loop. To avoid this, unhook your function before calling the function you need, then re-hook it afterward.
```
// this function makes all posts in the default category private
function set_private_categories($post_id) {
// If this is a revision, get real post ID
if ( $parent_id = wp_is_post_revision( $post_id ) )
$post_id = $parent_id;
// Get default category ID from options
$defaultcat = get_option( 'default_category' );
// Check if this post is in default category
if ( in_category( $defaultcat, $post_id ) ) {
// unhook this function so it doesn't loop infinitely
remove_action( 'save_post', 'set_private_categories' );
// update the post, which calls save_post again
wp_update_post( array( 'ID' => $post_id, 'post_status' => 'private' ) );
// re-hook this function
add_action( 'save_post', 'set_private_categories' );
}
}
add_action( 'save_post', 'set_private_categories' );
```
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'save_post', $post_ID, $post, $update );
```
| 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. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'site_status_page_cache_supported_cache_headers', array $cache_headers ) apply\_filters( 'site\_status\_page\_cache\_supported\_cache\_headers', array $cache\_headers )
===============================================================================================
Filters the list of cache headers supported by core.
`$cache_headers` array Array of supported cache headers. 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_page_cache_supported_cache_headers', $cache_headers );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::get\_page\_cache\_headers()](../classes/wp_site_health/get_page_cache_headers) wp-admin/includes/class-wp-site-health.php | Returns a list of headers and its verification callback to verify if page cache is enabled or not. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'display_post_states', string[] $post_states, WP_Post $post ) apply\_filters( 'display\_post\_states', string[] $post\_states, WP\_Post $post )
=================================================================================
Filters the default post display states used in the posts list table.
`$post_states` string[] An array of post display states. `$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/)
```
return apply_filters( 'display_post_states', $post_states, $post );
```
| Used By | Description |
| --- | --- |
| [get\_post\_states()](../functions/get_post_states) wp-admin/includes/template.php | Retrieves an array of post states from a post. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Also applied in the Customizer context. If any admin functions are used within the filter, their existence should be checked with `function_exists()` before being used. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Added the `$post` parameter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'shake_error_codes', string[] $shake_error_codes ) apply\_filters( 'shake\_error\_codes', string[] $shake\_error\_codes )
======================================================================
Filters the error codes array for shaking the login form.
`$shake_error_codes` string[] Error codes that shake the login form. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
$shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );
```
| Used By | Description |
| --- | --- |
| [login\_header()](../functions/login_header) wp-login.php | Output the login page header. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'mu_activity_box_end' ) do\_action( 'mu\_activity\_box\_end' )
======================================
Fires at the end of the ‘Right Now’ widget in the Network Admin dashboard.
File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
do_action( 'mu_activity_box_end' );
```
| Used By | Description |
| --- | --- |
| [wp\_network\_dashboard\_right\_now()](../functions/wp_network_dashboard_right_now) wp-admin/includes/dashboard.php | |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'get_object_terms', WP_Term[]|int[]|string[]|string $terms, int[] $object_ids, string[] $taxonomies, array $args ) apply\_filters( 'get\_object\_terms', WP\_Term[]|int[]|string[]|string $terms, int[] $object\_ids, string[] $taxonomies, array $args )
======================================================================================================================================
Filters the terms for a given object or objects.
`$terms` [WP\_Term](../classes/wp_term)[]|int[]|string[]|string Array of terms or a count thereof as a numeric string. `$object_ids` int[] Array of object IDs for which terms were retrieved. `$taxonomies` string[] Array of taxonomy names from which terms were retrieved. `$args` array Array of arguments for retrieving terms for the given object(s). See [wp\_get\_object\_terms()](../functions/wp_get_object_terms) for details. More Arguments from wp\_get\_object\_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/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$terms = apply_filters( 'get_object_terms', $terms, $object_ids, $taxonomies, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_object\_terms()](../functions/wp_get_object_terms) wp-includes/taxonomy.php | Retrieves the terms associated with the given object(s), in the supplied taxonomies. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'theme_install_actions', string[] $actions, stdClass $theme ) apply\_filters( 'theme\_install\_actions', string[] $actions, stdClass $theme )
===============================================================================
Filters the install action links for a theme in the Install Themes list table.
`$actions` string[] An array of theme action links. Defaults are links to Install Now, Preview, and Details. `$theme` stdClass An object that contains theme data returned by the WordPress.org API. File: `wp-admin/includes/class-wp-theme-install-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-theme-install-list-table.php/)
```
$actions = apply_filters( 'theme_install_actions', $actions, $theme );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme\_Install\_List\_Table::single\_row()](../classes/wp_theme_install_list_table/single_row) wp-admin/includes/class-wp-theme-install-list-table.php | Prints a theme from the WordPress.org API. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'deleted_transient', string $transient ) do\_action( 'deleted\_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_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( 'wp_required_field_message', string $message ) apply\_filters( 'wp\_required\_field\_message', string $message )
=================================================================
Filters the message to explain required form fields.
`$message` string Message text and glyph wrapped in a `span` tag. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'wp_required_field_message', $message );
```
| Used By | Description |
| --- | --- |
| [wp\_required\_field\_message()](../functions/wp_required_field_message) wp-includes/general-template.php | Creates a message to explain required form fields. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'pre_user_email', string $raw_user_email ) apply\_filters( 'pre\_user\_email', string $raw\_user\_email )
==============================================================
Filters a user’s email before the user is created or updated.
`$raw_user_email` string The user's email. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$user_email = apply_filters( 'pre_user_email', $raw_user_email );
```
| 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( 'screen_layout_columns', array $empty_columns, string $screen_id, WP_Screen $screen ) apply\_filters( 'screen\_layout\_columns', array $empty\_columns, string $screen\_id, WP\_Screen $screen )
==========================================================================================================
Filters the array of screen layout columns.
This hook provides back-compat for plugins using the back-compat Filters instead of [add\_screen\_option()](../functions/add_screen_option) .
`$empty_columns` array Empty array. `$screen_id` string Screen ID. `$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/)
```
$columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
```
| 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 |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( "network_admin_plugin_action_links_{$plugin_file}", string[] $actions, string $plugin_file, array $plugin_data, string $context ) apply\_filters( "network\_admin\_plugin\_action\_links\_{$plugin\_file}", string[] $actions, string $plugin\_file, array $plugin\_data, string $context )
=========================================================================================================================================================
Filters the list of action links displayed for a specific plugin in the Network Admin 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.
`$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_{$plugin_file}", $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 apply_filters( "widget_{$this->id_base}_instance", array $instance, array $args, WP_Widget_Media $widget ) apply\_filters( "widget\_{$this->id\_base}\_instance", array $instance, array $args, WP\_Widget\_Media $widget )
================================================================================================================
Filters the media widget instance prior to rendering the media.
`$instance` array Instance data. `$args` array Widget args. `$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/)
```
$instance = apply_filters( "widget_{$this->id_base}_instance", $instance, $args, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Media::widget()](../classes/wp_widget_media/widget) wp-includes/widgets/class-wp-widget-media.php | Displays the widget on the front-end. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( 'nav_menu_link_attributes', array $atts, WP_Post $menu_item, stdClass $args, int $depth ) apply\_filters( 'nav\_menu\_link\_attributes', array $atts, WP\_Post $menu\_item, stdClass $args, int $depth )
==============================================================================================================
Filters the HTML attributes applied to a menu item’s anchor element.
`$atts` array The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
* `title`stringTitle attribute.
* `target`stringTarget attribute.
* `rel`stringThe rel attribute.
* `href`stringThe href attribute.
* `aria-current`stringThe aria-current attribute.
`$menu_item` [WP\_Post](../classes/wp_post) The current menu item object. `$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. * The filter permits full control over what HTML attributes are added to menus generated with the WP Menu API.
* This filter runs *per nav item*, vs providing a list of all nav elements at once.
* Note that the callback function must return a value after it is finished processing or the result will be empty.
File: `wp-includes/class-walker-nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-nav-menu.php/)
```
$atts = apply_filters( 'nav_menu_link_attributes', $atts, $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.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'user_request_action_email_subject', string $subject, string $sitename, array $email_data ) apply\_filters( 'user\_request\_action\_email\_subject', string $subject, string $sitename, array $email\_data )
================================================================================================================
Filters the subject of the email sent when an account action is attempted.
`$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.
* `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/)
```
$subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $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( 'pre_get_main_site_id', int|null $main_site_id, WP_Network $network ) apply\_filters( 'pre\_get\_main\_site\_id', int|null $main\_site\_id, WP\_Network $network )
============================================================================================
Filters the main site ID.
Returning a positive integer will effectively short-circuit the function.
`$main_site_id` int|null If a positive integer is returned, it is interpreted as the main site ID. `$network` [WP\_Network](../classes/wp_network) The network object for which the main site was detected. File: `wp-includes/class-wp-network.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-network.php/)
```
$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Network::get\_main\_site\_id()](../classes/wp_network/get_main_site_id) wp-includes/class-wp-network.php | Returns the main site ID for the network. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'update_post_term_count_statuses', string[] $post_statuses, WP_Taxonomy $taxonomy ) apply\_filters( 'update\_post\_term\_count\_statuses', string[] $post\_statuses, WP\_Taxonomy $taxonomy )
=========================================================================================================
Filters the post statuses for updating the term count.
`$post_statuses` string[] List of post statuses to include in the count. Default is `'publish'`. `$taxonomy` [WP\_Taxonomy](../classes/wp_taxonomy) Current taxonomy object. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$post_statuses = esc_sql( apply_filters( 'update_post_term_count_statuses', $post_statuses, $taxonomy ) );
```
| 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. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress do_action( "deleted_{$meta_type}meta", int $meta_id ) do\_action( "deleted\_{$meta\_type}meta", int $meta\_id )
=========================================================
Fires immediately after deleting post or comment metadata of a specific type.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post or comment).
Possible hook names include:
* `deleted_postmeta`
* `deleted_commentmeta`
* `deleted_termmeta`
* `deleted_usermeta`
`$meta_id` int Deleted metadata entry ID. 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_id );
```
| Used By | Description |
| --- | --- |
| [delete\_metadata\_by\_mid()](../functions/delete_metadata_by_mid) wp-includes/meta.php | Deletes metadata by meta ID. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'js_escape', string $safe_text, string $text ) apply\_filters( 'js\_escape', string $safe\_text, string $text )
================================================================
Filters a string cleaned and escaped for output in JavaScript.
Text passed to [esc\_js()](../functions/esc_js) is stripped of invalid or special characters, and properly slashed for 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( 'js_escape', $safe_text, $text );
```
| Used By | Description |
| --- | --- |
| [esc\_js()](../functions/esc_js) wp-includes/formatting.php | Escapes single quotes, `"`, , `&`, and fixes line endings. |
| Version | Description |
| --- | --- |
| [2.0.6](https://developer.wordpress.org/reference/since/2.0.6/) | Introduced. |
wordpress apply_filters( 'attachment_thumbnail_args', array $image_attachment, array $metadata, array $uploaded ) apply\_filters( 'attachment\_thumbnail\_args', array $image\_attachment, array $metadata, array $uploaded )
===========================================================================================================
Filters the parameters for the attachment thumbnail creation.
`$image_attachment` array An array of parameters to create the thumbnail. `$metadata` array Current attachment metadata. `$uploaded` array Information about the newly-uploaded file.
* `file`stringFilename of the newly-uploaded file.
* `url`stringURL of the uploaded file.
* `type`stringFile type.
File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
$image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded );
```
| Used By | Description |
| --- | --- |
| [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 |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_where_paged', string $where, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_where\_paged', string $where, WP\_Query $query )
====================================================================================
Filters the WHERE clause of the query.
Specifically for manipulating paging queries.
`$where` string The WHERE 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/)
```
$where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$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. |
| programming_docs |
wordpress do_action( 'export_wp', array $args ) do\_action( 'export\_wp', array $args )
=======================================
Fires at the beginning of an export, before any headers are sent.
`$args` array An array of export arguments. File: `wp-admin/includes/export.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/export.php/)
```
do_action( 'export_wp', $args );
```
| Used By | Description |
| --- | --- |
| [export\_wp()](../functions/export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'wp_lazy_loading_enabled', bool $default, string $tag_name, string $context ) apply\_filters( 'wp\_lazy\_loading\_enabled', bool $default, string $tag\_name, string $context )
=================================================================================================
Filters whether to add the `loading` attribute to the specified tag in the specified context.
`$default` bool Default value. `$tag_name` string The tag name. `$context` string Additional context, like the current filter name or the function name from where this was called. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return (bool) apply_filters( 'wp_lazy_loading_enabled', $default, $tag_name, $context );
```
| Used By | Description |
| --- | --- |
| [wp\_lazy\_loading\_enabled()](../functions/wp_lazy_loading_enabled) wp-includes/media.php | Determines whether to add the `loading` attribute to the specified tag in the specified context. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( "get_{$meta_type}_metadata_by_mid", stdClass|null $value, int $meta_id ) apply\_filters( "get\_{$meta\_type}\_metadata\_by\_mid", stdClass|null $value, int $meta\_id )
==============================================================================================
Short-circuits the return value when fetching a meta field 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:
* `get_post_metadata_by_mid`
* `get_comment_metadata_by_mid`
* `get_term_metadata_by_mid`
* `get_user_metadata_by_mid`
`$value` stdClass|null The value to return. `$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( "get_{$meta_type}_metadata_by_mid", null, $meta_id );
```
| Used By | Description |
| --- | --- |
| [get\_metadata\_by\_mid()](../functions/get_metadata_by_mid) wp-includes/meta.php | Retrieves metadata by meta ID. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'comment_notification_subject', string $subject, string $comment_id ) apply\_filters( 'comment\_notification\_subject', string $subject, string $comment\_id )
========================================================================================
Filters the comment notification email subject.
`$subject` string The comment notification email subject. `$comment_id` string Comment ID as a numeric string. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$subject = apply_filters( 'comment_notification_subject', $subject, $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 |
| --- | --- |
| [1.5.2](https://developer.wordpress.org/reference/since/1.5.2/) | Introduced. |
wordpress do_action( "admin_print_styles-{$hook_suffix}" ) do\_action( "admin\_print\_styles-{$hook\_suffix}" )
====================================================
Fires when styles 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_styles-{$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.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'password_change_email', array $pass_change_email, array $user, array $userdata ) apply\_filters( 'password\_change\_email', array $pass\_change\_email, array $user, array $userdata )
=====================================================================================================
Filters the contents of the email sent when the user’s password is changed.
`$pass_change_email` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe intended recipients. Add emails in a comma separated string.
* `subject`stringThe subject of the email.
* `message`stringThe content of the email.
The following strings have a special meaning and will get replaced dynamically:
+ `###USERNAME###` The current user's username.
+ `###ADMIN_EMAIL###` The admin email in case this was unexpected.
+ `###EMAIL###` The user's email address.
+ `###SITENAME###` The name of the site.
+ `###SITEURL###` The URL to the site.
* `headers`stringHeaders. Add headers in a newline (rn) separated string.
`$user` array The original user array. `$userdata` array The updated user array. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$pass_change_email = apply_filters( 'password_change_email', $pass_change_email, $user, $userdata );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_user()](../functions/wp_update_user) wp-includes/user.php | Updates a user in the database. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'mime_types', string[] $wp_get_mime_types ) apply\_filters( 'mime\_types', string[] $wp\_get\_mime\_types )
===============================================================
Filters the list of mime types and file extensions.
This filter should be used to add, not remove, mime types. To remove mime types, use the [‘upload\_mimes’](upload_mimes) filter.
`$wp_get_mime_types` string[] Mime types keyed by the file extension regex corresponding to those types. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters(
'mime_types',
array(
// Image formats.
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'bmp' => 'image/bmp',
'tiff|tif' => 'image/tiff',
'webp' => 'image/webp',
'ico' => 'image/x-icon',
'heic' => 'image/heic',
// Video formats.
'asf|asx' => 'video/x-ms-asf',
'wmv' => 'video/x-ms-wmv',
'wmx' => 'video/x-ms-wmx',
'wm' => 'video/x-ms-wm',
'avi' => 'video/avi',
'divx' => 'video/divx',
'flv' => 'video/x-flv',
'mov|qt' => 'video/quicktime',
'mpeg|mpg|mpe' => 'video/mpeg',
'mp4|m4v' => 'video/mp4',
'ogv' => 'video/ogg',
'webm' => 'video/webm',
'mkv' => 'video/x-matroska',
'3gp|3gpp' => 'video/3gpp', // Can also be audio.
'3g2|3gp2' => 'video/3gpp2', // Can also be audio.
// Text formats.
'txt|asc|c|cc|h|srt' => 'text/plain',
'csv' => 'text/csv',
'tsv' => 'text/tab-separated-values',
'ics' => 'text/calendar',
'rtx' => 'text/richtext',
'css' => 'text/css',
'htm|html' => 'text/html',
'vtt' => 'text/vtt',
'dfxp' => 'application/ttaf+xml',
// Audio formats.
'mp3|m4a|m4b' => 'audio/mpeg',
'aac' => 'audio/aac',
'ra|ram' => 'audio/x-realaudio',
'wav' => 'audio/wav',
'ogg|oga' => 'audio/ogg',
'flac' => 'audio/flac',
'mid|midi' => 'audio/midi',
'wma' => 'audio/x-ms-wma',
'wax' => 'audio/x-ms-wax',
'mka' => 'audio/x-matroska',
// Misc application formats.
'rtf' => 'application/rtf',
'js' => 'application/javascript',
'pdf' => 'application/pdf',
'swf' => 'application/x-shockwave-flash',
'class' => 'application/java',
'tar' => 'application/x-tar',
'zip' => 'application/zip',
'gz|gzip' => 'application/x-gzip',
'rar' => 'application/rar',
'7z' => 'application/x-7z-compressed',
'exe' => 'application/x-msdownload',
'psd' => 'application/octet-stream',
'xcf' => 'application/octet-stream',
// MS Office formats.
'doc' => 'application/msword',
'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
'wri' => 'application/vnd.ms-write',
'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
'mdb' => 'application/vnd.ms-access',
'mpp' => 'application/vnd.ms-project',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12',
'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
'oxps' => 'application/oxps',
'xps' => 'application/vnd.ms-xpsdocument',
// OpenOffice formats.
'odt' => 'application/vnd.oasis.opendocument.text',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'odc' => 'application/vnd.oasis.opendocument.chart',
'odb' => 'application/vnd.oasis.opendocument.database',
'odf' => 'application/vnd.oasis.opendocument.formula',
// WordPerfect formats.
'wp|wpd' => 'application/wordperfect',
// iWork formats.
'key' => 'application/vnd.apple.keynote',
'numbers' => 'application/vnd.apple.numbers',
'pages' => 'application/vnd.apple.pages',
)
);
```
| Used By | Description |
| --- | --- |
| [wp\_get\_mime\_types()](../functions/wp_get_mime_types) wp-includes/functions.php | Retrieves the list of mime types and file extensions. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'comment_moderation_subject', string $subject, int $comment_id ) apply\_filters( 'comment\_moderation\_subject', string $subject, int $comment\_id )
===================================================================================
Filters the comment moderation email subject.
`$subject` string Subject of the comment moderation email. `$comment_id` int Comment ID. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_notify\_moderator()](../functions/wp_notify_moderator) wp-includes/pluggable.php | Notifies the moderator of the site about a new comment that is awaiting approval. |
| Version | Description |
| --- | --- |
| [1.5.2](https://developer.wordpress.org/reference/since/1.5.2/) | Introduced. |
wordpress apply_filters( 'user_request_confirmed_email_content', string $content, array $email_data ) apply\_filters( 'user\_request\_confirmed\_email\_content', string $content, array $email\_data )
=================================================================================================
Filters the body of the user request confirmation email.
The email is sent to an administrator when a user request is confirmed.
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.
* `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/)
```
$content = apply_filters( 'user_request_confirmed_email_content', $content, $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.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( "pre_update_site_option_{$option}", mixed $value, mixed $old_value, string $option, int $network_id ) apply\_filters( "pre\_update\_site\_option\_{$option}", mixed $value, mixed $old\_value, string $option, int $network\_id )
===========================================================================================================================
Filters a specific network option before its value is updated.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$value` mixed New value of the network option. `$old_value` mixed Old value of the network option. `$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/)
```
$value = apply_filters( "pre_update_site_option_{$option}", $value, $old_value, $option, $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. |
| [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/) | |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'get_page_uri', string $uri, WP_Post $page ) apply\_filters( 'get\_page\_uri', string $uri, WP\_Post $page )
===============================================================
Filters the URI for a page.
`$uri` string Page URI. `$page` [WP\_Post](../classes/wp_post) Page object. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'get_page_uri', $uri, $page );
```
| Used By | Description |
| --- | --- |
| [get\_page\_uri()](../functions/get_page_uri) wp-includes/post.php | Builds the URI path for a page. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'manage_pages_custom_column', string $column_name, int $post_id ) do\_action( 'manage\_pages\_custom\_column', string $column\_name, int $post\_id )
==================================================================================
Fires in each custom column on the Posts list table.
This hook only fires if the current post type is hierarchical, such as pages.
`$column_name` string The name of the column to display. `$post_id` int The current post ID. Combined with the <manage_pages_columns> filter, this allows you to add or remove (unset) custom columns to the list page pages. Note that if you are using custom post types and it has ‘`hierarchical`‘ => `true`, then you will need to use this action hook and not [manage\_$post\_type\_posts\_custom\_column](manage_post-post_type_posts_custom_column).
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_pages_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 |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'comment_duplicate_message', string $comment_duplicate_message ) apply\_filters( 'comment\_duplicate\_message', string $comment\_duplicate\_message )
====================================================================================
Filters duplicate comment error message.
`$comment_duplicate_message` string Duplicate comment error message. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$comment_duplicate_message = apply_filters( 'comment_duplicate_message', __( 'Duplicate comment detected; it looks as though you’ve already said that!' ) );
```
| 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 |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( "manage_{$this->screen->id}_sortable_columns", array $sortable_columns ) apply\_filters( "manage\_{$this->screen->id}\_sortable\_columns", array $sortable\_columns )
============================================================================================
Filters the list table sortable columns for a specific screen.
The dynamic portion of the hook name, `$this->screen->id`, refers to the ID of the current screen.
`$sortable_columns` array An array of sortable columns. 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/)
```
$_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
```
| Used By | Description |
| --- | --- |
| [WP\_List\_Table::get\_column\_info()](../classes/wp_list_table/get_column_info) wp-admin/includes/class-wp-list-table.php | Gets a list of all, hidden, and sortable columns, with filter applied. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_protected_ajax_actions', string[] $actions_to_protect ) apply\_filters( 'wp\_protected\_ajax\_actions', string[] $actions\_to\_protect )
================================================================================
Filters the array of protected Ajax actions.
This filter is only fired when doing Ajax and the Ajax request has an ‘action’ property.
`$actions_to_protect` string[] Array of strings with Ajax actions to protect. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
$actions_to_protect = (array) apply_filters( 'wp_protected_ajax_actions', $actions_to_protect );
```
| Used By | Description |
| --- | --- |
| [is\_protected\_ajax\_action()](../functions/is_protected_ajax_action) wp-includes/load.php | Determines whether we are currently handling an Ajax action that should be protected against WSODs. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'page_rewrite_rules', string[] $page_rewrite ) apply\_filters( 'page\_rewrite\_rules', string[] $page\_rewrite )
=================================================================
Filters rewrite rules used for “page” post type archives.
`$page_rewrite` string[] Array of rewrite rules for the "page" post type, 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/)
```
$page_rewrite = apply_filters( 'page_rewrite_rules', $page_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( 'template_directory', string $template_dir, string $template, string $theme_root ) apply\_filters( 'template\_directory', string $template\_dir, string $template, string $theme\_root )
=====================================================================================================
Filters the active theme directory path.
`$template_dir` string The path of the active theme directory. `$template` string Directory name of the active theme. `$theme_root` string Absolute path to the themes directory. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'template_directory', $template_dir, $template, $theme_root );
```
| Used By | Description |
| --- | --- |
| [get\_template\_directory()](../functions/get_template_directory) wp-includes/theme.php | Retrieves template directory path for the active theme. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_insert_attachment_data', array $data, array $postarr, array $unsanitized_postarr, bool $update ) apply\_filters( 'wp\_insert\_attachment\_data', array $data, array $postarr, array $unsanitized\_postarr, bool $update )
========================================================================================================================
Filters attachment post data before it is updated in or added to the database.
`$data` array An array of slashed, sanitized, and processed attachment post data. `$postarr` array An array of slashed and sanitized attachment post data, but not processed. `$unsanitized_postarr` array An array of slashed yet \*unsanitized\* and unprocessed attachment post data as originally passed to [wp\_insert\_post()](../functions/wp_insert_post) . `$update` bool Whether this is an existing attachment post being updated. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$data = apply_filters( 'wp_insert_attachment_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. |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'customize_section_active', bool $active, WP_Customize_Section $section ) apply\_filters( 'customize\_section\_active', bool $active, WP\_Customize\_Section $section )
=============================================================================================
Filters response of [WP\_Customize\_Section::active()](../classes/wp_customize_section/active).
`$active` bool Whether the Customizer section is active. `$section` [WP\_Customize\_Section](../classes/wp_customize_section) [WP\_Customize\_Section](../classes/wp_customize_section) instance. File: `wp-includes/class-wp-customize-section.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-section.php/)
```
$active = apply_filters( 'customize_section_active', $active, $section );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Section::active()](../classes/wp_customize_section/active) wp-includes/class-wp-customize-section.php | Check whether section is active to current Customizer preview. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'plugin_install_action_links', string[] $action_links, array $plugin ) apply\_filters( 'plugin\_install\_action\_links', string[] $action\_links, array $plugin )
==========================================================================================
Filters the install action links for a plugin.
`$action_links` string[] An array of plugin action links.
Defaults are links to Details and Install Now. `$plugin` array An array of plugin data. See [plugins\_api()](../functions/plugins_api) for the list of possible values. More Arguments from plugins\_api( ... $args ) Array or object of arguments to serialize for the Plugin Info API.
* `slug`stringThe plugin slug.
* `per_page`intNumber of plugins per page. Default 24.
* `page`intNumber of current page. Default 1.
* `number`intNumber of tags or categories to be queried.
* `search`stringA search term.
* `tag`stringTag to filter plugins.
* `author`stringUsername of an plugin author to filter plugins.
* `user`stringUsername to query for their favorites.
* `browse`stringBrowse view: `'popular'`, `'new'`, `'beta'`, `'recommended'`.
* `locale`stringLocale to provide context-sensitive results. Default is the value of [get\_locale()](../functions/get_locale) .
* `installed_plugins`stringInstalled plugins to provide context-sensitive results.
* `is_ssl`boolWhether links should be returned with https or not. Default false.
* `fields`array Array of fields which should or should not be returned.
+ `short_description`boolWhether to return the plugin short description. Default true.
+ `description`boolWhether to return the plugin full description. Default false.
+ `sections`boolWhether to return the plugin readme sections: description, installation, FAQ, screenshots, other notes, and changelog. Default false.
+ `tested`boolWhether to return the 'Compatible up to' value. Default true.
+ `requires`boolWhether to return the required WordPress version. Default true.
+ `requires_php`boolWhether to return the required PHP version. Default true.
+ `rating`boolWhether to return the rating in percent and total number of ratings.
Default true.
+ `ratings`boolWhether to return the number of rating for each star (1-5). Default true.
+ `downloaded`boolWhether to return the download count. Default true.
+ `downloadlink`boolWhether to return the download link for the package. Default true.
+ `last_updated`boolWhether to return the date of the last update. Default true.
+ `added`boolWhether to return the date when the plugin was added to the wordpress.org repository. Default true.
+ `tags`boolWhether to return the assigned tags. Default true.
+ `compatibility`boolWhether to return the WordPress compatibility list. Default true.
+ `homepage`boolWhether to return the plugin homepage link. Default true.
+ `versions`boolWhether to return the list of all available versions. Default false.
+ `donate_link`boolWhether to return the donation link. Default true.
+ `reviews`boolWhether to return the plugin reviews. Default false.
+ `banners`boolWhether to return the banner images links. Default false.
+ `icons`boolWhether to return the icon links. Default false.
+ `active_installs`boolWhether to return the number of active installations. Default false.
+ `group`boolWhether to return the assigned group. Default false.
+ `contributors`boolWhether to return the list of contributors. Default false. 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/)
```
$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugin\_Install\_List\_Table::display\_rows()](../classes/wp_plugin_install_list_table/display_rows) 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( 'wp_handle_upload', array $upload, string $context ) apply\_filters( 'wp\_handle\_upload', array $upload, string $context )
======================================================================
Filters the data array for the uploaded file.
`$upload` array Array of upload data.
* `file`stringFilename of the newly-uploaded file.
* `url`stringURL of the newly-uploaded file.
* `type`stringMime type of the newly-uploaded file.
`$context` string The type of upload action. Values include `'upload'` or `'sideload'`. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
return apply_filters(
'wp_handle_upload',
array(
'file' => $new_file,
'url' => $url,
'type' => $type,
),
'wp_handle_sideload' === $action ? 'sideload' : 'upload'
);
```
| Used By | Description |
| --- | --- |
| [\_wp\_handle\_upload()](../functions/_wp_handle_upload) wp-admin/includes/file.php | Handles PHP uploads in WordPress. |
| [wp\_upload\_bits()](../functions/wp_upload_bits) wp-includes/functions.php | Creates a file in the upload folder with given content. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'cron_schedules', array[] $new_schedules ) apply\_filters( 'cron\_schedules', array[] $new\_schedules )
============================================================
Filters the non-default cron schedules.
`$new_schedules` array[] An array of non-default cron schedule arrays. Default empty. The filter accepts an array of non-default cron schedules in arrays (an array of arrays). The outer array has a key that is the name of the schedule (for example, ‘weekly’). The value is an array with two keys, one is ‘interval’ and the other is ‘display’.
The ‘interval’ is a number in seconds of when the cron job shall run. So, for a hourly schedule, the ‘interval’ value would be 3600 or 60\*60. For for a weekly schedule, the ‘interval’ value would be 60\*60\*24\*7 or 604800.
The ‘display’ is the description of the non-default cron schedules. For the ‘weekly’ key, the ‘display’ may be \_\_(‘Once Weekly’).
**Why is this important?**
When scheduling your own actions to run using the WordPress Cron service, you have to specify which interval WordPress should use. WordPress has its own, limited, default set of intervals, or “schedules”, including ‘hourly’, ‘twicedaily’, and ‘daily’. This filter allows you to add your own intervals to the default set.
For your plugin, you will be passed an array, you can easily add a weekly schedule by doing something like:
```
function my_add_weekly( $schedules ) {
// add a 'weekly' schedule to the existing set
$schedules['weekly'] = array(
'interval' => 604800,
'display' => __('Once Weekly')
);
return $schedules;
}
add_filter( 'cron_schedules', 'my_add_weekly' );
```
Adding multiple intervals works similarly:
```
function my_add_intervals($schedules) {
// add a 'weekly' interval
$schedules['weekly'] = array(
'interval' => 604800,
'display' => __('Once Weekly')
);
$schedules['monthly'] = array(
'interval' => 2635200,
'display' => __('Once a month')
);
return $schedules;
}
add_filter( 'cron_schedules', 'my_add_intervals');
```
Be sure to add your schedule to the passed array, as shown in the example. If you simply return only your own schedule array then you will potentially delete schedules created by other plugins.
File: `wp-includes/cron.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/cron.php/)
```
return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_schedules()](../functions/wp_get_schedules) wp-includes/cron.php | Retrieve supported event recurrence schedules. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_personal_data_email_headers', string|array $headers, string $subject, string $content, int $request_id, array $email_data ) apply\_filters( 'wp\_privacy\_personal\_data\_email\_headers', string|array $headers, string $subject, string $content, int $request\_id, array $email\_data )
==============================================================================================================================================================
Filters the headers of the email sent with a personal data export file.
`$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.
* `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/)
```
$headers = apply_filters( 'wp_privacy_personal_data_email_headers', $headers, $subject, $content, $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.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress apply_filters( 'site_by_path_segments_count', int|null $segments, string $domain, string $path ) apply\_filters( 'site\_by\_path\_segments\_count', int|null $segments, string $domain, string $path )
=====================================================================================================
Filters the number of path segments to consider when searching for a site.
`$segments` int|null The number of path segments to consider. WordPress by default looks at one path segment following the network path. The function default of null only makes sense when you know the requested path should match a site. `$domain` string The requested domain. `$path` string The requested path, in full. File: `wp-includes/ms-load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-load.php/)
```
$segments = apply_filters( 'site_by_path_segments_count', $segments, $domain, $path );
```
| 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. |
wordpress do_action_deprecated( 'add_tag_form', string $taxonomy ) do\_action\_deprecated( 'add\_tag\_form', string $taxonomy )
============================================================
This hook has been deprecated. Use [‘{$taxonomy](../functions/%e2%80%98taxonomy)\_add\_form’} instead.
Fires at the end of the Add Tag form.
`$taxonomy` string The taxonomy slug. File: `wp-admin/edit-tags.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-tags.php/)
```
do_action_deprecated( 'add_tag_form', array( $taxonomy ), '3.0.0', '{$taxonomy}_add_form' );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Use ['{$taxonomy](../functions/taxonomy)\_add\_form'} instead. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'begin_fetch_post_thumbnail_html', int $post_id, int $post_thumbnail_id, string|int[] $size ) do\_action( 'begin\_fetch\_post\_thumbnail\_html', int $post\_id, int $post\_thumbnail\_id, string|int[] $size )
================================================================================================================
Fires before fetching the post thumbnail HTML.
Provides "just in time" filtering of all filters in [wp\_get\_attachment\_image()](../functions/wp_get_attachment_image) .
`$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( 'begin_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( 'wp_send_new_user_notification_to_user', bool $send, WP_User $user ) apply\_filters( 'wp\_send\_new\_user\_notification\_to\_user', bool $send, WP\_User $user )
===========================================================================================
Filters whether the user is notified of their 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_user = apply_filters( 'wp_send_new_user_notification_to_user', 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( 'http_request_host_is_external', bool $external, string $host, string $url ) apply\_filters( 'http\_request\_host\_is\_external', bool $external, string $host, string $url )
================================================================================================
Check if HTTP request is external or not.
Allows to change and allow external requests for the HTTP request.
`$external` bool Whether HTTP request is external or not. `$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/)
```
if ( ! apply_filters( 'http_request_host_is_external', false, $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 |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'shortcut_link', string $link ) apply\_filters( 'shortcut\_link', string $link )
================================================
This hook has been deprecated.
Filters the Press This bookmarklet link.
`$link` string The Press This bookmarklet link. File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
return apply_filters( 'shortcut_link', $link );
```
| Used By | Description |
| --- | --- |
| [get\_shortcut\_link()](../functions/get_shortcut_link) wp-includes/deprecated.php | Retrieves the Press This bookmarklet link. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | This hook has been deprecated. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'network_admin_email_change_email', array $email_change_email, string $old_email, string $new_email, int $network_id ) apply\_filters( 'network\_admin\_email\_change\_email', array $email\_change\_email, string $old\_email, string $new\_email, int $network\_id )
===============================================================================================================================================
Filters the contents of the email notification sent when the network admin email address is changed.
`$email_change_email` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe intended recipient.
* `subject`stringThe subject of the email.
* `message`stringThe content of the email.
The following strings have a special meaning and will get replaced dynamically:
+ `###OLD_EMAIL###` The old network admin email address.
+ `###NEW_EMAIL###` The new network admin email address.
+ `###SITENAME###` The name of the network.
+ `###SITEURL###` The URL to the site.
* `headers`stringHeaders.
`$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/)
```
$email_change_email = apply_filters( 'network_admin_email_change_email', $email_change_email, $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 apply_filters( "site_health_test_rest_capability_{$check}", string $default_capability, string $check ) apply\_filters( "site\_health\_test\_rest\_capability\_{$check}", string $default\_capability, string $check )
==============================================================================================================
Filters the capability needed to run a given Site Health check.
`$default_capability` string The default capability required for this check. `$check` string The Site Health check being performed. File: `wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php/)
```
$capability = apply_filters( "site_health_test_rest_capability_{$check}", $default_capability, $check );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Site\_Health\_Controller::validate\_request\_permission()](../classes/wp_rest_site_health_controller/validate_request_permission) wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php | Validates if the current user can request this REST endpoint. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'wp_generate_tag_cloud_data', array[] $tags_data ) apply\_filters( 'wp\_generate\_tag\_cloud\_data', array[] $tags\_data )
=======================================================================
Filters the data used to generate the tag cloud.
`$tags_data` array[] An array of term data arrays for terms used to generate the tag cloud. File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
$tags_data = apply_filters( 'wp_generate_tag_cloud_data', $tags_data );
```
| 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 |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'attachment_fields_to_edit', array $form_fields, WP_Post $post ) apply\_filters( 'attachment\_fields\_to\_edit', array $form\_fields, WP\_Post $post )
=====================================================================================
Filters the attachment fields to edit.
`$form_fields` array An array of attachment form fields. `$post` [WP\_Post](../classes/wp_post) The [WP\_Post](../classes/wp_post) attachment object. * WordPress does not pass standard fields through this filter, though this can still be used for adding attachment form fields.
* Note that the filter function **must** return an array of attachment form fields after it is finished processing; otherwise, no fields will be displayed when editing an attachment and other plugins also filtering the `$form_fields` array may generate errors.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
```
| Used By | Description |
| --- | --- |
| [get\_attachment\_fields\_to\_edit()](../functions/get_attachment_fields_to_edit) wp-admin/includes/media.php | Retrieves the attachment fields to edit form fields. |
| [get\_compat\_media\_markup()](../functions/get_compat_media_markup) wp-admin/includes/media.php | |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( "register_{$taxonomy}_taxonomy_args", array $args, string $taxonomy, string[] $object_type ) apply\_filters( "register\_{$taxonomy}\_taxonomy\_args", array $args, string $taxonomy, string[] $object\_type )
================================================================================================================
Filters the arguments for registering a specific taxonomy.
The dynamic portion of the filter name, `$taxonomy`, refers to the taxonomy key.
Possible hook names include:
* `register_category_taxonomy_args`
* `register_post_tag_taxonomy_args`
`$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}_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 |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'wp_dropdown_pages', string $output, array $parsed_args, WP_Post[] $pages ) apply\_filters( 'wp\_dropdown\_pages', string $output, array $parsed\_args, WP\_Post[] $pages )
===============================================================================================
Filters the HTML output of a list of pages as a dropdown.
`$output` string HTML output for dropdown list of pages. `$parsed_args` array The parsed arguments array. See [wp\_dropdown\_pages()](../functions/wp_dropdown_pages) for information on accepted arguments. 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'`.
`$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_dropdown_pages', $output, $parsed_args, $pages );
```
| Used By | Description |
| --- | --- |
| [wp\_dropdown\_pages()](../functions/wp_dropdown_pages) wp-includes/post-template.php | Retrieves or displays a list of pages as a dropdown (select list). |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | `$parsed_args` and `$pages` added as arguments. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'oembed_result', string|false $data, string $url, string|array $args ) apply\_filters( 'oembed\_result', string|false $data, string $url, string|array $args )
=======================================================================================
Filters the HTML returned by the oEmbed provider.
`$data` string|false The returned oEmbed HTML (false if unsafe). `$url` string URL of the content to be embedded. `$args` string|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/)
```
return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed\_Controller::get\_proxy\_item()](../classes/wp_oembed_controller/get_proxy_item) wp-includes/class-wp-oembed-controller.php | Callback for the proxy API endpoint. |
| [WP\_oEmbed::get\_html()](../classes/wp_oembed/get_html) wp-includes/class-wp-oembed.php | The do-it-all function that takes a URL and attempts to return the HTML. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( "get_{$adjacent}_post_excluded_terms", int[]|string $excluded_terms ) apply\_filters( "get\_{$adjacent}\_post\_excluded\_terms", int[]|string $excluded\_terms )
==========================================================================================
Filters the IDs of terms excluded from adjacent post queries.
The dynamic portion of the hook name, `$adjacent`, refers to the type of adjacency, ‘next’ or ‘previous’.
Possible hook names include:
* `get_next_post_excluded_terms`
* `get_previous_post_excluded_terms`
`$excluded_terms` int[]|string Array of excluded term IDs. Empty string if none were provided. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );
```
| 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/) | Introduced. |
wordpress apply_filters( 'post_comments_link', string $formatted, int|WP_Post $post ) apply\_filters( 'post\_comments\_link', string $formatted, int|WP\_Post $post )
===============================================================================
Filters the formatted post comments link HTML.
`$formatted` string The HTML-formatted post comments link. `$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( 'post_comments_link', $formatted_link, $post );
```
| Used By | Description |
| --- | --- |
| [get\_post\_reply\_link()](../functions/get_post_reply_link) wp-includes/comment-template.php | Retrieves HTML content for reply to post link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'unregistered_taxonomy_for_object_type', string $taxonomy, string $object_type ) do\_action( 'unregistered\_taxonomy\_for\_object\_type', string $taxonomy, string $object\_type )
=================================================================================================
Fires after a taxonomy is unregistered 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( 'unregistered_taxonomy_for_object_type', $taxonomy, $object_type );
```
| Used By | Description |
| --- | --- |
| [unregister\_taxonomy\_for\_object\_type()](../functions/unregister_taxonomy_for_object_type) wp-includes/taxonomy.php | Removes an already registered taxonomy from an object type. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'get_comment_date', string|int $date, string $format, WP_Comment $comment ) apply\_filters( 'get\_comment\_date', string|int $date, string $format, WP\_Comment $comment )
==============================================================================================
Filters the returned comment date.
`$date` string|int Formatted date string or Unix timestamp. `$format` string PHP date format. `$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_date', $date, $format, $comment );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_date()](../functions/get_comment_date) wp-includes/comment-template.php | Retrieves the comment date of the current comment. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'wp_privacy_personal_data_export_file_created', string $archive_pathname, string $archive_url, string $html_report_pathname, int $request_id, string $json_report_pathname ) do\_action( 'wp\_privacy\_personal\_data\_export\_file\_created', string $archive\_pathname, string $archive\_url, string $html\_report\_pathname, int $request\_id, string $json\_report\_pathname )
=====================================================================================================================================================================================================
Fires right after all personal data has been written to the export file.
`$archive_pathname` string The full path to the export file on the filesystem. `$archive_url` string The URL of the archive file. `$html_report_pathname` string The full path to the HTML personal data report on the filesystem. `$request_id` int The export request ID. `$json_report_pathname` string The full path to the JSON personal data report on the filesystem. 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_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id, $json_report_pathname );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_generate\_personal\_data\_export\_file()](../functions/wp_privacy_generate_personal_data_export_file) wp-admin/includes/privacy-tools.php | Generate the personal data export file. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Added the `$json_report_pathname` parameter. |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'manage_sites_action_links', string[] $actions, int $blog_id, string $blogname ) apply\_filters( 'manage\_sites\_action\_links', string[] $actions, int $blog\_id, string $blogname )
====================================================================================================
Filters the action links displayed for each site in the Sites list table.
The ‘Edit’, ‘Dashboard’, ‘Delete’, and ‘Visit’ links are displayed by default for each site. The site’s status determines whether to show the ‘Activate’ or ‘Deactivate’ link, ‘Unarchive’ or ‘Archive’ links, and ‘Not Spam’ or ‘Spam’ link for each site.
`$actions` string[] An array of action links to be displayed. `$blog_id` int The site ID. `$blogname` string Site path, formatted depending on whether it is a sub-domain or subdirectory multisite installation. 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/)
```
$actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Sites\_List\_Table::handle\_row\_actions()](../classes/wp_ms_sites_list_table/handle_row_actions) wp-admin/includes/class-wp-ms-sites-list-table.php | Generates and displays row action links. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'get_post_status', string $post_status, WP_Post $post ) apply\_filters( 'get\_post\_status', string $post\_status, WP\_Post $post )
===========================================================================
Filters the post status.
`$post_status` string The post status. `$post` [WP\_Post](../classes/wp_post) The post object. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'get_post_status', $post_status, $post );
```
| Used By | Description |
| --- | --- |
| [get\_post\_status()](../functions/get_post_status) wp-includes/post.php | Retrieves the post status based on the post ID. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | The attachment post type is now passed through this filter. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'customizer_widgets_section_args', array $section_args, string $section_id, int|string $sidebar_id ) apply\_filters( 'customizer\_widgets\_section\_args', array $section\_args, string $section\_id, int|string $sidebar\_id )
==========================================================================================================================
Filters Customizer widget section arguments for a given sidebar.
`$section_args` array Array of Customizer widget section arguments. `$section_id` string Customizer section ID. `$sidebar_id` int|string Sidebar 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/)
```
$section_args = apply_filters( 'customizer_widgets_section_args', $section_args, $section_id, $sidebar_id );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Widgets::customize\_register()](../classes/wp_customize_widgets/customize_register) wp-includes/class-wp-customize-widgets.php | Registers Customizer settings and controls for all sidebars and widgets. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress do_action( 'saved_term', int $term_id, int $tt_id, string $taxonomy, bool $update, array $args ) do\_action( 'saved\_term', int $term\_id, int $tt\_id, string $taxonomy, bool $update, array $args )
====================================================================================================
Fires after a term has been saved, and the term cache has been cleared.
The [‘saved\_$taxonomy’](saved_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. `$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_term', $term_id, $tt_id, $taxonomy, 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( 'plugin_install_description', string $description, array $plugin ) apply\_filters( 'plugin\_install\_description', string $description, array $plugin )
====================================================================================
Filters the plugin card description on the Add Plugins screen.
`$description` string Plugin card description. `$plugin` array An array of plugin data. See [plugins\_api()](../functions/plugins_api) for the list of possible values. More Arguments from plugins\_api( ... $args ) Array or object of arguments to serialize for the Plugin Info API.
* `slug`stringThe plugin slug.
* `per_page`intNumber of plugins per page. Default 24.
* `page`intNumber of current page. Default 1.
* `number`intNumber of tags or categories to be queried.
* `search`stringA search term.
* `tag`stringTag to filter plugins.
* `author`stringUsername of an plugin author to filter plugins.
* `user`stringUsername to query for their favorites.
* `browse`stringBrowse view: `'popular'`, `'new'`, `'beta'`, `'recommended'`.
* `locale`stringLocale to provide context-sensitive results. Default is the value of [get\_locale()](../functions/get_locale) .
* `installed_plugins`stringInstalled plugins to provide context-sensitive results.
* `is_ssl`boolWhether links should be returned with https or not. Default false.
* `fields`array Array of fields which should or should not be returned.
+ `short_description`boolWhether to return the plugin short description. Default true.
+ `description`boolWhether to return the plugin full description. Default false.
+ `sections`boolWhether to return the plugin readme sections: description, installation, FAQ, screenshots, other notes, and changelog. Default false.
+ `tested`boolWhether to return the 'Compatible up to' value. Default true.
+ `requires`boolWhether to return the required WordPress version. Default true.
+ `requires_php`boolWhether to return the required PHP version. Default true.
+ `rating`boolWhether to return the rating in percent and total number of ratings.
Default true.
+ `ratings`boolWhether to return the number of rating for each star (1-5). Default true.
+ `downloaded`boolWhether to return the download count. Default true.
+ `downloadlink`boolWhether to return the download link for the package. Default true.
+ `last_updated`boolWhether to return the date of the last update. Default true.
+ `added`boolWhether to return the date when the plugin was added to the wordpress.org repository. Default true.
+ `tags`boolWhether to return the assigned tags. Default true.
+ `compatibility`boolWhether to return the WordPress compatibility list. Default true.
+ `homepage`boolWhether to return the plugin homepage link. Default true.
+ `versions`boolWhether to return the list of all available versions. Default false.
+ `donate_link`boolWhether to return the donation link. Default true.
+ `reviews`boolWhether to return the plugin reviews. Default false.
+ `banners`boolWhether to return the banner images links. Default false.
+ `icons`boolWhether to return the icon links. Default false.
+ `active_installs`boolWhether to return the number of active installations. Default false.
+ `group`boolWhether to return the assigned group. Default false.
+ `contributors`boolWhether to return the list of contributors. Default false. 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/)
```
$description = apply_filters( 'plugin_install_description', $description, $plugin );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugin\_Install\_List\_Table::display\_rows()](../classes/wp_plugin_install_list_table/display_rows) wp-admin/includes/class-wp-plugin-install-list-table.php | |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'customize_dynamic_setting_class', string $setting_class, string $setting_id, array $setting_args ) apply\_filters( 'customize\_dynamic\_setting\_class', string $setting\_class, string $setting\_id, array $setting\_args )
=========================================================================================================================
Allow non-statically created settings to be constructed with custom [WP\_Customize\_Setting](../classes/wp_customize_setting) subclass.
`$setting_class` string [WP\_Customize\_Setting](../classes/wp_customize_setting) or a subclass. `$setting_id` string ID for dynamic setting, usually coming from `$_POST['customized']`. `$setting_args` array [WP\_Customize\_Setting](../classes/wp_customize_setting) or a subclass. 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_class = apply_filters( 'customize_dynamic_setting_class', $setting_class, $setting_id, $setting_args );
```
| 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 do_action_ref_array( 'pre_get_users', WP_User_Query $query ) do\_action\_ref\_array( 'pre\_get\_users', WP\_User\_Query $query )
===================================================================
Fires before the [WP\_User\_Query](../classes/wp_user_query) has been parsed.
The passed [WP\_User\_Query](../classes/wp_user_query) object contains the query variables, not yet passed into SQL.
`$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_get_users', 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 |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress do_action( 'post-upload-ui' ) do\_action( 'post-upload-ui' )
==============================
Fires on the post upload UI screen.
Legacy (pre-3.5.0) media workflow hook.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'post-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( 'dashboard_secondary_feed', string $url ) apply\_filters( 'dashboard\_secondary\_feed', string $url )
===========================================================
Filters the secondary feed URL for the ‘WordPress Events and News’ dashboard widget.
`$url` string The widget's secondary feed URL. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
'url' => apply_filters( 'dashboard_secondary_feed', __( 'https://planet.wordpress.org/feed/' ) ),
```
| 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. |
| programming_docs |
wordpress apply_filters( 'post_types_to_delete_with_user', string[] $post_types_to_delete, int $id ) apply\_filters( 'post\_types\_to\_delete\_with\_user', string[] $post\_types\_to\_delete, int $id )
===================================================================================================
Filters the list of post types to delete with a user.
`$post_types_to_delete` string[] Array of post types to delete. `$id` int User ID. File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
$post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id );
```
| 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 |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( "save_post_{$post->post_type}", int $post_ID, WP_Post $post, bool $update ) do\_action( "save\_post\_{$post->post\_type}", int $post\_ID, WP\_Post $post, bool $update )
============================================================================================
Fires once a post has been saved.
The dynamic portion of the hook name, `$post->post_type`, refers to the post type slug.
Possible hook names include:
* `save_post_post`
* `save_post_page`
`$post_ID` int Post ID. `$post` [WP\_Post](../classes/wp_post) Post object. `$update` bool Whether this is an existing post being updated. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( "save_post_{$post->post_type}", $post_ID, $post, $update );
```
| 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. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'nav_menu_item_title', string $title, WP_Post $menu_item, stdClass $args, int $depth ) apply\_filters( 'nav\_menu\_item\_title', string $title, WP\_Post $menu\_item, stdClass $args, int $depth )
===========================================================================================================
Filters a menu item’s title.
`$title` string The menu item's title. `$menu_item` [WP\_Post](../classes/wp_post) The current menu item object. `$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/)
```
$title = apply_filters( 'nav_menu_item_title', $title, $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.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'show_advanced_plugins', bool $show, string $type ) apply\_filters( 'show\_advanced\_plugins', bool $show, string $type )
=====================================================================
Filters whether to display the advanced plugins list table.
There are two types of advanced plugins – must-use and drop-ins – which can be used in a single site or Multisite network.
The $type parameter allows you to differentiate between the type of advanced plugins to filter the display of. Contexts include ‘mustuse’ and ‘dropins’.
`$show` bool Whether to show the advanced plugins for the specified plugin type. Default true. `$type` string The plugin type. Accepts `'mustuse'`, `'dropins'`. 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/)
```
if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Plugins\_List\_Table::prepare\_items()](../classes/wp_plugins_list_table/prepare_items) wp-admin/includes/class-wp-plugins-list-table.php | |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'domain_exists', int|null $result, string $domain, string $path, int $network_id ) apply\_filters( 'domain\_exists', int|null $result, string $domain, string $path, int $network\_id )
====================================================================================================
Filters whether a site name is taken.
The name is the site’s subdomain or the site’s subdirectory path depending on the network settings.
`$result` int|null The site ID if the site name exists, null otherwise. `$domain` string Domain to be checked. `$path` string Path to be checked. `$network_id` int Network ID. Relevant only on multi-network installations. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
return apply_filters( 'domain_exists', $result, $domain, $path, $network_id );
```
| Used By | Description |
| --- | --- |
| [domain\_exists()](../functions/domain_exists) wp-includes/ms-functions.php | Checks whether a site name is already taken. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress do_action( 'post_stuck', int $post_id ) do\_action( 'post\_stuck', int $post\_id )
==========================================
Fires once a post has been added to the sticky list.
`$post_id` int ID of the post that was stuck. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'post_stuck', $post_id );
```
| Used By | Description |
| --- | --- |
| [stick\_post()](../functions/stick_post) wp-includes/post.php | Makes a post sticky. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'rest_route_data', array[] $available, array $routes ) apply\_filters( 'rest\_route\_data', array[] $available, array $routes )
========================================================================
Filters the publicly-visible data for REST API routes.
This data is exposed on indexes and can be used by clients or developers to investigate the site and find out how to use it. It acts as a form of self-documentation.
`$available` array[] Route data to expose in indexes, keyed by route. `$routes` array Internal route data as an associative array. 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_route_data', $available, $routes );
```
| 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( 'get_role_list', string[] $role_list, WP_User $user_object ) apply\_filters( 'get\_role\_list', string[] $role\_list, WP\_User $user\_object )
=================================================================================
Filters the returned array of translated role names for a user.
`$role_list` string[] An array of translated user role names keyed by role. `$user_object` [WP\_User](../classes/wp_user) A [WP\_User](../classes/wp_user) object. 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/)
```
return apply_filters( 'get_role_list', $role_list, $user_object );
```
| Used By | Description |
| --- | --- |
| [WP\_Users\_List\_Table::get\_role\_list()](../classes/wp_users_list_table/get_role_list) wp-admin/includes/class-wp-users-list-table.php | Returns an array of translated user role names for a given user object. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'admin_print_scripts' ) do\_action( 'admin\_print\_scripts' )
=====================================
Fires when scripts are printed for all admin pages.
* `admin_print_scripts` mainly used to echo inline javascript in admin pages header.
* `admin_print_scripts` **should not be used to enqueue styles or scripts** on the admin pages. Use `[admin\_enqueue\_scripts](https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts "Plugin API/Action Reference/admin enqueue scripts")` instead.
* `admin_print_scripts` could be used to insert inline script in admin pages header while `admin_print_footer_scripts` could be used to insert inline script in admin pages footer.
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' );
```
| 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. |
| [WP\_Customize\_Widgets::print\_scripts()](../classes/wp_customize_widgets/print_scripts) wp-includes/class-wp-customize-widgets.php | Calls admin\_print\_scripts-widgets.php and admin\_print\_scripts hooks to allow custom scripts from plugins. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'send_email_change_email', bool $send, array $user, array $userdata ) apply\_filters( 'send\_email\_change\_email', bool $send, array $user, array $userdata )
========================================================================================
Filters whether to send the email change email.
* [wp\_insert\_user()](../functions/wp_insert_user) : For `$user` and `$userdata` fields.
`$send` bool Whether to send the email. `$user` array The original user array. `$userdata` array The updated user array. It is part of the [wp\_update\_user()](../functions/wp_update_user) function.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$send_email_change_email = apply_filters( 'send_email_change_email', true, $user, $userdata );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_user()](../functions/wp_update_user) wp-includes/user.php | Updates a user in the database. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( "default_option_{$option}", mixed $default, string $option, bool $passed_default ) apply\_filters( "default\_option\_{$option}", mixed $default, string $option, bool $passed\_default )
=====================================================================================================
Filters the default value for an option.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$default` mixed The default value to return if the option does not exist in the database. `$option` string Option name. `$passed_default` bool Was `get_option()` passed a default value? File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
return apply_filters( "default_option_{$option}", $default, $option, $passed_default );
```
| Used By | Description |
| --- | --- |
| [update\_option()](../functions/update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| [add\_option()](../functions/add_option) wp-includes/option.php | Adds a new option. |
| [get\_option()](../functions/get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | The `$passed_default` parameter was added to distinguish between a `false` value and the default parameter value. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$option` parameter was added. |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'post_updated_messages', array[] $messages ) apply\_filters( 'post\_updated\_messages', array[] $messages )
==============================================================
Filters the post updated messages.
`$messages` array[] Post updated messages. For defaults see `$messages` declarations above. File: `wp-admin/edit-form-advanced.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-form-advanced.php/)
```
$messages = apply_filters( 'post_updated_messages', $messages );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'added_option', string $option, mixed $value ) do\_action( 'added\_option', string $option, mixed $value )
===========================================================
Fires after an option has been added.
`$option` string Name of the added option. `$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( 'added_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( 'mce_external_languages', array $translations, string $editor_id ) apply\_filters( 'mce\_external\_languages', array $translations, string $editor\_id )
=====================================================================================
Filters the translations loaded for external TinyMCE 3.x plugins.
The filter takes an associative array (‘plugin\_name’ => ‘path’) where ‘path’ is the include path to the file.
The language file should follow the same format as wp\_mce\_translation(), and should define a variable ($strings) that holds all translated strings.
`$translations` array Translations for external TinyMCE 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/)
```
$mce_external_languages = apply_filters( 'mce_external_languages', array(), $editor_id );
```
| Used By | Description |
| --- | --- |
| [\_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( 'update_welcome_user_subject', string $subject ) apply\_filters( 'update\_welcome\_user\_subject', string $subject )
===================================================================
Filters the subject of the welcome email after user 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_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login ) );
```
| 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 do_action( 'customize_preview_init', WP_Customize_Manager $manager ) do\_action( 'customize\_preview\_init', WP\_Customize\_Manager $manager )
=========================================================================
Fires once the Customizer preview has initialized and JavaScript settings have been printed.
`$manager` [WP\_Customize\_Manager](../classes/wp_customize_manager) [WP\_Customize\_Manager](../classes/wp_customize_manager) instance. This action hook allows you to enqueue assets (such as javascript files) directly in the Theme Customizer *only*. To output saved settings onto your live site, you still need to output generated CSS using the <wp_head> hook.
Generally, this hook is used almost exclusively to enqueue a *theme-customizer.js* file for controlling live previews in WordPress’s Theme Customizer.
For more information, see the Theme Handbook article on the [Theme\_Customization\_API](https://developer.wordpress.org/themes/customize-api/).
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_preview_init', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::customize\_preview\_init()](../classes/wp_customize_manager/customize_preview_init) wp-includes/class-wp-customize-manager.php | Prints JavaScript settings. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'bulk_edit_custom_box', string $column_name, string $post_type ) do\_action( 'bulk\_edit\_custom\_box', string $column\_name, string $post\_type )
=================================================================================
Fires once for each column in Bulk Edit mode.
`$column_name` string Name of the column to edit. `$post_type` string The post type slug. `bulk_edit_custom_box` is an action that lets plugin print inputs for custom columns when bulk editing. This action is called one time for each custom column. Custom columns are added with the [manage\_edit-${post\_type}\_columns](https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_edit-post_type_columns "Plugin API/Filter Reference/manage edit-post type columns") filter. To save the data from the custom inputs, hook the [save\_post](save_post "Plugin API/Action Reference/save post") action.
Note that the action function is passed neither the post ID nor any existing value for the column.
See [quick\_edit\_custom\_box](quick_edit_custom_box#Examples "Plugin API/Action Reference/quick edit custom box") for basis.
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( 'bulk_edit_custom_box', $column_name, $screen->post_type );
```
| 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 |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'esc_html', string $safe_text, string $text ) apply\_filters( 'esc\_html', string $safe\_text, string $text )
===============================================================
Filters a string cleaned and escaped for output in HTML.
Text passed to [esc\_html()](../functions/esc_html) 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( 'esc_html', $safe_text, $text );
```
| Used By | Description |
| --- | --- |
| [esc\_html()](../functions/esc_html) wp-includes/formatting.php | Escaping for HTML blocks. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'site_status_persistent_object_cache_notes', string $notes, string[] $available_services ) apply\_filters( 'site\_status\_persistent\_object\_cache\_notes', string $notes, string[] $available\_services )
================================================================================================================
Filters the second paragraph of the health check’s description when suggesting the use of a persistent object cache.
Hosts may want to replace the notes to recommend their preferred object caching solution.
Plugin authors may want to append notes (not replace) on why object caching is recommended for their plugin.
`$notes` string The notes appended to the health check description. `$available_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/)
```
$notes = apply_filters( 'site_status_persistent_object_cache_notes', $notes, $available_services );
```
| 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. |
wordpress apply_filters( 'wp_is_site_protected_by_basic_auth', bool $is_protected, string $context ) apply\_filters( 'wp\_is\_site\_protected\_by\_basic\_auth', bool $is\_protected, string $context )
==================================================================================================
Filters whether a site is protected by HTTP Basic Auth.
`$is_protected` bool Whether the site is protected by Basic Auth. `$context` string The context to check for protection. One of `'login'`, `'admin'`, or `'front'`. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
return apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_site\_protected\_by\_basic\_auth()](../functions/wp_is_site_protected_by_basic_auth) wp-includes/load.php | Checks if this site is protected by HTTP Basic Auth. |
| Version | Description |
| --- | --- |
| [5.6.1](https://developer.wordpress.org/reference/since/5.6.1/) | Introduced. |
wordpress apply_filters( 'register_meta_args', array $args, array $defaults, string $object_type, string $meta_key ) apply\_filters( 'register\_meta\_args', array $args, array $defaults, string $object\_type, string $meta\_key )
===============================================================================================================
Filters the registration arguments when registering meta.
`$args` array Array of meta registration arguments. `$defaults` array Array of default arguments. `$object_type` string Type of object metadata is for. Accepts `'post'`, `'comment'`, `'term'`, `'user'`, or any other object type with an associated meta table. `$meta_key` string Meta key. File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
$args = apply_filters( 'register_meta_args', $args, $defaults, $object_type, $meta_key );
```
| Used By | Description |
| --- | --- |
| [register\_meta()](../functions/register_meta) wp-includes/meta.php | Registers a meta key. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'user_registration_email', string $user_email ) apply\_filters( 'user\_registration\_email', string $user\_email )
==================================================================
Filters the email address of a user being registered.
`$user_email` string The email address of the new user. This filter hooks into the very start of the [register\_new\_user()](../functions/register_new_user) function of wp-login.php after the user has been sanitized and it is used to manipulate the value submitted for user\_email.
As it is the very first filter to be called in the registration process it’s a reasonable (i.e. not really good but possible) place to manipulate user registration data in $\_POST as well as the email field itself before that data is further processed.
This means that it can be used for instance to set the email address field to be the same as the username (which on your registration form you could label as email address if you wanted to), and do other more interesting form customizations.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$user_email = apply_filters( 'user_registration_email', $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_{$this->taxonomy}_collection_params", array $query_params, WP_Taxonomy $taxonomy ) apply\_filters( "rest\_{$this->taxonomy}\_collection\_params", array $query\_params, WP\_Taxonomy $taxonomy )
=============================================================================================================
Filters collection parameters for the terms controller.
The dynamic part of the filter `$this->taxonomy` refers to the taxonomy slug for the controller.
This filter registers the collection parameter, but does not map the collection parameter to an internal [WP\_Term\_Query](../classes/wp_term_query) parameter. Use the `rest\_{$this->taxonomy}\_query` filter to set [WP\_Term\_Query](../classes/wp_term_query) parameters.
`$query_params` array JSON Schema-formatted collection parameters. `$taxonomy` [WP\_Taxonomy](../classes/wp_taxonomy) Taxonomy 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_{$this->taxonomy}_collection_params", $query_params, $taxonomy );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Terms\_Controller::get\_collection\_params()](../classes/wp_rest_terms_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-terms-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( 'wp_embed_handler_audio', string $audio, array $attr, string $url, array $rawattr ) apply\_filters( 'wp\_embed\_handler\_audio', string $audio, array $attr, string $url, array $rawattr )
======================================================================================================
Filters the audio embed output.
`$audio` string Audio embed output. `$attr` array An array of embed attributes. `$url` string The original URL that was matched by the regex. `$rawattr` array The original unmodified attributes. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
return apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr );
```
| Used By | Description |
| --- | --- |
| [wp\_embed\_handler\_audio()](../functions/wp_embed_handler_audio) wp-includes/embed.php | Audio embed handler callback. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( "{$type}_template_hierarchy", string[] $templates ) apply\_filters( "{$type}\_template\_hierarchy", string[] $templates )
=====================================================================
Filters the list of template filenames that are searched for when retrieving a template to use.
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.
The last element in the array should always be the fallback template for this query type.
Possible hook names include:
* `404_template_hierarchy`
* `archive_template_hierarchy`
* `attachment_template_hierarchy`
* `author_template_hierarchy`
* `category_template_hierarchy`
* `date_template_hierarchy`
* `embed_template_hierarchy`
* `frontpage_template_hierarchy`
* `home_template_hierarchy`
* `index_template_hierarchy`
* `page_template_hierarchy`
* `paged_template_hierarchy`
* `privacypolicy_template_hierarchy`
* `search_template_hierarchy`
* `single_template_hierarchy`
* `singular_template_hierarchy`
* `tag_template_hierarchy`
* `taxonomy_template_hierarchy`
`$templates` string[] A list of template candidates, in descending order of priority. File: `wp-includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/template.php/)
```
$templates = apply_filters( "{$type}_template_hierarchy", $templates );
```
| Used By | Description |
| --- | --- |
| [get\_query\_template()](../functions/get_query_template) wp-includes/template.php | Retrieves path to a template. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'delete_widget', string $widget_id, string $sidebar_id, string $id_base ) do\_action( 'delete\_widget', string $widget\_id, string $sidebar\_id, string $id\_base )
=========================================================================================
Fires immediately after a widget has been marked for deletion.
`$widget_id` string ID of the widget marked for deletion. `$sidebar_id` string ID of the sidebar the widget was deleted from. `$id_base` string ID base for the widget. File: `wp-admin/widgets-form.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/widgets-form.php/)
```
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
```
| 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. |
| [wp\_ajax\_save\_widget()](../functions/wp_ajax_save_widget) wp-admin/includes/ajax-actions.php | Ajax handler for saving a widget. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'sanitize_title', string $title, string $raw_title, string $context ) apply\_filters( 'sanitize\_title', string $title, string $raw\_title, string $context )
=======================================================================================
Filters a sanitized title string.
`$title` string Sanitized title. `$raw_title` string The title prior to sanitization. `$context` string The context for which the title is being sanitized. `sanitize_title` is a filter applied to a value to be cleaned up for use in a URL by the function `sanitize_title()`
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$title = apply_filters( 'sanitize_title', $title, $raw_title, $context );
```
| Used By | Description |
| --- | --- |
| [sanitize\_title()](../functions/sanitize_title) wp-includes/formatting.php | Sanitizes a string into a slug, which can be used in URLs or HTML attributes. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'retrieve_password_title', string $title, string $user_login, WP_User $user_data ) apply\_filters( 'retrieve\_password\_title', string $title, string $user\_login, WP\_User $user\_data )
=======================================================================================================
Filters the subject of the password reset email.
`$title` string Email subject. `$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/)
```
$title = apply_filters( 'retrieve_password_title', $title, $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.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$user_login` and `$user_data` parameters. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'login_errors', string $errors ) apply\_filters( 'login\_errors', string $errors )
=================================================
Filters the error messages displayed above the login form.
`$errors` string Login error message. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
echo '<div id="login_error">' . apply_filters( 'login_errors', $errors ) . "</div>\n";
```
| 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( 'style_loader_src', string $src, string $handle ) apply\_filters( 'style\_loader\_src', string $src, string $handle )
===================================================================
Filters an enqueued style’s fully-qualified URL.
`$src` string The source URL of the enqueued style. `$handle` string The style's registered handle. File: `wp-includes/class-wp-styles.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes_class-wp-styles-php-2/)
```
$src = apply_filters( 'style_loader_src', $src, $handle );
```
| Used By | Description |
| --- | --- |
| [WP\_Styles::\_css\_href()](../classes/wp_styles/_css_href) wp-includes/class-wp-styles.php | Generates an enqueued style’s fully-qualified URL. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( "delete_{$meta_type}meta", int $meta_id ) do\_action( "delete\_{$meta\_type}meta", int $meta\_id )
========================================================
Fires immediately before deleting post or comment metadata of a specific type.
The dynamic portion of the hook name, `$meta_type`, refers to the meta object type (post or comment).
Possible hook names include:
* `delete_postmeta`
* `delete_commentmeta`
* `delete_termmeta`
* `delete_usermeta`
`$meta_id` int ID of the metadata entry to delete. 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_id );
```
| Used By | Description |
| --- | --- |
| [delete\_metadata\_by\_mid()](../functions/delete_metadata_by_mid) wp-includes/meta.php | Deletes metadata by meta ID. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( "rest_{$this->post_type}_item_schema", array $schema ) apply\_filters( "rest\_{$this->post\_type}\_item\_schema", array $schema )
==========================================================================
Filters the post’s schema.
The dynamic portion of the filter, `$this->post_type`, refers to the post type slug for the controller.
Possible hook names include:
* `rest_post_item_schema`
* `rest_page_item_schema`
* `rest_attachment_item_schema`
`$schema` array Item schema data. 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/)
```
$schema = apply_filters( "rest_{$this->post_type}_item_schema", $schema );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::get\_item\_schema()](../classes/wp_rest_posts_controller/get_item_schema) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Retrieves the post’s schema, conforming to JSON Schema. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'oembed_min_max_width', array $min_max_width ) apply\_filters( 'oembed\_min\_max\_width', array $min\_max\_width )
===================================================================
Filters the allowed minimum and maximum widths for the oEmbed response.
`$min_max_width` array Minimum and maximum widths for the oEmbed response.
* `min`intMinimum width. Default 200.
* `max`intMaximum width. Default 600.
File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
$min_max_width = apply_filters(
'oembed_min_max_width',
array(
'min' => 200,
'max' => 600,
)
);
```
| Used By | Description |
| --- | --- |
| [get\_oembed\_response\_data()](../functions/get_oembed_response_data) wp-includes/embed.php | Retrieves the oEmbed response data for a given post. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'comment_reply_link_args', array $args, WP_Comment $comment, WP_Post $post ) apply\_filters( 'comment\_reply\_link\_args', array $args, WP\_Comment $comment, WP\_Post $post )
=================================================================================================
Filters the comment reply link arguments.
`$args` array Comment reply link arguments. See [get\_comment\_reply\_link()](../functions/get_comment_reply_link) for more information on accepted arguments. More Arguments from get\_comment\_reply\_link( ... $args ) Override default arguments.
* `add_below`stringThe first part of the selector used to identify the comment to respond below.
The resulting value is passed as the first parameter to addComment.moveForm(), concatenated as $add\_below-$comment->comment\_ID. Default `'comment'`.
* `respond_id`stringThe selector identifying the responding comment. Passed as the third parameter to addComment.moveForm(), and appended to the link URL as a hash value.
Default `'respond'`.
* `reply_text`stringThe text of the Reply link. Default `'Reply'`.
* `login_text`stringThe text of the link to reply if logged out. Default 'Log in to Reply'.
* `max_depth`intThe max depth of the comment tree. Default 0.
* `depth`intThe depth of the new comment. Must be greater than 0 and less than the value of the `'thread_comments_depth'` option set in Settings > Discussion. Default 0.
* `before`stringThe text or HTML to add before the reply link.
* `after`stringThe text or HTML to add after the reply link.
`$comment` [WP\_Comment](../classes/wp_comment) The object of the comment being replied to. `$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/)
```
$args = apply_filters( 'comment_reply_link_args', $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 |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'pre_get_scheduled_event', null|false|object $pre, string $hook, array $args, int|null $timestamp ) apply\_filters( 'pre\_get\_scheduled\_event', null|false|object $pre, string $hook, array $args, int|null $timestamp )
======================================================================================================================
Filter to preflight or hijack retrieving a scheduled event.
Returning a non-null value will short-circuit the normal process, returning the filtered value instead.
Return false if the event does not exist, otherwise an event object should be returned.
`$pre` null|false|object Value to return instead. Default null to continue retrieving the event. `$hook` string Action hook of the event. `$args` array Array containing each separate argument to pass to the hook's callback function.
Although not passed to a callback, these arguments are used to uniquely identify the event. `$timestamp` int|null Unix timestamp (UTC) of the event. Null to retrieve next scheduled event. File: `wp-includes/cron.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/cron.php/)
```
$pre = apply_filters( 'pre_get_scheduled_event', null, $hook, $args, $timestamp );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_scheduled\_event()](../functions/wp_get_scheduled_event) wp-includes/cron.php | Retrieve a scheduled event. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'kses_allowed_protocols', string[] $protocols ) apply\_filters( 'kses\_allowed\_protocols', string[] $protocols )
=================================================================
Filters the list of protocols allowed in HTML attributes.
`$protocols` string[] Array of allowed protocols e.g. `'http'`, `'ftp'`, `'tel'`, and more. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$protocols = array_unique( (array) apply_filters( 'kses_allowed_protocols', $protocols ) );
```
| Used By | Description |
| --- | --- |
| [wp\_allowed\_protocols()](../functions/wp_allowed_protocols) wp-includes/functions.php | Retrieves a list of protocols to allow in HTML attributes. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_editor_set_quality', int $quality, string $mime_type ) apply\_filters( 'wp\_editor\_set\_quality', int $quality, string $mime\_type )
==============================================================================
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()](../classes/wp_image_editor/set_quality) method has priority over the filter.
`$quality` int Quality level between 1 (low) and 100 (high). `$mime_type` string 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/)
```
$quality = apply_filters( 'wp_editor_set_quality', $default_quality, $mime_type );
```
| Used By | Description |
| --- | --- |
| [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 |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress do_action( 'wp_after_load_template', string $_template_file, bool $require_once, array $args ) do\_action( 'wp\_after\_load\_template', string $\_template\_file, bool $require\_once, array $args )
=====================================================================================================
Fires after 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_after_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 apply_filters( 'rest_url', string $url, string $path, int|null $blog_id, string $scheme ) apply\_filters( 'rest\_url', string $url, string $path, int|null $blog\_id, string $scheme )
============================================================================================
Filters the REST URL.
Use this filter to adjust the url returned by the [get\_rest\_url()](../functions/get_rest_url) function.
`$url` string REST URL. `$path` string REST route. `$blog_id` int|null Blog ID. `$scheme` string Sanitization scheme. 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', $url, $path, $blog_id, $scheme );
```
| Used By | Description |
| --- | --- |
| [get\_rest\_url()](../functions/get_rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint on a site. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'status_header', string $status_header, int $code, string $description, string $protocol ) apply\_filters( 'status\_header', string $status\_header, int $code, string $description, string $protocol )
============================================================================================================
Filters an HTTP status header.
`$status_header` string HTTP status header. `$code` int HTTP status code. `$description` string Description for the status code. `$protocol` string Server protocol. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$status_header = apply_filters( 'status_header', $status_header, $code, $description, $protocol );
```
| Used By | Description |
| --- | --- |
| [status\_header()](../functions/status_header) wp-includes/functions.php | Sets HTTP status header. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'pre_reschedule_event', null|bool|WP_Error $pre, stdClass $event, bool $wp_error ) apply\_filters( 'pre\_reschedule\_event', null|bool|WP\_Error $pre, stdClass $event, bool $wp\_error )
======================================================================================================
Filter to preflight or hijack rescheduling of a recurring event.
Returning a non-null value will short-circuit the normal rescheduling process, causing the function to return the filtered value instead.
For plugins replacing wp-cron, return true if the event was successfully rescheduled, 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`stringHow 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.
`$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_reschedule_event', null, $event, $wp_error );
```
| Used By | Description |
| --- | --- |
| [wp\_reschedule\_event()](../functions/wp_reschedule_event) wp-includes/cron.php | Reschedules a recurring event. |
| 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 apply_filters( 'the_posts_pagination_args', array $args ) apply\_filters( 'the\_posts\_pagination\_args', array $args )
=============================================================
Filters the arguments for posts pagination links.
`$args` array Default pagination arguments, see [paginate\_links()](../functions/paginate_links) .
* `screen_reader_text`stringScreen reader text for navigation element.
Default 'Posts navigation'.
* `aria_label`stringARIA label text for the nav element. Default `'Posts'`.
* `class`stringCustom class for the nav element. Default `'pagination'`.
More Arguments from paginate\_links( ... $args ) Array or string of arguments for generating paginated links for archives.
* `base`stringBase of the paginated url.
* `format`stringFormat for the pagination structure.
* `total`intThe total amount of pages. Default is the value [WP\_Query](../classes/wp_query)'s `max_num_pages` or 1.
* `current`intThe current page number. Default is `'paged'` query var or 1.
* `aria_current`stringThe value for the aria-current attribute. Possible values are `'page'`, `'step'`, `'location'`, `'date'`, `'time'`, `'true'`, `'false'`. Default is `'page'`.
* `show_all`boolWhether to show all pages. Default false.
* `end_size`intHow many numbers on either the start and the end list edges.
Default 1.
* `mid_size`intHow many numbers to either side of the current pages. Default 2.
* `prev_next`boolWhether to include the previous and next links in the list. Default true.
* `prev_text`stringThe previous page text. Default '« Previous'.
* `next_text`stringThe next page text. Default 'Next »'.
* `type`stringControls format of the returned value. Possible values are `'plain'`, `'array'` and `'list'`. Default is `'plain'`.
* `add_args`arrayAn array of query args to add. Default false.
* `add_fragment`stringA string to append to each link.
* `before_page_number`stringA string to appear before the page number.
* `after_page_number`stringA string to append after the page number.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$args = apply_filters( 'the_posts_pagination_args', $args );
```
| Used By | Description |
| --- | --- |
| [get\_the\_posts\_pagination()](../functions/get_the_posts_pagination) wp-includes/link-template.php | Retrieves a paginated navigation to next/previous set of posts, when applicable. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'customize_render_partials_response', array $response, WP_Customize_Selective_Refresh $refresh, array $partials ) apply\_filters( 'customize\_render\_partials\_response', array $response, WP\_Customize\_Selective\_Refresh $refresh, array $partials )
=======================================================================================================================================
Filters the response from rendering the partials.
Plugins may use this filter to inject `$scripts` and `$styles`, which are dependencies for the partials being rendered. The response data will be available to the client via the `render-partials-response` JS event, so the client can then inject the scripts and styles into the DOM if they have not already been enqueued there.
If plugins do this, they’ll need to take care for any scripts that do `document.write()` and make sure that these are not injected, or else to override the function to no-op, or else the page will be destroyed.
Plugins should be aware that `$scripts` and `$styles` may eventually be included by default in the response.
`$response` array Response.
* `contents`arrayAssociative array mapping a partial ID its corresponding array of contents for the containers requested.
* `errors`arrayList of errors triggered during rendering of partials, if `WP_DEBUG_DISPLAY` is enabled.
`$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/)
```
$response = apply_filters( 'customize_render_partials_response', $response, $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( 'upload_dir', array $uploads ) apply\_filters( 'upload\_dir', array $uploads )
===============================================
Filters the uploads directory data.
`$uploads` array Array of information about the upload directory.
* `path`stringBase directory and subdirectory or full path to upload directory.
* `url`stringBase URL and subdirectory or absolute URL to upload directory.
* `subdir`stringSubdirectory if uploads use year/month folders option is on.
* `basedir`stringPath without subdir.
* `baseurl`stringURL path without subdir.
* `error`string|falseFalse or error message.
This hook allows you to change the directory where files are uploaded to. The keys and values in the array are used by the [wp\_upload\_dir()](../functions/wp_upload_dir) function in wordpress core, which is doing the work
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$uploads = apply_filters( 'upload_dir', $cache[ $key ] );
```
| Used By | Description |
| --- | --- |
| [wp\_upload\_dir()](../functions/wp_upload_dir) wp-includes/functions.php | Returns an array containing the current upload directory’s path and URL. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress do_action( 'ms_network_not_found', string $domain, string $path ) do\_action( 'ms\_network\_not\_found', string $domain, string $path )
=====================================================================
Fires when a network cannot be found based on the requested domain and path.
At the time of this action, the only recourse is to redirect somewhere and exit. If you want to declare a particular network, do so earlier.
`$domain` string The domain used to search for a network. `$path` string The path used to search for a path. File: `wp-includes/ms-load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-load.php/)
```
do_action( 'ms_network_not_found', $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 |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'wp_sitemaps_init', WP_Sitemaps $wp_sitemaps ) do\_action( 'wp\_sitemaps\_init', WP\_Sitemaps $wp\_sitemaps )
==============================================================
Fires when initializing the Sitemaps object.
Additional sitemaps should be registered on this hook.
`$wp_sitemaps` [WP\_Sitemaps](../classes/wp_sitemaps) Sitemaps object. File: `wp-includes/sitemaps.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps.php/)
```
do_action( 'wp_sitemaps_init', $wp_sitemaps );
```
| Used By | Description |
| --- | --- |
| [wp\_sitemaps\_get\_server()](../functions/wp_sitemaps_get_server) wp-includes/sitemaps.php | Retrieves the current Sitemaps server instance. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'metadata_lazyloader_queued_objects', array $object_ids, string $object_type, WP_Metadata_Lazyloader $lazyloader ) do\_action( 'metadata\_lazyloader\_queued\_objects', array $object\_ids, string $object\_type, WP\_Metadata\_Lazyloader $lazyloader )
=====================================================================================================================================
Fires after objects are added to the metadata lazy-load queue.
`$object_ids` array Array of object IDs. `$object_type` string Type of object being queued. `$lazyloader` [WP\_Metadata\_Lazyloader](../classes/wp_metadata_lazyloader) The lazy-loader object. File: `wp-includes/class-wp-metadata-lazyloader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-metadata-lazyloader.php/)
```
do_action( 'metadata_lazyloader_queued_objects', $object_ids, $object_type, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Metadata\_Lazyloader::queue\_objects()](../classes/wp_metadata_lazyloader/queue_objects) wp-includes/class-wp-metadata-lazyloader.php | Adds objects to the metadata lazy-load queue. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'load_image_to_edit_path', string|false $filepath, int $attachment_id, string|int[] $size ) apply\_filters( 'load\_image\_to\_edit\_path', string|false $filepath, int $attachment\_id, string|int[] $size )
================================================================================================================
Filters the returned path or URL of the current image.
`$filepath` string|false File path or URL to current image, or false. `$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/)
```
return apply_filters( 'load_image_to_edit_path', $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 |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'wp_dashboard_setup' ) do\_action( 'wp\_dashboard\_setup' )
====================================
Fires after core widgets for the admin dashboard have been registered.
This hook grants access to Dashboard-related customization options. In particular, this hook is used for adding [[wp\_add\_dashboard\_widget()](../functions/wp_add_dashboard_widget) ] or removing[[remove\_meta\_box()](../functions/remove_meta_box) ] dashboard widgets from WordPress.
To add a dashboard widget, use [wp\_add\_dashboard\_widget()](../functions/wp_add_dashboard_widget)
To remove a dashboard widget, use [remove\_meta\_box()](../functions/remove_meta_box)
File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
do_action( 'wp_dashboard_setup' );
```
| 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( 'stylesheet', string $stylesheet ) apply\_filters( 'stylesheet', string $stylesheet )
==================================================
Filters the name of current stylesheet.
`$stylesheet` string Name of the current stylesheet. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'stylesheet', get_option( 'stylesheet' ) );
```
| Used By | Description |
| --- | --- |
| [get\_stylesheet()](../functions/get_stylesheet) wp-includes/theme.php | Retrieves name of the current stylesheet. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_count_comments', array|stdClass $count, int $post_id ) apply\_filters( 'wp\_count\_comments', array|stdClass $count, int $post\_id )
=============================================================================
Filters the comments count for a given post or the whole site.
`$count` array|stdClass An empty array or an object containing comment counts. `$post_id` int The post ID. Can be 0 to represent the whole site. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$filtered = apply_filters( 'wp_count_comments', array(), $post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_count\_comments()](../functions/wp_count_comments) wp-includes/comment.php | Retrieves the total comment counts for the whole site or a single post. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_posts_pre_url_list', array[]|null $url_list, string $post_type, int $page_num ) apply\_filters( 'wp\_sitemaps\_posts\_pre\_url\_list', array[]|null $url\_list, string $post\_type, int $page\_num )
====================================================================================================================
Filters the posts 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. `$post_type` string Post type name. `$page_num` int Page of results. 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/)
```
$url_list = apply_filters(
'wp_sitemaps_posts_pre_url_list',
null,
$post_type,
$page_num
);
```
| 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 apply_filters( 'wp_theme_json_data_theme', WP_Theme_JSON_Data ) apply\_filters( 'wp\_theme\_json\_data\_theme', WP\_Theme\_JSON\_Data )
=======================================================================
Filters the data provided by the theme for global styles and 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_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme\_JSON\_Resolver::get\_theme\_data()](../classes/wp_theme_json_resolver/get_theme_data) wp-includes/class-wp-theme-json-resolver.php | Returns the theme’s data. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'signup_finished' ) do\_action( 'signup\_finished' )
================================
Fires when the site or user sign-up process is complete.
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
do_action( 'signup_finished' );
```
| Used By | Description |
| --- | --- |
| [confirm\_another\_blog\_signup()](../functions/confirm_another_blog_signup) wp-signup.php | Shows a message confirming that the new site has been created. |
| [confirm\_user\_signup()](../functions/confirm_user_signup) wp-signup.php | Shows a message confirming that the new user has been registered and is awaiting activation. |
| [confirm\_blog\_signup()](../functions/confirm_blog_signup) wp-signup.php | Shows a message confirming that the new site has been registered and is awaiting activation. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'login_footer' ) do\_action( 'login\_footer' )
=============================
Fires in the login page footer.
File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
do_action( 'login_footer' );
```
| Used By | Description |
| --- | --- |
| [login\_footer()](../functions/login_footer) wp-login.php | Outputs the footer for the login page. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'the_modified_time', string|false $get_the_modified_time, string $format ) apply\_filters( 'the\_modified\_time', string|false $get\_the\_modified\_time, string $format )
===============================================================================================
Filters the localized time a post was last modified, for display.
`$get_the_modified_time` string|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. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
echo apply_filters( 'the_modified_time', get_the_modified_time( $format ), $format );
```
| Used By | Description |
| --- | --- |
| [the\_modified\_time()](../functions/the_modified_time) wp-includes/general-template.php | Displays the time at which the post was last modified. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', bool $bad_slug, string $slug ) apply\_filters( 'wp\_unique\_post\_slug\_is\_bad\_attachment\_slug', bool $bad\_slug, string $slug )
====================================================================================================
Filters whether the post slug would make a bad attachment slug.
`$bad_slug` bool Whether the slug would be bad as an attachment slug. `$slug` string The post slug. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$is_bad_attachment_slug = apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $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.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'comment_status_links', string[] $status_links ) apply\_filters( 'comment\_status\_links', string[] $status\_links )
===================================================================
Filters the comment status links.
`$status_links` string[] An associative array of fully-formed comment status links. Includes `'All'`, `'Mine'`, `'Pending'`, `'Approved'`, `'Spam'`, and `'Trash'`. 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/)
```
return apply_filters( 'comment_status_links', $this->get_views_links( $status_links ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Comments\_List\_Table::get\_views()](../classes/wp_comments_list_table/get_views) wp-admin/includes/class-wp-comments-list-table.php | |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | The `'Mine'` link was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_enabled', bool $is_enabled ) apply\_filters( 'xmlrpc\_enabled', bool $is\_enabled )
======================================================
Filters whether XML-RPC methods requiring authentication are enabled.
Contrary to the way it’s named, this filter does not control whether XML-RPC is *fully* enabled, rather, it only controls whether XML-RPC methods requiring authentication – such as for publishing purposes – are enabled.
Further, the filter does not control whether pingbacks or other custom endpoints that don’t require authentication are enabled. This behavior is expected, and due to how parity was matched with the `enable_xmlrpc` UI option the filter replaced when it was introduced in 3.5.
To disable XML-RPC methods that require authentication, use:
```
add_filter( 'xmlrpc_enabled', '__return_false' );
```
For more granular control over all XML-RPC methods and requests, see the [‘xmlrpc\_methods’](xmlrpc_methods) and [‘xmlrpc\_element\_limit’](xmlrpc_element_limit) hooks.
`$is_enabled` bool Whether XML-RPC is enabled. Default true. 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->is_enabled = apply_filters( 'xmlrpc_enabled', $is_enabled );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::set\_is\_enabled()](../classes/wp_xmlrpc_server/set_is_enabled) wp-includes/class-wp-xmlrpc-server.php | Set wp\_xmlrpc\_server::$is\_enabled property. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'automatic_updates_is_vcs_checkout', bool $checkout, string $context ) apply\_filters( 'automatic\_updates\_is\_vcs\_checkout', bool $checkout, string $context )
==========================================================================================
Filters whether the automatic updater should consider a filesystem location to be potentially managed by a version control system.
`$checkout` bool Whether a VCS checkout was discovered at `$context` or ABSPATH, or anywhere higher. `$context` string The filesystem context (a path) against which filesystem status should be checked. 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/)
```
return apply_filters( 'automatic_updates_is_vcs_checkout', $checkout, $context );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health\_Auto\_Updates::test\_vcs\_abspath()](../classes/wp_site_health_auto_updates/test_vcs_abspath) wp-admin/includes/class-wp-site-health-auto-updates.php | Checks if WordPress is controlled by a VCS (Git, Subversion etc). |
| [WP\_Automatic\_Updater::is\_vcs\_checkout()](../classes/wp_automatic_updater/is_vcs_checkout) wp-admin/includes/class-wp-automatic-updater.php | Checks for version control checkouts. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'customize_previewable_devices', array $devices ) apply\_filters( 'customize\_previewable\_devices', array $devices )
===================================================================
Filters the available devices to allow previewing in the Customizer.
* [WP\_Customize\_Manager::get\_previewable\_devices()](../classes/wp_customize_manager/get_previewable_devices)
`$devices` array List of devices with labels and default setting. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
$devices = apply_filters( 'customize_previewable_devices', $devices );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::get\_previewable\_devices()](../classes/wp_customize_manager/get_previewable_devices) wp-includes/class-wp-customize-manager.php | Returns a list of devices to allow previewing. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'doing_it_wrong_trigger_error', bool $trigger, string $function, string $message, string $version ) apply\_filters( 'doing\_it\_wrong\_trigger\_error', bool $trigger, string $function, string $message, string $version )
=======================================================================================================================
Filters whether to trigger an error for [\_doing\_it\_wrong()](../functions/_doing_it_wrong) calls.
`$trigger` bool Whether to trigger the error for [\_doing\_it\_wrong()](../functions/_doing_it_wrong) calls. Default true. `$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/)
```
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $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 |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Added the $function, $message and $version parameters. |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'duplicate_comment_id', int $dupe_id, array $commentdata ) apply\_filters( 'duplicate\_comment\_id', int $dupe\_id, array $commentdata )
=============================================================================
Filters the ID, if any, of the duplicate comment found when creating a new comment.
Return an empty value from this filter to allow what WP considers a duplicate comment.
`$dupe_id` int ID of the comment identified as a duplicate. `$commentdata` array Data for the comment being created. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$dupe_id = apply_filters( 'duplicate_comment_id', $dupe_id, $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.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'after_password_reset', WP_User $user, string $new_pass ) do\_action( 'after\_password\_reset', WP\_User $user, string $new\_pass )
=========================================================================
Fires after the user’s password is reset.
`$user` [WP\_User](../classes/wp_user) The user. `$new_pass` string New user password. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'after_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 |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'month_link', string $monthlink, int $year, int $month ) apply\_filters( 'month\_link', string $monthlink, int $year, int $month )
=========================================================================
Filters the month archive permalink.
`$monthlink` string Permalink for the month archive. `$year` int Year for the archive. `$month` int The month 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( 'month_link', $monthlink, $year, $month );
```
| Used By | Description |
| --- | --- |
| [get\_month\_link()](../functions/get_month_link) wp-includes/link-template.php | Retrieves the permalink for the month archives with year. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'site_status_persistent_object_cache_thresholds', int[] $thresholds ) apply\_filters( 'site\_status\_persistent\_object\_cache\_thresholds', int[] $thresholds )
==========================================================================================
Filters the thresholds used to determine whether to suggest the use of a persistent object cache.
`$thresholds` int[] The list of threshold numbers keyed by threshold name. 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/)
```
$thresholds = apply_filters(
'site_status_persistent_object_cache_thresholds',
array(
'alloptions_count' => 500,
'alloptions_bytes' => 100000,
'comments_count' => 1000,
'options_count' => 1000,
'posts_count' => 1000,
'terms_count' => 1000,
'users_count' => 1000,
)
);
```
| 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( 'author_link', string $link, int $author_id, string $author_nicename ) apply\_filters( 'author\_link', string $link, int $author\_id, string $author\_nicename )
=========================================================================================
Filters the URL to the author’s page.
`$link` string The URL to the author's page. `$author_id` int The author's ID. `$author_nicename` string The author's nice name. File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
$link = apply_filters( 'author_link', $link, $author_id, $author_nicename );
```
| Used By | Description |
| --- | --- |
| [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. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'image_sideload_extensions', string[] $allowed_extensions, string $file ) apply\_filters( 'image\_sideload\_extensions', string[] $allowed\_extensions, string $file )
============================================================================================
Filters the list of allowed file extensions when sideloading an image from a URL.
The default allowed extensions are:
* `jpg`
* `jpeg`
* `jpe`
* `png`
* `gif`
`$allowed_extensions` string[] Array of allowed file extensions. `$file` string The URL of the image to download. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$allowed_extensions = apply_filters( 'image_sideload_extensions', $allowed_extensions, $file );
```
| Used By | Description |
| --- | --- |
| [media\_sideload\_image()](../functions/media_sideload_image) wp-admin/includes/media.php | Downloads an image from the specified URL, saves it as an attachment, and optionally attaches it to a post. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'edit_posts_per_page', int $posts_per_page, string $post_type ) apply\_filters( 'edit\_posts\_per\_page', int $posts\_per\_page, string $post\_type )
=====================================================================================
Filters the number of posts displayed per page when specifically listing “posts”.
`$posts_per_page` int Number of posts to be displayed. Default 20. `$post_type` string The post type. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page, $post_type );
```
| 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\_edit\_posts\_query()](../functions/wp_edit_posts_query) wp-admin/includes/post.php | Runs the query to fetch the posts for listing on the edit posts page. |
| [WP\_Posts\_List\_Table::prepare\_items()](../classes/wp_posts_list_table/prepare_items) wp-admin/includes/class-wp-posts-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_default_revision_fields', array $field, string $method ) apply\_filters( 'xmlrpc\_default\_revision\_fields', array $field, string $method )
===================================================================================
Filters the default revision query fields used by the given XML-RPC method.
`$field` array An array of revision query fields. `$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_revision_fields', array( 'post_date', 'post_date_gmt' ), 'wp.getRevisions' );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_getRevisions()](../classes/wp_xmlrpc_server/wp_getrevisions) wp-includes/class-wp-xmlrpc-server.php | Retrieve revisions for a specific post. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'img_caption_shortcode', string $output, array $attr, string $content ) apply\_filters( 'img\_caption\_shortcode', string $output, array $attr, string $content )
=========================================================================================
Filters the default caption shortcode output.
If the filtered output isn’t empty, it will be used instead of generating the default caption template.
* [img\_caption\_shortcode()](../functions/img_caption_shortcode)
`$output` string The caption output. Default empty. `$attr` 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/)
```
$output = apply_filters( 'img_caption_shortcode', '', $attr, $content );
```
| Used By | Description |
| --- | --- |
| [img\_caption\_shortcode()](../functions/img_caption_shortcode) wp-includes/media.php | Builds the Caption shortcode output. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'admin_body_class', string $classes ) apply\_filters( 'admin\_body\_class', string $classes )
=======================================================
Filters the CSS classes for the body tag in the admin.
This filter differs from the [‘post\_class’](post_class) and [‘body\_class’](body_class) filters in two important ways:
1. `$classes` is a space-separated string of class names instead of an array.
2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, and no-js cannot be removed.
`$classes` string Space-separated list of CSS classes. File: `wp-admin/admin-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-header.php/)
```
$admin_body_classes = apply_filters( 'admin_body_class', '' );
```
| Used By | Description |
| --- | --- |
| [iframe\_header()](../functions/iframe_header) wp-admin/includes/template.php | Generic Iframe header for use with Thickbox. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters_deprecated( 'block_editor_settings', array $editor_settings, WP_Post $post ) apply\_filters\_deprecated( 'block\_editor\_settings', array $editor\_settings, WP\_Post $post )
================================================================================================
This hook has been deprecated. Use the [‘block\_editor\_settings\_all’](block_editor_settings_all) filter instead.
Filters the settings to pass to the block editor.
`$editor_settings` array Default editor settings. `$post` [WP\_Post](../classes/wp_post) Post being edited. File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
$editor_settings = apply_filters_deprecated( 'block_editor_settings', array( $editor_settings, $post ), '5.8.0', 'block_editor_settings_all' );
```
| 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/) | Use the ['block\_editor\_settings\_all'](block_editor_settings_all) filter instead. |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'do_meta_boxes', string $post_type, string $context, WP_Post|object|string $post ) do\_action( 'do\_meta\_boxes', string $post\_type, string $context, WP\_Post|object|string $post )
==================================================================================================
Fires after meta boxes have been added.
Fires once for each of the default meta box contexts: normal, advanced, and side.
`$post_type` string Post type of the post on Edit Post screen, `'link'` on Edit Link screen, `'dashboard'` on Dashboard screen. `$context` string Meta box context. Possible values include `'normal'`, `'advanced'`, `'side'`. `$post` [WP\_Post](../classes/wp_post)|object|string Post object on Edit Post screen, link object on Edit Link screen, an empty string on Dashboard screen. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
do_action( 'do_meta_boxes', $post_type, 'normal', $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. |
| [wp\_dashboard\_setup()](../functions/wp_dashboard_setup) wp-admin/includes/dashboard.php | Registers dashboard widgets. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'query', string $query ) apply\_filters( 'query', string $query )
========================================
Filters the database query.
Some queries are made before the plugins have been loaded, and thus cannot be filtered with this method.
`$query` string Database query. File: `wp-includes/class-wpdb.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wpdb.php/)
```
$query = apply_filters( 'query', $query );
```
| Used By | Description |
| --- | --- |
| [wpdb::query()](../classes/wpdb/query) wp-includes/class-wpdb.php | Performs a database query, using current database connection. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'pre_http_send_through_proxy', bool|null $override, string $uri, array $check, array $home ) apply\_filters( 'pre\_http\_send\_through\_proxy', bool|null $override, string $uri, array $check, array $home )
================================================================================================================
Filters whether to preempt sending the request through the proxy.
Returning false will bypass the proxy; returning true will send the request through the proxy. Returning null bypasses the filter.
`$override` bool|null Whether to send the request through the proxy. Default null. `$uri` string URL of the request. `$check` array Associative array result of parsing the request URL with `parse_url()`. `$home` array Associative array result of parsing the site URL with `parse_url()`. File: `wp-includes/class-wp-http-proxy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-proxy.php/)
```
$result = apply_filters( 'pre_http_send_through_proxy', null, $uri, $check, $home );
```
| Used By | Description |
| --- | --- |
| [WP\_HTTP\_Proxy::send\_through\_proxy()](../classes/wp_http_proxy/send_through_proxy) wp-includes/class-wp-http-proxy.php | Determines whether the request should be sent through a proxy. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'hidden_columns', string[] $hidden, WP_Screen $screen, bool $use_defaults ) apply\_filters( 'hidden\_columns', string[] $hidden, WP\_Screen $screen, bool $use\_defaults )
==============================================================================================
Filters the list of hidden columns.
`$hidden` string[] Array of IDs of hidden columns. `$screen` [WP\_Screen](../classes/wp_screen) [WP\_Screen](../classes/wp_screen) object of the current screen. `$use_defaults` bool Whether to show the default columns. File: `wp-admin/includes/screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/screen.php/)
```
return apply_filters( 'hidden_columns', $hidden, $screen, $use_defaults );
```
| Used By | Description |
| --- | --- |
| [get\_hidden\_columns()](../functions/get_hidden_columns) wp-admin/includes/screen.php | Get a list of hidden columns. |
| Version | Description |
| --- | --- |
| [4.4.1](https://developer.wordpress.org/reference/since/4.4.1/) | Added the `use_defaults` parameter. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'deleted_term_taxonomy', int $tt_id ) do\_action( 'deleted\_term\_taxonomy', int $tt\_id )
====================================================
Fires immediately after a term taxonomy ID is deleted.
`$tt_id` int Term taxonomy ID. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'deleted_term_taxonomy', $tt_id );
```
| 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 apply_filters( 'wp_safe_redirect_fallback', string $fallback_url, int $status ) apply\_filters( 'wp\_safe\_redirect\_fallback', string $fallback\_url, int $status )
====================================================================================
Filters the redirect fallback URL for when the provided redirect is not safe (local).
`$fallback_url` string The fallback URL to use by default. `$status` int The HTTP response status code to use. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );
```
| Used By | Description |
| --- | --- |
| [wp\_safe\_redirect()](../functions/wp_safe_redirect) wp-includes/pluggable.php | Performs a safe (local) redirect, using [wp\_redirect()](../functions/wp_redirect) . |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'http_response', array $response, array $parsed_args, string $url ) apply\_filters( 'http\_response', array $response, array $parsed\_args, string $url )
=====================================================================================
Filters a successful HTTP API response immediately before the response is returned.
`$response` array HTTP response. `$parsed_args` array 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/)
```
return apply_filters( 'http_response', $response, $parsed_args, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_Http::\_dispatch\_request()](../classes/wp_http/_dispatch_request) wp-includes/class-wp-http.php | Dispatches a HTTP request to a supporting transport. |
| [WP\_Http::request()](../classes/wp_http/request) wp-includes/class-wp-http.php | Send an HTTP request to a URI. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_list_bookmarks', string $html ) apply\_filters( 'wp\_list\_bookmarks', string $html )
=====================================================
Filters the bookmarks list before it is echoed or returned.
`$html` string The HTML list of bookmarks. File: `wp-includes/bookmark-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/bookmark-template.php/)
```
$html = apply_filters( 'wp_list_bookmarks', $output );
```
| Used By | Description |
| --- | --- |
| [wp\_list\_bookmarks()](../functions/wp_list_bookmarks) wp-includes/bookmark-template.php | Retrieves or echoes all of the bookmarks. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'get_media_item_args', array $parsed_args ) apply\_filters( 'get\_media\_item\_args', array $parsed\_args )
===============================================================
Filters the arguments used to retrieve an image for the edit image form.
* [get\_media\_item](../functions/get_media_item)
`$parsed_args` array An array of arguments. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$parsed_args = apply_filters( 'get_media_item_args', $parsed_args );
```
| Used By | Description |
| --- | --- |
| [get\_media\_item()](../functions/get_media_item) wp-admin/includes/media.php | Retrieves HTML form for modifying the image attachment. |
| [get\_compat\_media\_markup()](../functions/get_compat_media_markup) wp-admin/includes/media.php | |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'customize_loaded_components', string[] $components, WP_Customize_Manager $manager ) apply\_filters( 'customize\_loaded\_components', string[] $components, WP\_Customize\_Manager $manager )
========================================================================================================
Filters the core Customizer components to load.
This allows Core components to be excluded from being instantiated by filtering them out of the array. Note that this filter generally runs during the [‘plugins\_loaded’](plugins_loaded) action, so it cannot be added in a theme.
* [WP\_Customize\_Manager::\_\_construct()](../classes/wp_customize_manager/__construct)
`$components` string[] Array of core components to load. `$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/)
```
$components = apply_filters( 'customize_loaded_components', $this->components, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::\_\_construct()](../classes/wp_customize_manager/__construct) wp-includes/class-wp-customize-manager.php | Constructor. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'smilies_src', string $smiley_url, string $img, string $site_url ) apply\_filters( 'smilies\_src', string $smiley\_url, string $img, string $site\_url )
=====================================================================================
Filters the Smiley image URL before it’s used in the image element.
`$smiley_url` string URL for the smiley image. `$img` string Filename for the smiley image. `$site_url` string Site URL, as returned by [site\_url()](../functions/site_url) . File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
```
| Used By | Description |
| --- | --- |
| [translate\_smiley()](../functions/translate_smiley) wp-includes/formatting.php | Converts one smiley code to the icon graphic file equivalent. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'plupload_default_settings', array $defaults ) apply\_filters( 'plupload\_default\_settings', array $defaults )
================================================================
Filters the Plupload default settings.
`$defaults` array Default Plupload settings array. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$defaults = apply_filters( 'plupload_default_settings', $defaults );
```
| 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( 'comments_array', array $comments, int $post_id ) apply\_filters( 'comments\_array', array $comments, int $post\_id )
===================================================================
Filters the comments array.
`$comments` array Array of comments supplied to the comments template. `$post_id` int Post ID. Used inside comments\_template that allows you to catch all the comments going through the query for the post.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );
```
| Used By | Description |
| --- | --- |
| [comments\_template()](../functions/comments_template) wp-includes/comment-template.php | Loads the comment template specified in $file. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'the_modified_author', string $display_name ) apply\_filters( 'the\_modified\_author', string $display\_name )
================================================================
Filters the display name of the author who last edited the current post.
`$display_name` string The author's display name, empty string if unknown. File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
return apply_filters( 'the_modified_author', $last_user ? $last_user->display_name : '' );
```
| Used By | Description |
| --- | --- |
| [get\_the\_modified\_author()](../functions/get_the_modified_author) wp-includes/author-template.php | Retrieves the author who last edited the current post. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'login_enqueue_scripts' ) do\_action( 'login\_enqueue\_scripts' )
=======================================
Enqueue scripts and styles for the login page.
`login_enqueue_scripts` is the proper hook to use when enqueuing items that are meant to appear on the login page. Despite the name, it is used for enqueuing **both** scripts and styles, on all login and registration related screens.
File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
do_action( 'login_enqueue_scripts' );
```
| Used By | Description |
| --- | --- |
| [login\_header()](../functions/login_header) wp-login.php | Output the login page header. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'get_comment_author_email', string $comment_author_email, string $comment_ID, WP_Comment $comment ) apply\_filters( 'get\_comment\_author\_email', string $comment\_author\_email, string $comment\_ID, WP\_Comment $comment )
==========================================================================================================================
Filters the comment author’s returned email address.
`$comment_author_email` string The comment author's email address. `$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_author_email', $comment->comment_author_email, $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_author\_email()](../functions/get_comment_author_email) wp-includes/comment-template.php | Retrieves the email of the author 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( 'get_attached_media_args', array $args, string $type, WP_Post $post ) apply\_filters( 'get\_attached\_media\_args', array $args, string $type, WP\_Post $post )
=========================================================================================
Filters arguments used to retrieve media attached to the given post.
`$args` array Post query arguments. `$type` string Mime type of the desired media. `$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/)
```
$args = apply_filters( 'get_attached_media_args', $args, $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 do_action( 'http_api_debug', array|WP_Error $response, string $context, string $class, array $parsed_args, string $url ) do\_action( 'http\_api\_debug', array|WP\_Error $response, string $context, string $class, array $parsed\_args, string $url )
=============================================================================================================================
Fires after an HTTP API response is received and before the response is returned.
`$response` array|[WP\_Error](../classes/wp_error) HTTP response or [WP\_Error](../classes/wp_error) object. `$context` string Context under which the hook is fired. `$class` string HTTP transport used. `$parsed_args` array 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/)
```
do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_Http::\_dispatch\_request()](../classes/wp_http/_dispatch_request) wp-includes/class-wp-http.php | Dispatches a HTTP request to a supporting transport. |
| [WP\_Http::request()](../classes/wp_http/request) wp-includes/class-wp-http.php | Send an HTTP request to a URI. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'get_blogs_of_user', object[] $sites, int $user_id, bool $all ) apply\_filters( 'get\_blogs\_of\_user', object[] $sites, int $user\_id, bool $all )
===================================================================================
Filters the list of sites a user belongs to.
`$sites` object[] An array of site objects belonging to the user. `$user_id` int User ID. `$all` bool Whether the returned sites 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/)
```
return apply_filters( 'get_blogs_of_user', $sites, $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 |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'install_plugin_complete_actions', string[] $install_actions, object $api, string $plugin_file ) apply\_filters( 'install\_plugin\_complete\_actions', string[] $install\_actions, object $api, string $plugin\_file )
=====================================================================================================================
Filters the list of action links available following a single plugin installation.
`$install_actions` string[] Array of plugin action links. `$api` object Object containing WordPress.org API plugin data. Empty for non-API installs, such as when a plugin is installed via upload. `$plugin_file` string Path to the plugin file relative to the plugins directory. 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_complete_actions', $install_actions, $this->api, $plugin_file );
```
| Used By | Description |
| --- | --- |
| [Plugin\_Installer\_Skin::after()](../classes/plugin_installer_skin/after) wp-admin/includes/class-plugin-installer-skin.php | Action to perform following a plugin install. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action_ref_array( 'in_widget_form', WP_Widget $widget, null $return, array $instance ) do\_action\_ref\_array( 'in\_widget\_form', WP\_Widget $widget, null $return, array $instance )
===============================================================================================
Fires at the end of the widget control form.
Use this hook to add extra fields to the widget form. The hook is only fired if the value passed to the ‘widget\_form\_callback’ hook is not false.
Note: If the widget has no form, the text echoed from the default form method can be hidden using CSS.
`$widget` [WP\_Widget](../classes/wp_widget) The widget instance (passed by reference). `$return` null Return null if new fields are added. `$instance` array An array of the widget's settings. File: `wp-includes/class-wp-widget.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-widget.php/)
```
do_action_ref_array( 'in_widget_form', array( &$this, &$return, $instance ) );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_widget\_form()](../classes/wp_rest_widget_types_controller/get_widget_form) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Returns the output of [WP\_Widget::form()](../classes/wp_widget/form) when called with the provided instance. Used by encode\_form\_data() to preview a widget’s form. |
| [WP\_Widget::form\_callback()](../classes/wp_widget/form_callback) wp-includes/class-wp-widget.php | Generates the widget control form (Do NOT override). |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_chunk_parsing_size', int $chunk_size ) apply\_filters( 'xmlrpc\_chunk\_parsing\_size', int $chunk\_size )
==================================================================
Filters the chunk size that can be used to parse an XML-RPC response message.
`$chunk_size` int Chunk size to parse in bytes. File: `wp-includes/IXR/class-IXR-message.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ixr/class-ixr-message.php/)
```
$chunk_size = apply_filters( 'xmlrpc_chunk_parsing_size', $chunk_size );
```
| Used By | Description |
| --- | --- |
| [IXR\_Message::parse()](../classes/ixr_message/parse) wp-includes/IXR/class-IXR-message.php | |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'wp_mail_failed', WP_Error $error ) do\_action( 'wp\_mail\_failed', WP\_Error $error )
==================================================
Fires after a PHPMailer\PHPMailer\Exception is caught.
`$error` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object with the PHPMailerPHPMailerException message, and an array containing the mail recipient, subject, message, headers, and attachments. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $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 |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'login_form' ) do\_action( 'login\_form' )
===========================
Fires following the ‘Password’ field in the login form.
It can be used to customize the built-in WordPress login form. Use in conjunction with ‘<login_head>‘ (for validation).
File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
do_action( 'login_form' );
```
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_get_original_image_url', string $original_image_url, int $attachment_id ) apply\_filters( 'wp\_get\_original\_image\_url', string $original\_image\_url, int $attachment\_id )
====================================================================================================
Filters the URL to the original attachment image.
`$original_image_url` string URL to original image. `$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( 'wp_get_original_image_url', $original_image_url, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_original\_image\_url()](../functions/wp_get_original_image_url) wp-includes/post.php | Retrieves the URL to an original attachment image. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress do_action( 'comment_form_before' ) do\_action( 'comment\_form\_before' )
=====================================
Fires before 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_before' );
```
| 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 do_action( 'admin_menu', string $context ) do\_action( 'admin\_menu', string $context )
============================================
Fires before the administration menu loads in the admin.
`$context` string Empty context. * This action is used to add extra submenus and menu options to the admin panel’s menu structure. It runs after the basic admin panel menu structure is in place.
* This action mustn’t be placed in an <admin_init> action function because the admin\_init action is called after admin\_menu.
File: `wp-admin/includes/menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/menu.php/)
```
do_action( 'admin_menu', '' );
```
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'oembed_remote_get_args', array $args, string $url ) apply\_filters( 'oembed\_remote\_get\_args', array $args, string $url )
=======================================================================
Filters oEmbed remote get arguments.
* [WP\_Http::request()](../classes/wp_http/request)
`$args` array oEmbed remote get arguments. `$url` string URL to be inspected. File: `wp-includes/class-wp-oembed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed.php/)
```
$args = apply_filters( 'oembed_remote_get_args', $args, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed::discover()](../classes/wp_oembed/discover) wp-includes/class-wp-oembed.php | Attempts to discover link tags at the given URL for an oEmbed provider. |
| [WP\_oEmbed::\_fetch\_with\_format()](../classes/wp_oembed/_fetch_with_format) wp-includes/class-wp-oembed.php | Fetches result from an oEmbed provider for a specific format and complete provider URL |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'intermediate_image_sizes', string[] $default_sizes ) apply\_filters( 'intermediate\_image\_sizes', string[] $default\_sizes )
========================================================================
Filters the list of intermediate image sizes.
`$default_sizes` string[] An array of intermediate image size names. Defaults are `'thumbnail'`, `'medium'`, `'medium_large'`, `'large'`. The `$default_sizes` parameter also contains all image sizes registered with [add\_image\_size()](../functions/add_image_size)
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'intermediate_image_sizes', $default_sizes );
```
| Used By | Description |
| --- | --- |
| [get\_intermediate\_image\_sizes()](../functions/get_intermediate_image_sizes) wp-includes/media.php | Gets the available intermediate image size names. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( "get_user_option_{$option}", mixed $result, string $option, WP_User $user ) apply\_filters( "get\_user\_option\_{$option}", mixed $result, string $option, WP\_User $user )
===============================================================================================
Filters a specific user option value.
The dynamic portion of the hook name, `$option`, refers to the user option name.
`$result` mixed Value for the user's option. `$option` string Name of the option being retrieved. `$user` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object of the user whose option is being retrieved. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( "get_user_option_{$option}", $result, $option, $user );
```
| Used By | Description |
| --- | --- |
| [get\_user\_option()](../functions/get_user_option) wp-includes/user.php | Retrieves user option that can be either per Site or per Network. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_cache_themes_persistently', bool $cache_expiration, string $context ) apply\_filters( 'wp\_cache\_themes\_persistently', bool $cache\_expiration, string $context )
=============================================================================================
Filters whether to get the cache of the registered theme directories.
`$cache_expiration` bool Whether to get the cache of the theme directories. Default false. `$context` string The class or function name calling the filter. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
$cache_expiration = apply_filters( 'wp_cache_themes_persistently', false, 'search_theme_directories' );
```
| Used By | Description |
| --- | --- |
| [search\_theme\_directories()](../functions/search_theme_directories) wp-includes/theme.php | Searches all registered theme directories for complete and valid themes. |
| [WP\_Theme::\_\_construct()](../classes/wp_theme/__construct) wp-includes/class-wp-theme.php | Constructor for [WP\_Theme](../classes/wp_theme). |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'comment_form_submit_field', string $submit_field, array $args ) apply\_filters( 'comment\_form\_submit\_field', string $submit\_field, array $args )
====================================================================================
Filters the submit field for the comment form to display.
The submit field includes the submit button, hidden fields for the comment form, and any wrapper markup.
`$submit_field` string HTML markup for the submit field. `$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/)
```
echo apply_filters( 'comment_form_submit_field', $submit_field, $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( 'pre_post_link', string $permalink, WP_Post $post, bool $leavename ) apply\_filters( 'pre\_post\_link', string $permalink, WP\_Post $post, bool $leavename )
=======================================================================================
Filters the permalink structure for a post before token replacement occurs.
Only applies to posts with post\_type of ‘post’.
`$permalink` string The site's permalink structure. `$post` [WP\_Post](../classes/wp_post) The post in question. `$leavename` bool Whether to keep the post name. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$permalink = apply_filters( 'pre_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 |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'show_network_active_plugins', bool $show ) apply\_filters( 'show\_network\_active\_plugins', bool $show )
==============================================================
Filters whether to display network-active plugins alongside plugins active for the current site.
This also controls the display of inactive network-only plugins (plugins with "Network: true" in the plugin header).
Plugins cannot be network-activated or network-deactivated from this screen.
`$show` bool Whether to show network-active plugins. Default is whether the current user can manage network plugins (ie. a Super Admin). 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/)
```
$show_network_active = apply_filters( 'show_network_active_plugins', $show );
```
| Used By | Description |
| --- | --- |
| [WP\_Plugins\_List\_Table::prepare\_items()](../classes/wp_plugins_list_table/prepare_items) wp-admin/includes/class-wp-plugins-list-table.php | |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_get_object_terms', WP_Term[]|int[]|string[]|string $terms, string $object_ids, string $taxonomies, array $args ) apply\_filters( 'wp\_get\_object\_terms', WP\_Term[]|int[]|string[]|string $terms, string $object\_ids, string $taxonomies, array $args )
=========================================================================================================================================
Filters the terms for a given object or objects.
The `$taxonomies` parameter passed to this filter is formatted as a SQL fragment. The [‘get\_object\_terms’](get_object_terms) filter is recommended as an alternative.
`$terms` [WP\_Term](../classes/wp_term)[]|int[]|string[]|string Array of terms or a count thereof as a numeric string. `$object_ids` string Comma separated list of object IDs for which terms were retrieved. `$taxonomies` string SQL fragment of taxonomy names from which terms were retrieved. `$args` array Array of arguments for retrieving terms for the given object(s). See [wp\_get\_object\_terms()](../functions/wp_get_object_terms) for details. More Arguments from wp\_get\_object\_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/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
return apply_filters( 'wp_get_object_terms', $terms, $object_ids, $taxonomies, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_object\_terms()](../functions/wp_get_object_terms) wp-includes/taxonomy.php | Retrieves the terms associated with the given object(s), in the supplied taxonomies. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_default_user_fields', array $fields, string $method ) apply\_filters( 'xmlrpc\_default\_user\_fields', array $fields, string $method )
================================================================================
Filters the default user query fields used by the given XML-RPC method.
`$fields` array User query fields for given method. Default `'all'`. `$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_user_fields', array( 'all' ), 'wp.getUser' );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_getUser()](../classes/wp_xmlrpc_server/wp_getuser) wp-includes/class-wp-xmlrpc-server.php | Retrieve a user. |
| [wp\_xmlrpc\_server::wp\_getUsers()](../classes/wp_xmlrpc_server/wp_getusers) wp-includes/class-wp-xmlrpc-server.php | Retrieve users. |
| [wp\_xmlrpc\_server::wp\_getProfile()](../classes/wp_xmlrpc_server/wp_getprofile) wp-includes/class-wp-xmlrpc-server.php | Retrieve information about the requesting user. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'rest_user_query', array $prepared_args, WP_REST_Request $request ) apply\_filters( 'rest\_user\_query', array $prepared\_args, WP\_REST\_Request $request )
========================================================================================
Filters [WP\_User\_Query](../classes/wp_user_query) arguments when querying users via the REST API.
`$prepared_args` array Array of arguments for [WP\_User\_Query](../classes/wp_user_query). `$request` [WP\_REST\_Request](../classes/wp_rest_request) The REST API request. 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/)
```
$prepared_args = apply_filters( 'rest_user_query', $prepared_args, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::get\_items()](../classes/wp_rest_users_controller/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. |
| programming_docs |
wordpress apply_filters( "pre_site_option_{$option}", mixed $pre_option, string $option, int $network_id, mixed $default ) apply\_filters( "pre\_site\_option\_{$option}", mixed $pre\_option, string $option, int $network\_id, mixed $default )
======================================================================================================================
Filters the value of an existing network 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\_network\_option()](../functions/get_network_option) .
Default false (to skip past the short-circuit). `$option` string Option name. `$network_id` int ID of the network. `$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_site_option_{$option}", false, $option, $network_id, $default );
```
| Used By | Description |
| --- | --- |
| [get\_network\_option()](../functions/get_network_option) wp-includes/option.php | Retrieves a network’s option value based on the option name. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `$default` parameter was added. |
| [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/) | |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_network_dashboard_widgets', string[] $dashboard_widgets ) apply\_filters( 'wp\_network\_dashboard\_widgets', string[] $dashboard\_widgets )
=================================================================================
Filters the list of widgets to load for the Network 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_network_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( 'comment_moderation_text', string $notify_message, int $comment_id ) apply\_filters( 'comment\_moderation\_text', string $notify\_message, int $comment\_id )
========================================================================================
Filters the comment moderation email text.
`$notify_message` string Text of the comment moderation email. `$comment_id` int Comment ID. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$notify_message = apply_filters( 'comment_moderation_text', $notify_message, $comment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_notify\_moderator()](../functions/wp_notify_moderator) wp-includes/pluggable.php | Notifies the moderator of the site about a new comment that is awaiting approval. |
| Version | Description |
| --- | --- |
| [1.5.2](https://developer.wordpress.org/reference/since/1.5.2/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_blogger_editPost', int $post_ID, array $args ) do\_action( 'xmlrpc\_call\_success\_blogger\_editPost', int $post\_ID, array $args )
====================================================================================
Fires after a post has been successfully updated via the XML-RPC Blogger API.
`$post_ID` int ID of the updated post. `$args` array An array of arguments for the post to edit. 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_editPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::blogger\_editPost()](../classes/wp_xmlrpc_server/blogger_editpost) wp-includes/class-wp-xmlrpc-server.php | Edit a post. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'wp_link_pages_link', string $link, int $i ) apply\_filters( 'wp\_link\_pages\_link', string $link, int $i )
===============================================================
Filters the HTML output of individual page number links.
`$link` string The page number HTML output. `$i` int Page number for paginated posts' page links. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$link = apply_filters( 'wp_link_pages_link', $link, $i );
```
| 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( 'post_thumbnail_url', string|false $thumbnail_url, int|WP_Post|null $post, string|int[] $size ) apply\_filters( 'post\_thumbnail\_url', string|false $thumbnail\_url, int|WP\_Post|null $post, string|int[] $size )
===================================================================================================================
Filters the post thumbnail URL.
`$thumbnail_url` string|false Post thumbnail URL 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`. `$size` string|int[] Registered image size to retrieve the source for or a flat array of height and width dimensions. Default `'post-thumbnail'`. File: `wp-includes/post-thumbnail-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-thumbnail-template.php/)
```
return apply_filters( 'post_thumbnail_url', $thumbnail_url, $post, $size );
```
| Used By | Description |
| --- | --- |
| [get\_the\_post\_thumbnail\_url()](../functions/get_the_post_thumbnail_url) wp-includes/post-thumbnail-template.php | Returns the post thumbnail URL. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'widget_form_callback', array $instance, WP_Widget $widget ) apply\_filters( 'widget\_form\_callback', array $instance, WP\_Widget $widget )
===============================================================================
Filters the widget instance’s settings before displaying the control form.
Returning false effectively short-circuits display of the control form.
`$instance` array The current widget instance's 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_form_callback', $instance, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::get\_widget\_form()](../classes/wp_rest_widget_types_controller/get_widget_form) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Returns the output of [WP\_Widget::form()](../classes/wp_widget/form) when called with the provided instance. Used by encode\_form\_data() to preview a widget’s form. |
| [WP\_Widget::form\_callback()](../classes/wp_widget/form_callback) wp-includes/class-wp-widget.php | Generates the widget control form (Do NOT override). |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'load_textdomain_mofile', string $mofile, string $domain ) apply\_filters( 'load\_textdomain\_mofile', string $mofile, string $domain )
============================================================================
Filters MO file path for loading translations for a specific text domain.
`$mofile` string Path to the MO file. `$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/)
```
$mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );
```
| 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( 'old_slug_redirect_post_id', int $id ) apply\_filters( 'old\_slug\_redirect\_post\_id', int $id )
==========================================================
Filters the old slug redirect post ID.
`$id` int The redirect post ID. File: `wp-includes/query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/query.php/)
```
$id = apply_filters( 'old_slug_redirect_post_id', $id );
```
| 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.9.3](https://developer.wordpress.org/reference/since/4.9.3/) | Introduced. |
wordpress apply_filters( 'illegal_user_logins', array $usernames ) apply\_filters( 'illegal\_user\_logins', array $usernames )
===========================================================
Filters the list of disallowed usernames.
`$usernames` array Array of disallowed usernames. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::check\_username()](../classes/wp_rest_users_controller/check_username) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Check a username for the REST API. |
| [edit\_user()](../functions/edit_user) wp-admin/includes/user.php | Edit user settings based on contents of $\_POST |
| [register\_new\_user()](../functions/register_new_user) wp-includes/user.php | Handles registering a new user. |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| [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 |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'pre_move_uploaded_file', mixed $move_new_file, array $file, string $new_file, string $type ) apply\_filters( 'pre\_move\_uploaded\_file', mixed $move\_new\_file, array $file, string $new\_file, string $type )
===================================================================================================================
Filters whether to short-circuit moving the uploaded file after passing all checks.
If a non-null value is returned from the filter, moving the file and any related error reporting will be completely skipped.
`$move_new_file` mixed If null (default) move the file after the upload. `$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.
`$new_file` string Filename of the newly-uploaded file. `$type` string Mime type of the newly-uploaded file. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$move_new_file = apply_filters( 'pre_move_uploaded_file', null, $file, $new_file, $type );
```
| Used By | Description |
| --- | --- |
| [\_wp\_handle\_upload()](../functions/_wp_handle_upload) wp-admin/includes/file.php | Handles PHP uploads in WordPress. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( '_wp_post_revision_fields', string[] $fields, array $post ) apply\_filters( '\_wp\_post\_revision\_fields', string[] $fields, array $post )
===============================================================================
Filters the list of fields saved in post revisions.
Included by default: ‘post\_title’, ‘post\_content’ and ‘post\_excerpt’.
Disallowed fields: ‘ID’, ‘post\_name’, ‘post\_parent’, ‘post\_date’, ‘post\_date\_gmt’, ‘post\_status’, ‘post\_type’, ‘comment\_count’, and ‘post\_author’.
`$fields` string[] List of fields to revision. Contains `'post_title'`, `'post_content'`, and `'post_excerpt'` by default. `$post` array A post array being processed for insertion as a post revision. File: `wp-includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/revision.php/)
```
$fields = apply_filters( '_wp_post_revision_fields', $fields, $post );
```
| Used By | Description |
| --- | --- |
| [\_wp\_post\_revision\_fields()](../functions/_wp_post_revision_fields) wp-includes/revision.php | Determines which fields of posts are to be saved in revisions. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The `$post` parameter was added. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters_deprecated( 'login_headertitle', string $login_header_title ) apply\_filters\_deprecated( 'login\_headertitle', string $login\_header\_title )
================================================================================
This hook has been deprecated. Use [‘login\_headertext’](login_headertext) instead.
Filters the title attribute of the header logo above login form.
`$login_header_title` string Login header logo title attribute. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
$login_header_title = apply_filters_deprecated(
'login_headertitle',
array( $login_header_title ),
'5.2.0',
'login_headertext',
__( 'Usage of the title attribute on the login logo is not recommended for accessibility reasons. Use the link text instead.' )
);
```
| 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/) | Use ['login\_headertext'](login_headertext) instead. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'manage_comments_custom_column', string $column_name, string $comment_id ) do\_action( 'manage\_comments\_custom\_column', string $column\_name, string $comment\_id )
===========================================================================================
Fires when the default column output is displayed for a single row.
`$column_name` string The custom column's name. `$comment_id` string The comment ID as a numeric string. 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( 'manage_comments_custom_column', $column_name, $item->comment_ID );
```
| Used By | Description |
| --- | --- |
| [WP\_Comments\_List\_Table::column\_default()](../classes/wp_comments_list_table/column_default) wp-admin/includes/class-wp-comments-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'insert_custom_user_meta', array $custom_meta, WP_User $user, bool $update, array $userdata ) apply\_filters( 'insert\_custom\_user\_meta', array $custom\_meta, WP\_User $user, bool $update, array $userdata )
==================================================================================================================
Filters a user’s custom meta values and keys immediately after the user is created or updated and before any user meta is inserted or updated.
For non-custom meta fields, see the [‘insert\_user\_meta’](insert_user_meta) filter.
`$custom_meta` array Array of custom user meta values keyed by meta key. `$user` [WP\_User](../classes/wp_user) User object. `$update` bool Whether the user is being updated rather than 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/)
```
$custom_meta = apply_filters( 'insert_custom_user_meta', $custom_meta, $user, $update, $userdata );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_user()](../functions/wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( "{$type}_upload_iframe_src", string $upload_iframe_src ) apply\_filters( "{$type}\_upload\_iframe\_src", string $upload\_iframe\_src )
=============================================================================
Filters the upload iframe source URL for a specific media type.
The dynamic portion of the hook name, `$type`, refers to the type of media uploaded.
Possible hook names include:
* `image_upload_iframe_src`
* `media_upload_iframe_src`
`$upload_iframe_src` string The upload iframe source URL. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$upload_iframe_src = apply_filters( "{$type}_upload_iframe_src", $upload_iframe_src );
```
| Used By | Description |
| --- | --- |
| [get\_upload\_iframe\_src()](../functions/get_upload_iframe_src) wp-admin/includes/media.php | Retrieves the upload iframe source URL. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'feed_links_extra_show_search_feed', bool $show ) apply\_filters( 'feed\_links\_extra\_show\_search\_feed', bool $show )
======================================================================
Filters whether to display the search results feed link.
`$show` bool Whether to display the search results 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_search_feed = apply_filters( 'feed_links_extra_show_search_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( 'get_network', WP_Network $_network ) apply\_filters( 'get\_network', WP\_Network $\_network )
========================================================
Fires after a network is retrieved.
`$_network` [WP\_Network](../classes/wp_network) Network data. File: `wp-includes/ms-network.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-network.php/)
```
$_network = apply_filters( 'get_network', $_network );
```
| Used By | Description |
| --- | --- |
| [get\_network()](../functions/get_network) wp-includes/ms-network.php | Retrieves network data given a network ID or network object. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'months_dropdown_results', object[] $months, string $post_type ) apply\_filters( 'months\_dropdown\_results', object[] $months, string $post\_type )
===================================================================================
Filters the ‘Months’ drop-down results.
`$months` object[] Array of the months drop-down query results. `$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( 'months_dropdown_results', $months, $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 |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( "ngettext_with_context_{$domain}", string $translation, string $single, string $plural, int $number, string $context, string $domain ) apply\_filters( "ngettext\_with\_context\_{$domain}", string $translation, string $single, string $plural, int $number, string $context, string $domain )
=========================================================================================================================================================
Filters the singular or plural form of a string with gettext context 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. `$context` string Context information for the translators. `$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_with_context_{$domain}", $translation, $single, $plural, $number, $context, $domain );
```
| Used By | Description |
| --- | --- |
| [\_nx()](../functions/_nx) wp-includes/l10n.php | Translates and retrieves the singular or plural form based on the supplied number, with gettext context. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'image_size_names_choose', string[] $size_names ) apply\_filters( 'image\_size\_names\_choose', string[] $size\_names )
=====================================================================
Filters the names and labels of the default image sizes.
`$size_names` string[] Array of image size labels keyed by their name. Default values include `'Thumbnail'`, `'Medium'`, `'Large'`, and 'Full Size'. The ‘`image_size_names_choose`‘ filter allows modification of the list of image sizes that are available to administrators in the WordPress Media Library.
This is most commonly used to make [custom image sizes](../functions/add_image_size) available from selection in the WordPress admin.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$size_names = apply_filters(
'image_size_names_choose',
array(
'thumbnail' => __( 'Thumbnail' ),
'medium' => __( 'Medium' ),
'large' => __( 'Large' ),
'full' => __( 'Full Size' ),
)
);
```
| Used By | Description |
| --- | --- |
| [get\_default\_block\_editor\_settings()](../functions/get_default_block_editor_settings) wp-includes/block-editor.php | Returns the default block editor settings. |
| [image\_size\_input\_fields()](../functions/image_size_input_fields) wp-admin/includes/media.php | Retrieves HTML for the size radio buttons with the specified one checked. |
| [Custom\_Background::wp\_set\_background\_image()](../classes/custom_background/wp_set_background_image) wp-admin/includes/class-custom-background.php | |
| [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. |
| [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/) | Introduced. |
wordpress apply_filters( 'show_admin_bar', bool $show_admin_bar ) apply\_filters( 'show\_admin\_bar', bool $show\_admin\_bar )
============================================================
Filters whether to show the admin bar.
Returning false to this hook is the recommended way to hide the admin bar.
The user’s display preference is used for logged in users.
`$show_admin_bar` bool Whether the admin bar should be shown. Default false. The show\_admin\_bar filter toggles the display status of the [Toolbar](https://wordpress.org/support/article/administration-screens/#toolbar-keeping-it-all-together) for the front side of your website (you cannot turn off the toolbar on the WordPress dashboard anymore).
This filter is part of the function [is\_admin\_bar\_showing()](../functions/is_admin_bar_showing) .
Note: The Admin Bar is replaced with the Toolbar since WordPress [Version 3.3](https://wordpress.org/support/wordpress-version/version-3-3/).
File: `wp-includes/admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
```
$show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );
```
| Used By | Description |
| --- | --- |
| [is\_admin\_bar\_showing()](../functions/is_admin_bar_showing) wp-includes/admin-bar.php | Determines whether the admin bar should be showing. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'get_theme_starter_content', array $content, array $config ) apply\_filters( 'get\_theme\_starter\_content', array $content, array $config )
===============================================================================
Filters the expanded array of starter content.
`$content` array Array of starter content. `$config` array Array of theme-specific starter content configuration. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'get_theme_starter_content', $content, $config );
```
| Used By | Description |
| --- | --- |
| [get\_theme\_starter\_content()](../functions/get_theme_starter_content) wp-includes/theme.php | Expands a theme’s starter content configuration using core-provided data. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'widget_title', string $title, array $instance, mixed $id_base ) apply\_filters( 'widget\_title', string $title, array $instance, mixed $id\_base )
==================================================================================
Filters the widget title.
`$title` string The widget title. Default `'Pages'`. `$instance` array Array of settings for the current widget. `$id_base` mixed The widget ID. 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/)
```
$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Custom\_HTML::widget()](../classes/wp_widget_custom_html/widget) wp-includes/widgets/class-wp-widget-custom-html.php | Outputs the content for the current Custom HTML widget instance. |
| [WP\_Widget\_Media::widget()](../classes/wp_widget_media/widget) wp-includes/widgets/class-wp-widget-media.php | Displays the widget on the front-end. |
| [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\_Text::widget()](../classes/wp_widget_text/widget) wp-includes/widgets/class-wp-widget-text.php | Outputs the content for the current Text widget instance. |
| [WP\_Widget\_Calendar::widget()](../classes/wp_widget_calendar/widget) wp-includes/widgets/class-wp-widget-calendar.php | Outputs the content for the current Calendar 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\_Search::widget()](../classes/wp_widget_search/widget) wp-includes/widgets/class-wp-widget-search.php | Outputs the content for the current Search 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 |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'wp_delete_file', string $file ) apply\_filters( 'wp\_delete\_file', string $file )
==================================================
Filters the path of the file to delete.
`$file` string Path to the file to delete. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$delete = apply_filters( 'wp_delete_file', $file );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_file()](../functions/wp_delete_file) wp-includes/functions.php | Deletes a file. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'dashboard_primary_feed', string $url ) apply\_filters( 'dashboard\_primary\_feed', string $url )
=========================================================
Filters the primary feed URL for the ‘WordPress Events and News’ dashboard widget.
`$url` string The widget's primary feed URL. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
'url' => apply_filters( 'dashboard_primary_feed', __( 'https://wordpress.org/news/feed/' ) ),
```
| 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 apply_filters( 'pre_oembed_result', null|string $result, string $url, string|array $args ) apply\_filters( 'pre\_oembed\_result', null|string $result, string $url, string|array $args )
=============================================================================================
Filters the oEmbed result before any HTTP requests are made.
This allows one to short-circuit the default logic, perhaps by replacing it with a routine that is more optimal for your setup.
Returning a non-null value from the filter will effectively short-circuit retrieval and return the passed value instead.
`$result` null|string The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
Default null to continue retrieving the result. `$url` string The URL to the content that should be attempted to be embedded. `$args` string|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/)
```
$pre = apply_filters( 'pre_oembed_result', null, $url, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed::get\_html()](../classes/wp_oembed/get_html) wp-includes/class-wp-oembed.php | The do-it-all function that takes a URL and attempts to return the HTML. |
| Version | Description |
| --- | --- |
| [4.5.3](https://developer.wordpress.org/reference/since/4.5.3/) | Introduced. |
wordpress do_action( 'customize_save', WP_Customize_Manager $manager ) do\_action( 'customize\_save', WP\_Customize\_Manager $manager )
================================================================
Fires once the theme has switched in the Customizer, but before 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', $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.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( "wp_nav_menu_{$menu->slug}_items", string $items, stdClass $args ) apply\_filters( "wp\_nav\_menu\_{$menu->slug}\_items", string $items, stdClass $args )
======================================================================================
Filters the HTML list content for a specific navigation menu.
* [wp\_nav\_menu()](../functions/wp_nav_menu)
`$items` string The HTML list content for the menu items. `$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/)
```
$items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $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.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_sitemaps_taxonomies_query_args', array $args, string $taxonomy ) apply\_filters( 'wp\_sitemaps\_taxonomies\_query\_args', array $args, string $taxonomy )
========================================================================================
Filters the taxonomy terms query arguments.
Allows modification of the taxonomy query arguments before querying.
* [WP\_Term\_Query](../classes/wp_term_query): for a full list of arguments
`$args` array Array of [WP\_Term\_Query](../classes/wp_term_query) arguments. `$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/)
```
$args = apply_filters(
'wp_sitemaps_taxonomies_query_args',
array(
'taxonomy' => $taxonomy,
'orderby' => 'term_order',
'number' => wp_sitemaps_get_max_urls( $this->object_type ),
'hide_empty' => true,
'hierarchical' => false,
'update_term_meta_cache' => false,
),
$taxonomy
);
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Taxonomies::get\_taxonomies\_query\_args()](../classes/wp_sitemaps_taxonomies/get_taxonomies_query_args) wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php | Returns the query args for retrieving taxonomy terms to list in the sitemap. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_personal_data_erasers', array $args ) apply\_filters( 'wp\_privacy\_personal\_data\_erasers', array $args )
=====================================================================
Filters the array of personal data eraser callbacks.
`$args` array An array of callable erasers of personal data. Default empty array.
* `...$0`array Array of personal data exporters.
+ `callback`callableCallable eraser that accepts an email address and a page and returns an array with boolean values for whether items were removed or retained and any messages from the eraser, as well as if additional pages are available.
+ `exporter_friendly_name`stringTranslated user facing friendly name for the eraser. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() );
```
| Used By | Description |
| --- | --- |
| [WP\_Privacy\_Data\_Removal\_Requests\_List\_Table::column\_email()](../classes/wp_privacy_data_removal_requests_list_table/column_email) wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php | Actions column. |
| [WP\_Privacy\_Data\_Removal\_Requests\_List\_Table::column\_next\_steps()](../classes/wp_privacy_data_removal_requests_list_table/column_next_steps) wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php | Next steps column. |
| [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. |
| [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 apply_filters( 'get_header_image_tag', string $html, object $header, array $attr ) apply\_filters( 'get\_header\_image\_tag', string $html, object $header, array $attr )
======================================================================================
Filters the markup of header images.
`$html` string The HTML image tag markup being filtered. `$header` object The custom header object returned by '[get\_custom\_header()](../functions/get_custom_header) '. `$attr` array Array of the attributes for the image tag. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'get_header_image_tag', $html, $header, $attr );
```
| 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 |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'theme_auto_update_debug_string', string $auto_updates_string, WP_Theme $theme, bool $enabled ) apply\_filters( 'theme\_auto\_update\_debug\_string', string $auto\_updates\_string, WP\_Theme $theme, bool $enabled )
======================================================================================================================
Filters the text string of the auto-updates setting for each theme in the Site Health debug data.
`$auto_updates_string` string The string output for the auto-updates column. `$theme` [WP\_Theme](../classes/wp_theme) An object of theme data. `$enabled` bool Whether auto-updates are enabled for this item. File: `wp-admin/includes/class-wp-debug-data.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-debug-data.php/)
```
$auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $theme, $enabled );
```
| Used By | Description |
| --- | --- |
| [WP\_Debug\_Data::debug\_data()](../classes/wp_debug_data/debug_data) wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'the_editor', string $output ) apply\_filters( 'the\_editor', string $output )
===============================================
Filters the HTML markup output that displays the editor.
`$output` string Editor's HTML markup. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$the_editor = apply_filters(
'the_editor',
'<div id="wp-' . $editor_id_attr . '-editor-container" class="wp-editor-container">' .
$quicktags_toolbar .
'<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . esc_attr( $set['textarea_name'] ) . '" ' .
'id="' . $editor_id_attr . '">%s</textarea></div>'
);
```
| Used By | Description |
| --- | --- |
| [\_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_ref_array( 'comments_clauses', string[] $clauses, WP_Comment_Query $query ) apply\_filters\_ref\_array( 'comments\_clauses', string[] $clauses, WP\_Comment\_Query $query )
===============================================================================================
Filters the comment query clauses.
`$clauses` string[] An associative array of comment query clauses. `$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/)
```
$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Comment\_Query::get\_comment\_ids()](../classes/wp_comment_query/get_comment_ids) wp-includes/class-wp-comment-query.php | Used internally to get a list of comment IDs matching the query vars. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'get_pages', WP_Post[] $pages, array $parsed_args ) apply\_filters( 'get\_pages', WP\_Post[] $pages, array $parsed\_args )
======================================================================
Filters the retrieved list of pages.
`$pages` [WP\_Post](../classes/wp_post)[] Array of page objects. `$parsed_args` array Array of [get\_pages()](../functions/get_pages) arguments. More Arguments from get\_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'`.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'get_pages', $pages, $parsed_args );
```
| Used By | Description |
| --- | --- |
| [get\_pages()](../functions/get_pages) wp-includes/post.php | Retrieves an array of pages (or hierarchical post type items). |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'recovery_mode_cookie_length', int $length ) apply\_filters( 'recovery\_mode\_cookie\_length', int $length )
===============================================================
Filters the length of time a Recovery Mode cookie is valid for.
`$length` int Length in seconds. File: `wp-includes/class-wp-recovery-mode-cookie-service.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode-cookie-service.php/)
```
$length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS );
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Cookie\_Service::set\_cookie()](../classes/wp_recovery_mode_cookie_service/set_cookie) wp-includes/class-wp-recovery-mode-cookie-service.php | Sets the recovery mode cookie. |
| [WP\_Recovery\_Mode\_Cookie\_Service::validate\_cookie()](../classes/wp_recovery_mode_cookie_service/validate_cookie) wp-includes/class-wp-recovery-mode-cookie-service.php | Validates the recovery mode cookie. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action( 'pre-plupload-upload-ui' ) do\_action( 'pre-plupload-upload-ui' )
======================================
Fires before 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( 'pre-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( 'wp_edit_nav_menu_walker', string $class, int $menu_id ) apply\_filters( 'wp\_edit\_nav\_menu\_walker', string $class, int $menu\_id )
=============================================================================
Filters the [Walker](../classes/walker) class used when adding nav menu items.
`$class` string The walker class to use. Default '[Walker\_Nav\_Menu\_Edit](../classes/walker_nav_menu_edit)'. `$menu_id` int ID of the menu being rendered. File: `wp-admin/includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/nav-menu.php/)
```
$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_add\_menu\_item()](../functions/wp_ajax_add_menu_item) wp-admin/includes/ajax-actions.php | Ajax handler for adding a menu item. |
| [wp\_get\_nav\_menu\_to\_edit()](../functions/wp_get_nav_menu_to_edit) wp-admin/includes/nav-menu.php | Returns the menu formatted to edit. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'permalink_structure_changed', string $old_permalink_structure, string $permalink_structure ) do\_action( 'permalink\_structure\_changed', string $old\_permalink\_structure, string $permalink\_structure )
==============================================================================================================
Fires after the permalink structure is updated.
`$old_permalink_structure` string The previous permalink structure. `$permalink_structure` string The new permalink structure. File: `wp-includes/class-wp-rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
```
do_action( 'permalink_structure_changed', $old_permalink_structure, $permalink_structure );
```
| Used By | Description |
| --- | --- |
| [WP\_Rewrite::set\_permalink\_structure()](../classes/wp_rewrite/set_permalink_structure) wp-includes/class-wp-rewrite.php | Sets the main permalink structure for the site. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'enable_maintenance_mode', bool $enable_checks, int $upgrading ) apply\_filters( 'enable\_maintenance\_mode', bool $enable\_checks, int $upgrading )
===================================================================================
Filters whether to enable maintenance mode.
This filter runs before it can be used by plugins. It is designed for non-web runtimes. If this filter returns true, maintenance mode will be active and the request will end. If false, the request will be allowed to continue processing even if maintenance mode should be active.
`$enable_checks` bool Whether to enable maintenance mode. Default true. `$upgrading` int The timestamp set in the .maintenance file. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
if ( ! apply_filters( 'enable_maintenance_mode', true, $upgrading ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_is\_maintenance\_mode()](../functions/wp_is_maintenance_mode) wp-includes/load.php | Check if maintenance mode is enabled. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress do_action( 'wp_maybe_auto_update' ) do\_action( 'wp\_maybe\_auto\_update' )
=======================================
Fires during wp\_cron, starting the auto-update process.
File: `wp-includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/update.php/)
```
do_action( 'wp_maybe_auto_update' );
```
| Used By | Description |
| --- | --- |
| [wp\_version\_check()](../functions/wp_version_check) wp-includes/update.php | Checks WordPress version against the newest version. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'default_hidden_columns', string[] $hidden, WP_Screen $screen ) apply\_filters( 'default\_hidden\_columns', string[] $hidden, WP\_Screen $screen )
==================================================================================
Filters the default list of hidden columns.
`$hidden` string[] Array of IDs of columns 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_columns', $hidden, $screen );
```
| Used By | Description |
| --- | --- |
| [get\_hidden\_columns()](../functions/get_hidden_columns) wp-admin/includes/screen.php | Get a list of hidden columns. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'the_content_more_link', string $more_link_element, string $more_link_text ) apply\_filters( 'the\_content\_more\_link', string $more\_link\_element, string $more\_link\_text )
===================================================================================================
Filters the Read More link text.
`$more_link_element` string Read More link element. `$more_link_text` string Read More text. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink( $_post ) . "#more-{$_post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );
```
| Used By | Description |
| --- | --- |
| [get\_the\_content()](../functions/get_the_content) wp-includes/post-template.php | Retrieves the post content. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'delete_term_relationships', int $object_id, array $tt_ids, string $taxonomy ) do\_action( 'delete\_term\_relationships', int $object\_id, array $tt\_ids, string $taxonomy )
==============================================================================================
Fires immediately before 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( 'delete_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. |
| programming_docs |
wordpress do_action( "deactivate_{$plugin}", bool $network_deactivating ) do\_action( "deactivate\_{$plugin}", bool $network\_deactivating )
==================================================================
Fires as a specific plugin is being deactivated.
This hook is the "deactivation" hook used internally by [register\_deactivation\_hook()](../functions/register_deactivation_hook) .
The dynamic portion of the hook name, `$plugin`, refers to the plugin basename.
If a plugin is silently deactivated (such as during an update), this hook does not fire.
`$network_deactivating` bool Whether the plugin is deactivated 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( "deactivate_{$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.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'theme_auto_update_setting_template', string $template ) apply\_filters( 'theme\_auto\_update\_setting\_template', string $template )
============================================================================
Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay).
See [wp\_prepare\_themes\_for\_js()](../functions/wp_prepare_themes_for_js) for the properties of the `data` object.
`$template` string The template for displaying the auto-update setting link. File: `wp-admin/themes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/themes.php/)
```
return apply_filters( 'theme_auto_update_setting_template', $template );
```
| Used By | Description |
| --- | --- |
| [wp\_theme\_auto\_update\_setting\_template()](../functions/wp_theme_auto_update_setting_template) wp-admin/themes.php | Returns the JavaScript template used to display the auto-update setting for a theme. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_block_pattern', WP_REST_Response $response, object $raw_pattern, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_block\_pattern', WP\_REST\_Response $response, object $raw\_pattern, WP\_REST\_Request $request )
=================================================================================================================================
Filters the REST API response for a block pattern.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$raw_pattern` object The unprepared block pattern. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php/)
```
return apply_filters( 'rest_prepare_block_pattern', $response, $raw_pattern, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Pattern\_Directory\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_pattern_directory_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php | Prepare a raw block pattern before it gets output in a REST API response. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( "post_type_labels_{$post_type}", object $labels ) apply\_filters( "post\_type\_labels\_{$post\_type}", object $labels )
=====================================================================
Filters the labels of a specific post type.
The dynamic portion of the hook name, `$post_type`, refers to the post type slug.
Possible hook names include:
* `post_type_labels_post`
* `post_type_labels_page`
* `post_type_labels_attachment`
* [get\_post\_type\_labels()](../functions/get_post_type_labels) : for the full list of labels.
`$labels` object Object with labels for the post type as member variables. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$labels = apply_filters( "post_type_labels_{$post_type}", $labels );
```
| Used By | Description |
| --- | --- |
| [get\_post\_type\_labels()](../functions/get_post_type_labels) wp-includes/post.php | Builds an object with all post type labels out of a post type object. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_orderby', string $orderby, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_orderby', string $orderby, WP\_Query $query )
=================================================================================
Filters the ORDER BY clause of the query.
`$orderby` string The ORDER BY clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). This filter is applied before a post-retrieving SQL statement is executed. Use it to make custom modifications to the orderby. [WP\_Query](../classes/wp_query) is versatile but there may be situations where you need to orderby a value that is in a separate database, a custom equation, etc.
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$orderby = apply_filters_ref_array( 'posts_orderby', array( $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 |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'found_networks_query', string $found_networks_query, WP_Network_Query $network_query ) apply\_filters( 'found\_networks\_query', string $found\_networks\_query, WP\_Network\_Query $network\_query )
==============================================================================================================
Filters the query used to retrieve found network count.
`$found_networks_query` string SQL query. Default 'SELECT FOUND\_ROWS()'. `$network_query` [WP\_Network\_Query](../classes/wp_network_query) The `WP_Network_Query` instance. File: `wp-includes/class-wp-network-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-network-query.php/)
```
$found_networks_query = apply_filters( 'found_networks_query', 'SELECT FOUND_ROWS()', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Network\_Query::set\_found\_networks()](../classes/wp_network_query/set_found_networks) wp-includes/class-wp-network-query.php | Populates found\_networks 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 do_action( 'wp_verify_nonce_failed', string $nonce, string|int $action, WP_User $user, string $token ) do\_action( 'wp\_verify\_nonce\_failed', string $nonce, string|int $action, WP\_User $user, string $token )
===========================================================================================================
Fires when nonce verification fails.
`$nonce` string The invalid nonce. `$action` string|int The nonce action. `$user` [WP\_User](../classes/wp_user) The current user object. `$token` string The user's session token. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token );
```
| 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. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_sprintf_l', array $delimiters ) apply\_filters( 'wp\_sprintf\_l', array $delimiters )
=====================================================
Filters the translated delimiters used by [wp\_sprintf\_l()](../functions/wp_sprintf_l) .
Placeholders (%s) are included to assist translators and then removed before the array of strings reaches the filter.
Please note: Ampersands and entities should be avoided here.
`$delimiters` array An array of translated delimiters. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$l = apply_filters(
'wp_sprintf_l',
array(
/* translators: Used to join items in a list with more than 2 items. */
'between' => sprintf( __( '%1$s, %2$s' ), '', '' ),
/* translators: Used to join last two items in a list with more than 2 times. */
'between_last_two' => sprintf( __( '%1$s, and %2$s' ), '', '' ),
/* translators: Used to join items in a list with only 2 items. */
'between_only_two' => sprintf( __( '%1$s and %2$s' ), '', '' ),
)
);
```
| Used By | Description |
| --- | --- |
| [wp\_sprintf\_l()](../functions/wp_sprintf_l) wp-includes/formatting.php | Localizes list items before the rest of the content. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( "pre_set_theme_mod_{$name}", mixed $value, mixed $old_value ) apply\_filters( "pre\_set\_theme\_mod\_{$name}", mixed $value, mixed $old\_value )
==================================================================================
Filters the theme modification, or ‘theme\_mod’, value on save.
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.
`$value` mixed The new value of the theme modification. `$old_value` mixed The current value of the theme modification. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
$mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );
```
| Used By | Description |
| --- | --- |
| [set\_theme\_mod()](../functions/set_theme_mod) wp-includes/theme.php | Updates theme modification value for the active theme. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_exports_url', string $exports_url ) apply\_filters( 'wp\_privacy\_exports\_url', string $exports\_url )
===================================================================
Filters the URL of the directory used to store personal data export files.
`$exports_url` string Exports directory URL. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'wp_privacy_exports_url', $exports_url );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_exports\_url()](../functions/wp_privacy_exports_url) wp-includes/functions.php | Returns the URL of 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 URL 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( 'wp_before_admin_bar_render' ) do\_action( 'wp\_before\_admin\_bar\_render' )
==============================================
Fires before the admin bar is rendered.
The **wp\_before\_admin\_bar\_render** action allows developers to modify the $wp\_admin\_bar object before it is used to render the [Toolbar](https://wordpress.org/support/article/toolbar/ "Toolbar") to the screen.
Please note that you must declare the **$wp\_admin\_bar** global object, as this hook is primarily intended to give you direct access to this object **before it is rendered to the screen**.
File: `wp-includes/admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
```
do_action( 'wp_before_admin_bar_render' );
```
| 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( 'the_author', string|null $display_name ) apply\_filters( 'the\_author', string|null $display\_name )
===========================================================
Filters the display name of the current post’s author.
`$display_name` string|null The author's display name. 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', is_object( $authordata ) ? $authordata->display_name : null );
```
| Used By | Description |
| --- | --- |
| [get\_the\_author()](../functions/get_the_author) wp-includes/author-template.php | Retrieves the author of the current post. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( "admin_head-{$hook_suffix}" ) do\_action( "admin\_head-{$hook\_suffix}" )
===========================================
Fires in head section for a specific admin page.
The dynamic portion of the hook name, `$hook_suffix`, refers to the hook suffix for the admin page.
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.
File: `wp-admin/admin-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-header.php/)
```
do_action( "admin_head-{$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( 'bloginfo_rss', string $rss_container, string $show ) apply\_filters( 'bloginfo\_rss', string $rss\_container, string $show )
=======================================================================
Filters the bloginfo for display in RSS feeds.
* [get\_bloginfo()](../functions/get_bloginfo)
`$rss_container` string RSS container for the blog information. `$show` string The type of blog information to retrieve. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
echo apply_filters( 'bloginfo_rss', get_bloginfo_rss( $show ), $show );
```
| Used By | Description |
| --- | --- |
| [bloginfo\_rss()](../functions/bloginfo_rss) wp-includes/feed.php | Displays RSS container for the bloginfo function. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_trim_excerpt', string $text, string $raw_excerpt ) apply\_filters( 'wp\_trim\_excerpt', string $text, string $raw\_excerpt )
=========================================================================
Filters the trimmed excerpt string.
`$text` string The trimmed text. `$raw_excerpt` string The text prior to trimming. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'wp_trim_excerpt', $text, $raw_excerpt );
```
| 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.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'pre_user_first_name', string $first_name ) apply\_filters( 'pre\_user\_first\_name', string $first\_name )
===============================================================
Filters a user’s first name before the user is created or updated.
`$first_name` string The user's first name. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$meta['first_name'] = apply_filters( 'pre_user_first_name', $first_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 do_action( "wp_ajax_nopriv_{$action}" ) do\_action( "wp\_ajax\_nopriv\_{$action}" )
===========================================
Fires non-authenticated Ajax actions for logged-out users.
The dynamic portion of the hook name, `$action`, refers to the name of the Ajax action callback being fired.
This hook is functionally the same as [wp\_ajax\_{$action}](wp_ajax_action), except the “nopriv” variant is used for handling AJAX requests from unauthenticated users, i.e. when [is\_user\_logged\_in()](../functions/is_user_logged_in) returns false.
Unlike [wp\_ajax\_{$action}](wp_ajax_action) the ajaxurl javascript global property will not be automatically defined and must be included manually or by using [wp\_localize\_script()](../functions/wp_localize_script) with admin\_url( ‘admin-ajax.php’ ) as the data.
See also [wp\_ajax\_nopriv\_{$\_REQUEST[‘action’]}](wp_ajax_nopriv__requestaction).
For more information, see [Ajax Plugin Handbook](https://developer.wordpress.org/plugins/javascript/ajax/) on the new WordPress Developer Resource.
File: `wp-admin/admin-ajax.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-ajax.php/)
```
do_action( "wp_ajax_nopriv_{$action}" );
```
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'wp_check_comment_disallowed_list', string $author, string $email, string $url, string $comment, string $user_ip, string $user_agent ) do\_action( 'wp\_check\_comment\_disallowed\_list', string $author, string $email, string $url, string $comment, string $user\_ip, string $user\_agent )
========================================================================================================================================================
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( 'wp_check_comment_disallowed_list', $author, $email, $url, $comment, $user_ip, $user_agent );
```
| 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/) | Introduced. |
| programming_docs |
wordpress do_action( 'media_buttons', string $editor_id ) do\_action( 'media\_buttons', string $editor\_id )
==================================================
Fires after the default media button(s) are displayed.
`$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/)
```
do_action( 'media_buttons', $editor_id );
```
| Used By | Description |
| --- | --- |
| [\_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.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'excerpt_length', int $number ) apply\_filters( 'excerpt\_length', int $number )
================================================
Filters the maximum number of words in a post excerpt.
`$number` int The maximum number of words. Default 55. Use this filter if you want to change the default excerpt length.
To change excerpt length, add the following code to `functions.php` file in your theme adjusting the “20” to match the number of words you wish to display in the excerpt:
```
function mytheme_custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'mytheme_custom_excerpt_length', 999 );
```
Make sure to set the priority correctly, such as 999, otherwise the default WordPress filter on this function will run last and override what you set here.
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$excerpt_length = (int) apply_filters( 'excerpt_length', $excerpt_length );
```
| 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.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'wp_authenticate_user', WP_User|WP_Error $user, string $password ) apply\_filters( 'wp\_authenticate\_user', WP\_User|WP\_Error $user, string $password )
======================================================================================
Filters whether the given user can be authenticated with the provided password.
`$user` [WP\_User](../classes/wp_user)|[WP\_Error](../classes/wp_error) [WP\_User](../classes/wp_user) or [WP\_Error](../classes/wp_error) object if a previous callback failed authentication. `$password` string Password to check against the user. This hook should return either a [WP\_User](../classes/wp_user)() object or, if generating an error, a [WP\_Error](../classes/wp_error)() object.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$user = apply_filters( 'wp_authenticate_user', $user, $password );
```
| Used By | Description |
| --- | --- |
| [wp\_authenticate\_email\_password()](../functions/wp_authenticate_email_password) wp-includes/user.php | Authenticates a user using the email and password. |
| [wp\_authenticate\_username\_password()](../functions/wp_authenticate_username_password) wp-includes/user.php | Authenticates a user, confirming the username and password are valid. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'wpmu_activate_user', int $user_id, string $password, array $meta ) do\_action( 'wpmu\_activate\_user', int $user\_id, string $password, array $meta )
==================================================================================
Fires immediately after a new user is activated.
`$user_id` int User ID. `$password` string User password. `$meta` array Signup meta data. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
do_action( 'wpmu_activate_user', $user_id, $password, $meta );
```
| Used By | Description |
| --- | --- |
| [wpmu\_activate\_signup()](../functions/wpmu_activate_signup) wp-includes/ms-functions.php | Activates a signup. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_filesize', int $size, string $path ) apply\_filters( 'wp\_filesize', int $size, string $path )
=========================================================
Filters the size of the file.
`$size` int The result of PHP filesize on the file. `$path` string Path to the file. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return (int) apply_filters( 'wp_filesize', $size, $path );
```
| Used By | Description |
| --- | --- |
| [wp\_filesize()](../functions/wp_filesize) wp-includes/functions.php | Wrapper for PHP filesize with filters and casting the result as an integer. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'wp_img_tag_add_width_and_height_attr', bool $value, string $image, string $context, int $attachment_id ) apply\_filters( 'wp\_img\_tag\_add\_width\_and\_height\_attr', bool $value, string $image, string $context, int $attachment\_id )
=================================================================================================================================
Filters whether to add the missing `width` and `height` 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_width_and_height_attr', true, $image, $context, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_img\_tag\_add\_width\_and\_height\_attr()](../functions/wp_img_tag_add_width_and_height_attr) wp-includes/media.php | Adds `width` and `height` attributes to an `img` HTML tag. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_mail', null|bool $return, array $atts ) apply\_filters( 'pre\_wp\_mail', null|bool $return, array $atts )
=================================================================
Filters whether to preempt sending an email.
Returning a non-null value will short-circuit [wp\_mail()](../functions/wp_mail) , returning that value instead. A boolean return value should be used to indicate whether the email was successfully sent.
`$return` null|bool Short-circuit return value. `$atts` 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.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$pre_wp_mail = apply_filters( 'pre_wp_mail', null, $atts );
```
| Used By | Description |
| --- | --- |
| [wp\_mail()](../functions/wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress do_action( 'mu_rightnow_end' ) do\_action( 'mu\_rightnow\_end' )
=================================
Fires at the end of the ‘Right Now’ widget in the Network Admin dashboard.
File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
do_action( 'mu_rightnow_end' );
```
| Used By | Description |
| --- | --- |
| [wp\_network\_dashboard\_right\_now()](../functions/wp_network_dashboard_right_now) wp-admin/includes/dashboard.php | |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'pre_get_block_file_template', WP_Block_Template|null $block_template, string $id, string $template_type ) apply\_filters( 'pre\_get\_block\_file\_template', WP\_Block\_Template|null $block\_template, string $id, string $template\_type )
==================================================================================================================================
Filters the block template object before the theme file discovery takes place.
Return a non-null value to bypass the WordPress theme file discovery.
`$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_file_template', null, $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 apply_filters( 'wp_get_revision_ui_diff', array[] $return, WP_Post $compare_from, WP_Post $compare_to ) apply\_filters( 'wp\_get\_revision\_ui\_diff', array[] $return, WP\_Post $compare\_from, WP\_Post $compare\_to )
================================================================================================================
Filters the fields displayed in the post revision diff UI.
`$return` array[] Array of revision UI fields. Each item is an array of id, name, and diff. `$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/)
```
return apply_filters( 'wp_get_revision_ui_diff', $return, $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( 'heartbeat_tick', array $response, string $screen_id ) do\_action( 'heartbeat\_tick', array $response, string $screen\_id )
====================================================================
Fires when Heartbeat ticks in logged-in environments.
Allows the transport to be easily replaced with long-polling.
`$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/)
```
do_action( 'heartbeat_tick', $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_ref_array( 'posts_clauses', string[] $clauses, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_clauses', string[] $clauses, WP\_Query $query )
===================================================================================
Filters all query clauses at once, for convenience.
Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT, fields (SELECT), and LIMIT clauses.
`$clauses` string[] Associative array of the clauses for the query.
* `where`stringThe WHERE clause of the query.
* `groupby`stringThe GROUP BY clause of the query.
* `join`stringThe JOIN clause of the query.
* `orderby`stringThe ORDER BY clause of the query.
* `distinct`stringThe DISTINCT clause of the query.
* `fields`stringThe SELECT clause of the query.
* `limits`stringThe LIMIT clause of the query.
`$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). The `posts_clauses` filter runs before the query gets executed and is essentially the sum of all filters that run immediately before it. So it should be used if you don’t intend to let another plugin override it, or if you need to alter several different parts of the query at once. If you’re only modifying a particular clause, you should probably use one of these clause-specific filters:
```
* posts_where_paged
* posts_groupby
* posts_join_paged
* posts_orderby
* posts_distinct
* post_limits
* posts_fields
```
Note: If you’re working on a caching plugin, use the <posts_clauses_request> filter instead. It’s basically the same filter, but it runs later (and after <posts_selection>), specifically so that “regular” plugins can execute their filters *before* your caching plugin does anything.
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$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.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'big_image_size_threshold', int $threshold, array $imagesize, string $file, int $attachment_id ) apply\_filters( 'big\_image\_size\_threshold', int $threshold, array $imagesize, string $file, int $attachment\_id )
====================================================================================================================
Filters the “BIG image” threshold value.
If the original image width or height is above the threshold, it will be scaled down. The threshold is used as max width and max height. The scaled down image will be used as the largest available size, including the `_wp_attached_file` post meta value.
Returning `false` from the filter callback will disable the scaling.
`$threshold` int The threshold value in pixels. Default 2560. `$imagesize` array Indexed array of the image width and height in pixels.
* intThe image width.
* `1`intThe image height.
`$file` string Full path to the uploaded image file. `$attachment_id` int Attachment post ID. File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
$threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $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/) | Introduced. |
wordpress apply_filters( 'wp_upload_bits', array|string $upload_bits_error ) apply\_filters( 'wp\_upload\_bits', array|string $upload\_bits\_error )
=======================================================================
Filters whether to treat the upload bits as an error.
Returning a non-array from the filter will effectively short-circuit preparing the upload bits and return that value instead. An error message should be returned as a string.
`$upload_bits_error` array|string An array of upload bits data, or error message to return. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$upload_bits_error = apply_filters(
'wp_upload_bits',
array(
'name' => $name,
'bits' => $bits,
'time' => $time,
)
);
```
| Used By | Description |
| --- | --- |
| [wp\_upload\_bits()](../functions/wp_upload_bits) wp-includes/functions.php | Creates a file in the upload folder with given content. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wpmu_signup_user_notification', string $user_login, string $user_email, string $key, array $meta ) apply\_filters( 'wpmu\_signup\_user\_notification', string $user\_login, string $user\_email, string $key, array $meta )
========================================================================================================================
Filters whether to bypass the email notification for new user sign-up.
`$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/)
```
if ( ! apply_filters( 'wpmu_signup_user_notification', $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( 'get_the_guid', string $post_guid, int $post_id ) apply\_filters( 'get\_the\_guid', string $post\_guid, int $post\_id )
=====================================================================
Filters the Global Unique Identifier (guid) of the post.
`$post_guid` string Global Unique Identifier (guid) of the post. `$post_id` int The post ID. Note that the filter callback function must return the guid after it is finished processing, or any code using the guid (for example: RSS feeds) will break, and other plugins also filtering the guid may generate errors.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
return apply_filters( 'get_the_guid', $post_guid, $post_id );
```
| 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\_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. |
| [get\_the\_guid()](../functions/get_the_guid) wp-includes/post-template.php | Retrieves the Post Global Unique Identifier (guid). |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'update_bulk_theme_complete_actions', string[] $update_actions, WP_Theme $theme_info ) apply\_filters( 'update\_bulk\_theme\_complete\_actions', string[] $update\_actions, WP\_Theme $theme\_info )
=============================================================================================================
Filters the list of action links available following bulk theme updates.
`$update_actions` string[] Array of theme action links. `$theme_info` [WP\_Theme](../classes/wp_theme) Theme object for the last-updated theme. File: `wp-admin/includes/class-bulk-theme-upgrader-skin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-bulk-theme-upgrader-skin.php/)
```
$update_actions = apply_filters( 'update_bulk_theme_complete_actions', $update_actions, $this->theme_info );
```
| Used By | Description |
| --- | --- |
| [Bulk\_Theme\_Upgrader\_Skin::bulk\_footer()](../classes/bulk_theme_upgrader_skin/bulk_footer) wp-admin/includes/class-bulk-theme-upgrader-skin.php | |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'comment_form_logged_in_after', array $commenter, string $user_identity ) do\_action( 'comment\_form\_logged\_in\_after', array $commenter, string $user\_identity )
==========================================================================================
Fires after the [is\_user\_logged\_in()](../functions/is_user_logged_in) check in the comment form.
`$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/)
```
do_action( 'comment_form_logged_in_after', $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. |
wordpress do_action( 'profile_update', int $user_id, WP_User $old_user_data, array $userdata ) do\_action( 'profile\_update', int $user\_id, WP\_User $old\_user\_data, array $userdata )
==========================================================================================
Fires immediately after an existing user is updated.
`$user_id` int User ID. `$old_user_data` [WP\_User](../classes/wp_user) Object containing user's data prior to update. `$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/)
```
do_action( 'profile_update', $user_id, $old_user_data, $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. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress do_action( 'setted_transient', string $transient, mixed $value, int $expiration ) do\_action( 'setted\_transient', string $transient, mixed $value, int $expiration )
===================================================================================
Fires after the value for a transient has been set.
`$transient` string The name of the transient. `$value` mixed 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_transient', $transient, $value, $expiration );
```
| Used By | Description |
| --- | --- |
| [set\_transient()](../functions/set_transient) wp-includes/option.php | Sets/updates the value of a transient. |
| Version | Description |
| --- | --- |
| [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( 'image_memory_limit', int|string $filtered_limit ) apply\_filters( 'image\_memory\_limit', int|string $filtered\_limit )
=====================================================================
Filters the memory limit allocated for image manipulation.
`$filtered_limit` int|string Maximum memory limit to allocate for images.
Default `WP_MAX_MEMORY_LIMIT` 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( 'image_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/) | The default now takes the original `memory_limit` into account. |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress do_action( "customize_post_value_set_{$setting_id}", mixed $value, WP_Customize_Manager $manager ) do\_action( "customize\_post\_value\_set\_{$setting\_id}", mixed $value, WP\_Customize\_Manager $manager )
==========================================================================================================
Announces when a specific 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.
The dynamic portion of the hook name, `$setting_id`, refers to the 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( 'rest_prepare_theme', WP_REST_Response $response, WP_Theme $theme, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_theme', WP\_REST\_Response $response, WP\_Theme $theme, WP\_REST\_Request $request )
====================================================================================================================
Filters theme data returned from the REST API.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$theme` [WP\_Theme](../classes/wp_theme) Theme object used to create response. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. File: `wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php/)
```
return apply_filters( 'rest_prepare_theme', $response, $theme, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Themes\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_themes_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php | Prepares a single theme output for response. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'wp_list_authors_args', array $query_args, array $parsed_args ) apply\_filters( 'wp\_list\_authors\_args', array $query\_args, array $parsed\_args )
====================================================================================
Filters the query arguments for the list of all authors of the site.
`$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\_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/)
```
$query_args = apply_filters( 'wp_list_authors_args', $query_args, $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. |
wordpress apply_filters( 'render_block_context', array $context, array $parsed_block, WP_Block|null $parent_block ) apply\_filters( 'render\_block\_context', array $context, array $parsed\_block, WP\_Block|null $parent\_block )
===============================================================================================================
Filters the default context provided to a rendered block.
`$context` array Default context. `$parsed_block` array Block being rendered, filtered by `render_block_data`. `$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/)
```
$context = apply_filters( 'render_block_context', $context, $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.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'manage_plugins_custom_column', string $column_name, string $plugin_file, array $plugin_data ) do\_action( 'manage\_plugins\_custom\_column', string $column\_name, string $plugin\_file, array $plugin\_data )
================================================================================================================
Fires inside each custom column of the Plugins list table.
`$column_name` string Name of the column. `$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. 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( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
```
| 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 apply_filters( 'dashboard_recent_posts_query_args', array $query_args ) apply\_filters( 'dashboard\_recent\_posts\_query\_args', array $query\_args )
=============================================================================
Filters the query arguments used for the Recent Posts widget.
`$query_args` array The arguments passed to [WP\_Query](../classes/wp_query) to produce the list of posts. 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_posts_query_args', $query_args );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_recent\_posts()](../functions/wp_dashboard_recent_posts) wp-admin/includes/dashboard.php | Generates Publishing Soon and Recently Published sections. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress do_action( 'wp_delete_post_revision', int $revision_id, WP_Post $revision ) do\_action( 'wp\_delete\_post\_revision', int $revision\_id, WP\_Post $revision )
=================================================================================
Fires once a post revision has been deleted.
`$revision_id` int Post revision ID. `$revision` [WP\_Post](../classes/wp_post) Post revision object. File: `wp-includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/revision.php/)
```
do_action( 'wp_delete_post_revision', $revision->ID, $revision );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_post\_revision()](../functions/wp_delete_post_revision) wp-includes/revision.php | Deletes a revision. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'wp_error_added', string|int $code, string $message, mixed $data, WP_Error $wp_error ) do\_action( 'wp\_error\_added', string|int $code, string $message, mixed $data, WP\_Error $wp\_error )
======================================================================================================
Fires when an error is added to a [WP\_Error](../classes/wp_error) object.
`$code` string|int Error code. `$message` string Error message. `$data` mixed Error data. Might be empty. `$wp_error` [WP\_Error](../classes/wp_error) The [WP\_Error](../classes/wp_error) object. File: `wp-includes/class-wp-error.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-error.php/)
```
do_action( 'wp_error_added', $code, $message, $data, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Error::add()](../classes/wp_error/add) wp-includes/class-wp-error.php | Adds an error or appends an additional message to an existing error. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'get_to_ping', string[] $to_ping ) apply\_filters( 'get\_to\_ping', string[] $to\_ping )
=====================================================
Filters the list of URLs yet to ping for the given post.
`$to_ping` string[] List of URLs yet to ping. * Callback functions applied to this filter should not ping the URLs. Instead, they may modify the array of URLs to be pinged, and WordPress will ping them automatically.
* Note that each of the filter callback functions must return an array of URLs after it is finished processing. Otherwise, any code using the `$to_ping` array will break and other plugins also filtering the `$to_ping` array may generate errors.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'get_to_ping', $to_ping );
```
| Used By | Description |
| --- | --- |
| [get\_to\_ping()](../functions/get_to_ping) wp-includes/post.php | Retrieves URLs that need to be pinged. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'wp_title_parts', string[] $title_array ) apply\_filters( 'wp\_title\_parts', string[] $title\_array )
============================================================
Filters the parts of the page title.
`$title_array` string[] Array of parts of the page title. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) );
```
| 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 |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'admin_memory_limit', int|string $filtered_limit ) apply\_filters( 'admin\_memory\_limit', int|string $filtered\_limit )
=====================================================================
Filters the maximum memory limit available for administration screens.
This only applies to administrators, who may require more memory for tasks like updates. Memory limits when processing images (uploaded or edited by users of any role) are handled separately.
The `WP_MAX_MEMORY_LIMIT` constant specifically defines the maximum memory limit available when in the administration back end. The default is 256M (256 megabytes of memory) or the original `memory_limit` php.ini value if this is higher.
`$filtered_limit` int|string The maximum WordPress memory limit. 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( 'admin_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/) | The default now takes the original `memory_limit` into account. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'get_space_allowed', int $space_allowed ) apply\_filters( 'get\_space\_allowed', int $space\_allowed )
============================================================
Filters the upload quota for the current site.
`$space_allowed` int Upload quota in megabytes for the current blog. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
return apply_filters( 'get_space_allowed', $space_allowed );
```
| Used By | Description |
| --- | --- |
| [get\_space\_allowed()](../functions/get_space_allowed) wp-includes/ms-functions.php | Returns the upload quota for the current blog. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress do_action( 'plugins_loaded' ) do\_action( 'plugins\_loaded' )
===============================
Fires once activated plugins have loaded.
Pluggable functions are also available at this point in the loading order.
The hook is generally used for immediate filter setup, or plugin overrides.
The `plugins_loaded` action hook fires early, and precedes the [`setup_theme`](setup_theme), [`after_setup_theme`](after_setup_theme), [`init`](init) and [`wp_loaded`](wp_loaded) action hooks.
File: `wp-settings.php`. [View all references](https://developer.wordpress.org/reference/files/wp-settings.php/)
```
do_action( 'plugins_loaded' );
```
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'wp_audio_shortcode_override', string $html, array $attr, string $content, int $instance ) apply\_filters( 'wp\_audio\_shortcode\_override', string $html, array $attr, string $content, int $instance )
=============================================================================================================
Filters the default audio shortcode output.
If the filtered output isn’t empty, it will be used instead of generating the default audio template.
`$html` string Empty variable to be replaced with shortcode markup. `$attr` array Attributes of the shortcode. @see [wp\_audio\_shortcode()](../functions/wp_audio_shortcode) More Arguments from wp\_audio\_shortcode( ... $attr ) Attributes of the audio shortcode.
* `src`stringURL to the source of the audio file. Default empty.
* `loop`stringThe `'loop'` attribute for the `<audio>` element. Default empty.
* `autoplay`stringThe `'autoplay'` attribute for the `<audio>` element. Default empty.
* `preload`stringThe `'preload'` attribute for the `<audio>` element. Default `'none'`.
* `class`stringThe `'class'` attribute for the `<audio>` element. Default `'wp-audio-shortcode'`.
* `style`stringThe `'style'` attribute for the `<audio>` element. Default 'width: 100%;'.
`$content` string Shortcode content. `$instance` int Unique numeric ID of this audio shortcode instance. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$override = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instance );
```
| 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. |
wordpress do_action( 'before_wp_tiny_mce', array $mce_settings ) do\_action( 'before\_wp\_tiny\_mce', array $mce\_settings )
===========================================================
Fires immediately before the TinyMCE settings are printed.
`$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( 'before_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_{$this->post_type}_query", array $args, WP_REST_Request $request ) apply\_filters( "rest\_{$this->post\_type}\_query", array $args, WP\_REST\_Request $request )
=============================================================================================
Filters [WP\_Query](../classes/wp_query) arguments when querying posts 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_post_query`
* `rest_page_query`
* `rest_attachment_query`
Enables adding extra arguments or setting defaults for a post collection request.
`$args` array Array of arguments for [WP\_Query](../classes/wp_query). `$request` [WP\_REST\_Request](../classes/wp_rest_request) The REST API request. 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/)
```
$args = apply_filters( "rest_{$this->post_type}_query", $args, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::get\_items()](../classes/wp_rest_posts_controller/get_items) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Retrieves a collection of posts. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Moved after the `tax_query` query arg is generated. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'recovery_mode_email_rate_limit', int $rate_limit ) apply\_filters( 'recovery\_mode\_email\_rate\_limit', int $rate\_limit )
========================================================================
Filters the rate limit between sending new recovery mode email links.
`$rate_limit` int Time to wait in seconds. Defaults to 1 day. File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
return apply_filters( 'recovery_mode_email_rate_limit', DAY_IN_SECONDS );
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::get\_email\_rate\_limit()](../classes/wp_recovery_mode/get_email_rate_limit) wp-includes/class-wp-recovery-mode.php | Gets the rate limit between sending new recovery mode email links. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'body_class', string[] $classes, string[] $class ) apply\_filters( 'body\_class', string[] $classes, string[] $class )
===================================================================
Filters the list of CSS body class names for the current post or page.
`$classes` string[] An array of body class names. `$class` string[] An array of additional class names added to the body. Note that the filter function **must** return the array of classes after it is finished processing, or all of the classes will be cleared and could seriously impact the visual state of a user’s site.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
$classes = apply_filters( 'body_class', $classes, $class );
```
| Used By | Description |
| --- | --- |
| [get\_body\_class()](../functions/get_body_class) wp-includes/post-template.php | Retrieves an array of the class names for the body element. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_query_search_exclusion_prefix', string $exclusion_prefix ) apply\_filters( 'wp\_query\_search\_exclusion\_prefix', string $exclusion\_prefix )
===================================================================================
Filters the prefix that indicates that a search term should be excluded from results.
`$exclusion_prefix` string The prefix. Default `'-'`. Returning an empty value disables exclusions. File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$exclusion_prefix = apply_filters( 'wp_query_search_exclusion_prefix', '-' );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::parse\_search()](../classes/wp_query/parse_search) wp-includes/class-wp-query.php | Generates SQL for the WHERE clause based on passed search terms. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'ms_sites_list_table_query_args', array $args ) apply\_filters( 'ms\_sites\_list\_table\_query\_args', array $args )
====================================================================
Filters the arguments for the site query in the sites list table.
`$args` array An array of [get\_sites()](../functions/get_sites) arguments. More Arguments from get\_sites( ... $args ) Array or query string of site query parameters.
* `site__in`int[]Array of site IDs to include.
* `site__not_in`int[]Array of site IDs to exclude.
* `count`boolWhether to return a site count (true) or array of site objects.
Default false.
* `date_query`arrayDate query clauses to limit sites by. See [WP\_Date\_Query](../classes/wp_date_query).
Default null.
* `fields`stringSite fields to return. Accepts `'ids'` (returns an array of site IDs) or empty (returns an array of complete site objects).
* `ID`intA site ID to only return that site.
* `number`intMaximum number of sites to retrieve. Default 100.
* `offset`intNumber of sites 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|arraySite status or array of statuses. Accepts:
+ `'id'`
+ `'domain'`
+ `'path'`
+ `'network_id'`
+ `'last_updated'`
+ `'registered'`
+ `'domain_length'`
+ `'path_length'`
+ `'site__in'`
+ `'network__in'`
+ `'deleted'`
+ `'mature'`
+ `'spam'`
+ `'archived'`
+ `'public'`
+ false, an empty array, or `'none'` to disable `ORDER BY` clause. Default `'id'`.
* `order`stringHow to order retrieved sites. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
* `network_id`intLimit results to those affiliated with a given network ID. If 0, include all networks. Default 0.
* `network__in`int[]Array of network IDs to include affiliated sites for.
* `network__not_in`int[]Array of network IDs to exclude affiliated sites for.
* `domain`stringLimit results to those affiliated with a given domain.
* `domain__in`string[]Array of domains to include affiliated sites for.
* `domain__not_in`string[]Array of domains to exclude affiliated sites for.
* `path`stringLimit results to those affiliated with a given path.
* `path__in`string[]Array of paths to include affiliated sites for.
* `path__not_in`string[]Array of paths to exclude affiliated sites for.
* `public`intLimit results to public sites. Accepts `'1'` or `'0'`.
* `archived`intLimit results to archived sites. Accepts `'1'` or `'0'`.
* `mature`intLimit results to mature sites. Accepts `'1'` or `'0'`.
* `spam`intLimit results to spam sites. Accepts `'1'` or `'0'`.
* `deleted`intLimit results to deleted sites. Accepts `'1'` or `'0'`.
* `lang_id`intLimit results to a language ID.
* `lang__in`string[]Array of language IDs to include affiliated sites for.
* `lang__not_in`string[]Array of language IDs to exclude affiliated sites for.
* `search`stringSearch term(s) to retrieve matching sites for.
* `search_columns`string[]Array of column names to be searched. Accepts `'domain'` and `'path'`.
Default empty array.
* `update_site_cache`boolWhether to prime the cache for found sites. Default true.
* `update_site_meta_cache`boolWhether to prime the metadata cache for found sites. 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-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/)
```
$args = apply_filters( 'ms_sites_list_table_query_args', $args );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Sites\_List\_Table::prepare\_items()](../classes/wp_ms_sites_list_table/prepare_items) wp-admin/includes/class-wp-ms-sites-list-table.php | Prepares the list of sites for display. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_sitemaps_post_types', WP_Post_Type[] $post_types ) apply\_filters( 'wp\_sitemaps\_post\_types', WP\_Post\_Type[] $post\_types )
============================================================================
Filters the list of post object sub types available within the sitemap.
`$post_types` [WP\_Post\_Type](../classes/wp_post_type)[] Array of registered post type objects keyed by their 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/)
```
return apply_filters( 'wp_sitemaps_post_types', $post_types );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Posts::get\_object\_subtypes()](../classes/wp_sitemaps_posts/get_object_subtypes) wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | Returns the public post types, which excludes nav\_items and similar types. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action_ref_array( 'parse_query', WP_Query $query ) do\_action\_ref\_array( 'parse\_query', WP\_Query $query )
==========================================================
Fires after the main query vars have been parsed.
`$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). parse\_query is an action triggered after [WP\_Query::parse\_query()](../classes/wp_query/parse_query) has set up query variables (such as the various `is_` variables used for [conditional tags](https://developer.wordpress.org/themes/basics/conditional-tags/)).
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( 'parse_query', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::parse\_query()](../classes/wp_query/parse_query) wp-includes/class-wp-query.php | Parse a query string and set query type booleans. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'pre_http_request', false|array|WP_Error $preempt, array $parsed_args, string $url ) apply\_filters( 'pre\_http\_request', false|array|WP\_Error $preempt, array $parsed\_args, string $url )
========================================================================================================
Filters the preemptive return value of an HTTP request.
Returning a non-false value from the filter will short-circuit the HTTP request and return early with that value. A filter should return one of:
* An array containing ‘headers’, ‘body’, ‘response’, ‘cookies’, and ‘filename’ elements
* A [WP\_Error](../classes/wp_error) instance
* boolean false to avoid short-circuiting the response
Returning any other value may result in unexpected behaviour.
`$preempt` false|array|[WP\_Error](../classes/wp_error) A preemptive return value of an HTTP request. Default false. `$parsed_args` array 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/)
```
$pre = apply_filters( 'pre_http_request', false, $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.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'get_delete_post_link', string $link, int $post_id, bool $force_delete ) apply\_filters( 'get\_delete\_post\_link', string $link, int $post\_id, bool $force\_delete )
=============================================================================================
Filters the post delete link.
`$link` string The delete link. `$post_id` int Post ID. `$force_delete` bool Whether to bypass the Trash and force deletion. Default false. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, "$action-post_{$post->ID}" ), $post->ID, $force_delete );
```
| Used By | Description |
| --- | --- |
| [get\_delete\_post\_link()](../functions/get_delete_post_link) wp-includes/link-template.php | Retrieves the delete posts link for post. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( "add_site_option_{$option}", string $option, mixed $value, int $network_id ) do\_action( "add\_site\_option\_{$option}", string $option, mixed $value, int $network\_id )
============================================================================================
Fires after a specific network option has been successfully added.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$option` string Name of the network option. `$value` mixed 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( "add_site_option_{$option}", $option, $value, $network_id );
```
| Used By | Description |
| --- | --- |
| [add\_network\_option()](../functions/add_network_option) wp-includes/option.php | Adds a new network option. |
| 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( 'upload_per_page', int $media_per_page ) apply\_filters( 'upload\_per\_page', int $media\_per\_page )
============================================================
Filters the number of items to list per page when listing media items.
`$media_per_page` int Number of media to list. Default 20. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page );
```
| Used By | Description |
| --- | --- |
| [wp\_edit\_attachments\_query\_vars()](../functions/wp_edit_attachments_query_vars) wp-admin/includes/post.php | Returns the query variables for the current attachments request. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'ngettext_with_context', string $translation, string $single, string $plural, int $number, string $context, string $domain ) apply\_filters( 'ngettext\_with\_context', string $translation, string $single, string $plural, int $number, string $context, string $domain )
==============================================================================================================================================
Filters the singular or plural form of a string with gettext context.
`$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. `$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 and plurals at the same time (`[\_nx()](../functions/_nx)`).
**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 such as `[\_x()](../functions/_x)`, see filter hook [`gettext_with_context()`](gettext_with_context).
File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );
```
| Used By | Description |
| --- | --- |
| [\_nx()](../functions/_nx) wp-includes/l10n.php | Translates and retrieves the singular or plural form based on the supplied number, with gettext context. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( "register_{$post_type}_post_type_args", array $args, string $post_type ) apply\_filters( "register\_{$post\_type}\_post\_type\_args", array $args, string $post\_type )
==============================================================================================
Filters the arguments for registering a specific post type.
The dynamic portion of the filter name, `$post_type`, refers to the post type key.
Possible hook names include:
* `register_post_post_type_args`
* `register_page_post_type_args`
`$args` array Array of arguments for registering a post type.
See the [register\_post\_type()](../functions/register_post_type) function for accepted arguments. More Arguments from register\_post\_type( ... $args ) Post type registration arguments. `$post_type` string Post type key. File: `wp-includes/class-wp-post-type.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-post-type.php/)
```
$args = apply_filters( "register_{$post_type}_post_type_args", $args, $this->name );
```
| Used By | Description |
| --- | --- |
| [WP\_Post\_Type::set\_props()](../classes/wp_post_type/set_props) wp-includes/class-wp-post-type.php | Sets post type properties. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( "plugin_action_links_{$plugin_file}", string[] $actions, string $plugin_file, array $plugin_data, string $context ) apply\_filters( "plugin\_action\_links\_{$plugin\_file}", string[] $actions, string $plugin\_file, array $plugin\_data, string $context )
=========================================================================================================================================
Filters the list of action links displayed for a specific plugin 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.
`$actions` string[] An array of plugin action links. By default this can include `'activate'`, `'deactivate'`, and `'delete'`. With Multisite active this can also include `'network_active'` and `'network_only'` items. `$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'`. Applied to the list of links to display on the plugins page (beside the activate/deactivate links).
Basic Example:
```
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'add_action_links' );
function add_action_links ( $actions ) {
$mylinks = array(
'<a href="' . admin_url( 'options-general.php?page=myplugin' ) . '">Settings</a>',
);
$actions = array_merge( $actions, $mylinks );
return $actions;
}
```
When the ‘plugin\_action\_links\_(plugin file name)’ filter is called, it is passed one parameter: the links to show on the plugins overview page in an array.
The (plugin file name) placeholder stands for the plugin name that you can normally get from the magic constant \_\_FILE\_\_.
```
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'my_plugin_action_links' );
function my_plugin_action_links( $actions ) {
$actions[] = '<a href="'. esc_url( get_admin_url(null, 'options-general.php?page=gpaisr') ) .'">Settings</a>';
$actions[] = '<a href="http://wp-buddy.com" target="_blank">More plugins by WP-Buddy</a>';
return $actions;
}
```
Will result in something like this:
We can also edit the link to put them in front of the deactivate and edit link. Here is an example:
```
add_filter( 'plugin_action_links', 'ttt_wpmdr_add_action_plugin', 10, 5 );
function ttt_wpmdr_add_action_plugin( $actions, $plugin_file )
{
static $plugin;
if (!isset($plugin))
$plugin = plugin_basename(__FILE__);
if ($plugin == $plugin_file) {
$settings = array('settings' => '<a href="options-general.php#redirecthere">' . __('Settings', 'General') . '</a>');
$site_link = array('support' => '<a href="http://thetechterminus.com" target="_blank">Support</a>');
$actions = array_merge($settings, $actions);
$actions = array_merge($site_link, $actions);
}
return $actions;
}
```
This will work with both single file plugin and a folder plugin:
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( "plugin_action_links_{$plugin_file}", $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 |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `'Edit'` link was removed from the list of action links. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( "{$adjacent}_post_link", string $output, string $format, string $link, WP_Post $post, string $adjacent ) apply\_filters( "{$adjacent}\_post\_link", string $output, string $format, string $link, WP\_Post $post, string $adjacent )
===========================================================================================================================
Filters the adjacent post link.
The dynamic portion of the hook name, `$adjacent`, refers to the type of adjacency, ‘next’ or ‘previous’.
Possible hook names include:
* `next_post_link`
* `previous_post_link`
`$output` string The adjacent post link. `$format` string Link anchor format. `$link` string Link permalink format. `$post` [WP\_Post](../classes/wp_post) The adjacent post. `$adjacent` string Whether the post is previous or next. 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_link", $output, $format, $link, $post, $adjacent );
```
| Used By | Description |
| --- | --- |
| [get\_adjacent\_post\_link()](../functions/get_adjacent_post_link) wp-includes/link-template.php | Retrieves the adjacent post link. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Added the `$adjacent` parameter. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_widget_type', WP_REST_Response $response, array $widget_type, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_widget\_type', WP\_REST\_Response $response, array $widget\_type, WP\_REST\_Request $request )
==============================================================================================================================
Filters the REST API response for a widget type.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$widget_type` array The array of widget data. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request object. 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/)
```
return apply_filters( 'rest_prepare_widget_type', $response, $widget_type, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_widget_types_controller/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 do_action( 'pre_comment_on_post', int $comment_post_id ) do\_action( 'pre\_comment\_on\_post', int $comment\_post\_id )
==============================================================
Fires before a comment is posted.
`$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( 'pre_comment_on_post', $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.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'widgets_init' ) do\_action( 'widgets\_init' )
=============================
Fires after all default WordPress widgets have been registered.
File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
do_action( 'widgets_init' );
```
| Used By | Description |
| --- | --- |
| [wp\_widgets\_init()](../functions/wp_widgets_init) wp-includes/widgets.php | Registers all of the default WordPress widgets on startup. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action( 'posts_selection', string $selection ) do\_action( 'posts\_selection', string $selection )
===================================================
Fires to announce the query’s current selection parameters.
For use by caching plugins.
`$selection` string The assembled selection query. This action hook is executed prior to the query and is passed a string containing the assembled query. Note that this string is NOT passed by reference and manipulating this string will not affect the actual query. This is intended to be used primarily by caching plugins.
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );
```
| 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. |
| programming_docs |
wordpress apply_filters_ref_array( 'sites_pre_query', array|int|null $site_data, WP_Site_Query $query ) apply\_filters\_ref\_array( 'sites\_pre\_query', array|int|null $site\_data, WP\_Site\_Query $query )
=====================================================================================================
Filters the site data before the get\_sites query takes place.
Return a non-null value to bypass WordPress’ default site 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 site count as an integer.
* When `'ids' === $this->query_vars['fields']`, the filter should return an array of site IDs.
* Otherwise the filter should return an array of [WP\_Site](../classes/wp_site) objects.
Note that if the filter returns an array of site data, it will be assigned to the `sites` property of the current [WP\_Site\_Query](../classes/wp_site_query) instance.
Filtering functions that require pagination information are encouraged to set the `found_sites` and `max_num_pages` properties of the [WP\_Site\_Query](../classes/wp_site_query) object, passed to the filter by reference. If [WP\_Site\_Query](../classes/wp_site_query) does not perform a database query, it will not have enough information to generate these values itself.
`$site_data` array|int|null Return an array of site data to short-circuit WP's site query, the site count as an integer if `$this->query_vars['count']` is set, or null to run the normal queries. `$query` [WP\_Site\_Query](../classes/wp_site_query) The [WP\_Site\_Query](../classes/wp_site_query) instance, 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/)
```
$site_data = apply_filters_ref_array( 'sites_pre_query', array( $site_data, &$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 |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The returned array of site data is assigned to the `sites` property of the current [WP\_Site\_Query](../classes/wp_site_query) instance. |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'wp_header_image_attachment_metadata', array $metadata ) apply\_filters( 'wp\_header\_image\_attachment\_metadata', array $metadata )
============================================================================
Filters the header image attachment metadata.
* [wp\_generate\_attachment\_metadata()](../functions/wp_generate_attachment_metadata)
`$metadata` array Attachment metadata. 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/)
```
$metadata = apply_filters( 'wp_header_image_attachment_metadata', $metadata );
```
| Used By | Description |
| --- | --- |
| [Custom\_Image\_Header::insert\_attachment()](../classes/custom_image_header/insert_attachment) wp-admin/includes/class-custom-image-header.php | Insert an attachment and its metadata. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress do_action_deprecated( 'private_to_published', int $post_id ) do\_action\_deprecated( 'private\_to\_published', int $post\_id )
=================================================================
This hook has been deprecated. Use [‘private\_to\_publish’](private_to_publish) instead.
Fires when a post’s status is transitioned from private to published.
`$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_deprecated( 'private_to_published', array( $post->ID ), '2.3.0', 'private_to_publish' );
```
| Used By | Description |
| --- | --- |
| [\_transition\_post\_status()](../functions/_transition_post_status) wp-includes/post.php | Hook for managing future post transitions to published. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Use ['private\_to\_publish'](private_to_publish) instead. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'auto_plugin_theme_update_email', array $email, string $type, array $successful_updates, array $failed_updates ) apply\_filters( 'auto\_plugin\_theme\_update\_email', array $email, string $type, array $successful\_updates, array $failed\_updates )
======================================================================================================================================
Filters the email sent following an automatic background update for plugins and themes.
`$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'`, `'mixed'`. `$successful_updates` array A list of updates that succeeded. `$failed_updates` array A list of updates that failed. 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_plugin_theme_update_email', $email, $type, $successful_updates, $failed_updates );
```
| Used By | Description |
| --- | --- |
| [WP\_Automatic\_Updater::send\_plugin\_theme\_email()](../classes/wp_automatic_updater/send_plugin_theme_email) wp-admin/includes/class-wp-automatic-updater.php | Sends an email upon the completion or failure of a plugin or theme background update. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_die_handler', callable $callback ) apply\_filters( 'wp\_die\_handler', callable $callback )
========================================================
Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-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_handler', '_default_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 |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'plugin_auto_update_debug_string', string $auto_updates_string, string $plugin_path, array $plugin, bool $enabled ) apply\_filters( 'plugin\_auto\_update\_debug\_string', string $auto\_updates\_string, string $plugin\_path, array $plugin, bool $enabled )
==========================================================================================================================================
Filters the text string of the auto-updates setting for each plugin in the Site Health debug data.
`$auto_updates_string` string The string output for the auto-updates column. `$plugin_path` string The path to the plugin file. `$plugin` array An array of plugin data. `$enabled` bool Whether auto-updates are enabled for this item. File: `wp-admin/includes/class-wp-debug-data.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-debug-data.php/)
```
$auto_updates_string = apply_filters( 'plugin_auto_update_debug_string', $auto_updates_string, $plugin_path, $plugin, $enabled );
```
| Used By | Description |
| --- | --- |
| [WP\_Debug\_Data::debug\_data()](../classes/wp_debug_data/debug_data) wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'allowed_http_origins', string[] $allowed_origins ) apply\_filters( 'allowed\_http\_origins', string[] $allowed\_origins )
======================================================================
Change the origin types allowed for HTTP requests.
`$allowed_origins` string[] Array of default allowed HTTP origins.
* stringNon-secure URL for admin origin.
* `1`stringSecure URL for admin origin.
* `2`stringNon-secure URL for home origin.
* `3`stringSecure URL for home origin.
File: `wp-includes/http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/http.php/)
```
return apply_filters( 'allowed_http_origins', $allowed_origins );
```
| Used By | Description |
| --- | --- |
| [get\_allowed\_http\_origins()](../functions/get_allowed_http_origins) wp-includes/http.php | Retrieve list of allowed HTTP origins. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'wp_calculate_image_srcset', array $sources, array $size_array, string $image_src, array $image_meta, int $attachment_id ) apply\_filters( 'wp\_calculate\_image\_srcset', array $sources, array $size\_array, string $image\_src, array $image\_meta, int $attachment\_id )
=================================================================================================================================================
Filters an image’s ‘srcset’ sources.
`$sources` array One or more arrays of source data to include in the 'srcset'.
* `width`array
+ `url`stringThe URL of an image source.
+ `descriptor`stringThe descriptor type used in the image candidate string, either `'w'` or `'x'`.
+ `value`intThe source width if paired with a `'w'` descriptor, or a pixel density value if paired with an `'x'` descriptor. `$size_array` array 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. `$image_meta` array The image meta data as returned by '[wp\_get\_attachment\_metadata()](../functions/wp_get_attachment_metadata) '. `$attachment_id` int Image attachment ID or 0. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$sources = apply_filters( 'wp_calculate_image_srcset', $sources, $size_array, $image_src, $image_meta, $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.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_using_themes', bool $wp_using_themes ) apply\_filters( 'wp\_using\_themes', bool $wp\_using\_themes )
==============================================================
Filters whether the current request should use themes.
`$wp_using_themes` bool Whether the current request should use themes. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
return apply_filters( 'wp_using_themes', defined( 'WP_USE_THEMES' ) && WP_USE_THEMES );
```
| Used By | Description |
| --- | --- |
| [wp\_using\_themes()](../functions/wp_using_themes) wp-includes/load.php | Determines whether the current request should use themes. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'post_type_link', string $post_link, WP_Post $post, bool $leavename, bool $sample ) apply\_filters( 'post\_type\_link', string $post\_link, WP\_Post $post, bool $leavename, bool $sample )
=======================================================================================================
Filters the permalink for a post of a custom post type.
`$post_link` string The post's permalink. `$post` [WP\_Post](../classes/wp_post) The post in question. `$leavename` bool Whether to keep the post name. `$sample` bool Is it a sample permalink. `post_type_link` is a filter applied to the permalink URL for a post or custom post type prior to being returned by the function [get\_post\_permalink()](../functions/get_post_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_type_link', $post_link, $post, $leavename, $sample );
```
| Used By | Description |
| --- | --- |
| [get\_post\_permalink()](../functions/get_post_permalink) wp-includes/link-template.php | Retrieves the permalink for a post of a custom post type. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'esc_textarea', string $safe_text, string $text ) apply\_filters( 'esc\_textarea', string $safe\_text, string $text )
===================================================================
Filters a string cleaned and escaped for output in a textarea element.
`$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( 'esc_textarea', $safe_text, $text );
```
| Used By | Description |
| --- | --- |
| [esc\_textarea()](../functions/esc_textarea) wp-includes/formatting.php | Escaping for textarea values. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'check_is_user_spammed', bool $spammed, WP_User $user ) apply\_filters( 'check\_is\_user\_spammed', bool $spammed, WP\_User $user )
===========================================================================
Filters whether the user has been marked as a spammer.
`$spammed` bool Whether the user is considered a spammer. `$user` [WP\_User](../classes/wp_user) User to check against. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$spammed = apply_filters( 'check_is_user_spammed', is_user_spammy( $user ), $user );
```
| Used By | Description |
| --- | --- |
| [wp\_authenticate\_spam\_check()](../functions/wp_authenticate_spam_check) wp-includes/user.php | For Multisite blogs, checks if the authenticated user has been marked as a spammer, or if the user’s primary blog has been marked as spam. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'deprecated_constructor_trigger_error', bool $trigger ) apply\_filters( 'deprecated\_constructor\_trigger\_error', bool $trigger )
==========================================================================
Filters whether to trigger an error for deprecated functions.
`WP_DEBUG` must be true in addition to the filter evaluating to true.
`$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_constructor_trigger_error', true ) ) {
```
| 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.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( "install_plugins_table_api_args_{$tab}", array|false $args ) apply\_filters( "install\_plugins\_table\_api\_args\_{$tab}", array|false $args )
=================================================================================
Filters API request arguments for each Add Plugins screen tab.
The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs.
Possible hook names include:
* `install_plugins_table_api_args_favorites`
* `install_plugins_table_api_args_featured`
* `install_plugins_table_api_args_popular`
* `install_plugins_table_api_args_recommended`
* `install_plugins_table_api_args_upload`
* `install_plugins_table_api_args_search`
* `install_plugins_table_api_args_beta`
`$args` array|false Plugin install API arguments. 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/)
```
$args = apply_filters( "install_plugins_table_api_args_{$tab}", $args );
```
| 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 |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'post_column_taxonomy_links', string[] $term_links, string $taxonomy, WP_Term[] $terms ) apply\_filters( 'post\_column\_taxonomy\_links', string[] $term\_links, string $taxonomy, WP\_Term[] $terms )
=============================================================================================================
Filters the links in `$taxonomy` column of edit.php.
`$term_links` string[] Array of term editing links. `$taxonomy` string Taxonomy name. `$terms` [WP\_Term](../classes/wp_term)[] Array of term objects appearing in the post row. 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/)
```
$term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms );
```
| 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 |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'manage_pages_columns', string[] $post_columns ) apply\_filters( 'manage\_pages\_columns', string[] $post\_columns )
===================================================================
Filters the columns displayed in the Pages list table.
`$post_columns` string[] An associative array of column headings. * Applied to the list of columns to print on the manage [Pages Screen](https://wordpress.org/support/article/pages-screen/). Filter function argument/return value is an associative array where the element key is the name of the column, and the value is the header text for that column.
* See also the action hook <manage_pages_custom_column>, which alters the column information for each page in the edit table.
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.
* **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_pages_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 |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( "manage_taxonomies_for_{$post_type}_columns", string[] $taxonomies, string $post_type ) apply\_filters( "manage\_taxonomies\_for\_{$post\_type}\_columns", string[] $taxonomies, string $post\_type )
=============================================================================================================
Filters the taxonomy columns in the Posts list table.
The dynamic portion of the hook name, `$post_type`, refers to the post type slug.
Possible hook names include:
* `manage_taxonomies_for_post_columns`
* `manage_taxonomies_for_page_columns`
`$taxonomies` string[] Array of taxonomy names to show columns for. `$post_type` string The post type. 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/)
```
$taxonomies = apply_filters( "manage_taxonomies_for_{$post_type}_columns", $taxonomies, $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 |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'wpmu_signup_blog_notification_subject', string $subject, string $domain, string $path, string $title, string $user_login, string $user_email, string $key, array $meta ) apply\_filters( 'wpmu\_signup\_blog\_notification\_subject', string $subject, string $domain, string $path, string $title, string $user\_login, string $user\_email, string $key, array $meta )
===============================================================================================================================================================================================
Filters the subject of the new blog notification email.
`$subject` string Subject 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_subject',
/* translators: New site notification email subject. 1: Network title, 2: New site URL. */
_x( '[%1$s] Activate %2$s', 'New site notification email subject' ),
$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( 'get_comment_excerpt', string $excerpt, string $comment_ID, WP_Comment $comment ) apply\_filters( 'get\_comment\_excerpt', string $excerpt, string $comment\_ID, WP\_Comment $comment )
=====================================================================================================
Filters the retrieved comment excerpt.
`$excerpt` string The comment excerpt text. `$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_excerpt', $excerpt, $comment->comment_ID, $comment );
```
| 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.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( 'media_submitbox_misc_sections', array $fields, WP_Post $post ) apply\_filters( 'media\_submitbox\_misc\_sections', array $fields, WP\_Post $post )
===================================================================================
Filters the audio and video metadata fields to be shown in the publish meta box.
The key for each item in the array should correspond to an attachment metadata key, and the value should be the desired label.
`$fields` array An array of the attachment metadata keys and labels. `$post` [WP\_Post](../classes/wp_post) [WP\_Post](../classes/wp_post) object for the current attachment. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$fields = apply_filters( 'media_submitbox_misc_sections', $fields, $post );
```
| Used By | Description |
| --- | --- |
| [attachment\_submitbox\_metadata()](../functions/attachment_submitbox_metadata) wp-admin/includes/media.php | Displays non-editable attachment metadata in the publish meta box. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$post` parameter. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'get_post_gallery', array $gallery, int|WP_Post $post, array $galleries ) apply\_filters( 'get\_post\_gallery', array $gallery, int|WP\_Post $post, array $galleries )
============================================================================================
Filters the first-found post gallery.
`$gallery` array The first-found post gallery. `$post` int|[WP\_Post](../classes/wp_post) Post ID or object. `$galleries` array Associative array of all found post galleries. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'get_post_gallery', $gallery, $post, $galleries );
```
| Used By | Description |
| --- | --- |
| [get\_post\_gallery()](../functions/get_post_gallery) wp-includes/media.php | Checks a specified post’s content for gallery and, if present, return the first |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'wp_script_attributes', array $attributes ) apply\_filters( 'wp\_script\_attributes', array $attributes )
=============================================================
Filters attributes to be added to a script tag.
`$attributes` array Key-value pairs representing `<script>` tag attributes.
Only the attribute name is added to the `<script>` tag for entries with a boolean value, and that are true. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
$attributes = apply_filters( 'wp_script_attributes', $attributes );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_script\_tag()](../functions/wp_get_script_tag) wp-includes/script-loader.php | Formats loader tags. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'get_the_archive_description', string $description ) apply\_filters( 'get\_the\_archive\_description', string $description )
=======================================================================
Filters the archive description.
`$description` string Archive description to be displayed. 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_archive_description', $description );
```
| Used By | Description |
| --- | --- |
| [get\_the\_archive\_description()](../functions/get_the_archive_description) wp-includes/general-template.php | Retrieves the description for an author, post type, or term archive. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'upgrader_package_options', array $options ) apply\_filters( 'upgrader\_package\_options', array $options )
==============================================================
Filters the package options before running an update.
See also [‘upgrader\_process\_complete’](upgrader_process_complete).
`$options` array Options used by the upgrader.
* `package`stringPackage for update.
* `destination`stringUpdate location.
* `clear_destination`boolClear the destination resource.
* `clear_working`boolClear the working resource.
* `abort_if_destination_exists`boolAbort if the Destination directory exists.
* `is_multi`boolWhether the upgrader is running multiple times.
* `hook_extra`array Extra hook arguments.
+ `action`stringType of action. Default `'update'`.
+ `type`stringType of update process. Accepts `'plugin'`, `'theme'`, or `'core'`.
+ `bulk`boolWhether the update process is a bulk update. Default true.
+ `plugin`stringPath to the plugin file relative to the plugins directory.
+ `theme`stringThe stylesheet or template name of the theme.
+ `language_update_type`stringThe language pack update type. Accepts `'plugin'`, `'theme'`, or `'core'`.
+ `language_update`objectThe language pack update offer. File: `wp-admin/includes/class-wp-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-upgrader.php/)
```
$options = apply_filters( 'upgrader_package_options', $options );
```
| Used By | Description |
| --- | --- |
| [WP\_Upgrader::run()](../classes/wp_upgrader/run) wp-admin/includes/class-wp-upgrader.php | Run an upgrade/installation. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'richedit_pre', string $output ) apply\_filters( 'richedit\_pre', string $output )
=================================================
This hook has been deprecated.
Filters text returned for the rich text editor.
This filter is first evaluated, and the value returned, if an empty string is passed to [wp\_richedit\_pre()](../functions/wp_richedit_pre) . If an empty string is passed, it results in a break tag and line feed.
If a non-empty string is passed, the filter is evaluated on the [wp\_richedit\_pre()](../functions/wp_richedit_pre) return after being formatted.
`$output` string Text for the rich text editor. File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
return apply_filters( 'richedit_pre', '' );
```
| Used By | Description |
| --- | --- |
| [wp\_richedit\_pre()](../functions/wp_richedit_pre) wp-includes/deprecated.php | Formats text for the rich text editor. |
| [\_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 |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | This hook has been deprecated. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress do_action_deprecated( 'add_link_category_form_pre', object $arg ) do\_action\_deprecated( 'add\_link\_category\_form\_pre', object $arg )
=======================================================================
This hook has been deprecated. Use [‘{$taxonomy](../functions/%e2%80%98taxonomy)\_pre\_add\_form’} instead.
Fires before the link 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_link_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.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'image_strip_meta', bool $strip_meta ) apply\_filters( 'image\_strip\_meta', bool $strip\_meta )
=========================================================
Filters whether to strip metadata from images when they’re resized.
This filter only applies when resizing using the Imagick editor since GD always strips profiles by default.
`$strip_meta` bool Whether to strip image metadata during resizing. Default true. File: `wp-includes/class-wp-image-editor-imagick.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor-imagick.php/)
```
if ( apply_filters( 'image_strip_meta', $strip_meta ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Image\_Editor\_Imagick::thumbnail\_image()](../classes/wp_image_editor_imagick/thumbnail_image) wp-includes/class-wp-image-editor-imagick.php | Efficiently resize the current image |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress do_action( 'set_object_terms', int $object_id, array $terms, array $tt_ids, string $taxonomy, bool $append, array $old_tt_ids ) do\_action( 'set\_object\_terms', int $object\_id, array $terms, array $tt\_ids, string $taxonomy, bool $append, array $old\_tt\_ids )
======================================================================================================================================
Fires after an object’s terms have been set.
`$object_id` int Object ID. `$terms` array An array of object term IDs or slugs. `$tt_ids` array An array of term taxonomy IDs. `$taxonomy` string Taxonomy slug. `$append` bool Whether to append new terms to the old terms. `$old_tt_ids` array Old array of term taxonomy IDs. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );
```
| Used By | Description |
| --- | --- |
| [wp\_set\_object\_terms()](../functions/wp_set_object_terms) wp-includes/taxonomy.php | Creates term and taxonomy relationships. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'wp_after_admin_bar_render' ) do\_action( 'wp\_after\_admin\_bar\_render' )
=============================================
Fires after the admin bar is rendered.
File: `wp-includes/admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
```
do_action( 'wp_after_admin_bar_render' );
```
| 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( 'emoji_ext', string $extension ) apply\_filters( 'emoji\_ext', string $extension )
=================================================
Filters the extension of the emoji png files.
`$extension` string The emoji extension for png files. Default .png. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
'ext' => apply_filters( 'emoji_ext', '.png' ),
```
| 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 do_action( 'rest_insert_nav_menu_item', object $nav_menu_item, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_insert\_nav\_menu\_item', object $nav\_menu\_item, WP\_REST\_Request $request, bool $creating )
==================================================================================================================
Fires after a single menu item is 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_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( 'wp_validate_site_deletion', WP_Error $errors, WP_Site $old_site ) do\_action( 'wp\_validate\_site\_deletion', WP\_Error $errors, WP\_Site $old\_site )
====================================================================================
Fires before a site should be deleted from the database.
Plugins should amend the `$errors` object via its `WP_Error::add()` method. If any errors are present, the site will not be deleted.
`$errors` [WP\_Error](../classes/wp_error) Error object to add validation errors to. `$old_site` [WP\_Site](../classes/wp_site) The site object to be deleted. 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_deletion', $errors, $old_site );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_site()](../functions/wp_delete_site) wp-includes/ms-site.php | Deletes a site from the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_users_pre_url_list', array[]|null $url_list, int $page_num ) apply\_filters( 'wp\_sitemaps\_users\_pre\_url\_list', array[]|null $url\_list, int $page\_num )
================================================================================================
Filters the users 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. `$page_num` int Page of results. 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/)
```
$url_list = apply_filters(
'wp_sitemaps_users_pre_url_list',
null,
$page_num
);
```
| 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( 'wp_is_large_network', bool $is_large_network, string $component, int $count, int $network_id ) apply\_filters( 'wp\_is\_large\_network', bool $is\_large\_network, string $component, int $count, int $network\_id )
=====================================================================================================================
Filters whether the network is considered large.
`$is_large_network` bool Whether the network has more than 10000 users or sites. `$component` string The component to count. Accepts `'users'`, or `'sites'`. `$count` int The count of items for the component. `$network_id` int The ID of the network being checked. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
return apply_filters( 'wp_is_large_network', $is_large_network, 'users', $count, $network_id );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_large\_network()](../functions/wp_is_large_network) wp-includes/ms-functions.php | Determines whether or not we have a large network. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | The `$network_id` parameter has been added. |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'additional_capabilities_display', bool $enable, WP_User $profile_user ) apply\_filters( 'additional\_capabilities\_display', bool $enable, WP\_User $profile\_user )
============================================================================================
Filters whether to display additional capabilities for the user.
The ‘Additional Capabilities’ section will only be enabled if the number of the user’s capabilities exceeds their number of roles.
`$enable` bool Whether to display the capabilities. Default true. `$profile_user` [WP\_User](../classes/wp_user) The current [WP\_User](../classes/wp_user) object. File: `wp-admin/user-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/user-edit.php/)
```
$display_additional_caps = apply_filters( 'additional_capabilities_display', true, $profile_user );
```
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'image_downsize', bool|array $downsize, int $id, string|int[] $size ) apply\_filters( 'image\_downsize', bool|array $downsize, int $id, string|int[] $size )
======================================================================================
Filters whether to preempt the output of [image\_downsize()](../functions/image_downsize) .
Returning a truthy value from the filter will effectively short-circuit down-sizing the image, returning that value instead.
`$downsize` bool|array Whether to short-circuit the image downsize. `$id` int Attachment ID for 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/)
```
$out = apply_filters( 'image_downsize', false, $id, $size );
```
| 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. |
| [image\_downsize()](../functions/image_downsize) wp-includes/media.php | Scales an image to fit a particular size (such as ‘thumb’ or ‘medium’). |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.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. |
wordpress apply_filters( 'icon_dirs', string[] $uris ) apply\_filters( 'icon\_dirs', string[] $uris )
==============================================
Filters the array of icon directory URIs.
`$uris` string[] Array of icon directory URIs keyed by directory absolute path. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$dirs = apply_filters( 'icon_dirs', array( $icon_dir => $icon_dir_uri ) );
```
| 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.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_audio_extensions', string[] $extensions ) apply\_filters( 'wp\_audio\_extensions', string[] $extensions )
===============================================================
Filters the list of supported audio formats.
`$extensions` string[] An array of supported audio formats. Defaults are `'mp3'`, `'ogg'`, `'flac'`, `'m4a'`, `'wav'`. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'flac', 'm4a', 'wav' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_audio\_extensions()](../functions/wp_get_audio_extensions) wp-includes/media.php | Returns a filtered list of supported audio formats. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress do_action( 'submitlink_box' ) do\_action( 'submitlink\_box' )
===============================
Fires at the end of the Publish box in the Link editing screen.
File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
do_action( 'submitlink_box' );
```
| Used By | Description |
| --- | --- |
| [link\_submit\_meta\_box()](../functions/link_submit_meta_box) wp-admin/includes/meta-boxes.php | Displays link create form fields. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'rest_comment_collection_params', array $query_params ) apply\_filters( 'rest\_comment\_collection\_params', array $query\_params )
===========================================================================
Filters REST API collection parameters for the comments controller.
This filter registers the collection parameter, but does not map the collection parameter to an internal [WP\_Comment\_Query](../classes/wp_comment_query) parameter. Use the `rest_comment_query` filter to set [WP\_Comment\_Query](../classes/wp_comment_query) parameters.
`$query_params` array JSON Schema-formatted collection parameters. 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_comment_collection_params', $query_params );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::get\_collection\_params()](../classes/wp_rest_comments_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-comments-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( 'next_posts_link_attributes', string $attributes ) apply\_filters( 'next\_posts\_link\_attributes', string $attributes )
=====================================================================
Filters the anchor tag attributes for the next posts 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/)
```
$attr = apply_filters( 'next_posts_link_attributes', '' );
```
| Used By | Description |
| --- | --- |
| [get\_next\_posts\_link()](../functions/get_next_posts_link) wp-includes/link-template.php | Retrieves the next posts page link. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'dbdelta_queries', string[] $queries ) apply\_filters( 'dbdelta\_queries', string[] $queries )
=======================================================
Filters the dbDelta SQL queries.
`$queries` string[] An array of dbDelta SQL queries. File: `wp-admin/includes/upgrade.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/upgrade.php/)
```
$queries = apply_filters( 'dbdelta_queries', $queries );
```
| 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 apply_filters( 'user_request_action_confirmed_message', string $message, int $request_id ) apply\_filters( 'user\_request\_action\_confirmed\_message', string $message, int $request\_id )
================================================================================================
Filters the message displayed to a user when they confirm a data request.
`$message` string The message to the user. `$request_id` int The ID of the request being confirmed. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$message = apply_filters( 'user_request_action_confirmed_message', $message, $request_id );
```
| Used By | Description |
| --- | --- |
| [\_wp\_privacy\_account\_request\_confirmed\_message()](../functions/_wp_privacy_account_request_confirmed_message) wp-includes/user.php | Returns request confirmation message HTML. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'wp_http_ixr_client_headers', string[] $headers ) apply\_filters( 'wp\_http\_ixr\_client\_headers', string[] $headers )
=====================================================================
Filters the headers collection to be sent to the XML-RPC server.
`$headers` string[] Associative array of headers to be sent. File: `wp-includes/class-wp-http-ixr-client.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-ixr-client.php/)
```
$args['headers'] = apply_filters( 'wp_http_ixr_client_headers', $args['headers'] );
```
| Used By | Description |
| --- | --- |
| [WP\_HTTP\_IXR\_Client::query()](../classes/wp_http_ixr_client/query) wp-includes/class-wp-http-ixr-client.php | |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'generate_recovery_mode_key', string $token, string $key ) do\_action( 'generate\_recovery\_mode\_key', string $token, string $key )
=========================================================================
Fires when a recovery mode key is generated.
`$token` string The recovery data token. `$key` string The 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/)
```
do_action( 'generate_recovery_mode_key', $token, $key );
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode\_Key\_Service::generate\_and\_store\_recovery\_mode\_key()](../classes/wp_recovery_mode_key_service/generate_and_store_recovery_mode_key) wp-includes/class-wp-recovery-mode-key-service.php | Creates a recovery mode key. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( "edit_{$post_type}_per_page", int $posts_per_page ) apply\_filters( "edit\_{$post\_type}\_per\_page", int $posts\_per\_page )
=========================================================================
Filters the number of items per page to show for a specific ‘per\_page’ type.
The dynamic portion of the hook name, `$post_type`, refers to the post type.
Possible hook names include:
* `edit_post_per_page`
* `edit_page_per_page`
* `edit_attachment_per_page`
`$posts_per_page` int Number of posts to display per page for the given post type. Default 20. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$posts_per_page = apply_filters( "edit_{$post_type}_per_page", $posts_per_page );
```
| Used By | Description |
| --- | --- |
| [wp\_edit\_posts\_query()](../functions/wp_edit_posts_query) wp-admin/includes/post.php | Runs the query to fetch the posts for listing on the edit posts page. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_metadata', array $data, int $attachment_id ) apply\_filters( 'wp\_get\_attachment\_metadata', array $data, int $attachment\_id )
===================================================================================
Filters the attachment meta data.
`$data` array Array of meta data for the given attachment. `$attachment_id` int Attachment post 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_metadata', $data, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_metadata()](../functions/wp_get_attachment_metadata) wp-includes/post.php | Retrieves attachment metadata for attachment ID. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'can_add_user_to_blog', true|WP_Error $retval, int $user_id, string $role, int $blog_id ) apply\_filters( 'can\_add\_user\_to\_blog', true|WP\_Error $retval, int $user\_id, string $role, int $blog\_id )
================================================================================================================
Filters whether a user should be added to a site.
`$retval` true|[WP\_Error](../classes/wp_error) True if the user should be added to the site, error object otherwise. `$user_id` int User ID. `$role` string User role. `$blog_id` int Site ID. File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
$can_add_user = apply_filters( 'can_add_user_to_blog', true, $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 |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'edit_profile_url', string $url, int $user_id, string $scheme ) apply\_filters( 'edit\_profile\_url', string $url, int $user\_id, string $scheme )
==================================================================================
Filters the URL for a user’s profile editor.
`$url` string The complete URL including scheme and path. `$user_id` int The user ID. `$scheme` string Scheme to give the URL context. Accepts `'http'`, `'https'`, `'login'`, `'login_post'`, `'admin'`, `'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( 'edit_profile_url', $url, $user_id, $scheme );
```
| Used By | Description |
| --- | --- |
| [get\_edit\_profile\_url()](../functions/get_edit_profile_url) wp-includes/link-template.php | Retrieves the URL to the user’s profile editor. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_video_shortcode', string $output, array $atts, string $video, int $post_id, string $library ) apply\_filters( 'wp\_video\_shortcode', string $output, array $atts, string $video, int $post\_id, string $library )
====================================================================================================================
Filters the output of the video shortcode.
`$output` string Video shortcode HTML output. `$atts` array Array of video shortcode attributes. `$video` string Video file. `$post_id` int Post ID. `$library` string Media library used for the video shortcode. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
return apply_filters( 'wp_video_shortcode', $output, $atts, $video, $post_id, $library );
```
| Used By | Description |
| --- | --- |
| [wp\_video\_shortcode()](../functions/wp_video_shortcode) wp-includes/media.php | Builds the Video shortcode output. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_dispatch', mixed $result, WP_REST_Server $server, WP_REST_Request $request ) apply\_filters( 'rest\_pre\_dispatch', mixed $result, WP\_REST\_Server $server, WP\_REST\_Request $request )
============================================================================================================
Filters the pre-calculated result of a REST API dispatch request.
Allow hijacking the request before dispatching by returning a non-empty. The returned value will be used to serve the request instead.
`$result` mixed Response to replace the requested version with. Can be anything a normal endpoint can return, or null to not hijack the request. `$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_pre_dispatch', null, $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. |
| [WP\_REST\_Server::dispatch()](../classes/wp_rest_server/dispatch) wp-includes/rest-api/class-wp-rest-server.php | Matches the request to a callback and call it. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_is_comment_flood', bool $is_flood, string $comment_author_ip, string $comment_author_email, string $comment_date_gmt, bool $wp_error ) apply\_filters( 'wp\_is\_comment\_flood', bool $is\_flood, string $comment\_author\_ip, string $comment\_author\_email, string $comment\_date\_gmt, bool $wp\_error )
=====================================================================================================================================================================
Filters whether a comment is part of a comment flood.
The default check is [wp\_check\_comment\_flood()](../functions/wp_check_comment_flood) . See [check\_comment\_flood\_db()](../functions/check_comment_flood_db) .
`$is_flood` bool Is a comment flooding occurring? Default false. `$comment_author_ip` string Comment author's IP address. `$comment_author_email` string Comment author's email. `$comment_date_gmt` string GMT date the comment was posted. `$wp_error` bool Whether to return a [WP\_Error](../classes/wp_error) object instead of executing [wp\_die()](../functions/wp_die) or die() if a comment flood is occurring. More Arguments from wp\_die( ... $args ) Arguments to control behavior. If `$args` is an integer, then it is treated as the response code.
* `response`intThe HTTP response code. Default 200 for Ajax requests, 500 otherwise.
* `link_url`stringA URL to include a link to. Only works in combination with $link\_text.
Default empty string.
* `link_text`stringA label for the link to include. Only works in combination with $link\_url.
Default empty string.
* `back_link`boolWhether to include a link to go back. Default false.
* `text_direction`stringThe text direction. This is only useful internally, when WordPress is still loading and the site's locale is not set up yet. Accepts `'rtl'` and `'ltr'`.
Default is the value of [is\_rtl()](../functions/is_rtl) .
* `charset`stringCharacter set of the HTML output. Default `'utf-8'`.
* `code`stringError code to use. Default is `'wp_die'`, or the main error code if $message is a [WP\_Error](../classes/wp_error).
* `exit`boolWhether to exit the process after completion. Default true.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$is_flood = apply_filters(
'wp_is_comment_flood',
false,
$commentdata['comment_author_IP'],
$commentdata['comment_author_email'],
$commentdata['comment_date_gmt'],
$wp_error
);
```
| 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 |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$avoid_die` parameter was renamed to `$wp_error`. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( "{$taxonomy}_{$field}", mixed $value, int $term_id, string $context ) apply\_filters( "{$taxonomy}\_{$field}", mixed $value, int $term\_id, string $context )
=======================================================================================
Filters the taxonomy field sanitized for display.
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. `$term_id` int Term ID. `$context` string Context to retrieve the taxonomy field value. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$value = apply_filters( "{$taxonomy}_{$field}", $value, $term_id, $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( 'get_header_video_url', string $url ) apply\_filters( 'get\_header\_video\_url', string $url )
========================================================
Filters the header video URL.
`$url` string Header video URL, if available. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
$url = apply_filters( 'get_header_video_url', $url );
```
| Used By | Description |
| --- | --- |
| [get\_header\_video\_url()](../functions/get_header_video_url) wp-includes/theme.php | Retrieves header video URL for custom header. |
| Version | Description |
| --- | --- |
| [4.7.3](https://developer.wordpress.org/reference/since/4.7.3/) | Introduced. |
wordpress apply_filters( 'tag_feed_link', string $link, string $feed ) apply\_filters( 'tag\_feed\_link', string $link, string $feed )
===============================================================
Filters the post tag feed link.
`$link` string The tag 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( 'tag_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 |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'pre_auto_update', string $type, object $item, string $context ) do\_action( 'pre\_auto\_update', string $type, object $item, string $context )
==============================================================================
Fires immediately prior to an auto-update.
`$type` string The type of update being checked: `'core'`, `'theme'`, `'plugin'`, or `'translation'`. `$item` object The update offer. `$context` string The filesystem context (a path) against which filesystem access and status should be checked. 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( 'pre_auto_update', $type, $item, $context );
```
| Used By | Description |
| --- | --- |
| [WP\_Automatic\_Updater::update()](../classes/wp_automatic_updater/update) wp-admin/includes/class-wp-automatic-updater.php | Updates an item, if appropriate. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'post_playlist', string $output, array $attr, int $instance ) apply\_filters( 'post\_playlist', string $output, array $attr, int $instance )
==============================================================================
Filters the playlist output.
Returning a non-empty value from the filter will short-circuit generation of the default playlist output, returning the passed value instead.
`$output` string Playlist output. Default empty. `$attr` array An array of shortcode attributes. `$instance` int Unique numeric ID of this playlist shortcode instance. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$output = apply_filters( 'post_playlist', '', $attr, $instance );
```
| Used By | Description |
| --- | --- |
| [wp\_playlist\_shortcode()](../functions/wp_playlist_shortcode) wp-includes/media.php | Builds the Playlist shortcode output. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | The `$instance` parameter was added. |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'pre_load_script_translations', string|false|null $translations, string|false $file, string $handle, string $domain ) apply\_filters( 'pre\_load\_script\_translations', string|false|null $translations, string|false $file, string $handle, string $domain )
========================================================================================================================================
Pre-filters script translations for the given file, script handle and text domain.
Returning a non-null value allows to override the default logic, effectively short-circuiting the function.
`$translations` string|false|null JSON-encoded translation data. Default null. `$file` string|false Path to the translation file to load. False if there isn't one. `$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/)
```
$translations = apply_filters( 'pre_load_script_translations', null, $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( 'http_request_version', string $version, string $url ) apply\_filters( 'http\_request\_version', string $version, string $url )
========================================================================
Filters the version of the HTTP protocol used in a request.
`$version` string Version of HTTP used. Accepts `'1.0'` and `'1.1'`. Default `'1.0'`. `$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/)
```
'httpversion' => apply_filters( 'http_request_version', '1.0', $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 apply_filters( 'get_pung', string[] $pung ) apply\_filters( 'get\_pung', string[] $pung )
=============================================
Filters the list of already-pinged URLs for the given post.
`$pung` string[] Array of URLs already pinged for the given post. Note that the filter function **must** return an array of URLs after it is finished processing, or any code using the `$pung` array will break, and other plugins also filtering the `$pung` array may generate errors.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'get_pung', $pung );
```
| Used By | Description |
| --- | --- |
| [get\_pung()](../functions/get_pung) wp-includes/post.php | Retrieves URLs already pinged for a post. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'get_page_of_comment', int $page, array $args, array $original_args, int $comment_ID ) apply\_filters( 'get\_page\_of\_comment', int $page, array $args, array $original\_args, int $comment\_ID )
===========================================================================================================
Filters the calculated page on which a comment appears.
`$page` int Comment page. `$args` array Arguments used to calculate pagination. These include arguments auto-detected by the function, based on query vars, system settings, etc. For pristine arguments passed to the function, see `$original_args`.
* `type`stringType of comments to count.
* `page`intCalculated current page.
* `per_page`intCalculated number of comments per page.
* `max_depth`intMaximum comment threading depth allowed.
`$original_args` array Array of arguments passed to the function. Some or all of these may not be set.
* `type`stringType of comments to count.
* `page`intCurrent comment page.
* `per_page`intNumber of comments per page.
* `max_depth`intMaximum comment threading depth allowed.
`$comment_ID` int ID of the comment. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_ID );
```
| Used By | Description |
| --- | --- |
| [get\_page\_of\_comment()](../functions/get_page_of_comment) wp-includes/comment.php | Calculates what page number a comment will appear on for comment paging. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced the `$comment_ID` parameter. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'delete_plugin', string $plugin_file ) do\_action( 'delete\_plugin', string $plugin\_file )
====================================================
Fires immediately before a plugin deletion attempt.
`$plugin_file` string Path to the plugin file relative to the plugins directory. File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
do_action( 'delete_plugin', $plugin_file );
```
| 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( 'username_exists', int|false $user_id, string $username ) apply\_filters( 'username\_exists', int|false $user\_id, string $username )
===========================================================================
Filters whether the given username exists.
`$user_id` int|false The user ID associated with the username, or false if the username does not exist. `$username` string The username 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( 'username_exists', $user_id, $username );
```
| Used By | Description |
| --- | --- |
| [username\_exists()](../functions/username_exists) wp-includes/user.php | Determines whether the given username exists. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( "{$taxonomy}_row_actions", string[] $actions, WP_Term $tag ) apply\_filters( "{$taxonomy}\_row\_actions", string[] $actions, WP\_Term $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`
`$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( "{$taxonomy}_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 |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'comments_template_query_args', array $comment_args ) apply\_filters( 'comments\_template\_query\_args', array $comment\_args )
=========================================================================
Filters the arguments used to query comments in [comments\_template()](../functions/comments_template) .
* [WP\_Comment\_Query::\_\_construct()](../classes/wp_comment_query/__construct)
`$comment_args` array Array of [WP\_Comment\_Query](../classes/wp_comment_query) arguments.
* `orderby`string|arrayField(s) to order by.
* `order`stringOrder of results. Accepts `'ASC'` or `'DESC'`.
* `status`stringComment status.
* `include_unapproved`arrayArray of IDs or email addresses whose unapproved comments will be included in results.
* `post_id`intID of the post.
* `no_found_rows`boolWhether to refrain from querying for found rows.
* `update_comment_meta_cache`boolWhether to prime cache for comment meta.
* `hierarchical`bool|stringWhether to query for comments hierarchically.
* `offset`intComment offset.
* `number`intNumber of comments to fetch.
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$comment_args = apply_filters( 'comments_template_query_args', $comment_args );
```
| Used By | Description |
| --- | --- |
| [comments\_template()](../functions/comments_template) wp-includes/comment-template.php | Loads the comment template specified in $file. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress do_action( 'do_robotstxt' ) do\_action( 'do\_robotstxt' )
=============================
Fires when displaying the robots.txt file.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
do_action( 'do_robotstxt' );
```
| Used By | Description |
| --- | --- |
| [do\_robots()](../functions/do_robots) wp-includes/functions.php | Displays the default robots.txt file content. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'deprecated_hook_trigger_error', bool $trigger ) apply\_filters( 'deprecated\_hook\_trigger\_error', bool $trigger )
===================================================================
Filters whether to trigger deprecated hook errors.
`$trigger` bool Whether to trigger deprecated hook errors. Requires `WP_DEBUG` to be defined 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_hook_trigger_error', true ) ) {
```
| Used By | Description |
| --- | --- |
| [\_deprecated\_hook()](../functions/_deprecated_hook) wp-includes/functions.php | Marks a deprecated action or filter hook as deprecated and throws a notice. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'pre_category_nicename', string $value ) apply\_filters( 'pre\_category\_nicename', string $value )
==========================================================
Filters the category nicename before it is sanitized.
Use the [‘pre\_$taxonomy\_$field’](pre_taxonomy_field) hook instead.
`$value` string The category nicename. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$value = apply_filters( 'pre_category_nicename', $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.0.3](https://developer.wordpress.org/reference/since/2.0.3/) | Introduced. |
| programming_docs |
wordpress do_action( 'untrash_post_comments', int $post_id ) do\_action( 'untrash\_post\_comments', int $post\_id )
======================================================
Fires before 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( 'untrash_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_ref_array( 'posts_where', string $where, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_where', string $where, WP\_Query $query )
=============================================================================
Filters the WHERE clause of the query.
`$where` string The WHERE clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). * This filter applies to the posts where clause and allows you to restrict which posts will show up in various areas of the site. Combined with `restrict_manage_posts` it allows you to only show posts matching specific conditions. Here is an example to match the `restrict_manage_posts` example:
```
add_filter( 'posts_where' , 'posts_where' );
function posts_where( $where ) {
if( is_admin() ) {
global $wpdb;
if ( isset( $_GET['author_restrict_posts'] ) && !empty( $_GET['author_restrict_posts'] ) && intval( $_GET['author_restrict_posts'] ) != 0 ) {
$author = intval( $_GET['author_restrict_posts'] );
$where .= " AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id=$author )";
}
}
return $where;
}
```
Depending on setup, if we had a custom post type of type ‘book’ with a taxonomy (category style) of type ‘author’, this filter would allow us to only show books written by a specific author.
* Certain functions which retrieve posts do not run filters, so the posts\_where filter functions you attach will not modify the query. To overcome this, set suppress\_filters to false in the argument array passed to the function. The following code sample illustrates this.
```
//some function that modifies the query
function useless_condition ( $where ) { return $where . ' AND 1=1 '; }
//attach your function to the posts_where filter
add_filter( 'posts_where' , 'useless_condition' );
//get posts AND make sure filters are NOT suppressed
$posts = get_posts( array( 'suppress_filters' => FALSE ) );
```
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$where = apply_filters_ref_array( 'posts_where', array( $where, &$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( 'schedule_event', stdClass|false $event ) apply\_filters( 'schedule\_event', stdClass|false $event )
==========================================================
Modify an event before it is scheduled.
`$event` stdClass|false An object containing an event's data, or boolean false to prevent the event from being scheduled.
* `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.
* The hook is applied when a new event is added to the cron schedule. The hook passes through one parameter: the `$event` being scheduled.
* In WordPress 3.21, the following recurring events are scheduled by the core: `wp_version_check`, `wp_update_plugins`, `wp_update_themes`, `wp_schedule_delete`, and (for the main site of multisite installs only) `wp_update_network_counts`.
* In WordPress 3.21, the following single events are scheduled on demand by the core: `publish_future_post`, `do_pings`, `importer_scheduled_cleanup`.
File: `wp-includes/cron.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/cron.php/)
```
$event = apply_filters( 'schedule_event', $event );
```
| 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 |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'do_shortcode_tag', string $output, string $tag, array|string $attr, array $m ) apply\_filters( 'do\_shortcode\_tag', string $output, string $tag, array|string $attr, array $m )
=================================================================================================
Filters the output created by a shortcode callback.
`$output` string Shortcode output. `$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( 'do_shortcode_tag', $output, $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 do_action( 'added_usermeta' ) do\_action( 'added\_usermeta' )
===============================
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
/**
```
wordpress apply_filters( 'media_meta', string $media_dims, WP_Post $post ) apply\_filters( 'media\_meta', string $media\_dims, WP\_Post $post )
====================================================================
Filters the media metadata.
`$media_dims` string The HTML markup containing the media dimensions. `$post` [WP\_Post](../classes/wp_post) The [WP\_Post](../classes/wp_post) attachment object. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$media_dims = apply_filters( 'media_meta', $media_dims, $post );
```
| Used By | Description |
| --- | --- |
| [attachment\_submitbox\_metadata()](../functions/attachment_submitbox_metadata) wp-admin/includes/media.php | Displays non-editable attachment metadata in the publish meta box. |
| [get\_media\_item()](../functions/get_media_item) wp-admin/includes/media.php | Retrieves HTML form for modifying the image attachment. |
| [get\_compat\_media\_markup()](../functions/get_compat_media_markup) wp-admin/includes/media.php | |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_required_field_indicator', string $indicator ) apply\_filters( 'wp\_required\_field\_indicator', string $indicator )
=====================================================================
Filters the markup for a visual indicator of required form fields.
`$indicator` string Markup for the indicator element. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'wp_required_field_indicator', $indicator );
```
| Used By | Description |
| --- | --- |
| [wp\_required\_field\_indicator()](../functions/wp_required_field_indicator) wp-includes/general-template.php | Assigns a visual indicator for required form fields. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'deprecated_hook_run', string $hook, string $replacement, string $version, string $message ) do\_action( 'deprecated\_hook\_run', string $hook, string $replacement, string $version, string $message )
==========================================================================================================
Fires when a deprecated hook is called.
`$hook` string The hook that was called. `$replacement` string The hook that should be used as a replacement. `$version` string The version of WordPress that deprecated the argument used. `$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_hook_run', $hook, $replacement, $version, $message );
```
| Used By | Description |
| --- | --- |
| [\_deprecated\_hook()](../functions/_deprecated_hook) wp-includes/functions.php | Marks a deprecated action or filter hook as deprecated and throws a notice. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'the_post_thumbnail_caption', string $caption ) apply\_filters( 'the\_post\_thumbnail\_caption', string $caption )
==================================================================
Filters the displayed post thumbnail caption.
`$caption` string Caption for the given attachment. File: `wp-includes/post-thumbnail-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-thumbnail-template.php/)
```
echo apply_filters( 'the_post_thumbnail_caption', get_the_post_thumbnail_caption( $post ) );
```
| Used By | Description |
| --- | --- |
| [the\_post\_thumbnail\_caption()](../functions/the_post_thumbnail_caption) wp-includes/post-thumbnail-template.php | Displays the post thumbnail caption. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_insert_nav_menu_item', object $prepared_nav_item, WP_REST_Request $request ) apply\_filters( 'rest\_pre\_insert\_nav\_menu\_item', object $prepared\_nav\_item, WP\_REST\_Request $request )
===============================================================================================================
Filters a menu item before it is inserted via the REST API.
`$prepared_nav_item` object An object representing a single menu item 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-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/)
```
return apply_filters( 'rest_pre_insert_nav_menu_item', $prepared_nav_item, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menu\_Items\_Controller::prepare\_item\_for\_database()](../classes/wp_rest_menu_items_controller/prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php | Prepares a single post for create or update. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'widget_custom_html_content', string $content, array $instance, WP_Widget_Custom_HTML $widget ) apply\_filters( 'widget\_custom\_html\_content', string $content, array $instance, WP\_Widget\_Custom\_HTML $widget )
=====================================================================================================================
Filters the content of the Custom HTML widget.
`$content` string The widget content. `$instance` array Array of settings for the current widget. `$widget` [WP\_Widget\_Custom\_HTML](../classes/wp_widget_custom_html) Current Custom HTML widget instance. File: `wp-includes/widgets/class-wp-widget-custom-html.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-custom-html.php/)
```
$content = apply_filters( 'widget_custom_html_content', $content, $instance, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Custom\_HTML::widget()](../classes/wp_widget_custom_html/widget) wp-includes/widgets/class-wp-widget-custom-html.php | Outputs the content for the current Custom HTML widget instance. |
| Version | Description |
| --- | --- |
| [4.8.1](https://developer.wordpress.org/reference/since/4.8.1/) | Introduced. |
wordpress do_action( "rest_delete_{$this->taxonomy}", WP_Term $term, WP_REST_Response $response, WP_REST_Request $request ) do\_action( "rest\_delete\_{$this->taxonomy}", WP\_Term $term, WP\_REST\_Response $response, WP\_REST\_Request $request )
=========================================================================================================================
Fires after a single term is deleted via the REST API.
The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `rest_delete_category`
* `rest_delete_post_tag`
`$term` [WP\_Term](../classes/wp_term) The deleted term. `$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-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_delete_{$this->taxonomy}", $term, $response, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menus\_Controller::delete\_item()](../classes/wp_rest_menus_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Deletes a single term from a taxonomy. |
| [WP\_REST\_Terms\_Controller::delete\_item()](../classes/wp_rest_terms_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Deletes a single term from a taxonomy. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'post_type_archive_title', string $post_type_name, string $post_type ) apply\_filters( 'post\_type\_archive\_title', string $post\_type\_name, string $post\_type )
============================================================================================
Filters the post type archive title.
`$post_type_name` string Post type `'name'` label. `$post_type` string Post type. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type );
```
| Used By | Description |
| --- | --- |
| [post\_type\_archive\_title()](../functions/post_type_archive_title) wp-includes/general-template.php | Displays or retrieves title for a post type archive. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'post_password_required', bool $required, WP_Post $post ) apply\_filters( 'post\_password\_required', bool $required, WP\_Post $post )
============================================================================
Filters whether a post requires the user to supply a password.
`$required` bool Whether the user needs to supply a password. True if password has not been provided or is incorrect, false if password has been supplied or is not required. `$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( 'post_password_required', $required, $post );
```
| Used By | Description |
| --- | --- |
| [post\_password\_required()](../functions/post_password_required) wp-includes/post-template.php | Determines whether the post requires password and whether a correct password has been provided. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'site_status_good_response_time_threshold', int $threshold ) apply\_filters( 'site\_status\_good\_response\_time\_threshold', int $threshold )
=================================================================================
Filters the threshold below which a response time is considered good.
The default is based on <https://web.dev/time-to-first-byte/>.
`$threshold` int Threshold in milliseconds. Default 600. 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 (int) apply_filters( 'site_status_good_response_time_threshold', 600 );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::get\_good\_response\_time\_threshold()](../classes/wp_site_health/get_good_response_time_threshold) wp-admin/includes/class-wp-site-health.php | Gets the threshold below which a response time is considered good. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'pre_upload_error', bool $error ) apply\_filters( 'pre\_upload\_error', bool $error )
===================================================
Filters whether to preempt the XML-RPC media upload.
Returning a truthy value will effectively short-circuit the media upload, returning that value as a 500 error instead.
`$error` bool Whether to pre-empt the media upload. 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/)
```
$upload_err = apply_filters( 'pre_upload_error', false );
```
| 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 |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'comment_notification_headers', string $message_headers, string $comment_id ) apply\_filters( 'comment\_notification\_headers', string $message\_headers, string $comment\_id )
=================================================================================================
Filters the comment notification email headers.
`$message_headers` string Headers for the comment notification email. `$comment_id` string Comment ID as a numeric string. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $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 |
| --- | --- |
| [1.5.2](https://developer.wordpress.org/reference/since/1.5.2/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'template', string $template ) apply\_filters( 'template', string $template )
==============================================
Filters the name of the active theme.
`$template` string active theme's directory name. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'template', get_option( 'template' ) );
```
| Used By | Description |
| --- | --- |
| [get\_template()](../functions/get_template) wp-includes/theme.php | Retrieves name of the active theme. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'pre-html-upload-ui' ) do\_action( 'pre-html-upload-ui' )
==================================
Fires before the upload button in the media upload interface.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'pre-html-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. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'add_attachment', int $post_ID ) do\_action( 'add\_attachment', int $post\_ID )
==============================================
Fires once an attachment has been added.
`$post_ID` int Attachment ID. This hook is called when an attachment created by [wp\_insert\_attachment()](../functions/wp_insert_attachment) in wp-includes/post.php.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'add_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_ref_array( 'found_posts', int $found_posts, WP_Query $query ) apply\_filters\_ref\_array( 'found\_posts', int $found\_posts, WP\_Query $query )
=================================================================================
Filters the number of found posts for the query.
`$found_posts` int The number of posts found. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). This filter hook allows developers to adjust the number of posts that WordPress’s [WP\_Query](../classes/wp_query) class reports finding when it runs a query.
This hook is especially useful when developing [custom pagination](https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination). For instance, if you are declaring a custom offset value in your queries, WordPress will NOT deduct the offset from the the $wp\_query->found\_posts parameter (for example, if you have 45 usable posts after an offset of 10, WordPress will ignore the offset and still give found\_posts a value of 55).
Make sure you haven’t passed no\_found\_rows in query arguments, Otherwise you will receive a 0 value in return.
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$this->found_posts = (int) apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$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 do_action( 'post_unstuck', int $post_id ) do\_action( 'post\_unstuck', int $post\_id )
============================================
Fires once a post has been removed from the sticky list.
`$post_id` int ID of the post that was unstuck. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'post_unstuck', $post_id );
```
| Used By | Description |
| --- | --- |
| [unstick\_post()](../functions/unstick_post) wp-includes/post.php | Un-sticks a post. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress do_action( "add_option_{$option}", string $option, mixed $value ) do\_action( "add\_option\_{$option}", string $option, mixed $value )
====================================================================
Fires after a specific option has been added.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$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}", $option, $value );
```
| Used By | Description |
| --- | --- |
| [add\_option()](../functions/add_option) wp-includes/option.php | Adds a new option. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'comment_moderation_headers', string $message_headers, int $comment_id ) apply\_filters( 'comment\_moderation\_headers', string $message\_headers, int $comment\_id )
============================================================================================
Filters the comment moderation email headers.
`$message_headers` string Headers for the comment moderation email. `$comment_id` int Comment ID. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_notify\_moderator()](../functions/wp_notify_moderator) wp-includes/pluggable.php | Notifies the moderator of the site about a new comment that is awaiting approval. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'admin_title', string $admin_title, string $title ) apply\_filters( 'admin\_title', string $admin\_title, string $title )
=====================================================================
Filters the title tag content for an admin page.
`$admin_title` string The page title, with extra context added. `$title` string The original page title. File: `wp-admin/admin-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-header.php/)
```
$admin_title = apply_filters( 'admin_title', $admin_title, $title );
```
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action_ref_array( 'phpmailer_init', PHPMailer $phpmailer ) do\_action\_ref\_array( 'phpmailer\_init', PHPMailer $phpmailer )
=================================================================
Fires after PHPMailer is initialized.
`$phpmailer` PHPMailer The PHPMailer instance (passed by reference). The [wp\_mail()](../functions/wp_mail) function relies on the [PHPMailer](https://github.com/PHPMailer/PHPMailer/) class to send email through PHP’s `mail` function. The `phpmailer_init` action hook allows you to hook to the phpmailer object and pass in your own arguments.
This action is initiated with `do\_action\_ref\_array` rather than `do\_action`. You still hook to it with `do\_action`. However, there are some notable differences:
* If you pass an array to `[do\_action\_ref\_array()](../functions/do_action_ref_array) `, each element’s value of that array is passed as a separate parameter to the callback.
* If you pass an array to `[do\_action()](../functions/do_action) `, the complete array is passed as a single argument including any keys.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
```
| 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( 'pre_get_table_charset', string|WP_Error|null $charset, string $table ) apply\_filters( 'pre\_get\_table\_charset', string|WP\_Error|null $charset, string $table )
===========================================================================================
Filters the table charset value before the DB is checked.
Returning a non-null value from the filter will effectively short-circuit checking the DB for the charset, returning that value instead.
`$charset` string|[WP\_Error](../classes/wp_error)|null The character set to use, [WP\_Error](../classes/wp_error) object if it couldn't be found. Default null. `$table` string The name of the table being checked. File: `wp-includes/class-wpdb.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wpdb.php/)
```
$charset = apply_filters( 'pre_get_table_charset', null, $table );
```
| Used By | Description |
| --- | --- |
| [wpdb::get\_table\_charset()](../classes/wpdb/get_table_charset) wp-includes/class-wpdb.php | Retrieves the character set for the given table. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'customize_nav_menu_available_items', array $items, string $object_type, string $object_name, int $page ) apply\_filters( 'customize\_nav\_menu\_available\_items', array $items, string $object\_type, string $object\_name, int $page )
===============================================================================================================================
Filters the available menu items.
`$items` array The array of menu items. `$object_type` string The object type. `$object_name` string The object name. `$page` int The current page number. File: `wp-includes/class-wp-customize-nav-menus.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-nav-menus.php/)
```
$items = apply_filters( 'customize_nav_menu_available_items', $items, $object_type, $object_name, $page );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Nav\_Menus::load\_available\_items\_query()](../classes/wp_customize_nav_menus/load_available_items_query) wp-includes/class-wp-customize-nav-menus.php | Performs the post\_type and taxonomy queries for loading available menu items. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action( 'deleted_link', int $link_id ) do\_action( 'deleted\_link', int $link\_id )
============================================
Fires after a link has been deleted.
`$link_id` int ID of the deleted link. File: `wp-admin/includes/bookmark.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/bookmark.php/)
```
do_action( 'deleted_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.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'user_request_action_email_headers', string|array $headers, string $subject, string $content, int $request_id, array $email_data ) apply\_filters( 'user\_request\_action\_email\_headers', string|array $headers, string $subject, string $content, int $request\_id, array $email\_data )
========================================================================================================================================================
Filters the headers of the email sent when an account action is attempted.
`$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.
* `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/)
```
$headers = apply_filters( 'user_request_action_email_headers', $headers, $subject, $content, $request_id, $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 |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress apply_filters( 'email_change_email', array $email_change_email, array $user, array $userdata ) apply\_filters( 'email\_change\_email', array $email\_change\_email, array $user, array $userdata )
===================================================================================================
Filters the contents of the email sent when the user’s email is changed.
`$email_change_email` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe intended recipients.
* `subject`stringThe subject of the email.
* `message`stringThe content of the email.
The following strings have a special meaning and will get replaced dynamically:
+ `###USERNAME###` The current user's username.
+ `###ADMIN_EMAIL###` The admin email in case this was unexpected.
+ `###NEW_EMAIL###` The new email address.
+ `###EMAIL###` The old email address.
+ `###SITENAME###` The name of the site.
+ `###SITEURL###` The URL to the site.
* `headers`stringHeaders.
`$user` array The original user array. `$userdata` array The updated user array. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$email_change_email = apply_filters( 'email_change_email', $email_change_email, $user, $userdata );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_user()](../functions/wp_update_user) wp-includes/user.php | Updates a user in the database. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action( 'upgrader_overwrote_package', string $package, array $data, string $package_type ) do\_action( 'upgrader\_overwrote\_package', string $package, array $data, string $package\_type )
=================================================================================================
Fires when the upgrader has successfully overwritten a currently installed plugin or theme with an uploaded zip package.
`$package` string The package file. `$data` array The new plugin or theme data. `$package_type` string The package type (`'plugin'` or `'theme'`). File: `wp-admin/includes/class-plugin-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-plugin-upgrader.php/)
```
do_action( 'upgrader_overwrote_package', $package, $this->new_plugin_data, 'plugin' );
```
| Used By | Description |
| --- | --- |
| [Theme\_Upgrader::install()](../classes/theme_upgrader/install) wp-admin/includes/class-theme-upgrader.php | Install a theme package. |
| [Plugin\_Upgrader::install()](../classes/plugin_upgrader/install) wp-admin/includes/class-plugin-upgrader.php | Install a plugin package. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'comment_save_pre', string $comment_content ) apply\_filters( 'comment\_save\_pre', string $comment\_content )
================================================================
Filters the comment content before it is updated in the database.
`$comment_content` string The comment data. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$data['comment_content'] = apply_filters( 'comment_save_pre', $data['comment_content'] );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_comment()](../functions/wp_update_comment) wp-includes/comment.php | Updates an existing comment in the database. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'wp_update_nav_menu', int $menu_id, array $menu_data ) do\_action( 'wp\_update\_nav\_menu', int $menu\_id, array $menu\_data )
=======================================================================
Fires after a navigation menu has been successfully updated.
`$menu_id` int ID of the updated 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_update_nav_menu', $menu_id, $menu_data );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Menus\_Controller::handle\_auto\_add()](../classes/wp_rest_menus_controller/handle_auto_add) wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Updates the menu’s auto add from a REST request. |
| [wp\_nav\_menu\_update\_menu\_items()](../functions/wp_nav_menu_update_menu_items) wp-admin/includes/nav-menu.php | Saves nav menu items |
| [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 do_action( 'add_meta_boxes', string $post_type, WP_Post $post ) do\_action( 'add\_meta\_boxes', string $post\_type, WP\_Post $post )
====================================================================
Fires after all built-in meta boxes have been added.
`$post_type` string Post type. `$post` [WP\_Post](../classes/wp_post) Post object. The hook allows meta box registration for any post type.
Passes two parameters: `$post_type` and `$post`.
Note: You can also use `add_meta_boxes_{post_type}` for best practice, so your hook will only run when editing a specific post type. This will only receive 1 parameter – `$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( '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( "taxonomy_labels_{$taxonomy}", object $labels ) apply\_filters( "taxonomy\_labels\_{$taxonomy}", object $labels )
=================================================================
Filters the labels of a specific taxonomy.
The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
Possible hook names include:
* `taxonomy_labels_category`
* `taxonomy_labels_post_tag`
* [get\_taxonomy\_labels()](../functions/get_taxonomy_labels) : for the full list of taxonomy labels.
`$labels` object Object with labels for the taxonomy as member variables. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$labels = apply_filters( "taxonomy_labels_{$taxonomy}", $labels );
```
| Used By | Description |
| --- | --- |
| [get\_taxonomy\_labels()](../functions/get_taxonomy_labels) wp-includes/taxonomy.php | Builds an object with all taxonomy labels out of a taxonomy object. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'get_avatar_data', array $args, mixed $id_or_email ) apply\_filters( 'get\_avatar\_data', array $args, mixed $id\_or\_email )
========================================================================
Filters the avatar data.
`$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/)
```
return apply_filters( '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 do_action( 'add_site_option', string $option, mixed $value, int $network_id ) do\_action( 'add\_site\_option', string $option, mixed $value, int $network\_id )
=================================================================================
Fires after a network option has been successfully added.
`$option` string Name of the network option. `$value` mixed 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( 'add_site_option', $option, $value, $network_id );
```
| Used By | Description |
| --- | --- |
| [add\_network\_option()](../functions/add_network_option) wp-includes/option.php | Adds a new network option. |
| 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_ref_array( 'posts_orderby_request', string $orderby, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_orderby\_request', string $orderby, WP\_Query $query )
==========================================================================================
Filters the ORDER BY clause of the query.
For use by caching plugins.
`$orderby` 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/)
```
$orderby = apply_filters_ref_array( 'posts_orderby_request', array( $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 |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_block_type', WP_REST_Response $response, WP_Block_Type $block_type, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_block\_type', WP\_REST\_Response $response, WP\_Block\_Type $block\_type, WP\_REST\_Request $request )
======================================================================================================================================
Filters a block type returned from the REST API.
Allows modification of the block type data right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$block_type` [WP\_Block\_Type](../classes/wp_block_type) The original block 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-block-types-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php/)
```
return apply_filters( 'rest_prepare_block_type', $response, $block_type, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Block\_Types\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_block_types_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php | Prepares a block type object for serialization. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'embed_oembed_discover', bool $enable ) apply\_filters( 'embed\_oembed\_discover', bool $enable )
=========================================================
Filters whether to inspect the given URL for discoverable link tags.
* [WP\_oEmbed::discover()](../classes/wp_oembed/discover)
`$enable` bool Whether to enable `<link>` tag discovery. Default true. File: `wp-includes/class-wp-embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-embed.php/)
```
$attr['discover'] = apply_filters( 'embed_oembed_discover', true );
```
| 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.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The default value changed to true. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'print_admin_styles', bool $print ) apply\_filters( 'print\_admin\_styles', bool $print )
=====================================================
Filters whether to print the admin styles.
`$print` bool Whether to print the admin styles. 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_admin_styles', true ) ) {
```
| Used By | Description |
| --- | --- |
| [print\_admin\_styles()](../functions/print_admin_styles) wp-includes/script-loader.php | Prints the styles queue in the HTML head on admin pages. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'category_link', string $termlink, int $term_id ) apply\_filters( 'category\_link', string $termlink, int $term\_id )
===================================================================
Filters the category link.
`$termlink` string Category 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( 'category_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. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'comment_moderation_recipients', string[] $emails, int $comment_id ) apply\_filters( 'comment\_moderation\_recipients', string[] $emails, int $comment\_id )
=======================================================================================
Filters the list of recipients for comment moderation emails.
`$emails` string[] List of email addresses to notify for comment moderation. `$comment_id` int Comment ID. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_notify\_moderator()](../functions/wp_notify_moderator) wp-includes/pluggable.php | Notifies the moderator of the site about a new comment that is awaiting approval. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress do_action( "manage_{$this->screen->id}_custom_column", string $column_name, array $item ) do\_action( "manage\_{$this->screen->id}\_custom\_column", string $column\_name, array $item )
==============================================================================================
Fires 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. `$item` array The application password item. 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", $column_name, $item );
```
| Used By | Description |
| --- | --- |
| [WP\_Application\_Passwords\_List\_Table::column\_default()](../classes/wp_application_passwords_list_table/column_default) wp-admin/includes/class-wp-application-passwords-list-table.php | Generates content for a single row of the table |
| [WP\_Privacy\_Requests\_Table::column\_default()](../classes/wp_privacy_requests_table/column_default) wp-admin/includes/class-wp-privacy-requests-table.php | Default column handler. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'media_upload_mime_type_links', string[] $type_links ) apply\_filters( 'media\_upload\_mime\_type\_links', string[] $type\_links )
===========================================================================
Filters the media upload mime type list items.
Returned values should begin with an `<li>` tag.
`$type_links` string[] An array of list items containing mime type link HTML. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
echo implode( ' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>';
```
| Used By | Description |
| --- | --- |
| [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 |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'archive_blog', int $site_id ) do\_action( 'archive\_blog', int $site\_id )
============================================
Fires when the ‘archived’ 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( 'archive_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( 'media_library_months_with_files', stdClass[]|null $months ) apply\_filters( 'media\_library\_months\_with\_files', stdClass[]|null $months )
================================================================================
Allows overriding the list of months displayed in the media library.
By default (if this filter does not return an array), a query will be run to determine the months that have media items. This query can be expensive for large media libraries, so it may be desirable for sites to override this behavior.
`$months` stdClass[]|null An array of objects with `month` and `year` properties, or `null` for default behavior. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$months = apply_filters( 'media_library_months_with_files', null );
```
| 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.7.4](https://developer.wordpress.org/reference/since/4.7.4/) | Introduced. |
wordpress do_action( "edit_post_{$post->post_type}", int $post_ID, WP_Post $post ) do\_action( "edit\_post\_{$post->post\_type}", int $post\_ID, WP\_Post $post )
==============================================================================
Fires once an existing post has been updated.
The dynamic portion of the hook name, `$post->post_type`, refers to the post type slug.
Possible hook names include:
* `edit_post_post`
* `edit_post_page`
`$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->post_type}", $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 |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'oembed_linktypes', string[] $format ) apply\_filters( 'oembed\_linktypes', string[] $format )
=======================================================
Filters the link types that contain oEmbed provider URLs.
`$format` string[] Array of oEmbed link types. Accepts `'application/json+oembed'`, `'text/xml+oembed'`, and `'application/xml+oembed'` (incorrect, used by at least Vimeo). File: `wp-includes/class-wp-oembed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed.php/)
```
$linktypes = apply_filters(
'oembed_linktypes',
array(
'application/json+oembed' => 'json',
'text/xml+oembed' => 'xml',
'application/xml+oembed' => 'xml',
)
);
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed::discover()](../classes/wp_oembed/discover) wp-includes/class-wp-oembed.php | Attempts to discover link tags at the given URL for an oEmbed provider. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_personal_data_email_subject', string $subject, string $sitename, array $email_data ) apply\_filters( 'wp\_privacy\_personal\_data\_email\_subject', string $subject, string $sitename, array $email\_data )
======================================================================================================================
Filters the subject of the email sent when an export 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.
* `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/)
```
$subject = apply_filters( 'wp_privacy_personal_data_email_subject', $subject, $site_name, $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. |
| programming_docs |
wordpress apply_filters( 'term_name', string $pad_tag_name, WP_Term $tag ) apply\_filters( 'term\_name', string $pad\_tag\_name, WP\_Term $tag )
=====================================================================
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.
* [WP\_Terms\_List\_Table::column\_name()](../classes/wp_terms_list_table/column_name)
`$pad_tag_name` string The term name, padded if not top-level. `$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/)
```
$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
```
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::column\_name()](../classes/wp_terms_list_table/column_name) wp-admin/includes/class-wp-terms-list-table.php | |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'edit_comment_link', string $link, string $comment_id, string $text ) apply\_filters( 'edit\_comment\_link', string $link, string $comment\_id, string $text )
========================================================================================
Filters the comment edit link anchor tag.
`$link` string Anchor tag for the edit link. `$comment_id` string Comment ID as a numeric string. `$text` string Anchor text. 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_comment_link', $link, $comment->comment_ID, $text ) . $after;
```
| Used By | Description |
| --- | --- |
| [edit\_comment\_link()](../functions/edit_comment_link) wp-includes/link-template.php | Displays the edit comment link with formatting. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'wp_get_original_image_path', string $original_image, int $attachment_id ) apply\_filters( 'wp\_get\_original\_image\_path', string $original\_image, int $attachment\_id )
================================================================================================
Filters the path to the original image.
`$original_image` string Path to original image file. `$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( 'wp_get_original_image_path', $original_image, $attachment_id );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_original\_image\_path()](../functions/wp_get_original_image_path) wp-includes/post.php | Retrieves the path to an uploaded image file. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters_ref_array( 'post_limits', string $limits, WP_Query $query ) apply\_filters\_ref\_array( 'post\_limits', string $limits, WP\_Query $query )
==============================================================================
Filters the LIMIT clause of the query.
`$limits` string The LIMIT clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). * This filter applies to the `LIMIT` clause of the query before the query is sent to the database, allowing you to define a new query `LIMIT`.
* You can return `null` to remove the `LIMIT` clause from the query, allowing you to return all results. However, this will set `$wp_query->found_posts` to `0`.
* On some server environments, the `LIMIT` will be applied to all queries on the page. This results in menu items and widgets also being limited to the defined number. To only limit the number of posts on a page use the action hook <pre_get_posts>.
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', 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.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'wp_upgrade', int $wp_db_version, int $wp_current_db_version ) do\_action( 'wp\_upgrade', int $wp\_db\_version, int $wp\_current\_db\_version )
================================================================================
Fires after a site is fully upgraded.
`$wp_db_version` int The new $wp\_db\_version. `$wp_current_db_version` int The old (current) $wp\_db\_version. File: `wp-admin/includes/upgrade.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/upgrade.php/)
```
do_action( 'wp_upgrade', $wp_db_version, $wp_current_db_version );
```
| Used By | Description |
| --- | --- |
| [wp\_upgrade()](../functions/wp_upgrade) wp-admin/includes/upgrade.php | Runs WordPress Upgrade functions. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'signup_user_init', array $signup_user_defaults ) apply\_filters( 'signup\_user\_init', array $signup\_user\_defaults )
=====================================================================
Filters the default user variables used on the user sign-up form.
`$signup_user_defaults` array An array of default user variables.
* `user_name`stringThe user username.
* `user_email`stringThe user email address.
* `errors`[WP\_Error](../classes/wp_error)A [WP\_Error](../classes/wp_error) object with possible errors relevant to the sign-up user.
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
$filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults );
```
| Used By | Description |
| --- | --- |
| [signup\_user()](../functions/signup_user) wp-signup.php | Shows a form for a visitor to sign up for a new user account. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'edit_term_link', string $link, int $term_id ) apply\_filters( 'edit\_term\_link', string $link, int $term\_id )
=================================================================
Filters the anchor tag for the edit link of a term.
`$link` string The anchor tag for the edit link. `$term_id` int Term ID. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;
```
| Used By | Description |
| --- | --- |
| [edit\_term\_link()](../functions/edit_term_link) wp-includes/link-template.php | Displays or retrieves the edit term link with formatting. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'wpmu_activate_blog', int $blog_id, int $user_id, string $password, string $signup_title, array $meta ) do\_action( 'wpmu\_activate\_blog', int $blog\_id, int $user\_id, string $password, string $signup\_title, array $meta )
========================================================================================================================
Fires immediately after a site is activated.
`$blog_id` int Blog ID. `$user_id` int User ID. `$password` string User password. `$signup_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/)
```
do_action( 'wpmu_activate_blog', $blog_id, $user_id, $password, $signup->title, $meta );
```
| Used By | Description |
| --- | --- |
| [wpmu\_activate\_signup()](../functions/wpmu_activate_signup) wp-includes/ms-functions.php | Activates a signup. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'bloginfo', mixed $output, string $show ) apply\_filters( 'bloginfo', mixed $output, string $show )
=========================================================
Filters the site information returned by [get\_bloginfo()](../functions/get_bloginfo) .
`$output` mixed The requested non-URL site information. `$show` string Type of information requested. Note that the function calls to `bloginfo("url")`, `bloginfo("directory")`, and `bloginfo("home")` will *not* have this filter hook applied (see <bloginfo_url> instead).
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$output = apply_filters( 'bloginfo', $output, $show );
```
| Used By | Description |
| --- | --- |
| [get\_bloginfo()](../functions/get_bloginfo) wp-includes/general-template.php | Retrieves information about the current site. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_posts_entry', array $sitemap_entry, WP_Post $post, string $post_type ) apply\_filters( 'wp\_sitemaps\_posts\_entry', array $sitemap\_entry, WP\_Post $post, string $post\_type )
=========================================================================================================
Filters the sitemap entry for an individual post.
`$sitemap_entry` array Sitemap entry for the post. `$post` [WP\_Post](../classes/wp_post) Post object. `$post_type` string Name of the post\_type. 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_entry', $sitemap_entry, $post, $post_type );
```
| 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 apply_filters( 'role_has_cap', bool[] $capabilities, string $cap, string $name ) apply\_filters( 'role\_has\_cap', bool[] $capabilities, string $cap, string $name )
===================================================================================
Filters which capabilities a role has.
`$capabilities` bool[] Array of key/value pairs where keys represent a capability name and boolean values represent whether the role has that capability. `$cap` string Capability name. `$name` string Role name. File: `wp-includes/class-wp-role.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-role.php/)
```
$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );
```
| Used By | Description |
| --- | --- |
| [WP\_Role::has\_cap()](../classes/wp_role/has_cap) wp-includes/class-wp-role.php | Determines whether the role has the given capability. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'load_script_translation_file', string|false $file, string $handle, string $domain ) apply\_filters( 'load\_script\_translation\_file', string|false $file, string $handle, string $domain )
=======================================================================================================
Filters the file path for loading script translations for the given script handle and text domain.
`$file` string|false Path to the translation file to load. False if there isn't one. `$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/)
```
$file = apply_filters( 'load_script_translation_file', $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 do_action( "update_option_{$option}", mixed $old_value, mixed $value, string $option ) do\_action( "update\_option\_{$option}", mixed $old\_value, mixed $value, string $option )
==========================================================================================
Fires after the value of a specific option has been successfully updated.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$old_value` mixed The old option value. `$value` mixed The new option value. `$option` string Option name. 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, $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.0.1](https://developer.wordpress.org/reference/since/2.0.1/) | Introduced. |
wordpress apply_filters( 'wp_resource_hints', array $urls, string $relation_type ) apply\_filters( 'wp\_resource\_hints', array $urls, string $relation\_type )
============================================================================
Filters domains and URLs for resource hints of relation type.
`$urls` array Array of resources and their attributes, or URLs to print for resource hints.
* `...$0`array|string Array of resource attributes, or a URL string.
+ `href`stringURL to include in resource hints. Required.
+ `as`stringHow the browser should treat the resource (`script`, `style`, `image`, `document`, etc).
+ `crossorigin`stringIndicates the CORS policy of the specified resource.
+ `pr`floatExpected probability that the resource hint will be used.
+ `type`stringType of the resource (`text/html`, `text/css`, etc). `$relation_type` string The relation type the URLs are printed for, e.g. `'preconnect'` or `'prerender'`. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$urls = apply_filters( 'wp_resource_hints', $urls, $relation_type );
```
| Used By | Description |
| --- | --- |
| [wp\_resource\_hints()](../functions/wp_resource_hints) wp-includes/general-template.php | Prints resource hints to browsers for pre-fetching, pre-rendering and pre-connecting to web sites. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | The `$urls` parameter accepts arrays of specific HTML attributes as its child elements. |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'get_terms_args', array $args, string[] $taxonomies ) apply\_filters( 'get\_terms\_args', array $args, string[] $taxonomies )
=======================================================================
Filters the terms query arguments.
`$args` array An array of [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/)
```
$args = apply_filters( 'get_terms_args', $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 |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'found_users_query', string $sql, WP_User_Query $query ) apply\_filters( 'found\_users\_query', string $sql, WP\_User\_Query $query )
============================================================================
Filters SELECT FOUND\_ROWS() query for the current [WP\_User\_Query](../classes/wp_user_query) instance.
`$sql` string The SELECT FOUND\_ROWS() query for the current [WP\_User\_Query](../classes/wp_user_query). `$query` [WP\_User\_Query](../classes/wp_user_query) The current [WP\_User\_Query](../classes/wp_user_query) instance. File: `wp-includes/class-wp-user-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-user-query.php/)
```
$found_users_query = apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()', $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/) | Added the `$this` parameter. |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'wp_generator_type', string $generator_type ) apply\_filters( 'wp\_generator\_type', string $generator\_type )
================================================================
Filters the output of the XHTML generator tag.
`$generator_type` string The XHTML generator. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) );
```
| Used By | Description |
| --- | --- |
| [wp\_generator()](../functions/wp_generator) wp-includes/general-template.php | Displays the XHTML generator that is generated on the wp\_head hook. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_where_request', string $where, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_where\_request', string $where, WP\_Query $query )
======================================================================================
Filters the WHERE clause of the query.
For use by caching plugins.
`$where` string The WHERE 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/)
```
$where = apply_filters_ref_array( 'posts_where_request', array( $where, &$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( 'default_title', string $post_title, WP_Post $post ) apply\_filters( 'default\_title', string $post\_title, WP\_Post $post )
=======================================================================
Filters the default post title initially used in the “Write Post” form.
`$post_title` string Default post title. `$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_title = (string) apply_filters( 'default_title', $post_title, $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_deprecated( 'contextual_help', string $old_help, string $screen_id, WP_Screen $screen ) apply\_filters\_deprecated( 'contextual\_help', string $old\_help, string $screen\_id, 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 text.
`$old_help` string Help text that appears on the screen. `$screen_id` string Screen ID. `$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/)
```
$old_help = apply_filters_deprecated(
'contextual_help',
array( $old_help, $this->id, $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 do_action( 'print_media_templates' ) do\_action( 'print\_media\_templates' )
=======================================
Fires when the custom Backbone media templates are printed.
File: `wp-includes/media-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media-template.php/)
```
do_action( 'print_media_templates' );
```
| Used By | Description |
| --- | --- |
| [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( 'get_comment_ID', string $comment_ID, WP_Comment $comment ) apply\_filters( 'get\_comment\_ID', string $comment\_ID, WP\_Comment $comment )
===============================================================================
Filters the returned comment ID.
`$comment_ID` string The current 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_ID', $comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [get\_comment\_ID()](../functions/get_comment_id) wp-includes/comment-template.php | Retrieves the comment ID of the current comment. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$comment` parameter was added. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'register_post_type_args', array $args, string $post_type ) apply\_filters( 'register\_post\_type\_args', array $args, string $post\_type )
===============================================================================
Filters the arguments for registering a post type.
`$args` array Array of arguments for registering a post type.
See the [register\_post\_type()](../functions/register_post_type) function for accepted arguments. More Arguments from register\_post\_type( ... $args ) Post type registration arguments. `$post_type` string Post type key. File: `wp-includes/class-wp-post-type.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-post-type.php/)
```
$args = apply_filters( 'register_post_type_args', $args, $this->name );
```
| Used By | Description |
| --- | --- |
| [WP\_Post\_Type::set\_props()](../classes/wp_post_type/set_props) wp-includes/class-wp-post-type.php | Sets post type properties. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'post_date_column_time', string $t_time, WP_Post $post, string $column_name, string $mode ) apply\_filters( 'post\_date\_column\_time', string $t\_time, WP\_Post $post, string $column\_name, string $mode )
=================================================================================================================
Filters the published time of the post.
`$t_time` string The published time. `$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/)
```
echo apply_filters( 'post_date_column_time', $t_time, $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 |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Removed the difference between `'excerpt'` and `'list'` modes. The published time and date are both displayed now, which is equivalent to the previous `'excerpt'` mode. |
| [2.5.1](https://developer.wordpress.org/reference/since/2.5.1/) | Introduced. |
wordpress apply_filters( "pre_add_site_option_{$option}", mixed $value, string $option, int $network_id ) apply\_filters( "pre\_add\_site\_option\_{$option}", mixed $value, string $option, int $network\_id )
=====================================================================================================
Filters the value of a specific network option before it is added.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$value` mixed Value of network option. `$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/)
```
$value = apply_filters( "pre_add_site_option_{$option}", $value, $option, $network_id );
```
| Used By | Description |
| --- | --- |
| [add\_network\_option()](../functions/add_network_option) wp-includes/option.php | Adds a new network option. |
| 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/) | |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'pre_comment_author_url', string $author_url_cookie ) apply\_filters( 'pre\_comment\_author\_url', string $author\_url\_cookie )
==========================================================================
Filters the comment author’s URL cookie before it is set.
When this filter hook is evaluated in [wp\_filter\_comment()](../functions/wp_filter_comment) , the comment author’s URL string is passed.
`$author_url_cookie` string The comment author URL cookie. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$comment_author_url = apply_filters( 'pre_comment_author_url', $_COOKIE[ 'comment_author_url_' . 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 apply_filters_deprecated( 'allowed_block_types', bool|string[] $allowed_block_types, WP_Post $post ) apply\_filters\_deprecated( 'allowed\_block\_types', bool|string[] $allowed\_block\_types, WP\_Post $post )
===========================================================================================================
This hook has been deprecated. Use the [‘allowed\_block\_types\_all’](allowed_block_types_all) filter instead.
Filters the allowed block types for the editor.
`$allowed_block_types` bool|string[] Array of block type slugs, or boolean to enable/disable all.
Default true (all registered block types supported) `$post` [WP\_Post](../classes/wp_post) The post resource data. File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
$allowed_block_types = apply_filters_deprecated( 'allowed_block_types', array( $allowed_block_types, $post ), '5.8.0', 'allowed_block_types_all' );
```
| Used By | Description |
| --- | --- |
| [get\_allowed\_block\_types()](../functions/get_allowed_block_types) wp-includes/block-editor.php | Gets the list of allowed block types to use in the block editor. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Use the ['allowed\_block\_types\_all'](allowed_block_types_all) filter instead. |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'untrashed_post', int $post_id, string $previous_status ) do\_action( 'untrashed\_post', int $post\_id, string $previous\_status )
========================================================================
Fires after a post is restored from the Trash.
`$post_id` int Post ID. `$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/)
```
do_action( 'untrashed_post', $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/) | The `$previous_status` parameter was added. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'upgrader_post_install', bool $response, array $hook_extra, array $result ) apply\_filters( 'upgrader\_post\_install', bool $response, array $hook\_extra, array $result )
==============================================================================================
Filters the installation response after the installation has finished.
`$response` bool Installation response. `$hook_extra` array Extra arguments passed to hooked filters. `$result` array Installation result data. 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_post_install', true, $args['hook_extra'], $this->result );
```
| 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 apply_filters( 'render_block', string $block_content, array $block, WP_Block $instance ) apply\_filters( 'render\_block', string $block\_content, array $block, WP\_Block $instance )
============================================================================================
Filters the content of a single block.
`$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', $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.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'after_theme_row', string $stylesheet, WP_Theme $theme, string $status ) do\_action( 'after\_theme\_row', string $stylesheet, WP\_Theme $theme, string $status )
=======================================================================================
Fires after each row in the Multisite themes list table.
`$stylesheet` string Directory name of the theme. `$theme` [WP\_Theme](../classes/wp_theme) Current [WP\_Theme](../classes/wp_theme) object. `$status` string Status of the theme. 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( 'after_theme_row', $stylesheet, $theme, $status );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Themes\_List\_Table::single\_row()](../classes/wp_ms_themes_list_table/single_row) 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 do_action( 'delete_theme', string $stylesheet ) do\_action( 'delete\_theme', string $stylesheet )
=================================================
Fires immediately before a theme deletion attempt.
`$stylesheet` string Stylesheet of the theme to delete. File: `wp-admin/includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
```
do_action( 'delete_theme', $stylesheet );
```
| Used By | Description |
| --- | --- |
| [delete\_theme()](../functions/delete_theme) wp-admin/includes/theme.php | Removes a theme. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_stylesheet_index_content', string $xsl_content ) apply\_filters( 'wp\_sitemaps\_stylesheet\_index\_content', string $xsl\_content )
==================================================================================
Filters the content of the sitemap index stylesheet.
`$xsl_content` string Full content for the XML stylesheet. 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_index_content', $xsl_content );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Stylesheet::get\_sitemap\_index\_stylesheet()](../classes/wp_sitemaps_stylesheet/get_sitemap_index_stylesheet) wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | Returns the escaped XSL for the index sitemaps. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( "{$field}", mixed $value, int $post_id, string $context ) apply\_filters( "{$field}", mixed $value, int $post\_id, string $context )
==========================================================================
Filters the value of a specific post field for display.
The dynamic portion of the hook name, `$field`, refers to the post field name.
`$value` mixed Value of the prefixed post field. `$post_id` int Post ID. `$context` string Context for how to sanitize the field.
Accepts `'raw'`, `'edit'`, `'db'`, `'display'`, `'attribute'`, or `'js'`. Default `'display'`. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$value = apply_filters( "{$field}", $value, $post_id, $context );
```
| 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( 'wp_inline_script_attributes', array $attributes, string $javascript ) apply\_filters( 'wp\_inline\_script\_attributes', array $attributes, string $javascript )
=========================================================================================
Filters attributes to be added to a script tag.
`$attributes` array Key-value pairs representing `<script>` tag attributes.
Only the attribute name is added to the `<script>` tag for entries with a boolean value, and that are true. `$javascript` string Inline JavaScript code. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
$attributes = apply_filters( 'wp_inline_script_attributes', $attributes, $javascript );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_inline\_script\_tag()](../functions/wp_get_inline_script_tag) wp-includes/script-loader.php | Wraps inline JavaScript in tag. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'rest_jsonp_enabled', bool $jsonp_enabled ) apply\_filters( 'rest\_jsonp\_enabled', bool $jsonp\_enabled )
==============================================================
Filters whether JSONP is enabled for the REST API.
`$jsonp_enabled` bool Whether JSONP is enabled. Default true. 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/)
```
$jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_jsonp\_request()](../functions/wp_is_jsonp_request) wp-includes/load.php | Checks whether current request is a JSONP request, or is expecting a JSONP response. |
| [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( 'page_css_class', string[] $css_class, WP_Post $page, int $depth, array $args, int $current_page_id ) apply\_filters( 'page\_css\_class', string[] $css\_class, WP\_Post $page, int $depth, array $args, int $current\_page\_id )
===========================================================================================================================
Filters the list of CSS classes to include with each page item in the list.
* [wp\_list\_pages()](../functions/wp_list_pages)
`$css_class` string[] An array of CSS classes to be applied to each list item. `$page` [WP\_Post](../classes/wp_post) Page data object. `$depth` int Depth of page, used for padding. `$args` array An array of arguments. `$current_page_id` int ID of the current page. File: `wp-includes/class-walker-page.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-page.php/)
```
$css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page_id ) );
```
| Used By | Description |
| --- | --- |
| [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. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action( 'manage_comments_nav', string $comment_status, string $which ) do\_action( 'manage\_comments\_nav', string $comment\_status, string $which )
=============================================================================
Fires after the Filter submit button for comment types.
`$comment_status` string The comment status name. Default `'All'`. `$which` string The location of the extra table nav markup: `'top'` or `'bottom'`. 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( 'manage_comments_nav', $comment_status, $which );
```
| 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 |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The `$which` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'populate_site_meta', array $meta, int $site_id ) apply\_filters( 'populate\_site\_meta', array $meta, int $site\_id )
====================================================================
Filters meta for a site on creation.
`$meta` array Associative array of site meta keys and values to be inserted. `$site_id` int ID of site to populate. File: `wp-admin/includes/schema.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/schema.php/)
```
$site_meta = apply_filters( 'populate_site_meta', $meta, $site_id );
```
| Used By | Description |
| --- | --- |
| [populate\_site\_meta()](../functions/populate_site_meta) wp-admin/includes/schema.php | Creates WordPress site meta and sets the default values. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'wp_video_shortcode_library', string $library ) apply\_filters( 'wp\_video\_shortcode\_library', string $library )
==================================================================
Filters the media library used for the video shortcode.
`$library` string Media library used for the video shortcode. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Media\_Video::enqueue\_preview\_scripts()](../classes/wp_widget_media_video/enqueue_preview_scripts) wp-includes/widgets/class-wp-widget-media-video.php | Enqueue preview scripts. |
| [wp\_video\_shortcode()](../functions/wp_video_shortcode) wp-includes/media.php | Builds the Video shortcode output. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters_deprecated( 'rest_enabled', bool $rest_enabled ) apply\_filters\_deprecated( 'rest\_enabled', bool $rest\_enabled )
==================================================================
This hook has been deprecated. Use the [‘rest\_authentication\_errors’](rest_authentication_errors) filter to restrict access to the REST API instead.
Filters whether the REST API is enabled.
`$rest_enabled` bool Whether the REST API is enabled. Default true. 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/)
```
apply_filters_deprecated(
'rest_enabled',
array( true ),
'4.7.0',
'rest_authentication_errors',
sprintf(
/* translators: %s: rest_authentication_errors */
__( 'The REST API can no longer be completely disabled, the %s filter can be used to restrict access to the API, instead.' ),
'rest_authentication_errors'
)
);
```
| 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.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Use the ['rest\_authentication\_errors'](rest_authentication_errors) filter to restrict access to the REST API. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_get_comment_fields_max_lengths', int[] $lengths ) apply\_filters( 'wp\_get\_comment\_fields\_max\_lengths', int[] $lengths )
==========================================================================
Filters the lengths for the comment form fields.
`$lengths` int[] Array of maximum lengths keyed by field name. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
return apply_filters( 'wp_get_comment_fields_max_lengths', $lengths );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_comment\_fields\_max\_lengths()](../functions/wp_get_comment_fields_max_lengths) wp-includes/comment.php | Retrieves the maximum character lengths for the comment form fields. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress do_action( 'heartbeat_nopriv_tick', array $response, string $screen_id ) do\_action( 'heartbeat\_nopriv\_tick', array $response, string $screen\_id )
============================================================================
Fires when Heartbeat ticks in no-privilege environments.
Allows the transport to be easily replaced with long-polling.
`$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/)
```
do_action( 'heartbeat_nopriv_tick', $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 do_action( "{$new_status}_{$post->post_type}", int $post_id, WP_Post $post, string $old_status ) do\_action( "{$new\_status}\_{$post->post\_type}", int $post\_id, WP\_Post $post, string $old\_status )
=======================================================================================================
Fires when a post is transitioned from one status to another.
The dynamic portions of the hook name, `$new_status` and `$post->post_type`, refer to the new post status and post type, respectively.
Possible hook names include:
* `draft_post`
* `future_post`
* `pending_post`
* `private_post`
* `publish_post`
* `trash_post`
* `draft_page`
* `future_page`
* `pending_page`
* `private_page`
* `publish_page`
* `trash_page`
* `publish_attachment`
* `trash_attachment`
Please note: When this action is hooked using a particular post status (like ‘publish’, as `publish_{$post->post_type}`), it will fire both when a post is first transitioned to that status from something else, as well as upon subsequent post updates (old and new status are both the same).
Therefore, if you are looking to only fire a callback when a post is first transitioned to a status, use the [‘transition\_post\_status’](transition_post_status) hook instead.
`$post_id` int Post ID. `$post` [WP\_Post](../classes/wp_post) Post object. `$old_status` string Old post status. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( "{$new_status}_{$post->post_type}", $post->ID, $post, $old_status );
```
| 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 |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Added `$old_status` parameter. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'user_has_cap', bool[] $allcaps, string[] $caps, array $args, WP_User $user ) apply\_filters( 'user\_has\_cap', bool[] $allcaps, string[] $caps, array $args, WP\_User $user )
================================================================================================
Dynamically filter a user’s capabilities.
`$allcaps` bool[] Array of key/value pairs where keys represent a capability name and boolean values represent whether the user has that capability. `$caps` string[] Required primitive capabilities for the requested capability. `$args` array Arguments that accompany the requested capability check.
* stringRequested capability.
* `1`intConcerned user ID.
* `...$2`mixedOptional second and further parameters, typically object ID.
`$user` [WP\_User](../classes/wp_user) The user object. Passing in a numeric value to [WP\_User::has\_cap()](../classes/wp_user/has_cap) object has been deprecated. Passing a numeric value will generate a deprecated option warning if [debugging mode](https://wordpress.org/support/article/debugging-in-wordpress/) is enabled via [wp\_config.php](https://wordpress.org/support/article/editing-wp-config-php/):
`Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.`
This will occur if a plugin or a theme calls `has_cap` directly. The plugin or theme needs to be updated to use the new roles and capabilities classes.
File: `wp-includes/class-wp-user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-user.php/)
```
$capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_User::has\_cap()](../classes/wp_user/has_cap) wp-includes/class-wp-user.php | Returns whether the user has the specified capability. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Added the `$user` parameter. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( "get_{$adjacent}_post_sort", string $order_by, WP_Post $post, string $order ) apply\_filters( "get\_{$adjacent}\_post\_sort", string $order\_by, WP\_Post $post, string $order )
==================================================================================================
Filters the ORDER BY 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_sort`
* `get_previous_post_sort`
`$order_by` string The `ORDER BY` clause in the SQL. `$post` [WP\_Post](../classes/wp_post) [WP\_Post](../classes/wp_post) object. `$order` string Sort order. `'DESC'` for previous post, `'ASC'` for next. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post, $order );
```
| Used By | Description |
| --- | --- |
| [get\_adjacent\_post()](../functions/get_adjacent_post) wp-includes/link-template.php | Retrieves the adjacent post. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$order` parameter. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$post` parameter. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'ms_user_list_site_actions', string[] $actions, int $userblog_id ) apply\_filters( 'ms\_user\_list\_site\_actions', string[] $actions, int $userblog\_id )
=======================================================================================
Filters the action links displayed next the sites a user belongs to in the Network Admin Users list table.
`$actions` string[] An array of action links to be displayed. Default `'Edit'`, `'View'`. `$userblog_id` int The site ID. 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_list_site_actions', $actions, $site->userblog_id );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Users\_List\_Table::column\_blogs()](../classes/wp_ms_users_list_table/column_blogs) wp-admin/includes/class-wp-ms-users-list-table.php | Handles the sites column output. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'user_dashboard_url', string $url, int $user_id, string $path, string $scheme ) apply\_filters( 'user\_dashboard\_url', string $url, int $user\_id, string $path, string $scheme )
==================================================================================================
Filters the dashboard URL for a user.
`$url` string The complete URL including scheme and path. `$user_id` int The user ID. `$path` string Path relative to the URL. Blank string if no path is specified. `$scheme` string Scheme to give the URL context. Accepts `'http'`, `'https'`, `'login'`, `'login_post'`, `'admin'`, `'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( 'user_dashboard_url', $url, $user_id, $path, $scheme );
```
| Used By | Description |
| --- | --- |
| [get\_dashboard\_url()](../functions/get_dashboard_url) wp-includes/link-template.php | Retrieves the URL to the user’s dashboard. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters_ref_array( 'the_networks', WP_Network[] $_networks, WP_Network_Query $query ) apply\_filters\_ref\_array( 'the\_networks', WP\_Network[] $\_networks, WP\_Network\_Query $query )
===================================================================================================
Filters the network query results.
`$_networks` [WP\_Network](../classes/wp_network)[] An array of [WP\_Network](../classes/wp_network) objects. `$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/)
```
$_networks = apply_filters_ref_array( 'the_networks', array( $_networks, &$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. |
| programming_docs |
wordpress apply_filters_deprecated( 'tag_rewrite_rules', string[] $rules ) apply\_filters\_deprecated( 'tag\_rewrite\_rules', string[] $rules )
====================================================================
This hook has been deprecated. Use [‘post\_tag\_rewrite\_rules’](post_tag_rewrite_rules) instead.
Filters rewrite rules used specifically for Tags.
`$rules` string[] Array of rewrite rules generated for tags, 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/)
```
$rules = apply_filters_deprecated( 'tag_rewrite_rules', array( $rules ), '3.1.0', 'post_tag_rewrite_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/) | Use ['post\_tag\_rewrite\_rules'](post_tag_rewrite_rules) instead. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'get_post_galleries', array $galleries, WP_Post $post ) apply\_filters( 'get\_post\_galleries', array $galleries, WP\_Post $post )
==========================================================================
Filters the list of all found galleries in the given post.
`$galleries` array Associative array of all found post galleries. `$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 apply_filters( 'get_post_galleries', $galleries, $post );
```
| Used By | Description |
| --- | --- |
| [get\_post\_galleries()](../functions/get_post_galleries) wp-includes/media.php | Retrieves galleries from the passed post’s content. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'script_loader_src', string $src, string $handle ) apply\_filters( 'script\_loader\_src', string $src, string $handle )
====================================================================
Filters the script loader source.
`$src` string Script loader source path. `$handle` string Script handle. File: `wp-includes/class-wp-scripts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes_class-wp-scripts-php-2/)
```
$srce = apply_filters( 'script_loader_src', $src, $handle );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_script\_polyfill()](../functions/wp_get_script_polyfill) wp-includes/script-loader.php | Returns contents of an inline script used in appending polyfill scripts for browsers which fail the provided tests. The provided array is a mapping from a condition to verify feature support to its polyfill script handle. |
| [WP\_Scripts::do\_item()](../classes/wp_scripts/do_item) wp-includes/class-wp-scripts.php | Processes a script dependency. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'rest_request_after_callbacks', WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response, array $handler, WP_REST_Request $request ) apply\_filters( 'rest\_request\_after\_callbacks', WP\_REST\_Response|WP\_HTTP\_Response|WP\_Error|mixed $response, array $handler, WP\_REST\_Request $request )
================================================================================================================================================================
Filters the response immediately after executing any REST API callbacks.
Allows plugins to perform any needed cleanup, for example, to undo changes made during the [‘rest\_request\_before\_callbacks’](rest_request_before_callbacks) filter.
Note that this filter will not be called for requests that fail to authenticate or match to a registered route.
Note that an endpoint’s `permission_callback` can still be called after this filter – see `rest_send_allow_header()`.
`$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_after_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 do_action( 'wp_nav_menu_item_custom_fields_customize_template' ) do\_action( 'wp\_nav\_menu\_item\_custom\_fields\_customize\_template' )
========================================================================
Fires at the end of the form field template for nav menu items in the customizer.
Additional fields can be rendered here and managed in JavaScript.
File: `wp-includes/customize/class-wp-customize-nav-menu-item-control.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-nav-menu-item-control.php/)
```
do_action( 'wp_nav_menu_item_custom_fields_customize_template' );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Nav\_Menu\_Item\_Control::content\_template()](../classes/wp_customize_nav_menu_item_control/content_template) wp-includes/customize/class-wp-customize-nav-menu-item-control.php | JS/Underscore template for the control UI. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress do_action( 'wp_edit_form_attachment_display', WP_Post $post ) do\_action( 'wp\_edit\_form\_attachment\_display', WP\_Post $post )
===================================================================
Fires when an attachment type can’t be rendered in the edit form.
`$post` [WP\_Post](../classes/wp_post) A post object. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'wp_edit_form_attachment_display', $post );
```
| Used By | Description |
| --- | --- |
| [edit\_form\_image\_editor()](../functions/edit_form_image_editor) wp-admin/includes/media.php | Displays the image and editor in the post editor |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( "edit_term_{$field}", mixed $value, int $term_id, string $taxonomy ) apply\_filters( "edit\_term\_{$field}", mixed $value, int $term\_id, string $taxonomy )
=======================================================================================
Filters a term field to edit before it is sanitized.
The dynamic portion of the hook name, `$field`, refers to the term field.
`$value` mixed Value of the term field. `$term_id` int Term ID. `$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( "edit_term_{$field}", $value, $term_id, $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( 'rest_themes_collection_params', array $query_params ) apply\_filters( 'rest\_themes\_collection\_params', array $query\_params )
==========================================================================
Filters REST API collection parameters for the themes controller.
`$query_params` array JSON Schema-formatted collection parameters. File: `wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php/)
```
return apply_filters( 'rest_themes_collection_params', $query_params );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Themes\_Controller::get\_collection\_params()](../classes/wp_rest_themes_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php | Retrieves the search params for the themes collection. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'the_content_export', string $post_content ) apply\_filters( 'the\_content\_export', string $post\_content )
===============================================================
Filters the post content used for WXR exports.
`$post_content` string Content of the current post. File: `wp-admin/includes/export.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/export.php/)
```
$content = wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
```
| Used By | Description |
| --- | --- |
| [export\_wp()](../functions/export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'plugins_update_check_locales', string[] $locales ) apply\_filters( 'plugins\_update\_check\_locales', string[] $locales )
======================================================================
Filters the locales requested for plugin translations.
`$locales` string[] Plugin locales. Default is all available locales of the site. File: `wp-includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/update.php/)
```
$locales = apply_filters( 'plugins_update_check_locales', $locales );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Plugins\_Controller::create\_item()](../classes/wp_rest_plugins_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php | Uploads a plugin and optionally activates it. |
| [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 |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The default value of the `$locales` parameter changed to include all locales. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'wp_should_replace_insecure_home_url', bool $should_replace_insecure_home_url ) apply\_filters( 'wp\_should\_replace\_insecure\_home\_url', bool $should\_replace\_insecure\_home\_url )
========================================================================================================
Filters whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart.
If a WordPress site had its URL changed from HTTP to HTTPS, by default this will return `true`. This filter can be used to disable that behavior, e.g. after having replaced URLs manually in the database.
`$should_replace_insecure_home_url` bool Whether insecure HTTP URLs to the site should be replaced. File: `wp-includes/https-migration.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/https-migration.php/)
```
return apply_filters( 'wp_should_replace_insecure_home_url', $should_replace_insecure_home_url );
```
| Used By | Description |
| --- | --- |
| [wp\_should\_replace\_insecure\_home\_url()](../functions/wp_should_replace_insecure_home_url) wp-includes/https-migration.php | Checks whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'allow_major_auto_core_updates', bool $upgrade_major ) apply\_filters( 'allow\_major\_auto\_core\_updates', bool $upgrade\_major )
===========================================================================
Filters whether to enable major automatic core updates.
`$upgrade_major` bool Whether to enable major automatic core updates. File: `wp-admin/includes/class-core-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-core-upgrader.php/)
```
return apply_filters( 'allow_major_auto_core_updates', $upgrade_major );
```
| Used By | Description |
| --- | --- |
| [core\_auto\_updates\_settings()](../functions/core_auto_updates_settings) wp-admin/update-core.php | Display WordPress auto-updates settings. |
| [Core\_Upgrader::should\_update\_to\_version()](../classes/core_upgrader/should_update_to_version) wp-admin/includes/class-core-upgrader.php | Determines if this WordPress Core version should update to an offered version or not. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'update_translations_complete_actions', string[] $update_actions ) apply\_filters( 'update\_translations\_complete\_actions', string[] $update\_actions )
======================================================================================
Filters the list of action links available following a translations update.
`$update_actions` string[] Array of translations update links. 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/)
```
$update_actions = apply_filters( 'update_translations_complete_actions', $update_actions );
```
| Used By | Description |
| --- | --- |
| [Language\_Pack\_Upgrader\_Skin::bulk\_footer()](../classes/language_pack_upgrader_skin/bulk_footer) wp-admin/includes/class-language-pack-upgrader-skin.php | |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'file_mod_allowed', bool $file_mod_allowed, string $context ) apply\_filters( 'file\_mod\_allowed', bool $file\_mod\_allowed, string $context )
=================================================================================
Filters whether file modifications are allowed.
`$file_mod_allowed` bool Whether file modifications are allowed. `$context` string The usage context. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
return apply_filters( 'file_mod_allowed', ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS, $context );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_file\_mod\_allowed()](../functions/wp_is_file_mod_allowed) wp-includes/load.php | Determines whether file modifications are allowed. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( 'rest_url_details_cache_expiration', int $ttl ) apply\_filters( 'rest\_url\_details\_cache\_expiration', int $ttl )
===================================================================
Filters the cache expiration.
Can be used to adjust the time until expiration in seconds for the cache of the data retrieved for the given URL.
`$ttl` int The time until cache expiration in seconds. 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/)
```
$cache_expiration = apply_filters( 'rest_url_details_cache_expiration', $ttl );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_URL\_Details\_Controller::set\_cache()](../classes/wp_rest_url_details_controller/set_cache) wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php | Utility function to cache a given data set at a given cache key. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( "get_{$adjacent}_post_join", string $join, bool $in_same_term, int[]|string $excluded_terms, string $taxonomy, WP_Post $post ) apply\_filters( "get\_{$adjacent}\_post\_join", string $join, bool $in\_same\_term, int[]|string $excluded\_terms, string $taxonomy, WP\_Post $post )
=====================================================================================================================================================
Filters the JOIN 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_join`
* `get_previous_post_join`
`$join` string The JOIN 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/)
```
$join = apply_filters( "get_{$adjacent}_post_join", $join, $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( 'pre_comment_user_ip', string $comment_author_ip ) apply\_filters( 'pre\_comment\_user\_ip', string $comment\_author\_ip )
=======================================================================
Filters the comment author’s IP address before it is set.
`$comment_author_ip` string The comment author's IP address. With this filter, we can change the comment author’s IP before it’s recorded. Example use case can be when a client submits a comment through a proxy server.
The general format of the header is:
`X-Forwarded-For: client1, proxy1, proxy2`
where the value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from. In this example, the request goes through the IPs: client1 -> proxy1 -> proxy2 -> proxy3. Proxy3 is not shown in the `X-Forwarded-For` header here and appears as the remote address of the request.
Since it is easy to forge an `X-Forwarded-For` header, the given information should be used with care.
`X-Forwarded-For`, `X-Forwarded-By`, and `X-Forwarded-Proto` are non-standard header fields and in increasing cases, have been superseded by the standard `Forwarded` header defined in RFC 7239. Example of a `Forwarded` header:
`Forwarded: for=192.0.2.60;proto=http;by=203.0.113.43`
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$commentdata['comment_author_IP'] = apply_filters( 'pre_comment_user_ip', $commentdata['comment_author_IP'] );
```
| 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. |
| programming_docs |
wordpress apply_filters( 'the_guid', string $post_guid, int $post_id ) apply\_filters( 'the\_guid', string $post\_guid, int $post\_id )
================================================================
Filters the escaped Global Unique Identifier (guid) of the post.
* [get\_the\_guid()](../functions/get_the_guid)
`$post_guid` string Escaped Global Unique Identifier (guid) of 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/)
```
echo apply_filters( 'the_guid', $post_guid, $post_id );
```
| Used By | Description |
| --- | --- |
| [the\_guid()](../functions/the_guid) wp-includes/post-template.php | Displays the Post Global Unique Identifier (guid). |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( "{$action}_overrides", array|false $overrides, array $file ) apply\_filters( "{$action}\_overrides", array|false $overrides, array $file )
=============================================================================
Filters the override parameters 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_overrides`
* `wp_handle_upload_overrides`
`$overrides` array|false An array of override parameters for this file. Boolean false if none are provided. @see [\_wp\_handle\_upload()](../functions/_wp_handle_upload) . More Arguments from \_wp\_handle\_upload( ... $overrides ) An array of override parameters for this file, or boolean false if none are provided.
* `upload_error_handler`callableFunction to call when there is an error during the upload process.
@see [wp\_handle\_upload\_error()](../functions/wp_handle_upload_error) .
* `unique_filename_callback`callableFunction to call when determining a unique file name for the file.
@see [wp\_unique\_filename()](../functions/wp_unique_filename) .
* `upload_error_strings`string[]The strings that describe the error indicated in `$_FILES[{form field}]['error']`.
* `test_form`boolWhether to test that the `$_POST['action']` parameter is as expected.
* `test_size`boolWhether to test that the file size is greater than zero bytes.
* `test_type`boolWhether to test that the mime type of the file is as expected.
* `mimes`string[]Array of allowed mime types keyed by their file extension regex.
`$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/)
```
$overrides = apply_filters( "{$action}_overrides", $overrides, $file );
```
| Used By | Description |
| --- | --- |
| [\_wp\_handle\_upload()](../functions/_wp_handle_upload) wp-admin/includes/file.php | Handles PHP uploads in WordPress. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'replace_editor', bool $replace, WP_Post $post ) apply\_filters( 'replace\_editor', bool $replace, WP\_Post $post )
==================================================================
Allows replacement of the editor.
`$replace` bool Whether to replace the editor. Default false. `$post` [WP\_Post](../classes/wp_post) Post object. File: `wp-admin/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/post.php/)
```
if ( true === apply_filters( 'replace_editor', false, $post ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::get()](../classes/wp_screen/get) wp-admin/includes/class-wp-screen.php | Fetches a screen object. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'image_resize_dimensions', null|mixed $null, int $orig_w, int $orig_h, int $dest_w, int $dest_h, bool|array $crop ) apply\_filters( 'image\_resize\_dimensions', null|mixed $null, int $orig\_w, int $orig\_h, int $dest\_w, int $dest\_h, bool|array $crop )
=========================================================================================================================================
Filters whether to preempt calculating the image resize dimensions.
Returning a non-null value from the filter will effectively short-circuit [image\_resize\_dimensions()](../functions/image_resize_dimensions) , returning that value instead.
`$null` null|mixed Whether to preempt output of the resize dimensions. `$orig_w` int Original width in pixels. `$orig_h` int Original height in pixels. `$dest_w` int New width in pixels. `$dest_h` int New height in pixels. `$crop` bool|array Whether to crop image to specified width and height or resize.
An array can specify positioning of the crop area. Default false. * Since version [3.4](https://wordpress.org/support/wordpress-version/version-3-4/), the `image_resize_dimensions` filter is used to filter the thumbnail and alternative sizes dimensions of image assets during resizing operations. This enables the override of WordPress default behavior on image resizing, including the thumbnail cropping.
* Note that the filter function **must** return an array matching the parameters to `imagecopyresampled()`, **or** `false` if the resizing is impossible, **or** should not occur, **or** `null` to fallback to WordPress default behavior.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$output = apply_filters( 'image_resize_dimensions', null, $orig_w, $orig_h, $dest_w, $dest_h, $crop );
```
| Used By | Description |
| --- | --- |
| [image\_resize\_dimensions()](../functions/image_resize_dimensions) wp-includes/media.php | Retrieves calculated resize dimensions for use in [WP\_Image\_Editor](../classes/wp_image_editor). |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'shutdown' ) do\_action( 'shutdown' )
========================
Fires just before PHP shuts down execution.
Runs just before PHP shuts down execution.
This hook is called by [shutdown\_action\_hook()](../functions/shutdown_action_hook) and registered with PHP as a shutdown function by [register\_shutdown\_function()](http://php.net/manual/en/function.register-shutdown-function.php) in `[wp-settings.php](https://core.trac.wordpress.org/browser/tags/5.5.1/src/wp-settings.php#L0)`.
File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
do_action( 'shutdown' );
```
| Used By | Description |
| --- | --- |
| [shutdown\_action\_hook()](../functions/shutdown_action_hook) wp-includes/load.php | Runs just before PHP shuts down execution. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'wp_die_ajax_handler', callable $callback ) apply\_filters( 'wp\_die\_ajax\_handler', callable $callback )
==============================================================
Filters the callback for killing WordPress execution for Ajax 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_ajax_handler', '_ajax_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 |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters_ref_array( 'comment_feed_where', string $cwhere, WP_Query $query ) apply\_filters\_ref\_array( 'comment\_feed\_where', string $cwhere, WP\_Query $query )
======================================================================================
Filters the WHERE clause of the comments feed query before sending.
`$cwhere` string The WHERE 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/)
```
$cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$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.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'site_admin_email_change_email', array $email_change_email, string $old_email, string $new_email ) apply\_filters( 'site\_admin\_email\_change\_email', array $email\_change\_email, string $old\_email, string $new\_email )
==========================================================================================================================
Filters the contents of the email notification sent when the site admin email address is changed.
`$email_change_email` array Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe intended recipient.
* `subject`stringThe subject of the email.
* `message`stringThe content of the email.
The following strings have a special meaning and will get replaced dynamically:
+ `###OLD_EMAIL###` The old site admin email address.
+ `###NEW_EMAIL###` The new site admin email address.
+ `###SITENAME###` The name of the site.
+ `###SITEURL###` The URL to the site.
* `headers`stringHeaders.
`$old_email` string The old site admin email address. `$new_email` string The new site admin email address. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$email_change_email = apply_filters( 'site_admin_email_change_email', $email_change_email, $old_email, $new_email );
```
| Used By | Description |
| --- | --- |
| [wp\_site\_admin\_email\_change\_notification()](../functions/wp_site_admin_email_change_notification) wp-includes/functions.php | Sends an email to the old site admin email address when the site admin email address changes. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'get_comment_author', string $author, string $comment_ID, WP_Comment $comment ) apply\_filters( 'get\_comment\_author', string $author, string $comment\_ID, WP\_Comment $comment )
===================================================================================================
Filters the returned comment author name.
`$author` string The comment author's username. `$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_author', $author, $comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_author()](../functions/get_comment_author) wp-includes/comment-template.php | Retrieves the author 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( 'pre_user_url', string $raw_user_url ) apply\_filters( 'pre\_user\_url', string $raw\_user\_url )
==========================================================
Filters a user’s URL before the user is created or updated.
`$raw_user_url` string The user's URL. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$user_url = apply_filters( 'pre_user_url', $raw_user_url );
```
| 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( 'privacy_on_link_text', string $content ) apply\_filters( 'privacy\_on\_link\_text', string $content )
============================================================
Filters the link label 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’.
`$content` string Default text. File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
$content = apply_filters( 'privacy_on_link_text', __( 'Search engines discouraged' ) );
```
| 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.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_get_nav_menu_items', array $items, object $menu, array $args ) apply\_filters( 'wp\_get\_nav\_menu\_items', array $items, object $menu, array $args )
======================================================================================
Filters the navigation menu items being returned.
`$items` array An array of menu item post objects. `$menu` object The menu object. `$args` array An array of arguments used to retrieve menu item 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_menu_items', $items, $menu, $args );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_nav\_menu\_items()](../functions/wp_get_nav_menu_items) wp-includes/nav-menu.php | Retrieves all menu items of a navigation menu. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'comment_excerpt', string $comment_excerpt, string $comment_ID ) apply\_filters( 'comment\_excerpt', string $comment\_excerpt, string $comment\_ID )
===================================================================================
Filters the comment excerpt for display.
`$comment_excerpt` string The comment excerpt text. `$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_excerpt', $comment_excerpt, $comment->comment_ID );
```
| Used By | Description |
| --- | --- |
| [comment\_excerpt()](../functions/comment_excerpt) wp-includes/comment-template.php | Displays the excerpt 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( 'wp_check_post_lock_window', int $interval ) apply\_filters( 'wp\_check\_post\_lock\_window', int $interval )
================================================================
Filters the post lock window duration.
`$interval` int The interval in seconds the post lock duration should last, plus 5 seconds. Default 150. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 150 ) + 5 ) . ':' . $active_lock[1];
```
| Used By | Description |
| --- | --- |
| [wp\_check\_post\_lock()](../functions/wp_check_post_lock) wp-admin/includes/post.php | Determines whether the post is currently being edited by another user. |
| [wp\_ajax\_wp\_remove\_post\_lock()](../functions/wp_ajax_wp_remove_post_lock) wp-admin/includes/ajax-actions.php | Ajax handler for removing a post lock. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress do_action( 'check_admin_referer', string $action, false|int $result ) do\_action( 'check\_admin\_referer', string $action, false|int $result )
========================================================================
Fires once the admin request has been validated or not.
`$action` string The 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. The filter hook is applied in the default `check_admin_referrer()` function after the nonce has been checked for security purposes; this allows a plugin to force WordPress to die for extra security reasons. Note that check\_admin\_referrer is also a “pluggable” function, meaning that plugins can override it.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'check_admin_referer', $action, $result );
```
| Used By | Description |
| --- | --- |
| [check\_admin\_referer()](../functions/check_admin_referer) wp-includes/pluggable.php | Ensures intent by verifying that a user was referred from another admin page with the correct security nonce. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress apply_filters( 'site_icon_meta_tags', string[] $meta_tags ) apply\_filters( 'site\_icon\_meta\_tags', string[] $meta\_tags )
================================================================
Filters the site icon meta tags, so plugins can add their own.
`$meta_tags` string[] Array of Site Icon meta tags. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$meta_tags = apply_filters( 'site_icon_meta_tags', $meta_tags );
```
| Used By | Description |
| --- | --- |
| [wp\_site\_icon()](../functions/wp_site_icon) wp-includes/general-template.php | Displays site icon meta tags. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'rest_send_nocache_headers', bool $rest_send_nocache_headers ) apply\_filters( 'rest\_send\_nocache\_headers', bool $rest\_send\_nocache\_headers )
====================================================================================
Filters whether to send nocache headers on a REST API request.
`$rest_send_nocache_headers` bool Whether to send no-cache headers. 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/)
```
$send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() );
```
| 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. |
| programming_docs |
wordpress apply_filters( 'install_themes_nonmenu_tabs', string[] $nonmenu_tabs ) apply\_filters( 'install\_themes\_nonmenu\_tabs', string[] $nonmenu\_tabs )
===========================================================================
Filters tabs not associated with a menu item on the Install Themes screen.
`$nonmenu_tabs` string[] The tabs that don't have a menu item on the Install Themes screen. File: `wp-admin/includes/class-wp-theme-install-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-theme-install-list-table.php/)
```
$nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );
```
| 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 apply_filters( 'wp_list_users_args', array $query_args, array $parsed_args ) apply\_filters( 'wp\_list\_users\_args', array $query\_args, array $parsed\_args )
==================================================================================
Filters the query arguments for the list of all users of the site.
`$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\_list\_users()](../functions/wp_list_users) combined with the defaults. More Arguments from wp\_list\_users( ... $args ) Array or string of default arguments.
* `orderby`stringHow to sort the users. 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 users to return or display. Default empty (all users).
* `exclude_admin`boolWhether to exclude the `'admin'` account, if it exists. Default false.
* `show_fullname`boolWhether to show the user's full name. Default false.
* `feed`stringIf not empty, show a link to the user's feed and use this text as the alt parameter of the link.
* `feed_image`stringIf not empty, show a link to the user's feed and use this image URL as clickable anchor.
* `feed_type`stringThe feed type to link to, such as `'rss2'`. Defaults to default feed type.
* `echo`boolWhether to output the result or instead return it. Default true.
* `style`stringIf `'list'`, each user is wrapped in an `<li>` element, otherwise the users will be separated by commas.
* `html`boolWhether to list the items in HTML form or plaintext. Default true.
* `exclude`stringAn array, comma-, or space-separated list of user IDs to exclude.
* `include`stringAn array, comma-, or space-separated list of user IDs to include.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$query_args = apply_filters( 'wp_list_users_args', $query_args, $parsed_args );
```
| Used By | Description |
| --- | --- |
| [wp\_list\_users()](../functions/wp_list_users) wp-includes/user.php | Lists all the users of the site, with several options available. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_personal_data_export_page', array $response, int $exporter_index, string $email_address, int $page, int $request_id, bool $send_as_email, string $exporter_key ) apply\_filters( 'wp\_privacy\_personal\_data\_export\_page', array $response, int $exporter\_index, string $email\_address, int $page, int $request\_id, bool $send\_as\_email, string $exporter\_key )
=======================================================================================================================================================================================================
Filters a page of personal data exporter data. Used to build the export report.
Allows the export response to be consumed by destinations in addition to Ajax.
`$response` array The personal data for the given exporter and page. `$exporter_index` int The index of the exporter 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. `$send_as_email` bool Whether the final results of the export should be emailed to the user. `$exporter_key` string The key (slug) of the exporter 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_export_page', $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key );
```
| Used By | Description |
| --- | --- |
| [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. |
wordpress apply_filters( 'wp_trim_words', string $text, int $num_words, string $more, string $original_text ) apply\_filters( 'wp\_trim\_words', string $text, int $num\_words, string $more, string $original\_text )
========================================================================================================
Filters the text content after words have been trimmed.
`$text` string The trimmed text. `$num_words` int The number of words to trim the text to. Default 55. `$more` string An optional string to append to the end of the trimmed text, e.g. …. `$original_text` string The text before it was trimmed. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'wp_trim_words', $text, $num_words, $more, $original_text );
```
| Used By | Description |
| --- | --- |
| [wp\_trim\_words()](../functions/wp_trim_words) wp-includes/formatting.php | Trims text to a certain number of words. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'allow_minor_auto_core_updates', bool $upgrade_minor ) apply\_filters( 'allow\_minor\_auto\_core\_updates', bool $upgrade\_minor )
===========================================================================
Filters whether to enable minor automatic core updates.
`$upgrade_minor` bool Whether to enable minor automatic core updates. File: `wp-admin/includes/class-core-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-core-upgrader.php/)
```
return apply_filters( 'allow_minor_auto_core_updates', $upgrade_minor );
```
| Used By | Description |
| --- | --- |
| [core\_auto\_updates\_settings()](../functions/core_auto_updates_settings) wp-admin/update-core.php | Display WordPress auto-updates settings. |
| [WP\_Site\_Health\_Auto\_Updates::test\_accepts\_minor\_updates()](../classes/wp_site_health_auto_updates/test_accepts_minor_updates) wp-admin/includes/class-wp-site-health-auto-updates.php | Checks if the site supports automatic minor updates. |
| [Core\_Upgrader::should\_update\_to\_version()](../classes/core_upgrader/should_update_to_version) wp-admin/includes/class-core-upgrader.php | Determines if this WordPress Core version should update to an offered version or not. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'pre_user_login', string $sanitized_user_login ) apply\_filters( 'pre\_user\_login', string $sanitized\_user\_login )
====================================================================
Filters a username after it has been sanitized.
This filter is called before the user is created or updated.
`$sanitized_user_login` string Username after it has been sanitized. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$pre_user_login = apply_filters( 'pre_user_login', $sanitized_user_login );
```
| 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( 'automatic_updates_send_debug_email', bool $development_version ) apply\_filters( 'automatic\_updates\_send\_debug\_email', bool $development\_version )
======================================================================================
Filters whether to send a debugging email for each automatic background update.
`$development_version` bool By default, emails are sent if the install is a development version.
Return false to avoid the email. 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( 'automatic_updates_send_debug_email', $development_version ) ) {
```
| 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.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( "customize_value_{$id_base}", mixed $default_value, WP_Customize_Setting $setting ) apply\_filters( "customize\_value\_{$id\_base}", mixed $default\_value, WP\_Customize\_Setting $setting )
=========================================================================================================
Filters a Customize setting value not handled as a theme\_mod or option.
The dynamic portion of the hook name, `$id_base`, refers to the base slug of the setting name, initialized from `$this->id_data['base']`.
For settings handled as theme\_mods or options, see those corresponding functions for available hooks.
`$default_value` mixed The setting default value. Default empty. `$setting` [WP\_Customize\_Setting](../classes/wp_customize_setting) The 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_value_{$id_base}", $value, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Custom\_CSS\_Setting::value()](../classes/wp_customize_custom_css_setting/value) wp-includes/customize/class-wp-customize-custom-css-setting.php | Fetch the value of the setting. Will return the previewed value when `preview()` is called. |
| [WP\_Customize\_Setting::value()](../classes/wp_customize_setting/value) wp-includes/class-wp-customize-setting.php | Fetch the value of the setting. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$this` setting instance as the second parameter. |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'register_block_type_args', array $args, string $block_type ) apply\_filters( 'register\_block\_type\_args', array $args, string $block\_type )
=================================================================================
Filters the arguments for registering a block type.
`$args` array Array of arguments for registering a block type. `$block_type` string Block type name including namespace. File: `wp-includes/class-wp-block-type.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-block-type.php/)
```
$args = apply_filters( 'register_block_type_args', $args, $this->name );
```
| Used By | Description |
| --- | --- |
| [WP\_Block\_Type::set\_props()](../classes/wp_block_type/set_props) wp-includes/class-wp-block-type.php | Sets block type properties. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( "shortcode_atts_{$shortcode}", array $out, array $pairs, array $atts, string $shortcode ) apply\_filters( "shortcode\_atts\_{$shortcode}", array $out, array $pairs, array $atts, string $shortcode )
===========================================================================================================
Filters shortcode attributes.
If the third parameter of the [shortcode\_atts()](../functions/shortcode_atts) function is present then this filter is available.
The third parameter, $shortcode, is the name of the shortcode.
`$out` array The output array of shortcode attributes. `$pairs` array The supported attributes and their defaults. `$atts` array The user defined shortcode attributes. `$shortcode` string The shortcode name. File: `wp-includes/shortcodes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/shortcodes.php/)
```
$out = apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts, $shortcode );
```
| Used By | Description |
| --- | --- |
| [shortcode\_atts()](../functions/shortcode_atts) wp-includes/shortcodes.php | Combines user attributes with known attributes and fill in defaults when needed. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$shortcode` parameter. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'auth_cookie_expired', string[] $cookie_elements ) do\_action( 'auth\_cookie\_expired', string[] $cookie\_elements )
=================================================================
Fires once an authentication cookie has expired.
`$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_expired', $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( 'embed_html', string $output, WP_Post $post, int $width, int $height ) apply\_filters( 'embed\_html', string $output, WP\_Post $post, int $width, int $height )
========================================================================================
Filters the embed HTML output for a given post.
`$output` string The default iframe tag to display embedded content. `$post` [WP\_Post](../classes/wp_post) Current post object. `$width` int Width of the response. `$height` int Height of the response. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
return apply_filters( 'embed_html', $output, $post, $width, $height );
```
| Used By | Description |
| --- | --- |
| [get\_post\_embed\_html()](../functions/get_post_embed_html) wp-includes/embed.php | Retrieves the embed code for a specific post. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'max_srcset_image_width', int $max_width, int[] $size_array ) apply\_filters( 'max\_srcset\_image\_width', int $max\_width, int[] $size\_array )
==================================================================================
Filters the maximum image width to be included in a ‘srcset’ attribute.
`$max_width` int The maximum image width to be included in the `'srcset'`. Default `'2048'`. `$size_array` int[] An array of requested width and height values.
* intThe width in pixels.
* `1`intThe height in pixels.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$max_srcset_image_width = apply_filters( 'max_srcset_image_width', 2048, $size_array );
```
| 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.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_embed_handler_video', string $video, array $attr, string $url, array $rawattr ) apply\_filters( 'wp\_embed\_handler\_video', string $video, array $attr, string $url, array $rawattr )
======================================================================================================
Filters the video embed output.
`$video` string Video embed output. `$attr` array An array of embed attributes. `$url` string The original URL that was matched by the regex. `$rawattr` array The original unmodified attributes. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr );
```
| Used By | Description |
| --- | --- |
| [wp\_embed\_handler\_video()](../functions/wp_embed_handler_video) wp-includes/embed.php | Video embed handler callback. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress do_action( 'deleted_option', string $option ) do\_action( 'deleted\_option', string $option )
===============================================
Fires after an option has been deleted.
`$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( 'deleted_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( 'is_post_type_viewable', bool $is_viewable, WP_Post_Type $post_type ) apply\_filters( 'is\_post\_type\_viewable', bool $is\_viewable, WP\_Post\_Type $post\_type )
============================================================================================
Filters whether a post type is considered “viewable”.
The returned filtered value must be a boolean type to ensure `is_post_type_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 type is "viewable" (strict type). `$post_type` [WP\_Post\_Type](../classes/wp_post_type) Post type 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_type_viewable', $is_viewable, $post_type );
```
| Used By | Description |
| --- | --- |
| [is\_post\_type\_viewable()](../functions/is_post_type_viewable) wp-includes/post.php | Determines whether a post type is considered “viewable”. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'upload_post_params', array $post_params ) apply\_filters( 'upload\_post\_params', array $post\_params )
=============================================================
Filters the media upload post parameters.
`$post_params` array An array of media upload parameters used by Plupload. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$post_params = apply_filters( 'upload_post_params', $post_params );
```
| 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/) | |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'comment_notification_text', string $notify_message, string $comment_id ) apply\_filters( 'comment\_notification\_text', string $notify\_message, string $comment\_id )
=============================================================================================
Filters the comment notification email text.
`$notify_message` string The comment notification email text. `$comment_id` string Comment ID as a numeric string. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$notify_message = apply_filters( 'comment_notification_text', $notify_message, $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 |
| --- | --- |
| [1.5.2](https://developer.wordpress.org/reference/since/1.5.2/) | Introduced. |
wordpress do_action( 'rest_insert_comment', WP_Comment $comment, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_insert\_comment', WP\_Comment $comment, WP\_REST\_Request $request, bool $creating )
=======================================================================================================
Fires 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_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 |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'media_date_column_time', string $h_time, WP_Post $post, string $column_name ) apply\_filters( 'media\_date\_column\_time', string $h\_time, WP\_Post $post, string $column\_name )
====================================================================================================
Filters the published time of an attachment displayed in the Media list table.
`$h_time` string The published time. `$post` [WP\_Post](../classes/wp_post) Attachment object. `$column_name` string The column name. 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/)
```
echo apply_filters( 'media_date_column_time', $h_time, $post, 'date' );
```
| Used By | Description |
| --- | --- |
| [WP\_Media\_List\_Table::column\_date()](../classes/wp_media_list_table/column_date) wp-admin/includes/class-wp-media-list-table.php | Handles the date column output. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'root_rewrite_rules', string[] $root_rewrite ) apply\_filters( 'root\_rewrite\_rules', string[] $root\_rewrite )
=================================================================
Filters rewrite rules used for root-level archives.
Likely root-level archives would include pagination rules for the homepage as well as site-wide post feeds (e.g. `/feed/`, and `/feed/atom/`).
`$root_rewrite` string[] Array of root-level rewrite rules, 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/)
```
$root_rewrite = apply_filters( 'root_rewrite_rules', $root_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( 'rest_prepare_autosave', WP_REST_Response $response, WP_Post $post, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_autosave', WP\_REST\_Response $response, WP\_Post $post, WP\_REST\_Request $request )
=====================================================================================================================
Filters a revision returned from the REST API.
Allows modification of the revision right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$post` [WP\_Post](../classes/wp_post) The original revision object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. File: `wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php/)
```
return apply_filters( 'rest_prepare_autosave', $response, $post, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Autosaves\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_autosaves_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php | Prepares the revision for the REST response. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'page_row_actions', string[] $actions, WP_Post $post ) apply\_filters( 'page\_row\_actions', string[] $actions, WP\_Post $post )
=========================================================================
Filters the array of row action links on the Pages list table.
The filter is evaluated only for 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( 'page_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. |
wordpress apply_filters( 'automatic_updates_debug_email', array $email, int $failures, mixed $results ) apply\_filters( 'automatic\_updates\_debug\_email', array $email, int $failures, mixed $results )
=================================================================================================
Filters the debug email that can be 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`stringEmail subject.
* `body`stringEmail message body.
* `headers`stringAny email headers. Default empty.
`$failures` int The number of failures encountered while upgrading. `$results` mixed 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/)
```
$email = apply_filters( 'automatic_updates_debug_email', $email, $failures, $this->update_results );
```
| Used By | Description |
| --- | --- |
| [WP\_Automatic\_Updater::send\_debug\_email()](../classes/wp_automatic_updater/send_debug_email) wp-admin/includes/class-wp-automatic-updater.php | Prepares and sends an email of a full log of background update results, useful for debugging and geekery. |
| Version | Description |
| --- | --- |
| [3.8.0](https://developer.wordpress.org/reference/since/3.8.0/) | Introduced. |
wordpress apply_filters( 'allow_empty_comment', bool $allow_empty_comment, array $commentdata ) apply\_filters( 'allow\_empty\_comment', bool $allow\_empty\_comment, array $commentdata )
==========================================================================================
Filters whether an empty comment should be allowed.
`$allow_empty_comment` bool Whether to allow empty comments. Default false. `$commentdata` array Array of comment data to be sent to [wp\_insert\_comment()](../functions/wp_insert_comment) . More Arguments from wp\_insert\_comment( ... $commentdata ) Array of arguments for inserting a new comment.
* `comment_agent`stringThe HTTP user agent of the `$comment_author` when the comment was submitted. Default empty.
* `comment_approved`int|stringWhether the comment has been approved. Default 1.
* `comment_author`stringThe name of the author of the comment. Default empty.
* `comment_author_email`stringThe email address of the `$comment_author`. Default empty.
* `comment_author_IP`stringThe IP address of the `$comment_author`. Default empty.
* `comment_author_url`stringThe URL address of the `$comment_author`. Default empty.
* `comment_content`stringThe content of the comment. Default empty.
* `comment_date`stringThe date the comment was submitted. To set the date manually, `$comment_date_gmt` must also be specified.
Default is the current time.
* `comment_date_gmt`stringThe date the comment was submitted in the GMT timezone.
Default is `$comment_date` in the site's GMT timezone.
* `comment_karma`intThe karma of the comment. Default 0.
* `comment_parent`intID of this comment's parent, if any. Default 0.
* `comment_post_ID`intID of the post that relates to the comment, if any.
Default 0.
* `comment_type`stringComment type. Default `'comment'`.
* `comment_meta`arrayOptional. Array of key/value pairs to be stored in commentmeta for the new comment.
* `user_id`intID of the user who submitted the comment. Default 0.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::check\_is\_comment\_content\_allowed()](../classes/wp_rest_comments_controller/check_is_comment_content_allowed) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | If empty comments are not allowed, checks if the provided comment content is not empty. |
| [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. |
| [wp\_xmlrpc\_server::wp\_newComment()](../classes/wp_xmlrpc_server/wp_newcomment) wp-includes/class-wp-xmlrpc-server.php | Create new comment. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'htmledit_pre', string $output ) apply\_filters( 'htmledit\_pre', string $output )
=================================================
This hook has been deprecated.
Filters the text before it is formatted for the HTML editor.
`$output` string The HTML-formatted text. File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
return apply_filters( 'htmledit_pre', $output );
```
| Used By | Description |
| --- | --- |
| [wp\_htmledit\_pre()](../functions/wp_htmledit_pre) wp-includes/deprecated.php | Formats text for the HTML editor. |
| [\_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 |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | This hook has been deprecated. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
| programming_docs |
wordpress do_action( "{$old_status}_to_{$new_status}", WP_Post $post ) do\_action( "{$old\_status}\_to\_{$new\_status}", WP\_Post $post )
==================================================================
Fires when a post is transitioned from one status to another.
The dynamic portions of the hook name, `$new_status` and `$old_status`, refer to the old and new post statuses, respectively.
Possible hook names include:
* `draft_to_publish`
* `publish_to_trash`
* `pending_to_draft`
`$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( "{$old_status}_to_{$new_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 do_action( 'post_submitbox_start', WP_Post|null $post ) do\_action( 'post\_submitbox\_start', WP\_Post|null $post )
===========================================================
Fires at the beginning of the publishing actions section of the Publish meta box.
`$post` [WP\_Post](../classes/wp_post)|null [WP\_Post](../classes/wp_post) object for the current post on Edit Post screen, null on Edit Link screen. 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_start', $post );
```
| Used By | Description |
| --- | --- |
| [link\_submit\_meta\_box()](../functions/link_submit_meta_box) wp-admin/includes/meta-boxes.php | Displays link create form fields. |
| [post\_submit\_meta\_box()](../functions/post_submit_meta_box) wp-admin/includes/meta-boxes.php | Displays post submit form fields. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$post` parameter. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'customize_save_validation_before', WP_Customize_Manager $manager ) do\_action( 'customize\_save\_validation\_before', WP\_Customize\_Manager $manager )
====================================================================================
Fires before save validation happens.
Plugins can add just-in-time [‘customize\_validate\_{$this->ID](../functions/%e2%80%98customize_validate_this-id)’} filters at this point to catch any settings registered after `customize_register`.
The dynamic portion of the hook name, `$this->ID` refers to the setting ID.
`$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_validation_before', $this );
```
| 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.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'pre_recurse_dirsize', int|false $space_used, string $directory, string|string[]|null $exclude, int $max_execution_time, array $directory_cache ) apply\_filters( 'pre\_recurse\_dirsize', int|false $space\_used, string $directory, string|string[]|null $exclude, int $max\_execution\_time, array $directory\_cache )
=======================================================================================================================================================================
Filters the amount of storage space used by one directory and all its children, in megabytes.
Return the actual used space to short-circuit the recursive PHP file size calculation and use something else, like a CDN API or native operating system tools for better performance.
`$space_used` int|false The amount of used space, in bytes. Default false. `$directory` string Full path of a directory. `$exclude` string|string[]|null Full path of a subdirectory to exclude from the total, or array of paths. `$max_execution_time` int Maximum time to run before giving up. In seconds. `$directory_cache` array Array of cached directory paths. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );
```
| Used By | Description |
| --- | --- |
| [recurse\_dirsize()](../functions/recurse_dirsize) wp-includes/functions.php | Gets the size of a directory recursively. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'log_query_custom_data', array $query_data, string $query, float $query_time, string $query_callstack, float $query_start ) apply\_filters( 'log\_query\_custom\_data', array $query\_data, string $query, float $query\_time, string $query\_callstack, float $query\_start )
==================================================================================================================================================
Filters the custom data to log alongside a query.
Caution should be used when modifying any of this data, it is recommended that any additional information you need to store about a query be added as a new associative array element.
`$query_data` array Custom query data. `$query` string The query's SQL. `$query_time` float Total time spent on the query, in seconds. `$query_callstack` string Comma-separated list of the calling functions. `$query_start` float Unix timestamp of the time at the start of the query. File: `wp-includes/class-wpdb.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wpdb.php/)
```
$query_data = apply_filters( 'log_query_custom_data', $query_data, $query, $query_time, $query_callstack, $query_start );
```
| Used By | Description |
| --- | --- |
| [wpdb::log\_query()](../classes/wpdb/log_query) wp-includes/class-wpdb.php | Logs query data. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'login_message', string $message ) apply\_filters( 'login\_message', string $message )
===================================================
Filters the message to display above the login form.
`$message` string Login message text. The **“login\_message”** filter is used to filter the message displayed on the WordPress login page above the login form. This filter can return HTML markup.
File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
$message = apply_filters( 'login_message', $message );
```
| 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_read_image_metadata', array $meta, string $file, int $image_type, array $iptc, array $exif ) apply\_filters( 'wp\_read\_image\_metadata', array $meta, string $file, int $image\_type, array $iptc, array $exif )
====================================================================================================================
Filters the array of meta data read from an image’s exif data.
`$meta` array Image meta data. `$file` string Path to image file. `$image_type` int Type of image, one of the `IMAGETYPE_XXX` constants. `$iptc` array IPTC data. `$exif` array EXIF data. File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
return apply_filters( 'wp_read_image_metadata', $meta, $file, $image_type, $iptc, $exif );
```
| 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 |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | The `$exif` parameter was added. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$iptc` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'translations_api', false|array $result, string $type, object $args ) apply\_filters( 'translations\_api', false|array $result, string $type, object $args )
======================================================================================
Allows a plugin to override the WordPress.org Translation Installation API entirely.
`$result` false|array The result array. Default false. `$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/)
```
$res = apply_filters( 'translations_api', false, $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. |
wordpress apply_filters( 'rss_enclosure', string $html_link_tag ) apply\_filters( 'rss\_enclosure', string $html\_link\_tag )
===========================================================
Filters the RSS 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( 'rss_enclosure', '<enclosure url="' . esc_url( trim( $enclosure[0] ) ) . '" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( $type ) . '" />' . "\n" );
```
| Used By | Description |
| --- | --- |
| [rss\_enclosure()](../functions/rss_enclosure) wp-includes/feed.php | Displays the rss enclosure for the current post. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'comment_form_fields', array $comment_fields ) apply\_filters( 'comment\_form\_fields', array $comment\_fields )
=================================================================
Filters the comment form fields, including the textarea.
`$comment_fields` array The comment fields. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$comment_fields = apply_filters( 'comment_form_fields', $comment_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 |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'embed_site_title_html', string $site_title ) apply\_filters( 'embed\_site\_title\_html', string $site\_title )
=================================================================
Filters the site title HTML in the embed footer.
`$site_title` string The site title HTML. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
echo apply_filters( 'embed_site_title_html', $site_title );
```
| Used By | Description |
| --- | --- |
| [the\_embed\_site\_title()](../functions/the_embed_site_title) wp-includes/embed.php | Prints the necessary markup for the site title in an embed template. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'rest_api_init', WP_REST_Server $wp_rest_server ) do\_action( 'rest\_api\_init', WP\_REST\_Server $wp\_rest\_server )
===================================================================
Fires when preparing to serve a REST API request.
Endpoint objects should be created and register their hooks on this action rather than another action to ensure they’re only loaded when needed.
`$wp_rest_server` [WP\_REST\_Server](../classes/wp_rest_server) Server object. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
do_action( 'rest_api_init', $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( "update_themes_{$hostname}", array|false $update, array $theme_data, string $theme_stylesheet, string[] $locales ) apply\_filters( "update\_themes\_{$hostname}", array|false $update, array $theme\_data, string $theme\_stylesheet, string[] $locales )
======================================================================================================================================
Filters the update response for a given theme 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 theme update data with the latest details. Default false.
* `id`stringOptional. ID of the theme for update purposes, should be a URI specified in the `Update URI` header field.
* `theme`stringDirectory name of the theme.
* `version`stringThe version of the theme.
* `url`stringThe URL for details of the theme.
* `package`stringOptional. The update ZIP for the theme.
* `tested`stringOptional. The version of WordPress the theme is tested against.
* `requires_php`stringOptional. The version of PHP which the theme requires.
* `autoupdate`boolOptional. Whether the theme should automatically update.
* `translations`array Optional. List of translation updates for the theme.
+ `language`stringThe language the translation update is for.
+ `version`stringThe version of the theme 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. `$theme_data` array Theme headers. `$theme_stylesheet` string Theme stylesheet. `$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_themes_{$hostname}", false, $theme_data, $theme_stylesheet, $locales );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_themes()](../functions/wp_update_themes) wp-includes/update.php | Checks for available updates to themes based on the latest versions hosted on WordPress.org. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_taxonomies', WP_Taxonomy[] $taxonomies ) apply\_filters( 'wp\_sitemaps\_taxonomies', WP\_Taxonomy[] $taxonomies )
========================================================================
Filters the list of taxonomy object subtypes available within the sitemap.
`$taxonomies` [WP\_Taxonomy](../classes/wp_taxonomy)[] Array of registered taxonomy objects keyed by their 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/)
```
return apply_filters( 'wp_sitemaps_taxonomies', $taxonomies );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Taxonomies::get\_object\_subtypes()](../classes/wp_sitemaps_taxonomies/get_object_subtypes) wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php | Returns all public, registered taxonomies. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'post_thumbnail_size', string|int[] $size, int $post_id ) apply\_filters( 'post\_thumbnail\_size', string|int[] $size, int $post\_id )
============================================================================
Filters the post thumbnail size.
`$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). `$post_id` int The post ID. File: `wp-includes/post-thumbnail-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-thumbnail-template.php/)
```
$size = apply_filters( 'post_thumbnail_size', $size, $post->ID );
```
| Used By | Description |
| --- | --- |
| [get\_the\_post\_thumbnail()](../functions/get_the_post_thumbnail) wp-includes/post-thumbnail-template.php | Retrieves the post thumbnail. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$post_id` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'wp_update_nav_menu_item', int $menu_id, int $menu_item_db_id, array $args ) do\_action( 'wp\_update\_nav\_menu\_item', int $menu\_id, int $menu\_item\_db\_id, array $args )
================================================================================================
Fires after a navigation menu item has been updated.
* [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 updated menu item. `$args` array An array of arguments used to update a 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_update_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 |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'audio_submitbox_misc_sections', array $fields, WP_Post $post ) apply\_filters( 'audio\_submitbox\_misc\_sections', array $fields, WP\_Post $post )
===================================================================================
Filters the audio attachment metadata fields to be shown in the publish meta box.
The key for each item in the array should correspond to an attachment metadata key, and the value should be the desired label.
`$fields` array An array of the attachment metadata keys and labels. `$post` [WP\_Post](../classes/wp_post) [WP\_Post](../classes/wp_post) object for the current attachment. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$audio_fields = apply_filters( 'audio_submitbox_misc_sections', $fields, $post );
```
| Used By | Description |
| --- | --- |
| [attachment\_submitbox\_metadata()](../functions/attachment_submitbox_metadata) wp-admin/includes/media.php | Displays non-editable attachment metadata in the publish meta box. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$post` parameter. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'template_redirect' ) do\_action( 'template\_redirect' )
==================================
Fires before determining which template to load.
* This action hook executes just before WordPress determines which template page to load. It is a good hook to use if you need to do a redirect with full knowledge of the content that has been queried.
* **Loading a different template is not a good use of this action hook**. If you include another template and then use `exit()` (or `die()`), no subsequent template\_redirect hooks will be run, which could break the site’s functionality. Instead, use the [`template_include`](template_include) filter hook to return the path to the new template you want to use. This will allow an alternative template to be used without interfering with the WordPress loading process.
File: `wp-includes/template-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/template-loader.php/)
```
do_action( 'template_redirect' );
```
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'default_wp_template_part_areas', array $default_area_definitions ) apply\_filters( 'default\_wp\_template\_part\_areas', array $default\_area\_definitions )
=========================================================================================
Filters the list of allowed template part area values.
`$default_area_definitions` array An array of supported area objects. 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_wp_template_part_areas', $default_area_definitions );
```
| Used By | Description |
| --- | --- |
| [get\_allowed\_block\_template\_part\_areas()](../functions/get_allowed_block_template_part_areas) wp-includes/block-template-utils.php | Returns a filtered list of allowed area values for template parts. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress do_action( 'clean_term_cache', array $ids, string $taxonomy, bool $clean_taxonomy ) do\_action( 'clean\_term\_cache', array $ids, string $taxonomy, bool $clean\_taxonomy )
=======================================================================================
Fires once after each taxonomy’s term cache has been cleaned.
`$ids` array An array of term IDs. `$taxonomy` string Taxonomy slug. `$clean_taxonomy` bool Whether or not to clean taxonomy-wide caches File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
do_action( 'clean_term_cache', $ids, $taxonomy, $clean_taxonomy );
```
| Used By | Description |
| --- | --- |
| [clean\_term\_cache()](../functions/clean_term_cache) wp-includes/taxonomy.php | Removes all of the term IDs from the cache. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Added the `$clean_taxonomy` parameter. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'get_edit_post_link', string $link, int $post_id, string $context ) apply\_filters( 'get\_edit\_post\_link', string $link, int $post\_id, string $context )
=======================================================================================
Filters the post edit link.
`$link` string The edit link. `$post_id` int Post ID. `$context` string The link context. If set to `'display'` then ampersands are encoded. 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_post_link', $link, $post->ID, $context );
```
| Used By | Description |
| --- | --- |
| [get\_edit\_post\_link()](../functions/get_edit_post_link) wp-includes/link-template.php | Retrieves the edit post link for post. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'rest_index', WP_REST_Response $response, WP_REST_Request $request ) apply\_filters( 'rest\_index', WP\_REST\_Response $response, WP\_REST\_Request $request )
=========================================================================================
Filters the REST API root index data.
This contains the data describing the API. This includes information about supported authentication schemes, supported namespaces, routes available on the API, and a small amount of data about the site.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) Response data. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request 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/)
```
return apply_filters( 'rest_index', $response, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Server::get\_index()](../classes/wp_rest_server/get_index) wp-includes/rest-api/class-wp-rest-server.php | Retrieves the site index. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Added `$request` parameter. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'manage_posts_custom_column', string $column_name, int $post_id ) do\_action( 'manage\_posts\_custom\_column', string $column\_name, int $post\_id )
==================================================================================
Fires in each custom column in the Posts list table.
This hook only fires if the current post type is non-hierarchical, such as posts.
`$column_name` string The name of the column to display. `$post_id` int The current post ID. 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 the list post/page/custom post type pages (which automatically appear in Screen Options). The action described in here works both for built in post types as well as custom post types. [manage\_{$post->$post\_type}\_posts\_custom\_column](manage_post-post_type_posts_custom_column) can be used in WP 3.1 and later for specific custom post types. Note that if the custom post type has `'hierarchical' => true`, then the correct action hook to use is <manage_pages_custom_column>.
**Predefined Column Names**:
The following column filters are already defined and used by WordPress. These can be redefined within a custom filter switch statement.
‘**cb**‘: checkbox for selecting post items for bulk actions
‘**title**‘: displays the post title as well as post action links (edit, quick edit, trash, view) based on user permissions
‘**author**‘: displays the username of the post author as a link to filter post by author
‘**categories**‘: displays the post categories as links to filter post by category
‘**tags**‘: displays the post tags as links to filter post by tags
‘**comments**‘: displays a comment icon with the number of comments as a permalink to manage the comments for that post
‘**date**‘: displays the date and 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/)
```
do_action( 'manage_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 |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'wpmu_blog_updated', int $blog_id ) do\_action( 'wpmu\_blog\_updated', int $blog\_id )
==================================================
Fires after the blog details are updated.
`$blog_id` int Site ID. File: `wp-includes/ms-blogs.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-blogs.php/)
```
do_action( 'wpmu_blog_updated', $site_id );
```
| Used By | Description |
| --- | --- |
| [wpmu\_update\_blogs\_date()](../functions/wpmu_update_blogs_date) wp-includes/ms-blogs.php | Update the last\_updated field for the current site. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'site_icon_image_sizes', int[] $site_icon_sizes ) apply\_filters( 'site\_icon\_image\_sizes', int[] $site\_icon\_sizes )
======================================================================
Filters the different dimensions that a site icon is saved in.
`$site_icon_sizes` int[] Array of sizes available for the Site Icon. 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/)
```
$this->site_icon_sizes = apply_filters( 'site_icon_image_sizes', $this->site_icon_sizes );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Icon::additional\_sizes()](../classes/wp_site_icon/additional_sizes) wp-admin/includes/class-wp-site-icon.php | Adds additional sizes to be made when creating the site icon images. |
| [WP\_Site\_Icon::intermediate\_image\_sizes()](../classes/wp_site_icon/intermediate_image_sizes) wp-admin/includes/class-wp-site-icon.php | Adds Site Icon sizes to the array of image sizes on demand. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action_ref_array( 'parse_site_query', WP_Site_Query $query ) do\_action\_ref\_array( 'parse\_site\_query', WP\_Site\_Query $query )
======================================================================
Fires after the site query vars have been parsed.
`$query` [WP\_Site\_Query](../classes/wp_site_query) The [WP\_Site\_Query](../classes/wp_site_query) instance (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( 'parse_site_query', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Query::parse\_query()](../classes/wp_site_query/parse_query) wp-includes/class-wp-site-query.php | Parses arguments passed to the site query with default query parameters. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'get_header_image', string $url ) apply\_filters( 'get\_header\_image', string $url )
===================================================
Filters the header image URL.
`$url` string Header image URL. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
$url = apply_filters( 'get_header_image', $url );
```
| Used By | Description |
| --- | --- |
| [get\_header\_image()](../functions/get_header_image) wp-includes/theme.php | Retrieves header image for custom header. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'get_date_sql', string $where, WP_Date_Query $query ) apply\_filters( 'get\_date\_sql', string $where, WP\_Date\_Query $query )
=========================================================================
Filters the date query WHERE clause.
`$where` string WHERE clause of the date query. `$query` [WP\_Date\_Query](../classes/wp_date_query) The [WP\_Date\_Query](../classes/wp_date_query) instance. File: `wp-includes/class-wp-date-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-date-query.php/)
```
return apply_filters( 'get_date_sql', $where, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Date\_Query::get\_sql()](../classes/wp_date_query/get_sql) wp-includes/class-wp-date-query.php | Generates WHERE clause to be appended to a main query. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'get_bloginfo_rss', string $info, string $show ) apply\_filters( 'get\_bloginfo\_rss', string $info, string $show )
==================================================================
Filters the bloginfo for use in RSS feeds.
* [convert\_chars()](../functions/convert_chars)
* [get\_bloginfo()](../functions/get_bloginfo)
`$info` string Converted string value of the blog information. `$show` string The type of blog information to retrieve. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
return apply_filters( 'get_bloginfo_rss', convert_chars( $info ), $show );
```
| Used By | Description |
| --- | --- |
| [get\_bloginfo\_rss()](../functions/get_bloginfo_rss) wp-includes/feed.php | Retrieves RSS container for the bloginfo function. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'print_late_styles', bool $print ) apply\_filters( 'print\_late\_styles', bool $print )
====================================================
Filters whether to print the styles queued too late for the HTML head.
`$print` bool Whether to print the `'late'` styles. 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_late_styles', true ) ) {
```
| Used By | Description |
| --- | --- |
| [print\_late\_styles()](../functions/print_late_styles) wp-includes/script-loader.php | Prints the styles that were queued too late for the HTML head. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'wp_omit_loading_attr_threshold', int $omit_threshold ) apply\_filters( 'wp\_omit\_loading\_attr\_threshold', int $omit\_threshold )
============================================================================
Filters the threshold for how many of the first content media elements to not lazy-load.
For these first content media elements, the `loading` attribute will be omitted. By default, this is the case for only the very first content media element.
`$omit_threshold` int The number of media elements where the `loading` attribute will not be added. Default 1. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$omit_threshold = apply_filters( 'wp_omit_loading_attr_threshold', 1 );
```
| Used By | Description |
| --- | --- |
| [wp\_omit\_loading\_attr\_threshold()](../functions/wp_omit_loading_attr_threshold) wp-includes/media.php | Gets the threshold for how many of the first content media elements to not lazy-load. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_users_query_args', array $args ) apply\_filters( 'wp\_sitemaps\_users\_query\_args', array $args )
=================================================================
Filters the query arguments for authors with public posts.
Allows modification of the authors query arguments before querying.
* [WP\_User\_Query](../classes/wp_user_query): for a full list of arguments
`$args` array Array of [WP\_User\_Query](../classes/wp_user_query) arguments. 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/)
```
$args = apply_filters(
'wp_sitemaps_users_query_args',
array(
'has_published_posts' => array_keys( $public_post_types ),
'number' => wp_sitemaps_get_max_urls( $this->object_type ),
)
);
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Users::get\_users\_query\_args()](../classes/wp_sitemaps_users/get_users_query_args) wp-includes/sitemaps/providers/class-wp-sitemaps-users.php | Returns the query args for retrieving users to list in the sitemap. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action_ref_array( 'send_headers', WP $wp ) do\_action\_ref\_array( 'send\_headers', WP $wp )
=================================================
Fires once the requested HTTP headers for caching, content type, etc. have been sent.
`$wp` WP Current WordPress environment instance (passed by reference). This action hook is used to add additional headers to the outgoing HTTP response.
File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
do_action_ref_array( 'send_headers', array( &$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.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_stylesheet_content', string $xsl_content ) apply\_filters( 'wp\_sitemaps\_stylesheet\_content', string $xsl\_content )
===========================================================================
Filters the content of the sitemap stylesheet.
`$xsl_content` string Full content for the XML stylesheet. 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_content', $xsl_content );
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Stylesheet::get\_sitemap\_stylesheet()](../classes/wp_sitemaps_stylesheet/get_sitemap_stylesheet) wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | Returns the escaped XSL for all sitemaps, except index. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'parse_tax_query', WP_Query $query ) do\_action( 'parse\_tax\_query', WP\_Query $query )
===================================================
Fires after taxonomy-related query vars have been parsed.
`$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( 'parse_tax_query', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::parse\_tax\_query()](../classes/wp_query/parse_tax_query) wp-includes/class-wp-query.php | Parses various taxonomy related query vars. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'themes_update_check_locales', string[] $locales ) apply\_filters( 'themes\_update\_check\_locales', string[] $locales )
=====================================================================
Filters the locales requested for theme translations.
`$locales` string[] Theme locales. Default is all available locales of the site. File: `wp-includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/update.php/)
```
$locales = apply_filters( 'themes_update_check_locales', $locales );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_themes()](../functions/wp_update_themes) wp-includes/update.php | Checks for available updates to themes based on the latest versions hosted on WordPress.org. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The default value of the `$locales` parameter changed to include all locales. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'the_excerpt_export', string $post_excerpt ) apply\_filters( 'the\_excerpt\_export', string $post\_excerpt )
===============================================================
Filters the post excerpt used for WXR exports.
`$post_excerpt` string Excerpt for the current post. File: `wp-admin/includes/export.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/export.php/)
```
$excerpt = wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
```
| Used By | Description |
| --- | --- |
| [export\_wp()](../functions/export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'parse_term_query', WP_Term_Query $query ) do\_action( 'parse\_term\_query', WP\_Term\_Query $query )
==========================================================
Fires after term query vars have been parsed.
`$query` [WP\_Term\_Query](../classes/wp_term_query) Current instance of [WP\_Term\_Query](../classes/wp_term_query). 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( 'parse_term_query', $this );
```
| 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.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_clauses_request', string[] $clauses, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_clauses\_request', string[] $clauses, WP\_Query $query )
============================================================================================
Filters all query clauses at once, for convenience.
For use by caching plugins.
Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT, fields (SELECT), and LIMIT clauses.
`$clauses` string[] Associative array of the clauses for the query.
* `where`stringThe WHERE clause of the query.
* `groupby`stringThe GROUP BY clause of the query.
* `join`stringThe JOIN clause of the query.
* `orderby`stringThe ORDER BY clause of the query.
* `distinct`stringThe DISTINCT clause of the query.
* `fields`stringThe SELECT clause of the query.
* `limits`stringThe 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/)
```
$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$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.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( "theme_{$post_type}_templates", string[] $post_templates, WP_Theme $theme, WP_Post|null $post, string $post_type ) apply\_filters( "theme\_{$post\_type}\_templates", string[] $post\_templates, WP\_Theme $theme, WP\_Post|null $post, string $post\_type )
=========================================================================================================================================
Filters list of page templates for a theme.
The dynamic portion of the hook name, `$post_type`, refers to the post type.
Possible hook names include:
* `theme_post_templates`
* `theme_page_templates`
* `theme_attachment_templates`
`$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_{$post_type}_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.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Added the `$post_type` parameter. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Converted to allow complete control over the `$page_templates` array. |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_filesize', null|int $size, string $path ) apply\_filters( 'pre\_wp\_filesize', null|int $size, string $path )
===================================================================
Filters the result of wp\_filesize before the PHP function is run.
`$size` null|int The unfiltered value. Returning an int from the callback bypasses the filesize call. `$path` string Path to the file. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$size = apply_filters( 'pre_wp_filesize', null, $path );
```
| Used By | Description |
| --- | --- |
| [wp\_filesize()](../functions/wp_filesize) wp-includes/functions.php | Wrapper for PHP filesize with filters and casting the result as an integer. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress do_action( 'wp_enqueue_scripts' ) do\_action( 'wp\_enqueue\_scripts' )
====================================
Fires when scripts and styles are enqueued.
`wp_enqueue_scripts` is the proper hook to use when enqueuing scripts and styles that are meant to appear on the front end. Despite the name, it is **used for enqueuing both scripts and styles**.
```
function themeslug_enqueue_style() {
wp_enqueue_style( 'my-theme', 'style.css', false );
}
function themeslug_enqueue_script() {
wp_enqueue_script( 'my-js', 'filename.js', false );
}
add_action( 'wp_enqueue_scripts', 'themeslug_enqueue_style' );
add_action( 'wp_enqueue_scripts', 'themeslug_enqueue_script' );
```
File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
do_action( 'wp_enqueue_scripts' );
```
| Used By | Description |
| --- | --- |
| [wp\_enqueue\_scripts()](../functions/wp_enqueue_scripts) wp-includes/script-loader.php | Wrapper for do\_action( ‘wp\_enqueue\_scripts’ ). |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'core_version_check_query_args', array $query ) apply\_filters( 'core\_version\_check\_query\_args', array $query )
===================================================================
Filters the query arguments sent as part of the core version check.
WARNING: Changing this data may result in your site not receiving security updates.
Please exercise extreme caution.
`$query` array Version check query arguments.
* `version`stringWordPress version number.
* `php`stringPHP version number.
* `locale`stringThe locale to retrieve updates for.
* `mysql`stringMySQL version number.
* `local_package`stringThe value of the $wp\_local\_package global, when set.
* `blogs`intNumber of sites on this WordPress installation.
* `users`intNumber of users on this WordPress installation.
* `multisite_enabled`intWhether this WordPress installation uses Multisite.
* `initial_db_version`intDatabase version of WordPress at time of installation.
File: `wp-includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/update.php/)
```
$query = apply_filters( 'core_version_check_query_args', $query );
```
| Used By | Description |
| --- | --- |
| [wp\_version\_check()](../functions/wp_version_check) wp-includes/update.php | Checks WordPress version against the newest version. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress do_action( 'clean_site_cache', string $id, WP_Site $blog, string $domain_path_key ) do\_action( 'clean\_site\_cache', string $id, WP\_Site $blog, string $domain\_path\_key )
=========================================================================================
Fires immediately after a site has been removed from the object cache.
`$id` string Site ID as a numeric string. `$blog` [WP\_Site](../classes/wp_site) Site object. `$domain_path_key` string md5 hash of domain and path. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );
```
| Used By | Description |
| --- | --- |
| [clean\_blog\_cache()](../functions/clean_blog_cache) wp-includes/ms-site.php | Clean the blog cache |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'pre_get_avatar', string|null $avatar, mixed $id_or_email, array $args ) apply\_filters( 'pre\_get\_avatar', string|null $avatar, mixed $id\_or\_email, array $args )
============================================================================================
Allows the HTML for a user’s avatar to be returned early.
Returning a non-null value will effectively short-circuit [get\_avatar()](../functions/get_avatar) , passing the value through the [‘get\_avatar’](get_avatar) filter and returning early.
`$avatar` string|null HTML for the user's avatar. Default null. `$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\_url()](../functions/get_avatar_url) , after processing. More Arguments from get\_avatar\_url( ... $args ) Arguments to use instead of the default arguments.
* `size`intHeight and width of the avatar in pixels. Default 96.
* `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.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );
```
| Used By | Description |
| --- | --- |
| [get\_avatar()](../functions/get_avatar) wp-includes/pluggable.php | Retrieves the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'get_the_post_type_description', string $description, WP_Post_Type $post_type_obj ) apply\_filters( 'get\_the\_post\_type\_description', string $description, WP\_Post\_Type $post\_type\_obj )
===========================================================================================================
Filters the description for a post type archive.
`$description` string The post type description. `$post_type_obj` [WP\_Post\_Type](../classes/wp_post_type) The post type 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_post_type_description', $description, $post_type_obj );
```
| Used By | Description |
| --- | --- |
| [get\_the\_post\_type\_description()](../functions/get_the_post_type_description) wp-includes/general-template.php | Retrieves the description for a post type archive. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'pre_ent2ncr', string|null $converted_text, string $text ) apply\_filters( 'pre\_ent2ncr', string|null $converted\_text, string $text )
============================================================================
Filters text before named entities are converted into numbered entities.
A non-null string must be returned for the filter to be evaluated.
`$converted_text` string|null The text to be converted. Default null. `$text` string The text prior to entity conversion. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$filtered = apply_filters( 'pre_ent2ncr', null, $text );
```
| Used By | Description |
| --- | --- |
| [ent2ncr()](../functions/ent2ncr) wp-includes/formatting.php | Converts named entities into numbered entities. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'insert_user_meta', array $meta, WP_User $user, bool $update, array $userdata ) apply\_filters( 'insert\_user\_meta', array $meta, WP\_User $user, bool $update, array $userdata )
==================================================================================================
Filters a user’s meta values and keys immediately after the user is created or updated and before any user meta is inserted or updated.
Does not include contact methods. These are added using `wp_get_user_contact_methods( $user )`.
For custom meta fields, see the [‘insert\_custom\_user\_meta’](insert_custom_user_meta) filter.
`$meta` array Default meta values and keys for the user.
* `nickname`stringThe user's nickname. Default is the user's username.
* `first_name`stringThe user's first name.
* `last_name`stringThe user's last name.
* `description`stringThe user's description.
* `rich_editing`stringWhether to enable the rich-editor for the user. Default `'true'`.
* `syntax_highlighting`stringWhether to enable the rich code editor for the user. Default `'true'`.
* `comment_shortcuts`stringWhether to enable keyboard shortcuts for the user. Default `'false'`.
* `admin_color`stringThe color scheme for a user's admin screen. Default `'fresh'`.
* `use_ssl`int|boolWhether to force SSL on the user's admin area. `0|false` if SSL is not forced.
* `show_admin_bar_front`stringWhether to show the admin bar on the front end for the user.
Default `'true'`.
* `locale`stringUser's locale. Default empty.
`$user` [WP\_User](../classes/wp_user) User object. `$update` bool Whether the user is being updated rather than 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/)
```
$meta = apply_filters( 'insert_user_meta', $meta, $user, $update, $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.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'send_site_admin_email_change_email', bool $send, string $old_email, string $new_email ) apply\_filters( 'send\_site\_admin\_email\_change\_email', bool $send, string $old\_email, string $new\_email )
===============================================================================================================
Filters whether to send the site admin email change notification email.
`$send` bool Whether to send the email notification. `$old_email` string The old site admin email address. `$new_email` string The new site admin email address. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$send = apply_filters( 'send_site_admin_email_change_email', $send, $old_email, $new_email );
```
| Used By | Description |
| --- | --- |
| [wp\_site\_admin\_email\_change\_notification()](../functions/wp_site_admin_email_change_notification) wp-includes/functions.php | Sends an email to the old site admin email address when the site admin email address changes. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'media_upload_default_tab', string $tab ) apply\_filters( 'media\_upload\_default\_tab', string $tab )
============================================================
Filters the default tab in the legacy (pre-3.5.0) media popup.
`$tab` string The default media popup tab. Default `'type'` (From Computer). File: `wp-admin/media-upload.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/media-upload.php/)
```
$tab = apply_filters( 'media_upload_default_tab', 'type' );
```
| Used By | Description |
| --- | --- |
| [the\_media\_upload\_tabs()](../functions/the_media_upload_tabs) wp-admin/includes/media.php | Outputs the legacy media upload tabs UI. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_nav_menu_item', WP_REST_Response $response, object $menu_item, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_nav\_menu\_item', WP\_REST\_Response $response, object $menu\_item, WP\_REST\_Request $request )
================================================================================================================================
Filters the menu item data for a REST API response.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$menu_item` object Menu item setup by [wp\_setup\_nav\_menu\_item()](../functions/wp_setup_nav_menu_item) . More Arguments from wp\_setup\_nav\_menu\_item( ... $menu\_item ) The menu item to modify. `$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/)
```
return apply_filters( 'rest_prepare_nav_menu_item', $response, $menu_item, $request );
```
| 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. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress apply_filters( 'user_erasure_fulfillment_email_content', string $content, array $email_data ) apply\_filters( 'user\_erasure\_fulfillment\_email\_content', string $content, array $email\_data )
===================================================================================================
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( 'user_erasure_fulfillment_email_content', $content, $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( 'send_password_change_email', bool $send, array $user, array $userdata ) apply\_filters( 'send\_password\_change\_email', bool $send, array $user, array $userdata )
===========================================================================================
Filters whether to send the password change email.
* [wp\_insert\_user()](../functions/wp_insert_user) : For `$user` and `$userdata` fields.
`$send` bool Whether to send the email. `$user` array The original user array. `$userdata` array The updated user array. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$send_password_change_email = apply_filters( 'send_password_change_email', true, $user, $userdata );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_user()](../functions/wp_update_user) wp-includes/user.php | Updates a user in the database. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action( 'comment_on_trash', int $comment_post_id ) do\_action( 'comment\_on\_trash', int $comment\_post\_id )
==========================================================
Fires when a comment is attempted on a trashed 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_trash', $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 do_action( 'edit_form_after_title', WP_Post $post ) do\_action( 'edit\_form\_after\_title', WP\_Post $post )
========================================================
Fires after the title field.
`$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_after_title', $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 |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'rest_dispatch_request', mixed $dispatch_result, WP_REST_Request $request, string $route, array $handler ) apply\_filters( 'rest\_dispatch\_request', mixed $dispatch\_result, WP\_REST\_Request $request, string $route, array $handler )
===============================================================================================================================
Filters the REST API dispatch request result.
Allow plugins to override dispatching the request.
`$dispatch_result` mixed Dispatch result, will be used if not empty. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. `$route` string Route matched for the request. `$handler` array Route handler used for the request. 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/)
```
$dispatch_result = apply_filters( 'rest_dispatch_request', null, $request, $route, $handler );
```
| 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.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Added `$route` and `$handler` parameters. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_targeted_link_rel', string $rel, string $link_html ) apply\_filters( 'wp\_targeted\_link\_rel', string $rel, string $link\_html )
============================================================================
Filters the rel values that are added to links with `target` attribute.
`$rel` string The rel values. `$link_html` string The matched content of the link tag including all HTML attributes. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$rel = apply_filters( 'wp_targeted_link_rel', 'noopener', $link_html );
```
| Used By | Description |
| --- | --- |
| [wp\_targeted\_link\_rel\_callback()](../functions/wp_targeted_link_rel_callback) wp-includes/formatting.php | Callback to add `rel="noopener"` string to HTML A element. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'sanitize_email', string $sanitized_email, string $email, string|null $message ) apply\_filters( 'sanitize\_email', string $sanitized\_email, string $email, string|null $message )
==================================================================================================
Filters a sanitized email address.
This filter is evaluated under several contexts, including ’email\_too\_short’, ’email\_no\_at’, ‘local\_invalid\_chars’, ‘domain\_period\_sequence’, ‘domain\_period\_limits’, ‘domain\_no\_periods’, ‘domain\_no\_valid\_subs’, or no context.
`$sanitized_email` string The sanitized email address. `$email` string The email address, as provided to [sanitize\_email()](../functions/sanitize_email) . More Arguments from sanitize\_email( ... $email ) Email address to filter. `$message` string|null A message to pass to the user. null if email is sanitized. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'sanitize_email', '', $email, 'email_too_short' );
```
| Used By | Description |
| --- | --- |
| [sanitize\_email()](../functions/sanitize_email) wp-includes/formatting.php | Strips out all characters that are not allowable in an email. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress do_action_ref_array( 'parse_comment_query', WP_Comment_Query $query ) do\_action\_ref\_array( 'parse\_comment\_query', WP\_Comment\_Query $query )
============================================================================
Fires after the comment query vars have been parsed.
`$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/)
```
do_action_ref_array( 'parse_comment_query', array( &$this ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Comment\_Query::parse\_query()](../classes/wp_comment_query/parse_query) wp-includes/class-wp-comment-query.php | Parse arguments passed to the comment query with default query parameters. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'rest_oembed_ttl', int $time, string $url, array $args ) apply\_filters( 'rest\_oembed\_ttl', int $time, string $url, array $args )
==========================================================================
Filters the oEmbed TTL value (time to live).
Similar to the [‘oembed\_ttl’](oembed_ttl) filter, but for the REST API oEmbed proxy endpoint.
`$time` int Time to live (in seconds). `$url` string The attempted embed URL. `$args` array An array of embed request arguments. File: `wp-includes/class-wp-oembed-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed-controller.php/)
```
$ttl = apply_filters( 'rest_oembed_ttl', DAY_IN_SECONDS, $url, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed\_Controller::get\_proxy\_item()](../classes/wp_oembed_controller/get_proxy_item) wp-includes/class-wp-oembed-controller.php | Callback for the proxy API endpoint. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( 'pre_get_col_charset', string|null $charset, string $table, string $column ) apply\_filters( 'pre\_get\_col\_charset', string|null $charset, string $table, string $column )
===============================================================================================
Filters the column charset value before the DB is checked.
Passing a non-null value to the filter will short-circuit checking the DB for the charset, returning that value instead.
`$charset` string|null The character set to use. Default null. `$table` string The name of the table being checked. `$column` string The name of the column being checked. File: `wp-includes/class-wpdb.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wpdb.php/)
```
$charset = apply_filters( 'pre_get_col_charset', null, $table, $column );
```
| Used By | Description |
| --- | --- |
| [wpdb::get\_col\_charset()](../classes/wpdb/get_col_charset) wp-includes/class-wpdb.php | Retrieves the character set for the given column. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress do_action( 'trashed_comment', string $comment_id, WP_Comment $comment ) do\_action( 'trashed\_comment', string $comment\_id, WP\_Comment $comment )
===========================================================================
Fires immediately after a comment is sent to Trash.
`$comment_id` string The comment ID as a numeric string. `$comment` [WP\_Comment](../classes/wp_comment) The trashed comment. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'trashed_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 apply_filters( 'walker_nav_menu_start_el', string $item_output, WP_Post $menu_item, int $depth, stdClass $args ) apply\_filters( 'walker\_nav\_menu\_start\_el', string $item\_output, WP\_Post $menu\_item, int $depth, stdClass $args )
========================================================================================================================
Filters a menu item’s starting output.
The menu item’s starting output only includes `$args->before`, the opening `<a>`, the menu item’s title, the closing `</a>`, and `$args->after`. Currently, there is no filter for modifying the opening and closing `<li>` for a menu item.
`$item_output` string The menu item's starting HTML output. `$menu_item` [WP\_Post](../classes/wp_post) Menu item data object. `$depth` int Depth of menu item. Used for padding. `$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'`.
File: `wp-includes/class-walker-nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-nav-menu.php/)
```
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $menu_item, $depth, $args );
```
| 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 |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'widget_text', string $text, array $instance, WP_Widget_Text|WP_Widget_Custom_HTML $widget ) apply\_filters( 'widget\_text', string $text, array $instance, WP\_Widget\_Text|WP\_Widget\_Custom\_HTML $widget )
==================================================================================================================
Filters the content of the Text widget.
`$text` string The widget content. `$instance` array Array of settings for the current widget. `$widget` [WP\_Widget\_Text](../classes/wp_widget_text)|[WP\_Widget\_Custom\_HTML](../classes/wp_widget_custom_html) Current text or HTML widget instance. May also apply to some third party widgets as well. This filter hook can be used to replace any text within sidebar widgets.
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', $text, $instance, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Widget\_Custom\_HTML::widget()](../classes/wp_widget_custom_html/widget) wp-includes/widgets/class-wp-widget-custom-html.php | Outputs the content for the current Custom HTML widget instance. |
| [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.1](https://developer.wordpress.org/reference/since/4.8.1/) | The `$widget` param may now be a `WP_Widget_Custom_HTML` object in addition to a `WP_Widget_Text` object. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$widget` parameter. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress do_action( 'before_delete_post', int $postid, WP_Post $post ) do\_action( 'before\_delete\_post', int $postid, WP\_Post $post )
=================================================================
Fires before a post is deleted, at the start 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. This hook runs:
* Just before other data associated with the post is deleted – like meta data. After the other data is deleted, the *delete\_post* action executes, the primary post is removed, and then the *deleted\_post* action is executed.
* When items marked for trash are going through final (forced) deletion (e.g. the trash is disabled and an item is deleted).
This hook does not run:
* For posts that are being marked as trash (unforced). The *wp\_trash\_post* hook is the functional equivalent, executed just before items are marked as trash.
* For attachments. The *delete\_attachment* hook is the functional equivalent, executed just before posts of type attachment are processed. With attachments, exactly as with other post types, meta data is removed, the *delete\_post* action is run, then the attachment is removed from the database, and finally, the *deleted\_post* action is run.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'before_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( 'oembed_default_width', int $maxwidth ) apply\_filters( 'oembed\_default\_width', int $maxwidth )
=========================================================
Filters the maxwidth oEmbed parameter.
`$maxwidth` int Maximum allowed width. Default 600. File: `wp-includes/class-wp-oembed-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed-controller.php/)
```
$maxwidth = apply_filters( 'oembed_default_width', 600 );
```
| Used By | Description |
| --- | --- |
| [WP\_oEmbed\_Controller::register\_routes()](../classes/wp_oembed_controller/register_routes) wp-includes/class-wp-oembed-controller.php | Register the oEmbed REST API route. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'download_url_error_max_body_size', int $size ) apply\_filters( 'download\_url\_error\_max\_body\_size', int $size )
====================================================================
Filters the maximum error response body size in `download_url()`.
* [download\_url()](../functions/download_url)
`$size` int The maximum error response body size. Default 1 KB. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$response_size = apply_filters( 'download_url_error_max_body_size', KB_IN_BYTES );
```
| 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.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'get_avatar', string $avatar, mixed $id_or_email, int $size, string $default, string $alt, array $args ) apply\_filters( 'get\_avatar', string $avatar, mixed $id\_or\_email, int $size, string $default, string $alt, array $args )
===========================================================================================================================
Filters the HTML for a user’s avatar.
`$avatar` string HTML for the user's 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. `$size` int Square avatar width and height in pixels to retrieve. `$default` string URL for the default image or a default type. Accepts `'404'`, `'retro'`, `'monsterid'`, `'wavatar'`, `'indenticon'`, `'mystery'`, `'mm'`, `'mysteryman'`, `'blank'`, or `'gravatar_default'`. `$alt` string Alternative text to use in the avatar image tag. `$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.
The “get\_avatar” filter can be used to alter the avatar image returned by the [get\_avatar()](../functions/get_avatar) function.
There are two tricky parts to using this filter:
1. [get\_avatar()](../functions/get_avatar) can be passed a user ID, user object or email address. So we will not know what we are looking at and will need to check for them all.
2. It returns the entire image html string with classes, alt, and src. So you need to recreate the entire thing, not just send back the image url.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
```
| Used By | Description |
| --- | --- |
| [get\_avatar()](../functions/get_avatar) wp-includes/pluggable.php | Retrieves the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | The `$args` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'theme_action_links', string[] $actions, WP_Theme $theme, string $context ) apply\_filters( 'theme\_action\_links', string[] $actions, WP\_Theme $theme, string $context )
==============================================================================================
Filters the action links displayed for each theme in the Multisite themes list table.
The action links displayed are determined by the theme’s status, and which Multisite themes list table is being displayed – the Network themes list table (themes.php), which displays all installed themes, or the Site themes list table (site-themes.php), which displays the non-network enabled themes when editing a site in the Network admin.
The default action links for the Network themes list table include ‘Network Enable’, ‘Network Disable’, and ‘Delete’.
The default action links for the Site themes list table include ‘Enable’, and ‘Disable’.
`$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', array_filter( $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 |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'filesystem_method', string $method, array $args, string $context, bool $allow_relaxed_file_ownership ) apply\_filters( 'filesystem\_method', string $method, array $args, string $context, bool $allow\_relaxed\_file\_ownership )
===========================================================================================================================
Filters the filesystem method to use.
`$method` string Filesystem method to return. `$args` array An array of connection details for the method. `$context` string Full path to the directory that is tested for being writable. `$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/)
```
return apply_filters( 'filesystem_method', $method, $args, $context, $allow_relaxed_file_ownership );
```
| Used By | Description |
| --- | --- |
| [get\_filesystem\_method()](../functions/get_filesystem_method) wp-admin/includes/file.php | Determines which method to use for reading, writing, modifying, or deleting files on the filesystem. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'wp_user_dashboard_setup' ) do\_action( 'wp\_user\_dashboard\_setup' )
==========================================
Fires after core widgets for the User 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_user_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 apply_filters( 'wp_robots', array $robots ) apply\_filters( 'wp\_robots', array $robots )
=============================================
Filters the directives to be included in the ‘robots’ meta tag.
The meta tag will only be included as necessary.
`$robots` array Associative array of directives. Every key must be the name of the directive, and the corresponding value must either be a string to provide as value for the directive or a boolean `true` if it is a boolean directive, i.e. without a value. File: `wp-includes/robots-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/robots-template.php/)
```
$robots = apply_filters( 'wp_robots', array() );
```
| Used By | Description |
| --- | --- |
| [wp\_robots()](../functions/wp_robots) wp-includes/robots-template.php | Displays the robots meta tag as necessary. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress do_action( 'customize_render_panel', WP_Customize_Panel $panel ) do\_action( 'customize\_render\_panel', WP\_Customize\_Panel $panel )
=====================================================================
Fires before rendering a Customizer panel.
`$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/)
```
do_action( 'customize_render_panel', $this );
```
| 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( 'post_gallery', string $output, array $attr, int $instance ) apply\_filters( 'post\_gallery', string $output, array $attr, int $instance )
=============================================================================
Filters the default gallery shortcode output.
If the filtered output isn’t empty, it will be used instead of generating the default gallery template.
* [gallery\_shortcode()](../functions/gallery_shortcode)
`$output` string The gallery output. Default empty. `$attr` array Attributes of the gallery shortcode. `$instance` int Unique numeric ID of this gallery shortcode instance. This filter allows plugins and themes to override the default gallery template (i.e. what the gallery shortcode returns).
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$output = apply_filters( 'post_gallery', '', $attr, $instance );
```
| Used By | Description |
| --- | --- |
| [gallery\_shortcode()](../functions/gallery_shortcode) wp-includes/media.php | Builds the Gallery shortcode output. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | The `$instance` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'get_the_excerpt', string $post_excerpt, WP_Post $post ) apply\_filters( 'get\_the\_excerpt', string $post\_excerpt, WP\_Post $post )
============================================================================
Filters the retrieved post excerpt.
`$post_excerpt` string The post excerpt. `$post` [WP\_Post](../classes/wp_post) Post object. The `get_the_excerpt` filter is used to filter the excerpt of the post after it is retrieved from the database and before it is returned from the [get\_the\_excerpt()](../functions/get_the_excerpt) function.
When the `get_the_excerpt` filter is called, the filter function is passed a single argument containing the post excerpt.
```
function filter_function_name( $excerpt ) {
# ...
}
add_filter( 'get_the_excerpt', 'filter_function_name' );
```
Where ‘`filter_function_name`‘ is the function WordPress should call when the excerpt is being retrieved. Note that the filter function **must** return the excerpt after it is finished processing, or page sections showing an excerpt will be blank, and other plugins also filtering the excerpt may generate errors.
The ‘`filter_function_name`‘ should be a unique function name. It cannot match any other function name already declared.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
return apply_filters( 'get_the_excerpt', $post->post_excerpt, $post );
```
| 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. |
| [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. |
| [get\_the\_excerpt()](../functions/get_the_excerpt) wp-includes/post-template.php | Retrieves the post excerpt. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced the `$post` parameter. |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_insert_user', object $prepared_user, WP_REST_Request $request ) apply\_filters( 'rest\_pre\_insert\_user', object $prepared\_user, WP\_REST\_Request $request )
===============================================================================================
Filters user data before insertion via the REST API.
`$prepared_user` object User object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request 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/)
```
return apply_filters( 'rest_pre_insert_user', $prepared_user, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_database()](../classes/wp_rest_users_controller/prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Prepares a single user for creation or update. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'get_default_comment_status', string $status, string $post_type, string $comment_type ) apply\_filters( 'get\_default\_comment\_status', string $status, string $post\_type, string $comment\_type )
============================================================================================================
Filters the default comment status for the given post type.
`$status` string Default status for the given post type, either `'open'` or `'closed'`. `$post_type` string Post type. Default is `post`. `$comment_type` string Type of comment. Default is `comment`. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
return apply_filters( 'get_default_comment_status', $status, $post_type, $comment_type );
```
| Used By | Description |
| --- | --- |
| [get\_default\_comment\_status()](../functions/get_default_comment_status) wp-includes/comment.php | Gets the default comment status for a post type. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_status', WP_REST_Response $response, object $status, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_status', WP\_REST\_Response $response, object $status, WP\_REST\_Request $request )
===================================================================================================================
Filters a post status returned from the REST API.
Allows modification of the status data right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$status` object The original post status 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-statuses-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php/)
```
return apply_filters( 'rest_prepare_status', $response, $status, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Post\_Statuses\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_post_statuses_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php | Prepares a post status object for serialization. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'image_send_to_editor', string $html, int $id, string $caption, string $title, string $align, string $url, string|int[] $size, string $alt, string $rel ) apply\_filters( 'image\_send\_to\_editor', string $html, int $id, string $caption, string $title, string $align, string $url, string|int[] $size, string $alt, string $rel )
============================================================================================================================================================================
Filters the image HTML markup to send to the editor when inserting an image.
`$html` string The image HTML markup to send. `$id` int The attachment ID. `$caption` string The image caption. `$title` string The image title. `$align` string The image alignment. `$url` string The image source URL. `$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). `$alt` string The image alternative, or alt, text. `$rel` string The image rel attribute. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt, $rel );
```
| Used By | Description |
| --- | --- |
| [get\_image\_send\_to\_editor()](../functions/get_image_send_to_editor) wp-admin/includes/media.php | Retrieves the image HTML to send to the editor. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | The `$rel` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'wp_revisions_to_keep', int $num, WP_Post $post ) apply\_filters( 'wp\_revisions\_to\_keep', int $num, WP\_Post $post )
=====================================================================
Filters the number of revisions to save for the given post.
Overrides the value of WP\_POST\_REVISIONS.
`$num` int Number of revisions to store. `$post` [WP\_Post](../classes/wp_post) Post object. * By default, an infinite number of revisions are stored if a post type supports revisions.
* Note that the filter callback functions **must** return a value after it is finished processing or the revisions will be empty.
File: `wp-includes/revision.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/revision.php/)
```
$num = apply_filters( 'wp_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 |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress do_action( 'wp_register_sidebar_widget', array $widget ) do\_action( 'wp\_register\_sidebar\_widget', array $widget )
============================================================
Fires once for each registered widget.
`$widget` array An array of default widget arguments. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
do_action( 'wp_register_sidebar_widget', $widget );
```
| Used By | Description |
| --- | --- |
| [wp\_register\_sidebar\_widget()](../functions/wp_register_sidebar_widget) wp-includes/widgets.php | Register an instance of a widget. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress do_action( 'rest_insert_user', WP_User $user, WP_REST_Request $request, bool $creating ) do\_action( 'rest\_insert\_user', WP\_User $user, WP\_REST\_Request $request, bool $creating )
==============================================================================================
Fires immediately after a user is 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_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 |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'add_link', int $link_id ) do\_action( 'add\_link', int $link\_id )
========================================
Fires after a link was added to the database.
`$link_id` int ID of the link that was added. File: `wp-admin/includes/bookmark.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/bookmark.php/)
```
do_action( 'add_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 apply_filters( 'filter_block_editor_meta_boxes', array $wp_meta_boxes ) apply\_filters( 'filter\_block\_editor\_meta\_boxes', array $wp\_meta\_boxes )
==============================================================================
Fires right before the meta boxes are rendered.
This allows for the filtering of meta box data, that should already be present by this point. Do not use as a means of adding meta box data.
`$wp_meta_boxes` array Global meta box state. File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
$wp_meta_boxes = apply_filters( 'filter_block_editor_meta_boxes', $wp_meta_boxes );
```
| Used By | Description |
| --- | --- |
| [the\_block\_editor\_meta\_boxes()](../functions/the_block_editor_meta_boxes) wp-admin/includes/post.php | Renders the meta boxes forms. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'private_title_format', string $prepend, WP_Post $post ) apply\_filters( 'private\_title\_format', string $prepend, WP\_Post $post )
===========================================================================
Filters the text prepended to the post title of private posts.
The filter is only applied on the front end.
`$prepend` string Text displayed before the post title.
Default 'Private: %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/)
```
$private_title_format = apply_filters( 'private_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 apply_filters( "rest_{$this->post_type}_collection_params", array $query_params, WP_Post_Type $post_type ) apply\_filters( "rest\_{$this->post\_type}\_collection\_params", array $query\_params, WP\_Post\_Type $post\_type )
===================================================================================================================
Filters collection parameters for the posts controller.
The dynamic part of the filter `$this->post_type` refers to the post type slug for the controller.
This filter registers the collection parameter, but does not map the collection parameter to an internal [WP\_Query](../classes/wp_query) parameter. Use the `rest\_{$this->post\_type}\_query` filter to set [WP\_Query](../classes/wp_query) parameters.
`$query_params` array JSON Schema-formatted collection parameters. `$post_type` [WP\_Post\_Type](../classes/wp_post_type) Post type 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_{$this->post_type}_collection_params", $query_params, $post_type );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::get\_collection\_params()](../classes/wp_rest_posts_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Retrieves the query params for the posts collection. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'enclosure_links', string[] $post_links, int $post_ID ) apply\_filters( 'enclosure\_links', string[] $post\_links, int $post\_ID )
==========================================================================
Filters the list of enclosure links before querying the database.
Allows for the addition and/or removal of potential enclosures to save to postmeta before checking the database for existing enclosures.
`$post_links` string[] An array of enclosure links. `$post_ID` int Post ID. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$post_links = apply_filters( 'enclosure_links', $post_links, $post->ID );
```
| Used By | Description |
| --- | --- |
| [do\_enclose()](../functions/do_enclose) wp-includes/functions.php | Checks content for video and audio links to add as enclosures. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'wp_unique_filename', string $filename, string $ext, string $dir, callable|null $unique_filename_callback, string[] $alt_filenames, int|string $number ) apply\_filters( 'wp\_unique\_filename', string $filename, string $ext, string $dir, callable|null $unique\_filename\_callback, string[] $alt\_filenames, int|string $number )
=============================================================================================================================================================================
Filters the result when generating a unique file name.
`$filename` string Unique file name. `$ext` string File extension. Example: ".png". `$dir` string Directory path. `$unique_filename_callback` callable|null Callback function that generates the unique file name. `$alt_filenames` string[] Array of alternate file names that were checked for collisions. `$number` int|string The highest number that was used to make the file name unique or an empty string if unused. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'wp_unique_filename', $filename, $ext, $dir, $unique_filename_callback, $alt_filenames, $number );
```
| 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.8.1](https://developer.wordpress.org/reference/since/5.8.1/) | The `$alt_filenames` and `$number` parameters were added. |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'pre_unschedule_hook', null|int|false|WP_Error $pre, string $hook, bool $wp_error ) apply\_filters( 'pre\_unschedule\_hook', null|int|false|WP\_Error $pre, string $hook, bool $wp\_error )
=======================================================================================================
Filter to preflight or hijack clearing all events attached to the hook.
Returning a non-null value will short-circuit the normal unscheduling process, causing the function to return the filtered value instead.
For plugins replacing wp-cron, return the number of events successfully unscheduled (zero if no events were registered with the hook) or false if unscheduling one or more events fails.
`$pre` null|int|false|[WP\_Error](../classes/wp_error) Value to return instead. Default null to continue unscheduling the hook. `$hook` string Action hook, the execution of which will be unscheduled. `$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_unschedule_hook', null, $hook, $wp_error );
```
| Used By | Description |
| --- | --- |
| [wp\_unschedule\_hook()](../functions/wp_unschedule_hook) wp-includes/cron.php | Unschedules all events attached to the hook. |
| 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 apply_filters( 'auth_cookie', string $cookie, int $user_id, int $expiration, string $scheme, string $token ) apply\_filters( 'auth\_cookie', string $cookie, int $user\_id, int $expiration, string $scheme, string $token )
===============================================================================================================
Filters the authentication cookie.
`$cookie` string Authentication cookie. `$user_id` int User ID. `$expiration` int The time the cookie expires as a UNIX timestamp. `$scheme` string Cookie scheme used. Accepts `'auth'`, `'secure_auth'`, or `'logged_in'`. `$token` string User's session token used. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
return apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token );
```
| Used By | Description |
| --- | --- |
| [wp\_generate\_auth\_cookie()](../functions/wp_generate_auth_cookie) wp-includes/pluggable.php | Generates authentication cookie contents. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | The `$token` parameter was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'add_ping', string $new ) apply\_filters( 'add\_ping', string $new )
==========================================
Filters the new ping URL to add for the given post.
`$new` string New ping URL to add. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$new = apply_filters( 'add_ping', $new );
```
| Used By | Description |
| --- | --- |
| [add\_ping()](../functions/add_ping) wp-includes/post.php | Adds a URL to those already pinged. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'print_scripts_array', string[] $to_do ) apply\_filters( 'print\_scripts\_array', string[] $to\_do )
===========================================================
Filters the list of script dependencies left to print.
`$to_do` string[] An array of script dependency handles. File: `wp-includes/class-wp-scripts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes_class-wp-scripts-php-2/)
```
$this->to_do = apply_filters( 'print_scripts_array', $this->to_do );
```
| Used By | Description |
| --- | --- |
| [WP\_Scripts::all\_deps()](../classes/wp_scripts/all_deps) wp-includes/class-wp-scripts.php | Determines script dependencies. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'get_comments_link', string $comments_link, int|WP_Post $post ) apply\_filters( 'get\_comments\_link', string $comments\_link, int|WP\_Post $post )
===================================================================================
Filters the returned post comments permalink.
`$comments_link` string Post comments permalink with `'#comments'` appended. `$post` int|[WP\_Post](../classes/wp_post) 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( 'get_comments_link', $comments_link, $post );
```
| Used By | Description |
| --- | --- |
| [get\_comments\_link()](../functions/get_comments_link) wp-includes/comment-template.php | Retrieves the link to the current post comments. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'get_comment_author_url', string $url, string|int $comment_ID, WP_Comment|null $comment ) apply\_filters( 'get\_comment\_author\_url', string $url, string|int $comment\_ID, WP\_Comment|null $comment )
==============================================================================================================
Filters the comment author’s URL.
`$url` string The comment author's URL, or an empty string. `$comment_ID` string|int The comment ID as a numeric string, or 0 if not found. `$comment` [WP\_Comment](../classes/wp_comment)|null The comment object, or null if not found. 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', $url, $id, $comment );
```
| Used By | Description |
| --- | --- |
| [get\_comment\_author\_url()](../functions/get_comment_author_url) wp-includes/comment-template.php | Retrieves the URL of the author of the current comment, not linked. |
| 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( 'documentation_ignore_functions', string[] $ignore_functions ) apply\_filters( 'documentation\_ignore\_functions', string[] $ignore\_functions )
=================================================================================
Filters the list of functions and classes to be ignored from the documentation lookup.
`$ignore_functions` string[] Array of names of functions and classes to be ignored. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
$ignore_functions = apply_filters( 'documentation_ignore_functions', $ignore_functions );
```
| Used By | Description |
| --- | --- |
| [wp\_doc\_link\_parse()](../functions/wp_doc_link_parse) wp-admin/includes/misc.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_blog_options', array $blog_options ) apply\_filters( 'xmlrpc\_blog\_options', array $blog\_options )
===============================================================
Filters the XML-RPC blog options property.
`$blog_options` array An array of XML-RPC blog options. 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->blog_options = apply_filters( 'xmlrpc_blog_options', $this->blog_options );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::initialise\_blog\_option\_info()](../classes/wp_xmlrpc_server/initialise_blog_option_info) wp-includes/class-wp-xmlrpc-server.php | Set up blog options property. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'comment_form_default_fields', string[] $fields ) apply\_filters( 'comment\_form\_default\_fields', string[] $fields )
====================================================================
Filters the default comment form fields.
`$fields` string[] Array of the default comment fields. File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
$fields = apply_filters( 'comment_form_default_fields', $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. |
wordpress apply_filters( 'get_custom_logo_image_attributes', array $custom_logo_attr, int $custom_logo_id, int $blog_id ) apply\_filters( 'get\_custom\_logo\_image\_attributes', array $custom\_logo\_attr, int $custom\_logo\_id, int $blog\_id )
=========================================================================================================================
Filters the list of custom logo image attributes.
`$custom_logo_attr` array Custom logo image attributes. `$custom_logo_id` int Custom logo attachment ID. `$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/)
```
$custom_logo_attr = apply_filters( 'get_custom_logo_image_attributes', $custom_logo_attr, $custom_logo_id, $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 |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_fields_request', string $fields, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_fields\_request', string $fields, WP\_Query $query )
========================================================================================
Filters the SELECT clause of the query.
For use by caching plugins.
`$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_request', 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.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'mce_css', string $stylesheets ) apply\_filters( 'mce\_css', string $stylesheets )
=================================================
Filters the comma-delimited list of stylesheets to load in TinyMCE.
`$stylesheets` string Comma-delimited list of stylesheets. If you are doing this from within a theme, consider using [add\_editor\_style()](../functions/add_editor_style) instead.
File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::editor\_settings()](../classes/_wp_editors/editor_settings) wp-includes/class-wp-editor.php | |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'wp_die_xmlrpc_handler', callable $callback ) apply\_filters( 'wp\_die\_xmlrpc\_handler', callable $callback )
================================================================
Filters the callback for killing WordPress execution for XML-RPC 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_xmlrpc_handler', '_xmlrpc_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 |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'number_format_i18n', string $formatted, float $number, int $decimals ) apply\_filters( 'number\_format\_i18n', string $formatted, float $number, int $decimals )
=========================================================================================
Filters the number formatted based on the locale.
`$formatted` string Converted number in string format. `$number` float The number to convert based on locale. `$decimals` int Precision of the number of decimal places. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'number_format_i18n', $formatted, $number, $decimals );
```
| Used By | Description |
| --- | --- |
| [number\_format\_i18n()](../functions/number_format_i18n) wp-includes/functions.php | Converts float number to format based on the locale. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `$number` and `$decimals` parameters were added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_allow_query_attachment_by_filename', bool $allow_query_attachment_by_filename ) apply\_filters( 'wp\_allow\_query\_attachment\_by\_filename', bool $allow\_query\_attachment\_by\_filename )
============================================================================================================
Filters whether an attachment query should include filenames or not.
`$allow_query_attachment_by_filename` bool Whether or not to include filenames. File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
$this->allow_query_attachment_by_filename = apply_filters( 'wp_allow_query_attachment_by_filename', false );
```
| 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 |
| --- | --- |
| [6.0.3](https://developer.wordpress.org/reference/since/6.0.3/) | Introduced. |
wordpress apply_filters( 'file_is_displayable_image', bool $result, string $path ) apply\_filters( 'file\_is\_displayable\_image', bool $result, string $path )
============================================================================
Filters whether the current image is displayable in the browser.
`$result` bool Whether the image can be displayed. Default true. `$path` string Path to the image. File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
return apply_filters( 'file_is_displayable_image', $result, $path );
```
| Used By | Description |
| --- | --- |
| [file\_is\_displayable\_image()](../functions/file_is_displayable_image) wp-admin/includes/image.php | Validates that file is suitable for displaying within a web page. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'use_block_editor_for_post', bool $use_block_editor, WP_Post $post ) apply\_filters( 'use\_block\_editor\_for\_post', bool $use\_block\_editor, WP\_Post $post )
===========================================================================================
Filters whether a post is able to be edited in the block editor.
`$use_block_editor` bool Whether the post can be edited or not. `$post` [WP\_Post](../classes/wp_post) The post being checked. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'use_block_editor_for_post', $use_block_editor, $post );
```
| Used By | Description |
| --- | --- |
| [use\_block\_editor\_for\_post()](../functions/use_block_editor_for_post) wp-includes/post.php | Returns whether the post can be edited in the block editor. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'delete_postmeta', string[] $meta_ids ) do\_action( 'delete\_postmeta', string[] $meta\_ids )
=====================================================
Fires immediately before 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( 'delete_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( 'ms_user_list_site_class', string[] $site_classes, int $site_id, int $network_id, WP_User $user ) apply\_filters( 'ms\_user\_list\_site\_class', string[] $site\_classes, int $site\_id, int $network\_id, WP\_User $user )
=========================================================================================================================
Filters the span class for a site listing on the mulisite user list table.
`$site_classes` string[] Array of class names used within the span tag. Default "site-#" with the site's network ID. `$site_id` int Site ID. `$network_id` int Network ID. `$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/)
```
$site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $site->userblog_id, $site->site_id, $user );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Users\_List\_Table::column\_blogs()](../classes/wp_ms_users_list_table/column_blogs) wp-admin/includes/class-wp-ms-users-list-table.php | Handles the sites column output. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action( 'edit_term', int $term_id, int $tt_id, string $taxonomy, array $args ) do\_action( 'edit\_term', int $term\_id, int $tt\_id, string $taxonomy, array $args )
=====================================================================================
Fires after a term has been updated, but before the term cache has been cleaned.
The [‘edit\_$taxonomy’](edit_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( 'edit_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( 'login_display_language_dropdown', bool ) apply\_filters( 'login\_display\_language\_dropdown', bool )
============================================================
Filters the Languages select input activation on the login screen.
Whether to display the Languages select input on the login screen. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
apply_filters( 'login_display_language_dropdown', true )
```
| 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( 'clean_comment_cache', int $id ) do\_action( 'clean\_comment\_cache', int $id )
==============================================
Fires immediately after a comment has been removed from the object cache.
`$id` int Comment ID. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'clean_comment_cache', $id );
```
| Used By | Description |
| --- | --- |
| [clean\_comment\_cache()](../functions/clean_comment_cache) wp-includes/comment.php | Removes a comment from the object cache. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress do_action( 'load_textdomain', string $domain, string $mofile ) do\_action( 'load\_textdomain', string $domain, string $mofile )
================================================================
Fires before the MO translation file is loaded.
`$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/)
```
do_action( 'load_textdomain', $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_tags', WP_Term[]|int|WP_Error $tags, array $args ) apply\_filters( 'get\_tags', WP\_Term[]|int|WP\_Error $tags, array $args )
==========================================================================
Filters the array of term objects returned for the ‘post\_tag’ taxonomy.
`$tags` [WP\_Term](../classes/wp_term)[]|int|[WP\_Error](../classes/wp_error) Array of `'post_tag'` term objects, a count thereof, or [WP\_Error](../classes/wp_error) if any of the taxonomies do not exist. `$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/)
```
$tags = apply_filters( 'get_tags', $tags, $args );
```
| Used By | Description |
| --- | --- |
| [get\_tags()](../functions/get_tags) wp-includes/category.php | Retrieves all post tags. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( "install_themes_table_api_args_{$tab}", array|false $args ) apply\_filters( "install\_themes\_table\_api\_args\_{$tab}", array|false $args )
================================================================================
Filters API request arguments for each Install Themes screen tab.
The dynamic portion of the hook name, `$tab`, refers to the theme install tab.
Possible hook names include:
* `install_themes_table_api_args_dashboard`
* `install_themes_table_api_args_featured`
* `install_themes_table_api_args_new`
* `install_themes_table_api_args_search`
* `install_themes_table_api_args_updated`
* `install_themes_table_api_args_upload`
`$args` array|false Theme install API arguments. File: `wp-admin/includes/class-wp-theme-install-list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-theme-install-list-table.php/)
```
$args = apply_filters( "install_themes_table_api_args_{$tab}", $args );
```
| 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 |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'login_url', string $login_url, string $redirect, bool $force_reauth ) apply\_filters( 'login\_url', string $login\_url, string $redirect, bool $force\_reauth )
=========================================================================================
Filters the login URL.
`$login_url` string The login URL. Not HTML-encoded. `$redirect` string The path to redirect to on login, if supplied. `$force_reauth` bool Whether to force reauthorization, even if a cookie is present. `login_ur`l is a filter applied to the url returned by the function [wp\_login\_url()](../functions/wp_login_url)
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'login_url', $login_url, $redirect, $force_reauth );
```
| Used By | Description |
| --- | --- |
| [wp\_login\_url()](../functions/wp_login_url) wp-includes/general-template.php | Retrieves the login URL. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | The `$force_reauth` parameter was added. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'smilies', string[] $wpsmiliestrans ) apply\_filters( 'smilies', string[] $wpsmiliestrans )
=====================================================
Filters all the smilies.
This filter must be added before `smilies_init` is run, as it is normally only run once to setup the smilies regex.
`$wpsmiliestrans` string[] List of the smilies' hexadecimal representations, keyed by their smily code. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans );
```
| Used By | Description |
| --- | --- |
| [smilies\_init()](../functions/smilies_init) wp-includes/functions.php | Converts smiley code to the icon graphic file equivalent. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_url_details', WP_REST_Response $response, string $url, WP_REST_Request $request, string $remote_url_response ) apply\_filters( 'rest\_prepare\_url\_details', WP\_REST\_Response $response, string $url, WP\_REST\_Request $request, string $remote\_url\_response )
=====================================================================================================================================================
Filters the URL data for the response.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$url` string The requested URL. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request object. `$remote_url_response` string HTTP response body from the remote 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/)
```
return apply_filters( 'rest_prepare_url_details', $response, $url, $request, $remote_url_response );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_URL\_Details\_Controller::parse\_url\_details()](../classes/wp_rest_url_details_controller/parse_url_details) wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php | Retrieves the contents of the title tag from the HTML response. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress do_action( 'revoke_super_admin', int $user_id ) do\_action( 'revoke\_super\_admin', int $user\_id )
===================================================
Fires before the user’s Super Admin privileges are revoked.
`$user_id` int ID of the user Super Admin privileges are being revoked from. File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
do_action( 'revoke_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( 'wp_update_https_url', string $update_url ) apply\_filters( 'wp\_update\_https\_url', string $update\_url )
===============================================================
Filters the URL to learn more about updating the HTTPS 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 HTTPS. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$update_url = apply_filters( 'wp_update_https_url', $update_url );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_update\_https\_url()](../functions/wp_get_update_https_url) wp-includes/functions.php | Gets the URL to learn more about updating the site to use HTTPS. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress do_action( 'deprecated_argument_run', string $function, string $message, string $version ) do\_action( 'deprecated\_argument\_run', string $function, string $message, string $version )
=============================================================================================
Fires when a deprecated argument is called.
`$function` string The function that was called. `$message` string A message regarding the change. `$version` string The version of WordPress that deprecated the argument used. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
do_action( 'deprecated_argument_run', $function, $message, $version );
```
| 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( "{$field_no_prefix}_edit_pre", mixed $value, int $post_id ) apply\_filters( "{$field\_no\_prefix}\_edit\_pre", mixed $value, int $post\_id )
================================================================================
Filters the value of a specific post field to edit.
The dynamic portion of the hook name, `$field_no_prefix`, refers to the post field name.
`$value` mixed Value of the post field. `$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$value = apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id );
```
| 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( 'customize_nav_menu_searched_items', array $items, array $args ) apply\_filters( 'customize\_nav\_menu\_searched\_items', array $items, array $args )
====================================================================================
Filters the available menu items during a search request.
`$items` array The array of menu items. `$args` array Includes `'pagenum'` and `'s'` (search) arguments. File: `wp-includes/class-wp-customize-nav-menus.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-nav-menus.php/)
```
$items = apply_filters( 'customize_nav_menu_searched_items', $items, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Nav\_Menus::search\_available\_items\_query()](../classes/wp_customize_nav_menus/search_available_items_query) wp-includes/class-wp-customize-nav-menus.php | Performs post queries for available-item searching. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'install_theme_complete_actions', string[] $install_actions, object $api, string $stylesheet, WP_Theme $theme_info ) apply\_filters( 'install\_theme\_complete\_actions', string[] $install\_actions, object $api, string $stylesheet, WP\_Theme $theme\_info )
==========================================================================================================================================
Filters the list of action links available following a single theme installation.
`$install_actions` string[] Array of theme action links. `$api` object Object containing WordPress.org API theme data. `$stylesheet` string Theme directory name. `$theme_info` [WP\_Theme](../classes/wp_theme) Theme object. 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_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info );
```
| Used By | Description |
| --- | --- |
| [Theme\_Installer\_Skin::after()](../classes/theme_installer_skin/after) wp-admin/includes/class-theme-installer-skin.php | Action to perform following a single theme install. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'allow_dev_auto_core_updates', bool $upgrade_dev ) apply\_filters( 'allow\_dev\_auto\_core\_updates', bool $upgrade\_dev )
=======================================================================
Filters whether to enable automatic core updates for development versions.
`$upgrade_dev` bool Whether to enable automatic updates for development versions. File: `wp-admin/includes/class-core-upgrader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-core-upgrader.php/)
```
if ( ! apply_filters( 'allow_dev_auto_core_updates', $upgrade_dev ) ) {
```
| Used By | Description |
| --- | --- |
| [core\_auto\_updates\_settings()](../functions/core_auto_updates_settings) wp-admin/update-core.php | Display WordPress auto-updates settings. |
| [WP\_Site\_Health\_Auto\_Updates::test\_accepts\_dev\_updates()](../classes/wp_site_health_auto_updates/test_accepts_dev_updates) wp-admin/includes/class-wp-site-health-auto-updates.php | Checks if the install is using a development branch and can use nightly packages. |
| [Core\_Upgrader::should\_update\_to\_version()](../classes/core_upgrader/should_update_to_version) wp-admin/includes/class-core-upgrader.php | Determines if this WordPress Core version should update to an offered version or not. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'password_hint', string $hint ) apply\_filters( 'password\_hint', string $hint )
================================================
Filters the text describing the site’s password complexity policy.
`$hint` string The password hint text. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
return apply_filters( 'password_hint', $hint );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_password\_hint()](../functions/wp_get_password_hint) wp-includes/user.php | Gets the text suggesting how to create strong passwords. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress apply_filters( 'get_lastpostdate', string|false $lastpostdate, string $timezone, string $post_type ) apply\_filters( 'get\_lastpostdate', string|false $lastpostdate, string $timezone, string $post\_type )
=======================================================================================================
Filters the most recent time that a post on the site was published.
`$lastpostdate` string|false The most recent time that a post was published, in 'Y-m-d H:i:s' format. False on failure. `$timezone` string Location to use for getting the post published 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/)
```
return apply_filters( 'get_lastpostdate', $lastpostdate, $timezone, $post_type );
```
| Used By | Description |
| --- | --- |
| [get\_lastpostdate()](../functions/get_lastpostdate) wp-includes/post.php | Retrieves the most recent time that a post on the site was published. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$post_type` parameter. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'customize_nav_menu_available_item_types', array $item_types ) apply\_filters( 'customize\_nav\_menu\_available\_item\_types', array $item\_types )
====================================================================================
Filters the available menu item types.
`$item_types` array Navigation menu item types. File: `wp-includes/class-wp-customize-nav-menus.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-nav-menus.php/)
```
$item_types = apply_filters( 'customize_nav_menu_available_item_types', $item_types );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Nav\_Menus::available\_item\_types()](../classes/wp_customize_nav_menus/available_item_types) wp-includes/class-wp-customize-nav-menus.php | Returns an array of all the available item types. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`. |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'get_avatar_comment_types', array $types ) apply\_filters( 'get\_avatar\_comment\_types', array $types )
=============================================================
Filters the list of allowed comment types for retrieving avatars.
`$types` array An array of content types. Default only contains `'comment'`. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) );
```
| Used By | Description |
| --- | --- |
| [is\_avatar\_comment\_type()](../functions/is_avatar_comment_type) wp-includes/link-template.php | Check if this comment type allows avatars to be retrieved. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_doing_cron', bool $wp_doing_cron ) apply\_filters( 'wp\_doing\_cron', bool $wp\_doing\_cron )
==========================================================
Filters whether the current request is a WordPress cron request.
`$wp_doing_cron` bool Whether the current request is a WordPress cron request. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
return apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON );
```
| Used By | Description |
| --- | --- |
| [wp\_doing\_cron()](../functions/wp_doing_cron) wp-includes/load.php | Determines whether the current request is a WordPress cron request. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( 'wp_theme_editor_filetypes', string[] $default_types, WP_Theme $theme ) apply\_filters( 'wp\_theme\_editor\_filetypes', string[] $default\_types, WP\_Theme $theme )
============================================================================================
Filters the list of file types allowed for editing in the theme file editor.
`$default_types` string[] An array of editable theme file extensions. `$theme` [WP\_Theme](../classes/wp_theme) The active theme object. File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
$file_types = apply_filters( 'wp_theme_editor_filetypes', $default_types, $theme );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_theme\_file\_editable\_extensions()](../functions/wp_get_theme_file_editable_extensions) wp-admin/includes/file.php | Gets the list of file extensions that are editable for a given theme. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( "admin_print_footer_scripts-{$hook_suffix}" ) do\_action( "admin\_print\_footer\_scripts-{$hook\_suffix}" )
=============================================================
Prints scripts and data queued for the footer.
The dynamic portion of the hook name, `$hook_suffix`, refers to the global hook suffix of the current page.
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-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [iframe\_footer()](../functions/iframe_footer) wp-admin/includes/template.php | Generic Iframe footer for use with Thickbox. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'editable_slug', string $slug, WP_Term|WP_Post $tag ) apply\_filters( 'editable\_slug', string $slug, WP\_Term|WP\_Post $tag )
========================================================================
Filters the editable slug for a post or term.
Note: This is a multi-use hook in that it is leveraged both for editable post URIs and term slugs.
`$slug` string The editable slug. Will be either a term slug or post URI depending upon the context in which it is evaluated. `$tag` [WP\_Term](../classes/wp_term)|[WP\_Post](../classes/wp_post) Term or post object. File: `wp-admin/edit-tag-form.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-tag-form.php/)
```
$slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : '';
```
| 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. |
| [get\_sample\_permalink()](../functions/get_sample_permalink) wp-admin/includes/post.php | Returns a sample permalink based on the post name. |
| [post\_slug\_meta\_box()](../functions/post_slug_meta_box) wp-admin/includes/meta-boxes.php | Displays slug form fields. |
| [WP\_Terms\_List\_Table::column\_name()](../classes/wp_terms_list_table/column_name) wp-admin/includes/class-wp-terms-list-table.php | |
| [WP\_Terms\_List\_Table::column\_slug()](../classes/wp_terms_list_table/column_slug) wp-admin/includes/class-wp-terms-list-table.php | |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$tag` parameter was added. |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'wp_comment_reply', string $content, array $args ) apply\_filters( 'wp\_comment\_reply', string $content, array $args )
====================================================================
Filters the in-line comment reply-to form output in the Comments list table.
Returning a non-empty value here will short-circuit display of the in-line comment-reply form in the Comments list table, echoing the returned value instead.
* [wp\_comment\_reply()](../functions/wp_comment_reply)
`$content` string The reply-to form content. `$args` array An array of default args. File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
$content = apply_filters(
'wp_comment_reply',
'',
array(
'position' => $position,
'checkbox' => $checkbox,
'mode' => $mode,
)
);
```
| Used By | Description |
| --- | --- |
| [wp\_comment\_reply()](../functions/wp_comment_reply) wp-admin/includes/template.php | Outputs the in-line comment reply-to form in the Comments list table. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'deleted_post', int $postid, WP_Post $post ) do\_action( 'deleted\_post', int $postid, WP\_Post $post )
==========================================================
Fires immediately after a post is deleted from the database.
`$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( 'deleted_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. |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action_deprecated( 'private_to_published', int $post_id ) do\_action\_deprecated( 'private\_to\_published', int $post\_id )
=================================================================
This hook has been deprecated. Use [‘private\_to\_publish’](private_to_publish) instead.
Fires when a post’s status is transitioned from private to published.
`$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_deprecated( 'private_to_published', array( $post->ID ), '2.3.0', 'private_to_publish' );
```
| Used By | Description |
| --- | --- |
| [\_transition\_post\_status()](../functions/_transition_post_status) wp-includes/post.php | Hook for managing future post transitions to published. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Use ['private\_to\_publish'](private_to_publish) instead. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_unique_post_slug', string|null $override_slug, string $slug, int $post_ID, string $post_status, string $post_type, int $post_parent ) apply\_filters( 'pre\_wp\_unique\_post\_slug', string|null $override\_slug, string $slug, int $post\_ID, string $post\_status, string $post\_type, int $post\_parent )
======================================================================================================================================================================
Filters the post slug before it is generated to be unique.
Returning a non-null value will short-circuit the unique slug generation, returning the passed value instead.
`$override_slug` string|null Short-circuit return value. `$slug` string The desired slug (post\_name). `$post_ID` int Post ID. `$post_status` string The post status. `$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/)
```
$override_slug = apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_ID, $post_status, $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 |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( "rest_query_var-{$key}", string $value ) apply\_filters( "rest\_query\_var-{$key}", string $value )
==========================================================
Filters the query\_vars used in get\_items() for the constructed query.
The dynamic portion of the hook name, `$key`, refers to the query\_var key.
`$value` string The query\_var value. 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/)
```
$query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::prepare\_items\_query()](../classes/wp_rest_revisions_controller/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](../classes/wp_query). |
| [WP\_REST\_Posts\_Controller::prepare\_items\_query()](../classes/wp_rest_posts_controller/prepare_items_query) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Determines the allowed query\_vars for a get\_items() response and prepares them for [WP\_Query](../classes/wp_query). |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'get_comment_author_IP', string $comment_author_ip, string $comment_ID, WP_Comment $comment ) apply\_filters( 'get\_comment\_author\_IP', string $comment\_author\_ip, string $comment\_ID, WP\_Comment $comment )
====================================================================================================================
Filters the comment author’s returned IP address.
`$comment_author_ip` string The comment author's IP address, or an empty string if it's not available. `$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_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [get\_comment\_author\_IP()](../functions/get_comment_author_ip) wp-includes/comment-template.php | Retrieves the IP address of the author 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( 'feed_links_show_posts_feed', bool $show ) apply\_filters( 'feed\_links\_show\_posts\_feed', bool $show )
==============================================================
Filters whether to display the posts feed link.
`$show` bool Whether to display the posts 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_posts_feed', true ) ) {
```
| Used By | Description |
| --- | --- |
| [feed\_links()](../functions/feed_links) wp-includes/general-template.php | Displays the links to the general feeds. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'dbdelta_insert_queries', string[] $iqueries ) apply\_filters( 'dbdelta\_insert\_queries', string[] $iqueries )
================================================================
Filters the dbDelta SQL queries for inserting or updating.
Queries filterable via this hook contain "INSERT INTO" or "UPDATE".
`$iqueries` string[] An array of dbDelta insert or update SQL queries. File: `wp-admin/includes/upgrade.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/upgrade.php/)
```
$iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
```
| 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 apply_filters( "customize_sanitize_{$this->id}", mixed $value, WP_Customize_Setting $setting ) apply\_filters( "customize\_sanitize\_{$this->id}", mixed $value, WP\_Customize\_Setting $setting )
===================================================================================================
Filters a Customize setting value in un-slashed form.
`$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/)
```
return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Nav\_Menu\_Setting::sanitize()](../classes/wp_customize_nav_menu_setting/sanitize) wp-includes/customize/class-wp-customize-nav-menu-setting.php | Sanitize an input. |
| [WP\_Customize\_Nav\_Menu\_Item\_Setting::sanitize()](../classes/wp_customize_nav_menu_item_setting/sanitize) wp-includes/customize/class-wp-customize-nav-menu-item-setting.php | Sanitize an input. |
| [WP\_Customize\_Setting::sanitize()](../classes/wp_customize_setting/sanitize) wp-includes/class-wp-customize-setting.php | Sanitize an input. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'emoji_svg_url', string $url ) apply\_filters( 'emoji\_svg\_url', string $url )
================================================
Filters the URL where emoji SVG images are hosted.
`$url` string The emoji base URL for svg images. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
'svgUrl' => apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/14.0.0/svg/' ),
```
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress apply_filters( 'wp_count_attachments', stdClass $counts, string|string[] $mime_type ) apply\_filters( 'wp\_count\_attachments', stdClass $counts, string|string[] $mime\_type )
=========================================================================================
Modifies returned attachment counts by mime type.
`$counts` stdClass An object containing the attachment counts by mime type. `$mime_type` string|string[] Array or comma-separated list of MIME patterns. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
return apply_filters( 'wp_count_attachments', (object) $counts, $mime_type );
```
| Used By | Description |
| --- | --- |
| [wp\_count\_attachments()](../functions/wp_count_attachments) wp-includes/post.php | Counts number of attachments for the mime type(s). |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'embed_oembed_html', string|false $cache, string $url, array $attr, int $post_ID ) apply\_filters( 'embed\_oembed\_html', string|false $cache, string $url, array $attr, int $post\_ID )
=====================================================================================================
Filters the cached oEmbed HTML.
* [WP\_Embed::shortcode()](../classes/wp_embed/shortcode)
`$cache` string|false The cached HTML result, stored in post meta. `$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/)
```
return apply_filters( 'embed_oembed_html', $cache, $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 |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'redirect_canonical', string $redirect_url, string $requested_url ) apply\_filters( 'redirect\_canonical', string $redirect\_url, string $requested\_url )
======================================================================================
Filters the canonical redirect URL.
Returning false to this filter will cancel the redirect.
`$redirect_url` string The redirect URL. `$requested_url` string The requested URL. File: `wp-includes/canonical.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/canonical.php/)
```
$redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url );
```
| 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 |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'ajax_term_search_results', string[] $results, WP_Taxonomy $taxonomy_object, string $search ) apply\_filters( 'ajax\_term\_search\_results', string[] $results, WP\_Taxonomy $taxonomy\_object, string $search )
==================================================================================================================
Filters the Ajax term search results.
`$results` string[] Array of term names. `$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/)
```
$results = apply_filters( 'ajax_term_search_results', $results, $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 |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'wp_initialize_site_args', array $args, WP_Site $site, WP_Network $network ) apply\_filters( 'wp\_initialize\_site\_args', array $args, WP\_Site $site, WP\_Network $network )
=================================================================================================
Filters the arguments for initializing a site.
`$args` array Arguments to modify the initialization behavior. `$site` [WP\_Site](../classes/wp_site) Site that is being initialized. `$network` [WP\_Network](../classes/wp_network) Network that the site belongs to. File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
$args = apply_filters( 'wp_initialize_site_args', $args, $site, $network );
```
| Used By | Description |
| --- | --- |
| [wp\_initialize\_site()](../functions/wp_initialize_site) wp-includes/ms-site.php | Runs the initialization routine for a given site. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress do_action( 'wp_delete_site', WP_Site $old_site ) do\_action( 'wp\_delete\_site', WP\_Site $old\_site )
=====================================================
Fires once a site has been deleted from the database.
`$old_site` [WP\_Site](../classes/wp_site) Deleted 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_delete_site', $old_site );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_site()](../functions/wp_delete_site) wp-includes/ms-site.php | Deletes a site from the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'after_signup_site', string $domain, string $path, string $title, string $user, string $user_email, string $key, array $meta ) do\_action( 'after\_signup\_site', string $domain, string $path, string $title, string $user, string $user\_email, string $key, array $meta )
=============================================================================================================================================
Fires after site signup information has been written to the database.
`$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. `$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/)
```
do_action( 'after_signup_site', $domain, $path, $title, $user, $user_email, $key, $meta );
```
| 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.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'signup_hidden_fields', string $context ) do\_action( 'signup\_hidden\_fields', string $context )
=======================================================
Hidden sign-up form fields output when creating another site or user.
`$context` string A string describing the steps of the sign-up process. The value can be `'create-another-site'`, `'validate-user'`, or `'validate-site'`. File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
do_action( 'signup_hidden_fields', 'create-another-site' );
```
| 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. |
| [signup\_user()](../functions/signup_user) wp-signup.php | Shows a form for a visitor to sign up for a new user account. |
| [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 |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_theme_json_data_default', WP_Theme_JSON_Data ) apply\_filters( 'wp\_theme\_json\_data\_default', WP\_Theme\_JSON\_Data )
=========================================================================
Filters the default data provided by WordPress 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_default', new WP_Theme_JSON_Data( $config, 'default' ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Theme\_JSON\_Resolver::get\_core\_data()](../classes/wp_theme_json_resolver/get_core_data) wp-includes/class-wp-theme-json-resolver.php | Returns core’s origin config. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress apply_filters( 'pre_unschedule_event', null|bool|WP_Error $pre, int $timestamp, string $hook, array $args, bool $wp_error ) apply\_filters( 'pre\_unschedule\_event', null|bool|WP\_Error $pre, int $timestamp, string $hook, array $args, bool $wp\_error )
================================================================================================================================
Filter to preflight or hijack unscheduling of events.
Returning a non-null value will short-circuit the normal unscheduling process, causing the function to return the filtered value instead.
For plugins replacing wp-cron, return true if the event was successfully unscheduled, 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 unscheduling the event. `$timestamp` int Timestamp for when to run the event. `$hook` string Action hook, the execution of which will be unscheduled. `$args` array Arguments to pass to the hook's callback function. `$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_unschedule_event', null, $timestamp, $hook, $args, $wp_error );
```
| Used By | Description |
| --- | --- |
| [wp\_unschedule\_event()](../functions/wp_unschedule_event) wp-includes/cron.php | Unschedule a previously scheduled event. |
| 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( 'wp_nav_menu_item_custom_fields', string $item_id, WP_Post $menu_item, int $depth, stdClass|null $args, int $current_object_id ) do\_action( 'wp\_nav\_menu\_item\_custom\_fields', string $item\_id, WP\_Post $menu\_item, int $depth, stdClass|null $args, int $current\_object\_id )
======================================================================================================================================================
Fires just before the move buttons of a nav menu item in the menu editor.
`$item_id` string Menu item ID as a numeric string. `$menu_item` [WP\_Post](../classes/wp_post) Menu item data object. `$depth` int Depth of menu item. Used for padding. `$args` stdClass|null An object of menu item arguments. `$current_object_id` int Nav menu ID. File: `wp-admin/includes/class-walker-nav-menu-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-walker-nav-menu-edit.php/)
```
do_action( 'wp_nav_menu_item_custom_fields', $item_id, $menu_item, $depth, $args, $current_object_id );
```
| Used By | Description |
| --- | --- |
| [Walker\_Nav\_Menu\_Edit::start\_el()](../classes/walker_nav_menu_edit/start_el) wp-admin/includes/class-walker-nav-menu-edit.php | Start the element output. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |
wordpress apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', bool $bad_slug, string $slug, string $post_type ) apply\_filters( 'wp\_unique\_post\_slug\_is\_bad\_flat\_slug', bool $bad\_slug, string $slug, string $post\_type )
==================================================================================================================
Filters whether the post slug would be bad as a flat slug.
`$bad_slug` bool Whether the post slug would be bad as a flat slug. `$slug` string The post slug. `$post_type` string Post type. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$is_bad_flat_slug = apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type );
```
| 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 do_action( '_core_updated_successfully', string $wp_version ) do\_action( '\_core\_updated\_successfully', string $wp\_version )
==================================================================
Fires after WordPress core has been successfully updated.
`$wp_version` string The current WordPress version. File: `wp-admin/includes/update-core.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update-core.php/)
```
do_action( '_core_updated_successfully', $wp_version );
```
| Used By | Description |
| --- | --- |
| [update\_core()](../functions/update_core) wp-admin/includes/update-core.php | Upgrades the core of WordPress. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'display_site_states', string[] $site_states, WP_Site $site ) apply\_filters( 'display\_site\_states', string[] $site\_states, WP\_Site $site )
=================================================================================
Filters the default site display states for items in the Sites list table.
`$site_states` string[] An array of site states. Default `'Main'`, `'Archived'`, `'Mature'`, `'Spam'`, `'Deleted'`. `$site` [WP\_Site](../classes/wp_site) The current site object. 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/)
```
$site_states = apply_filters( 'display_site_states', $site_states, $_site );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Sites\_List\_Table::site\_states()](../classes/wp_ms_sites_list_table/site_states) wp-admin/includes/class-wp-ms-sites-list-table.php | Maybe output comma-separated site states. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'parent_theme_file_uri', string $url, string $file ) apply\_filters( 'parent\_theme\_file\_uri', string $url, string $file )
=======================================================================
Filters the URL to a file in the parent 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( 'parent_theme_file_uri', $url, $file );
```
| Used By | Description |
| --- | --- |
| [get\_parent\_theme\_file\_uri()](../functions/get_parent_theme_file_uri) wp-includes/link-template.php | Retrieves the URL 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( 'get_edit_comment_link', string $location ) apply\_filters( 'get\_edit\_comment\_link', string $location )
==============================================================
Filters the comment edit link.
`$location` string The edit 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_edit_comment_link', $location );
```
| Used By | Description |
| --- | --- |
| [get\_edit\_comment\_link()](../functions/get_edit_comment_link) wp-includes/link-template.php | Retrieves the edit comment link. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'category_description', string $description, WP_Term $category ) apply\_filters( 'category\_description', string $description, WP\_Term $category )
==================================================================================
Filters the category description for display.
`$description` string Category description. `$category` [WP\_Term](../classes/wp_term) Category object. File: `wp-includes/class-walker-category.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-category.php/)
```
$atts['title'] = strip_tags( apply_filters( 'category_description', $category->description, $category ) );
```
| Used By | Description |
| --- | --- |
| [Walker\_Category::start\_el()](../classes/walker_category/start_el) wp-includes/class-walker-category.php | Starts the element output. |
| Version | Description |
| --- | --- |
| [1.2.0](https://developer.wordpress.org/reference/since/1.2.0/) | Introduced. |
wordpress apply_filters( 'application_password_is_api_request', bool $is_api_request ) apply\_filters( 'application\_password\_is\_api\_request', bool $is\_api\_request )
===================================================================================
Filters whether this is an API request that Application Passwords can be used on.
By default, Application Passwords is available for the REST API and XML-RPC.
`$is_api_request` bool If this is an acceptable API request. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$is_api_request = apply_filters( 'application_password_is_api_request', $is_api_request );
```
| 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_deprecated( 'pub_priv_sql_capability', string $cap ) apply\_filters\_deprecated( 'pub\_priv\_sql\_capability', string $cap )
=======================================================================
This hook has been deprecated. The hook transitioned from "somewhat useless" to "totally useless" instead.
Filters the capability to read private posts for a custom post type when generating SQL for getting posts by author.
`$cap` string Capability. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$cap = apply_filters_deprecated( 'pub_priv_sql_capability', array( '' ), '3.2.0' );
```
| Used By | Description |
| --- | --- |
| [get\_posts\_by\_author\_sql()](../functions/get_posts_by_author_sql) wp-includes/post.php | Retrieves the post SQL based on capability, author, and type. |
| Version | Description |
| --- | --- |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | The hook transitioned from "somewhat useless" to "totally useless". |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action( 'rest_delete_revision', WP_Post|false|null $result, WP_REST_Request $request ) do\_action( 'rest\_delete\_revision', WP\_Post|false|null $result, WP\_REST\_Request $request )
===============================================================================================
Fires after a revision is deleted via the REST API.
`$result` [WP\_Post](../classes/wp_post)|false|null 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. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The request sent to the API. 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/)
```
do_action( 'rest_delete_revision', $result, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Revisions\_Controller::delete\_item()](../classes/wp_rest_revisions_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Deletes a single revision. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'wp_http_accept_encoding', string[] $type, string $url, array $args ) apply\_filters( 'wp\_http\_accept\_encoding', string[] $type, string $url, array $args )
========================================================================================
Filters the allowed encoding types.
`$type` string[] Array of what encoding types to accept and their priority values. `$url` string URL of the HTTP request. `$args` array HTTP request arguments. Note that the filter function **must** return a $type value after it is finished processing or the HTTP call will fail.
File: `wp-includes/class-wp-http-encoding.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-encoding.php/)
```
$type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args );
```
| Used By | Description |
| --- | --- |
| [WP\_Http\_Encoding::accept\_encoding()](../classes/wp_http_encoding/accept_encoding) wp-includes/class-wp-http-encoding.php | What encoding types to accept and their priority values. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress apply_filters( 'view_mode_post_types', string[] $view_mode_post_types ) apply\_filters( 'view\_mode\_post\_types', string[] $view\_mode\_post\_types )
==============================================================================
Filters the post types that have different view mode options.
`$view_mode_post_types` string[] Array of post types that can change view modes.
Default post types with show\_ui on. File: `wp-admin/includes/class-wp-screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-screen.php/)
```
$view_mode_post_types = apply_filters( 'view_mode_post_types', $view_mode_post_types );
```
| Used By | Description |
| --- | --- |
| [WP\_Screen::render\_view\_mode()](../classes/wp_screen/render_view_mode) wp-admin/includes/class-wp-screen.php | Renders the list table view mode preferences. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( 'update_site_option', string $option, mixed $value, mixed $old_value, int $network_id ) do\_action( 'update\_site\_option', string $option, mixed $value, mixed $old\_value, int $network\_id )
=======================================================================================================
Fires after the value of a network option has been successfully updated.
`$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, $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/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'post_format_rewrite_base', string $context ) apply\_filters( 'post\_format\_rewrite\_base', string $context )
================================================================
Filters the post formats rewrite base.
`$context` string Context of the rewrite base. Default `'type'`. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$post_format_base = apply_filters( 'post_format_rewrite_base', 'type' );
```
| Used By | Description |
| --- | --- |
| [create\_initial\_taxonomies()](../functions/create_initial_taxonomies) wp-includes/taxonomy.php | Creates the initial taxonomies. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'disable_formats_dropdown', bool $disable, string $post_type ) apply\_filters( 'disable\_formats\_dropdown', bool $disable, string $post\_type )
=================================================================================
Filters whether to remove the ‘Formats’ drop-down from the post list table.
`$disable` bool Whether to disable the 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 ( apply_filters( 'disable_formats_dropdown', false, $post_type ) ) {
```
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::formats\_dropdown()](../classes/wp_posts_list_table/formats_dropdown) wp-admin/includes/class-wp-posts-list-table.php | Displays a formats drop-down for filtering items. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$post_type` parameter was added. |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'paginate_links_output', string $r, array $args ) apply\_filters( 'paginate\_links\_output', string $r, array $args )
===================================================================
Filters the HTML output of paginated links for archives.
`$r` string HTML output. `$args` array An array of arguments. See [paginate\_links()](../functions/paginate_links) for information on accepted arguments. More Arguments from paginate\_links( ... $args ) Array or string of arguments for generating paginated links for archives.
* `base`stringBase of the paginated url.
* `format`stringFormat for the pagination structure.
* `total`intThe total amount of pages. Default is the value [WP\_Query](../classes/wp_query)'s `max_num_pages` or 1.
* `current`intThe current page number. Default is `'paged'` query var or 1.
* `aria_current`stringThe value for the aria-current attribute. Possible values are `'page'`, `'step'`, `'location'`, `'date'`, `'time'`, `'true'`, `'false'`. Default is `'page'`.
* `show_all`boolWhether to show all pages. Default false.
* `end_size`intHow many numbers on either the start and the end list edges.
Default 1.
* `mid_size`intHow many numbers to either side of the current pages. Default 2.
* `prev_next`boolWhether to include the previous and next links in the list. Default true.
* `prev_text`stringThe previous page text. Default '« Previous'.
* `next_text`stringThe next page text. Default 'Next »'.
* `type`stringControls format of the returned value. Possible values are `'plain'`, `'array'` and `'list'`. Default is `'plain'`.
* `add_args`arrayAn array of query args to add. Default false.
* `add_fragment`stringA string to append to each link.
* `before_page_number`stringA string to appear before the page number.
* `after_page_number`stringA string to append after the page number.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$r = apply_filters( 'paginate_links_output', $r, $args );
```
| Used By | Description |
| --- | --- |
| [paginate\_links()](../functions/paginate_links) wp-includes/general-template.php | Retrieves paginated links for archive post pages. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters_ref_array( 'posts_distinct', string $distinct, WP_Query $query ) apply\_filters\_ref\_array( 'posts\_distinct', string $distinct, WP\_Query $query )
===================================================================================
Filters the DISTINCT clause of the query.
`$distinct` string The DISTINCT clause of the query. `$query` [WP\_Query](../classes/wp_query) The [WP\_Query](../classes/wp_query) instance (passed by reference). Returning “DISTINCTROW” from the filter has the same effect on the query as “DISTINCT”.
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', 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.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'login_messages', string $messages ) apply\_filters( 'login\_messages', string $messages )
=====================================================
Filters instructional messages displayed above the login form.
`$messages` string Login messages. File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
echo '<p class="message" id="login-message">' . apply_filters( 'login_messages', $messages ) . "</p>\n";
```
| Used By | Description |
| --- | --- |
| [login\_header()](../functions/login_header) wp-login.php | Output the login page header. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'loginout', string $link ) apply\_filters( 'loginout', string $link )
==========================================
Filters the HTML output for the Log In/Log Out link.
`$link` string The HTML link content. `loginout` filters the HTML output for the Log In/Log Out link generated by the [wp\_loginout()](../functions/wp_loginout) function.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
echo apply_filters( 'loginout', $link );
```
| Used By | Description |
| --- | --- |
| [wp\_loginout()](../functions/wp_loginout) wp-includes/general-template.php | Displays the Log In/Out link. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'application_password_did_authenticate', WP_User $user, array $item ) do\_action( 'application\_password\_did\_authenticate', WP\_User $user, array $item )
=====================================================================================
Fires after an application password was used for authentication.
`$user` [WP\_User](../classes/wp_user) The user who was authenticated. `$item` array The application password used. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'application_password_did_authenticate', $user, $item );
```
| 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( 'wp_spaces_regexp', string $spaces ) apply\_filters( 'wp\_spaces\_regexp', string $spaces )
======================================================
Filters the regexp for common whitespace characters.
This string is substituted for the \s sequence as needed in regular expressions. For websites not written in English, different characters may represent whitespace. For websites not encoded in UTF-8, the 0xC2 0xA0 sequence may not be in use.
`$spaces` string Regexp pattern for matching common whitespace characters. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$spaces = apply_filters( 'wp_spaces_regexp', '[\r\n\t ]|\xC2\xA0| ' );
```
| Used By | Description |
| --- | --- |
| [wp\_spaces\_regexp()](../functions/wp_spaces_regexp) wp-includes/formatting.php | Returns the regexp for common whitespace characters. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'get_the_archive_title', string $title, string $original_title, string $prefix ) apply\_filters( 'get\_the\_archive\_title', string $title, string $original\_title, string $prefix )
====================================================================================================
Filters the archive title.
`$title` string Archive title to be displayed. `$original_title` string Archive title without 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/)
```
return apply_filters( 'get_the_archive_title', $title, $original_title, $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/) | Added the `$prefix` and `$original_title` parameters. |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress do_action( 'signup_extra_fields', WP_Error $errors ) do\_action( 'signup\_extra\_fields', WP\_Error $errors )
========================================================
Fires at the end of the new user account registration form.
`$errors` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object containing `'user_name'` or `'user_email'` errors. File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
do_action( 'signup_extra_fields', $errors );
```
| Used By | Description |
| --- | --- |
| [show\_user\_form()](../functions/show_user_form) wp-signup.php | Displays the fields for the new user account registration form. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_privacy_export_expiration', int $expiration ) apply\_filters( 'wp\_privacy\_export\_expiration', int $expiration )
====================================================================
Filters the lifetime, in seconds, of a personal data export file.
By default, the lifetime is 3 days. Once the file reaches that age, it will automatically be deleted by a cron job.
`$expiration` int The expiration age of the export, in seconds. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
```
| Used By | Description |
| --- | --- |
| [wp\_privacy\_delete\_old\_export\_files()](../functions/wp_privacy_delete_old_export_files) wp-includes/functions.php | Cleans up export files older than three days old. |
| [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 |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( "transient_{$transient}", mixed $value, string $transient ) apply\_filters( "transient\_{$transient}", mixed $value, string $transient )
============================================================================
Filters an existing transient’s value.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$value` mixed 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/)
```
return apply_filters( "transient_{$transient}", $value, $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 do_action( "rest_after_insert_{$this->post_type}", WP_Post $post, WP_REST_Request $request, bool $creating ) do\_action( "rest\_after\_insert\_{$this->post\_type}", WP\_Post $post, WP\_REST\_Request $request, bool $creating )
====================================================================================================================
Fires after a single post is completely 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_after_insert_post`
* `rest_after_insert_page`
* `rest_after_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_after_insert_{$this->post_type}", $post, $request, true );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Templates\_Controller::update\_item()](../classes/wp_rest_templates_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Updates a single template. |
| [WP\_REST\_Templates\_Controller::create\_item()](../classes/wp_rest_templates_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Creates a single template. |
| [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 |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'autocomplete_users_for_site_admins', bool $enable ) apply\_filters( 'autocomplete\_users\_for\_site\_admins', bool $enable )
========================================================================
Filters whether to enable user auto-complete for non-super admins in Multisite.
`$enable` bool Whether to enable auto-complete for non-super admins. Default false. File: `wp-admin/user-new.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/user-new.php/)
```
&& ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) )
```
| Used By | Description |
| --- | --- |
| [wp\_ajax\_autocomplete\_user()](../functions/wp_ajax_autocomplete_user) wp-admin/includes/ajax-actions.php | Ajax handler for user autocomplete. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'dashboard_secondary_title', string $title ) apply\_filters( 'dashboard\_secondary\_title', string $title )
==============================================================
Filters the secondary link title for the ‘WordPress Events and News’ dashboard widget.
`$title` string Title attribute for the widget's secondary 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_secondary_title', __( 'Other WordPress 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.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'get_image_tag', string $html, int $id, string $alt, string $title, string $align, string|int[] $size ) apply\_filters( 'get\_image\_tag', string $html, int $id, string $alt, string $title, string $align, string|int[] $size )
=========================================================================================================================
Filters the HTML content for the image tag.
`$html` string HTML content for the image. `$id` int Attachment ID. `$alt` string Image description for the alt attribute. `$title` string Image description for the title attribute. `$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/)
```
return apply_filters( 'get_image_tag', $html, $id, $alt, $title, $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( 'theme_auto_update_setting_html', string $html, string $stylesheet, WP_Theme $theme ) apply\_filters( 'theme\_auto\_update\_setting\_html', string $html, string $stylesheet, WP\_Theme $theme )
==========================================================================================================
Filters the HTML of the auto-updates setting for each theme in the Themes list table.
`$html` string The HTML for theme's auto-update setting, including toggle auto-update action link and time to next update. `$stylesheet` string Directory name of the theme. `$theme` [WP\_Theme](../classes/wp_theme) [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/)
```
echo apply_filters( 'theme_auto_update_setting_html', $html, $stylesheet, $theme );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Themes\_List\_Table::column\_autoupdates()](../classes/wp_ms_themes_list_table/column_autoupdates) wp-admin/includes/class-wp-ms-themes-list-table.php | Handles the auto-updates column output. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'spammed_comment', int $comment_id, WP_Comment $comment ) do\_action( 'spammed\_comment', int $comment\_id, WP\_Comment $comment )
========================================================================
Fires immediately after a comment is marked as Spam.
`$comment_id` int The comment ID. `$comment` [WP\_Comment](../classes/wp_comment) The comment marked as spam. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'spammed_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_spam\_comment()](../functions/wp_spam_comment) wp-includes/comment.php | Marks a comment as 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( 'set_logged_in_cookie', string $logged_in_cookie, int $expire, int $expiration, int $user_id, string $scheme, string $token ) do\_action( 'set\_logged\_in\_cookie', string $logged\_in\_cookie, int $expire, int $expiration, int $user\_id, string $scheme, string $token )
===============================================================================================================================================
Fires immediately before the logged-in authentication cookie is set.
`$logged_in_cookie` string The logged-in 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 logged-in authentication cookie expires as a UNIX timestamp.
Default is 14 days from now. `$user_id` int User ID. `$scheme` string Authentication scheme. Default `'logged_in'`. `$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_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in', $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.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'get_the_categories', WP_Term[] $categories, int|false $post_id ) apply\_filters( 'get\_the\_categories', WP\_Term[] $categories, int|false $post\_id )
=====================================================================================
Filters the array of categories to return for a post.
`$categories` [WP\_Term](../classes/wp_term)[] An array of categories to return for the post. `$post_id` int|false The 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( 'get_the_categories', $categories, $post_id );
```
| Used By | Description |
| --- | --- |
| [get\_the\_category()](../functions/get_the_category) wp-includes/category-template.php | Retrieves post categories. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$post_id` parameter. |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_redirect', string $location, int $status ) apply\_filters( 'wp\_redirect', string $location, int $status )
===============================================================
Filters the redirect location.
`$location` string The path or URL to redirect to. `$status` int The HTTP response status code to use. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$location = apply_filters( 'wp_redirect', $location, $status );
```
| Used By | Description |
| --- | --- |
| [wp\_redirect()](../functions/wp_redirect) wp-includes/pluggable.php | Redirects to another page. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_mw_editPost', int $post_ID, array $args ) do\_action( 'xmlrpc\_call\_success\_mw\_editPost', int $post\_ID, array $args )
===============================================================================
Fires after a post has been successfully updated via the XML-RPC MovableType API.
`$post_ID` int ID of the updated post. `$args` array An array of arguments to update 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_mw_editPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::mw\_editPost()](../classes/wp_xmlrpc_server/mw_editpost) wp-includes/class-wp-xmlrpc-server.php | Edit a post. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'wp_kses_uri_attributes', string[] $uri_attributes ) apply\_filters( 'wp\_kses\_uri\_attributes', string[] $uri\_attributes )
========================================================================
Filters the list of attributes that are required to contain a URL.
Use this filter to add any `data-` attributes that are required to be validated as a URL.
`$uri_attributes` string[] HTML attribute names whose value contains a URL. File: `wp-includes/kses.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/kses.php/)
```
$uri_attributes = apply_filters( 'wp_kses_uri_attributes', $uri_attributes );
```
| Used By | Description |
| --- | --- |
| [wp\_kses\_uri\_attributes()](../functions/wp_kses_uri_attributes) wp-includes/kses.php | Returns an array of HTML attribute names whose value contains a URL. |
| Version | Description |
| --- | --- |
| [5.0.1](https://developer.wordpress.org/reference/since/5.0.1/) | Introduced. |
wordpress apply_filters( 'list_table_primary_column', string $default, string $context ) apply\_filters( 'list\_table\_primary\_column', string $default, string $context )
==================================================================================
Filters the name of the primary column for the current list table.
`$default` string Column name default for the specific list table, e.g. `'name'`. `$context` string Screen ID for specific list table, e.g. `'plugins'`. 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/)
```
$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
```
| Used By | Description |
| --- | --- |
| [WP\_List\_Table::get\_primary\_column\_name()](../classes/wp_list_table/get_primary_column_name) wp-admin/includes/class-wp-list-table.php | Gets the name of the primary column. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'http_api_transports', string[] $transports, array $args, string $url ) apply\_filters( 'http\_api\_transports', string[] $transports, array $args, string $url )
=========================================================================================
Filters which HTTP transports are available and in what order.
`$transports` string[] Array of HTTP transports to check. Default array contains `'curl'` and `'streams'`, in that order. `$args` array HTTP request arguments. `$url` string The URL to request. File: `wp-includes/class-wp-http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http.php/)
```
$request_order = apply_filters( 'http_api_transports', $transports, $args, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_Http::\_get\_first\_available\_transport()](../classes/wp_http/_get_first_available_transport) wp-includes/class-wp-http.php | Tests which transports are capable of supporting the request. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress do_action( 'admin_init' ) do\_action( 'admin\_init' )
===========================
Fires as an admin screen or script is being initialized.
Note, this does not just run on user-facing admin screens.
It runs on admin-ajax.php and admin-post.php as well.
This is roughly analogous to the more general [‘init’](init) hook, which fires earlier.
`admin_init` is triggered before any other hook when a user accesses the admin area.
This hook doesn’t provide any parameters, so it can only be used to callback a specified function.
File: `wp-admin/admin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin.php/)
```
do_action( 'admin_init' );
```
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'auth_cookie_valid', string[] $cookie_elements, WP_User $user ) do\_action( 'auth\_cookie\_valid', string[] $cookie\_elements, WP\_User $user )
===============================================================================
Fires once an authentication cookie has been validated.
`$cookie_elements` string[] Authentication cookie components.
* `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.
`$user` [WP\_User](../classes/wp_user) User object. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'auth_cookie_valid', $cookie_elements, $user );
```
| 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( 'the_privacy_policy_link', string $link, string $privacy_policy_url ) apply\_filters( 'the\_privacy\_policy\_link', string $link, string $privacy\_policy\_url )
==========================================================================================
Filters the privacy policy link.
`$link` string The privacy policy link. Empty string if it doesn't exist. `$privacy_policy_url` string The URL of the privacy policy. Empty string if it doesn't exist. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
$link = apply_filters( 'the_privacy_policy_link', $link, $privacy_policy_url );
```
| Used By | Description |
| --- | --- |
| [get\_the\_privacy\_policy\_link()](../functions/get_the_privacy_policy_link) wp-includes/link-template.php | Returns the privacy policy link with formatting, when applicable. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'pre_trash_post', bool|null $trash, WP_Post $post ) apply\_filters( 'pre\_trash\_post', bool|null $trash, WP\_Post $post )
======================================================================
Filters whether a post trashing should take place.
`$trash` bool|null Whether to go forward with trashing. `$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/)
```
$check = apply_filters( 'pre_trash_post', null, $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\_trash\_post()](../functions/wp_trash_post) wp-includes/post.php | Moves a post or page to the Trash |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'rest_request_from_url', WP_REST_Request|false $request, string $url ) apply\_filters( 'rest\_request\_from\_url', WP\_REST\_Request|false $request, string $url )
===========================================================================================
Filters the REST API request generated from a URL.
`$request` [WP\_REST\_Request](../classes/wp_rest_request)|false Generated request object, or false if URL could not be parsed. `$url` string URL the request was generated from. 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_from_url', $request, $url );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Request::from\_url()](../classes/wp_rest_request/from_url) wp-includes/rest-api/class-wp-rest-request.php | Retrieves a [WP\_REST\_Request](../classes/wp_rest_request) object from a full URL. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'wp_parse_str', array $array ) apply\_filters( 'wp\_parse\_str', array $array )
================================================
Filters the array of variables derived from a parsed string.
`$array` array The array populated with variables. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
$array = apply_filters( 'wp_parse_str', $array );
```
| Used By | Description |
| --- | --- |
| [wp\_parse\_str()](../functions/wp_parse_str) wp-includes/formatting.php | Parses a string into variables to be stored in an array. |
| Version | Description |
| --- | --- |
| [2.2.1](https://developer.wordpress.org/reference/since/2.2.1/) | Introduced. |
wordpress apply_filters( 'found_comments_query', string $found_comments_query, WP_Comment_Query $comment_query ) apply\_filters( 'found\_comments\_query', string $found\_comments\_query, WP\_Comment\_Query $comment\_query )
==============================================================================================================
Filters the query used to retrieve found comment count.
`$found_comments_query` string SQL query. Default 'SELECT FOUND\_ROWS()'. `$comment_query` [WP\_Comment\_Query](../classes/wp_comment_query) The `WP_Comment_Query` instance. File: `wp-includes/class-wp-comment-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-comment-query.php/)
```
$found_comments_query = apply_filters( 'found_comments_query', 'SELECT FOUND_ROWS()', $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Comment\_Query::set\_found\_comments()](../classes/wp_comment_query/set_found_comments) wp-includes/class-wp-comment-query.php | Populates found\_comments and max\_num\_pages properties for the current query if the limit clause was used. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'image_send_to_editor_url', string $html, string $src, string $alt, string $align ) apply\_filters( 'image\_send\_to\_editor\_url', string $html, string $src, string $alt, string $align )
=======================================================================================================
Filters the image URL sent to the editor.
`$html` string HTML markup sent to the editor for an image. `$src` string Image source URL. `$alt` string Image alternate, or alt, text. `$align` string The image alignment. Default `'alignnone'`. Possible values include `'alignleft'`, `'aligncenter'`, `'alignright'`, `'alignnone'`. File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
$html = apply_filters( 'image_send_to_editor_url', $html, sanitize_url( $src ), $alt, $align );
```
| Used By | Description |
| --- | --- |
| [wp\_media\_upload\_handler()](../functions/wp_media_upload_handler) wp-admin/includes/media.php | Handles the process of uploading media. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_caption', string $caption, int $post_id ) apply\_filters( 'wp\_get\_attachment\_caption', string $caption, int $post\_id )
================================================================================
Filters the attachment caption.
`$caption` string Caption for the given attachment. `$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_caption', $caption, $post->ID );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_caption()](../functions/wp_get_attachment_caption) wp-includes/post.php | Retrieves the caption for an attachment. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |
wordpress do_action( 'grant_super_admin', int $user_id ) do\_action( 'grant\_super\_admin', int $user\_id )
==================================================
Fires before the user is granted Super Admin privileges.
`$user_id` int ID of the user that is about to be granted Super Admin privileges. File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
do_action( 'grant_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( 'quick_edit_custom_box', string $column_name, string $post_type, string $taxonomy ) do\_action( 'quick\_edit\_custom\_box', string $column\_name, string $post\_type, string $taxonomy )
====================================================================================================
Fires once for each column in Quick Edit mode.
`$column_name` string Name of the column to edit. `$post_type` string The post type slug, or current screen name if this is a taxonomy list table. `$taxonomy` string The taxonomy name, if any. *quick\_edit\_custom\_box* is an action that lets a plugin print inputs for custom columns when quick editing. This action is called one time for each custom column. Custom columns are added with the [manage\_{$post\_type}\_posts\_columns](manage_post_type_posts_columns) filter. To save the data from the custom inputs, hook the <save_post> 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/)
```
do_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' );
```
| Used By | Description |
| --- | --- |
| [WP\_Terms\_List\_Table::inline\_edit()](../classes/wp_terms_list_table/inline_edit) wp-admin/includes/class-wp-terms-list-table.php | Outputs the hidden row displayed when inline editing |
| [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 |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'comments_per_page', int $comments_per_page, string $comment_status ) apply\_filters( 'comments\_per\_page', int $comments\_per\_page, string $comment\_status )
==========================================================================================
Filters the number of comments listed per page in the comments list table.
`$comments_per_page` int The number of comments to list per page. `$comment_status` string The comment status name. Default `'All'`. 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/)
```
return apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
```
| 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\_Comments\_List\_Table::get\_per\_page()](../classes/wp_comments_list_table/get_per_page) wp-admin/includes/class-wp-comments-list-table.php | |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress do_action( 'wp_meta' ) do\_action( 'wp\_meta' )
========================
Fires before displaying echoed content in the sidebar.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
do_action( 'wp_meta' );
```
| Used By | Description |
| --- | --- |
| [wp\_meta()](../functions/wp_meta) wp-includes/general-template.php | Theme container function for the ‘wp\_meta’ action. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters_deprecated( 'block_editor_preload_paths', string[] $preload_paths, WP_Post $selected_post ) apply\_filters\_deprecated( 'block\_editor\_preload\_paths', string[] $preload\_paths, WP\_Post $selected\_post )
=================================================================================================================
This hook has been deprecated. Use the [‘block\_editor\_rest\_api\_preload\_paths’](block_editor_rest_api_preload_paths) filter instead.
Filters the array of paths that will be preloaded.
Preload common data by specifying an array of REST API paths that will be preloaded.
`$preload_paths` string[] Array of paths to preload. `$selected_post` [WP\_Post](../classes/wp_post) Post being edited. File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
$preload_paths = apply_filters_deprecated( 'block_editor_preload_paths', array( $preload_paths, $selected_post ), '5.8.0', 'block_editor_rest_api_preload_paths' );
```
| 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/) | Use the ['block\_editor\_rest\_api\_preload\_paths'](block_editor_rest_api_preload_paths) filter instead. |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress do_action( 'is_wp_error_instance', WP_Error $thing ) do\_action( 'is\_wp\_error\_instance', WP\_Error $thing )
=========================================================
Fires when `is_wp_error()` is called and its parameter is an instance of `WP_Error`.
`$thing` [WP\_Error](../classes/wp_error) The error object passed to `is_wp_error()`. File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
do_action( 'is_wp_error_instance', $thing );
```
| Used By | Description |
| --- | --- |
| [is\_wp\_error()](../functions/is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( 'wp_login_failed', string $username, WP_Error $error ) do\_action( 'wp\_login\_failed', string $username, WP\_Error $error )
=====================================================================
Fires after a user login has failed.
`$username` string Username or email address. `$error` [WP\_Error](../classes/wp_error) A [WP\_Error](../classes/wp_error) object with the authentication failure details. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'wp_login_failed', $username, $error );
```
| Used By | Description |
| --- | --- |
| [wp\_authenticate()](../functions/wp_authenticate) wp-includes/pluggable.php | Authenticates a user, confirming the login credentials are valid. |
| Version | Description |
| --- | --- |
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | The `$error` parameter was added. |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The value of `$username` can now be an email address. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'rest_pattern_directory_collection_params', array $query_params ) apply\_filters( 'rest\_pattern\_directory\_collection\_params', array $query\_params )
======================================================================================
Filter collection parameters for the block pattern directory controller.
`$query_params` array JSON Schema-formatted collection parameters. File: `wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php/)
```
return apply_filters( 'rest_pattern_directory_collection_params', $query_params );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Pattern\_Directory\_Controller::get\_collection\_params()](../classes/wp_rest_pattern_directory_controller/get_collection_params) wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php | Retrieves the search parameters for the block pattern’s collection. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_image', string $html, int $attachment_id, string|int[] $size, bool $icon, string[] $attr ) apply\_filters( 'wp\_get\_attachment\_image', string $html, int $attachment\_id, string|int[] $size, bool $icon, string[] $attr )
=================================================================================================================================
Filters the HTML img element representing an image attachment.
`$html` string HTML img element or empty string on failure. `$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. `$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'`.
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', $html, $attachment_id, $size, $icon, $attr );
```
| 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 |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( 'post_lock_lost_dialog', WP_Post $post ) do\_action( 'post\_lock\_lost\_dialog', WP\_Post $post )
========================================================
Fires inside the dialog displayed when a user has lost the post lock.
`$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/)
```
do_action( 'post_lock_lost_dialog', $post );
```
| 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 apply_filters( 'rest_prepare_revision', WP_REST_Response $response, WP_Post $post, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_revision', WP\_REST\_Response $response, WP\_Post $post, WP\_REST\_Request $request )
=====================================================================================================================
Filters a revision returned from the REST API.
Allows modification of the revision right before it is returned.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$post` [WP\_Post](../classes/wp_post) The original revision object. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request used to generate the response. 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/)
```
return apply_filters( 'rest_prepare_revision', $response, $post, $request );
```
| 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. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( "pre_set_transient_{$transient}", mixed $value, int $expiration, string $transient ) apply\_filters( "pre\_set\_transient\_{$transient}", mixed $value, int $expiration, string $transient )
=======================================================================================================
Filters a specific transient before its value is set.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$value` mixed New value of transient. `$expiration` int Time until expiration in seconds. `$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_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. |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | The `$expiration` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( "edit_{$field}", mixed $value, int $post_id ) apply\_filters( "edit\_{$field}", mixed $value, int $post\_id )
===============================================================
Filters the value of a specific post field to edit.
The dynamic portion of the hook name, `$field`, refers to the post field name.
`$value` mixed Value of the post field. `$post_id` int Post ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$value = apply_filters( "edit_{$field}", $value, $post_id );
```
| 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( 'site_status_test_result', array $test_result ) apply\_filters( 'site\_status\_test\_result', array $test\_result )
===================================================================
Filters the output of a finished Site Health test.
`$test_result` array An associative array of test result data.
* `label`stringA label describing the test, and is used as a header in the output.
* `status`stringThe status of the test, which can be a value of `good`, `recommended` or `critical`.
* `badge`array Tests are put into categories which have an associated badge shown, these can be modified and assigned here.
+ `label`stringThe test label, for example `Performance`.
+ `color`stringDefault `blue`. A string representing a color to use for the label.
+ `description`stringA more descriptive explanation of what the test looks for, and why it is important for the end user.
+ `actions`stringAn action to direct the user to where they can resolve the issue, if one exists.
+ `test`stringThe name of the test being ran, used as a reference point. 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_test_result', call_user_func( $callback ) );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::perform\_test()](../classes/wp_site_health/perform_test) wp-admin/includes/class-wp-site-health.php | Runs a Site Health test directly. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_methods', string[] $methods ) apply\_filters( 'xmlrpc\_methods', string[] $methods )
======================================================
Filters the methods exposed by the XML-RPC server.
This filter can be used to add new methods, and remove built-in methods.
`$methods` string[] An array of XML-RPC methods, keyed by their methodName. 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->methods = apply_filters( 'xmlrpc_methods', $this->methods );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_\_construct()](../classes/wp_xmlrpc_server/__construct) wp-includes/class-wp-xmlrpc-server.php | Registers all of the XMLRPC methods that XMLRPC server understands. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( "admin_head_{$content_func}" ) do\_action( "admin\_head\_{$content\_func}" )
=============================================
Fires in the admin header for each specific form tab in the legacy (pre-3.5.0) media upload popup.
The dynamic portion of the hook name, `$content_func`, refers to the form callback for the media upload type.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( "admin_head_{$content_func}" );
```
| 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.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'stylesheet_directory', string $stylesheet_dir, string $stylesheet, string $theme_root ) apply\_filters( 'stylesheet\_directory', string $stylesheet\_dir, string $stylesheet, string $theme\_root )
===========================================================================================================
Filters the stylesheet directory path for the active theme.
`$stylesheet_dir` string Absolute path to the active theme. `$stylesheet` string Directory name of the active theme. `$theme_root` string Absolute path to themes directory. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
```
| Used By | Description |
| --- | --- |
| [get\_stylesheet\_directory()](../functions/get_stylesheet_directory) wp-includes/theme.php | Retrieves stylesheet directory path for the active theme. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'post_thumbnail_html', string $html, int $post_id, int $post_thumbnail_id, string|int[] $size, string|array $attr ) apply\_filters( 'post\_thumbnail\_html', string $html, int $post\_id, int $post\_thumbnail\_id, string|int[] $size, string|array $attr )
========================================================================================================================================
Filters the post thumbnail HTML.
`$html` string The post thumbnail HTML. `$post_id` int The post ID. `$post_thumbnail_id` int The post thumbnail ID, or 0 if there isn't one. `$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). `$attr` string|array Query string or array of attributes. File: `wp-includes/post-thumbnail-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-thumbnail-template.php/)
```
return apply_filters( 'post_thumbnail_html', $html, $post->ID, $post_thumbnail_id, $size, $attr );
```
| 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. |
| programming_docs |
wordpress apply_filters( 'pre_count_users', null|array $result, string $strategy, int $site_id ) apply\_filters( 'pre\_count\_users', null|array $result, string $strategy, int $site\_id )
==========================================================================================
Filters the user count before queries are run.
Return a non-null value to cause [count\_users()](../functions/count_users) to return early.
`$result` null|array The value to return instead. Default null to continue with the query. `$strategy` string The computational strategy to use when counting the users.
Accepts either `'time'` or `'memory'`. Default `'time'`. `$site_id` int The site ID to count users for. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$pre = apply_filters( 'pre_count_users', null, $strategy, $site_id );
```
| Used By | Description |
| --- | --- |
| [count\_users()](../functions/count_users) wp-includes/user.php | Counts number of users who have each of the user roles. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( "gettext_{$domain}", string $translation, string $text, string $domain ) apply\_filters( "gettext\_{$domain}", string $translation, string $text, string $domain )
=========================================================================================
Filters text with its translation for a domain.
The dynamic portion of the hook name, `$domain`, refers to the text domain.
`$translation` string Translated text. `$text` string Text to translate. `$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( "gettext_{$domain}", $translation, $text, $domain );
```
| Used By | Description |
| --- | --- |
| [translate()](../functions/translate) 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 apply_filters( 'signup_user_meta', array $meta, string $user, string $user_email, string $key ) apply\_filters( 'signup\_user\_meta', array $meta, string $user, string $user\_email, string $key )
===================================================================================================
Filters the metadata for a user signup.
The metadata will be serialized prior to storing it in the database.
`$meta` array Signup meta data. Default empty array. `$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_user_meta', $meta, $user, $user_email, $key );
```
| 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.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( "sanitize_option_{$option}", string $value, string $option, string $original_value ) apply\_filters( "sanitize\_option\_{$option}", string $value, string $option, string $original\_value )
=======================================================================================================
Filters an option value following sanitization.
`$value` string The sanitized option value. `$option` string The option name. `$original_value` string The original value passed to the function. There is one filter per option name; the $option in the filter name stands for the name (e.g. ‘`sanitize_option_blogname`‘, ‘`sanitize_option_siteurl`‘). You can use this filter to define a sanitizer for your own options. See the notes for [sanitize\_option()](../functions/sanitize_option) for a list of existing options.
**Filter existing options**
```
add_filter('sanitize_option_admin_email', 'sanitize_builtin_option', 10, 2);
add_filter('sanitize_option_new_admin_email', 'sanitize_builtin_option', 10, 2);
function sanitize_builtin_option($value, $option) {
//...
}
```
**Filter your own options**
```
add_filter('sanitize_option_feed_url', 'sanitize_url', 10, 2);
add_filter('sanitize_option_wpi_endpoint', 'sanitize_url', 10, 2);
add_filter('sanitize_option_contact_email', 'sanitize_email');
function sanitize_url($value, $option) {
//...
}
function sanitize_email($value, $option) {
//...
}
```
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );
```
| Used By | Description |
| --- | --- |
| [sanitize\_option()](../functions/sanitize_option) wp-includes/formatting.php | Sanitizes various option values based on the nature of the option. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Added the `$original_value` parameter. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'logout_url', string $logout_url, string $redirect ) apply\_filters( 'logout\_url', string $logout\_url, string $redirect )
======================================================================
Filters the logout URL.
`$logout_url` string The HTML-encoded logout URL. `$redirect` string Path to redirect to on logout. This filter is applied to the url returned by the function [wp\_logout\_url()](../functions/wp_logout_url) .
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'logout_url', $logout_url, $redirect );
```
| Used By | Description |
| --- | --- |
| [wp\_logout\_url()](../functions/wp_logout_url) wp-includes/general-template.php | Retrieves the logout URL. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'allowed_block_types_all', bool|string[] $allowed_block_types, WP_Block_Editor_Context $block_editor_context ) apply\_filters( 'allowed\_block\_types\_all', bool|string[] $allowed\_block\_types, WP\_Block\_Editor\_Context $block\_editor\_context )
========================================================================================================================================
Filters the allowed block types for all editor types.
`$allowed_block_types` bool|string[] Array of block type slugs, or boolean to enable/disable all.
Default true (all registered block types supported). `$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/)
```
$allowed_block_types = apply_filters( 'allowed_block_types_all', $allowed_block_types, $block_editor_context );
```
| Used By | Description |
| --- | --- |
| [get\_allowed\_block\_types()](../functions/get_allowed_block_types) wp-includes/block-editor.php | Gets the list of allowed block types to use in the block editor. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_echo_response', array $result, WP_REST_Server $server, WP_REST_Request $request ) apply\_filters( 'rest\_pre\_echo\_response', array $result, WP\_REST\_Server $server, WP\_REST\_Request $request )
==================================================================================================================
Filters the REST API response.
Allows modification of the response data after inserting embedded data (if any) and before echoing the response data.
`$result` array Response data to send to the client. `$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_pre_echo_response', $result, $this, $request );
```
| 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.8.1](https://developer.wordpress.org/reference/since/4.8.1/) | Introduced. |
wordpress do_action( 'deleted_theme', string $stylesheet, bool $deleted ) do\_action( 'deleted\_theme', string $stylesheet, bool $deleted )
=================================================================
Fires immediately after a theme deletion attempt.
`$stylesheet` string Stylesheet of the theme to delete. `$deleted` bool Whether the theme deletion was successful. File: `wp-admin/includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
```
do_action( 'deleted_theme', $stylesheet, $deleted );
```
| Used By | Description |
| --- | --- |
| [delete\_theme()](../functions/delete_theme) wp-admin/includes/theme.php | Removes a theme. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress apply_filters( 'oembed_response_data', array $data, WP_Post $post, int $width, int $height ) apply\_filters( 'oembed\_response\_data', array $data, WP\_Post $post, int $width, int $height )
================================================================================================
Filters the oEmbed response data.
`$data` array The response data. `$post` [WP\_Post](../classes/wp_post) The post object. `$width` int The requested width. `$height` int The calculated height. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
return apply_filters( 'oembed_response_data', $data, $post, $width, $height );
```
| Used By | Description |
| --- | --- |
| [get\_oembed\_response\_data()](../functions/get_oembed_response_data) wp-includes/embed.php | Retrieves the oEmbed response data for a given post. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'ext2type', array[] $ext2type ) apply\_filters( 'ext2type', array[] $ext2type )
===============================================
Filters file type based on the extension name.
* [wp\_ext2type()](../functions/wp_ext2type)
`$ext2type` array[] Multi-dimensional array of file extensions types keyed by the type of file. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters(
'ext2type',
array(
'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'heic', 'webp' ),
'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'flac', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
'video' => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ),
'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ),
'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb' ),
'interactive' => array( 'swf', 'key', 'ppt', 'pptx', 'pptm', 'pps', 'ppsx', 'ppsm', 'sldx', 'sldm', 'odp' ),
'text' => array( 'asc', 'csv', 'tsv', 'txt' ),
'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ),
'code' => array( 'css', 'htm', 'html', 'php', 'js' ),
)
);
```
| Used By | Description |
| --- | --- |
| [wp\_get\_ext\_types()](../functions/wp_get_ext_types) wp-includes/functions.php | Retrieves the list of common file extensions and their types. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'stylesheet_directory_uri', string $stylesheet_dir_uri, string $stylesheet, string $theme_root_uri ) apply\_filters( 'stylesheet\_directory\_uri', string $stylesheet\_dir\_uri, string $stylesheet, string $theme\_root\_uri )
==========================================================================================================================
Filters the stylesheet directory URI.
`$stylesheet_dir_uri` string Stylesheet directory URI. `$stylesheet` string Name of the activated theme's directory. `$theme_root_uri` string Themes root URI. File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
return apply_filters( 'stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet, $theme_root_uri );
```
| Used By | Description |
| --- | --- |
| [get\_stylesheet\_directory\_uri()](../functions/get_stylesheet_directory_uri) wp-includes/theme.php | Retrieves stylesheet directory URI for the active theme. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters( 'terms_clauses', string[] $clauses, string[] $taxonomies, array $args ) apply\_filters( 'terms\_clauses', string[] $clauses, string[] $taxonomies, array $args )
========================================================================================
Filters the terms query SQL clauses.
`$clauses` string[] Associative array of the clauses for the query.
* `fields`stringThe SELECT clause of the query.
* `join`stringThe JOIN clause of the query.
* `where`stringThe WHERE clause of the query.
* `distinct`stringThe DISTINCT clause of the query.
* `orderby`stringThe ORDER BY clause of the query.
* `order`stringThe ORDER clause of the query.
* `limits`stringThe LIMIT clause of the query.
`$taxonomies` string[] An array of taxonomy names. `$args` array An array of term query arguments. File: `wp-includes/class-wp-term-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-term-query.php/)
```
$clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args );
```
| 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 |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters_deprecated( 'image_edit_before_change', resource|GdImage $image, array $changes ) apply\_filters\_deprecated( 'image\_edit\_before\_change', resource|GdImage $image, array $changes )
====================================================================================================
This hook has been deprecated. Use [‘wp\_image\_editor\_before\_change’](wp_image_editor_before_change) instead.
Filters the GD image resource before applying changes to the image.
`$image` resource|GdImage GD image resource or GdImage 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_deprecated( 'image_edit_before_change', array( $image, $changes ), '3.5.0', 'wp_image_editor_before_change' );
```
| 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/) | Use ['wp\_image\_editor\_before\_change'](wp_image_editor_before_change) instead. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'send_auth_cookies', bool $send ) apply\_filters( 'send\_auth\_cookies', bool $send )
===================================================
Allows preventing auth cookies from actually being sent to the client.
`$send` bool Whether to send auth cookies to the client. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
if ( ! apply_filters( 'send_auth_cookies', true ) ) {
```
| 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\_clear\_auth\_cookie()](../functions/wp_clear_auth_cookie) wp-includes/pluggable.php | Removes all of the cookies associated with authentication. |
| Version | Description |
| --- | --- |
| [4.7.4](https://developer.wordpress.org/reference/since/4.7.4/) | Introduced. |
wordpress apply_filters( 'http_request_redirection_count', int $redirect_count, string $url ) apply\_filters( 'http\_request\_redirection\_count', int $redirect\_count, string $url )
========================================================================================
Filters the number of redirects allowed during an HTTP request.
`$redirect_count` int Number of redirects allowed. 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/)
```
'redirection' => apply_filters( 'http_request_redirection_count', 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 apply_filters( 'enter_title_here', string $text, WP_Post $post ) apply\_filters( 'enter\_title\_here', string $text, WP\_Post $post )
====================================================================
Filters the title field placeholder text.
`$text` string Placeholder text. Default 'Add title'. `$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/)
```
$title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post );
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_quick\_press()](../functions/wp_dashboard_quick_press) wp-admin/includes/dashboard.php | The Quick Draft widget display and creation of drafts. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'sanitize_file_name', string $filename, string $filename_raw ) apply\_filters( 'sanitize\_file\_name', string $filename, string $filename\_raw )
=================================================================================
Filters a sanitized filename string.
`$filename` string Sanitized filename. `$filename_raw` string The filename 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_file_name', $filename, $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. |
wordpress do_action( "updated_{$meta_type}_meta", int $meta_id, int $object_id, string $meta_key, mixed $_meta_value ) do\_action( "updated\_{$meta\_type}\_meta", int $meta\_id, int $object\_id, string $meta\_key, mixed $\_meta\_value )
=====================================================================================================================
Fires immediately after 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:
* `updated_post_meta`
* `updated_comment_meta`
* `updated_term_meta`
* `updated_user_meta`
`$meta_id` int ID of updated metadata entry. `$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( "updated_{$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. |
wordpress do_action( 'xmlrpc_call', string $name, array|string $args, wp_xmlrpc_server $server ) do\_action( 'xmlrpc\_call', string $name, array|string $args, wp\_xmlrpc\_server $server )
==========================================================================================
Fires after the XML-RPC user has been authenticated but before the rest of the method logic begins.
All built-in XML-RPC methods use the action xmlrpc\_call, with a parameter equal to the method’s name, e.g., wp.getUsersBlogs, wp.newPost, etc.
`$name` string The method name. `$args` array|string The escaped arguments passed to the method. `$server` [wp\_xmlrpc\_server](../classes/wp_xmlrpc_server) The XML-RPC server instance. 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', 'wp.getUsersBlogs', $args, $this );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::mt\_getPostCategories()](../classes/wp_xmlrpc_server/mt_getpostcategories) wp-includes/class-wp-xmlrpc-server.php | Retrieve post categories. |
| [wp\_xmlrpc\_server::mt\_setPostCategories()](../classes/wp_xmlrpc_server/mt_setpostcategories) wp-includes/class-wp-xmlrpc-server.php | Sets categories for a post. |
| [wp\_xmlrpc\_server::mt\_supportedMethods()](../classes/wp_xmlrpc_server/mt_supportedmethods) wp-includes/class-wp-xmlrpc-server.php | Retrieve an array of methods supported by this server. |
| [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. |
| [wp\_xmlrpc\_server::mt\_getTrackbackPings()](../classes/wp_xmlrpc_server/mt_gettrackbackpings) wp-includes/class-wp-xmlrpc-server.php | Retrieve trackbacks sent to a given post. |
| [wp\_xmlrpc\_server::mt\_publishPost()](../classes/wp_xmlrpc_server/mt_publishpost) wp-includes/class-wp-xmlrpc-server.php | Sets a post’s publish status to ‘publish’. |
| [wp\_xmlrpc\_server::pingback\_ping()](../classes/wp_xmlrpc_server/pingback_ping) wp-includes/class-wp-xmlrpc-server.php | Retrieves a pingback and registers it. |
| [wp\_xmlrpc\_server::pingback\_extensions\_getPingbacks()](../classes/wp_xmlrpc_server/pingback_extensions_getpingbacks) wp-includes/class-wp-xmlrpc-server.php | Retrieve array of URLs that pingbacked the given URL. |
| [wp\_xmlrpc\_server::mw\_editPost()](../classes/wp_xmlrpc_server/mw_editpost) wp-includes/class-wp-xmlrpc-server.php | Edit a post. |
| [wp\_xmlrpc\_server::mw\_getPost()](../classes/wp_xmlrpc_server/mw_getpost) wp-includes/class-wp-xmlrpc-server.php | Retrieve post. |
| [wp\_xmlrpc\_server::mw\_getRecentPosts()](../classes/wp_xmlrpc_server/mw_getrecentposts) wp-includes/class-wp-xmlrpc-server.php | Retrieve list of recent posts. |
| [wp\_xmlrpc\_server::mw\_getCategories()](../classes/wp_xmlrpc_server/mw_getcategories) wp-includes/class-wp-xmlrpc-server.php | Retrieve the list of categories on a given blog. |
| [wp\_xmlrpc\_server::mw\_newMediaObject()](../classes/wp_xmlrpc_server/mw_newmediaobject) wp-includes/class-wp-xmlrpc-server.php | Uploads a file, following your settings. |
| [wp\_xmlrpc\_server::mt\_getRecentPostTitles()](../classes/wp_xmlrpc_server/mt_getrecentposttitles) wp-includes/class-wp-xmlrpc-server.php | Retrieve the post titles of recent posts. |
| [wp\_xmlrpc\_server::mt\_getCategoryList()](../classes/wp_xmlrpc_server/mt_getcategorylist) wp-includes/class-wp-xmlrpc-server.php | Retrieve list of all categories on blog. |
| [wp\_xmlrpc\_server::blogger\_getUserInfo()](../classes/wp_xmlrpc_server/blogger_getuserinfo) wp-includes/class-wp-xmlrpc-server.php | Retrieve user’s data. |
| [wp\_xmlrpc\_server::blogger\_getPost()](../classes/wp_xmlrpc_server/blogger_getpost) wp-includes/class-wp-xmlrpc-server.php | Retrieve post. |
| [wp\_xmlrpc\_server::blogger\_getRecentPosts()](../classes/wp_xmlrpc_server/blogger_getrecentposts) wp-includes/class-wp-xmlrpc-server.php | Retrieve list of recent posts. |
| [wp\_xmlrpc\_server::blogger\_newPost()](../classes/wp_xmlrpc_server/blogger_newpost) wp-includes/class-wp-xmlrpc-server.php | Creates new post. |
| [wp\_xmlrpc\_server::blogger\_editPost()](../classes/wp_xmlrpc_server/blogger_editpost) wp-includes/class-wp-xmlrpc-server.php | Edit a post. |
| [wp\_xmlrpc\_server::blogger\_deletePost()](../classes/wp_xmlrpc_server/blogger_deletepost) wp-includes/class-wp-xmlrpc-server.php | Remove a post. |
| [wp\_xmlrpc\_server::mw\_newPost()](../classes/wp_xmlrpc_server/mw_newpost) wp-includes/class-wp-xmlrpc-server.php | Create a new post. |
| [wp\_xmlrpc\_server::wp\_getMediaItem()](../classes/wp_xmlrpc_server/wp_getmediaitem) wp-includes/class-wp-xmlrpc-server.php | Retrieve a media item by ID |
| [wp\_xmlrpc\_server::wp\_getPostFormats()](../classes/wp_xmlrpc_server/wp_getpostformats) wp-includes/class-wp-xmlrpc-server.php | Retrieves a list of post formats used by the site. |
| [wp\_xmlrpc\_server::wp\_getPostType()](../classes/wp_xmlrpc_server/wp_getposttype) wp-includes/class-wp-xmlrpc-server.php | Retrieves a post type |
| [wp\_xmlrpc\_server::wp\_getMediaLibrary()](../classes/wp_xmlrpc_server/wp_getmedialibrary) wp-includes/class-wp-xmlrpc-server.php | Retrieves a collection of media library items (or attachments) |
| [wp\_xmlrpc\_server::wp\_getPostTypes()](../classes/wp_xmlrpc_server/wp_getposttypes) wp-includes/class-wp-xmlrpc-server.php | Retrieves a post types |
| [wp\_xmlrpc\_server::wp\_getRevisions()](../classes/wp_xmlrpc_server/wp_getrevisions) wp-includes/class-wp-xmlrpc-server.php | Retrieve revisions for a specific post. |
| [wp\_xmlrpc\_server::wp\_restoreRevision()](../classes/wp_xmlrpc_server/wp_restorerevision) wp-includes/class-wp-xmlrpc-server.php | Restore a post revision |
| [wp\_xmlrpc\_server::blogger\_getUsersBlogs()](../classes/wp_xmlrpc_server/blogger_getusersblogs) wp-includes/class-wp-xmlrpc-server.php | Retrieve blogs that user owns. |
| [wp\_xmlrpc\_server::wp\_getComments()](../classes/wp_xmlrpc_server/wp_getcomments) wp-includes/class-wp-xmlrpc-server.php | Retrieve comments. |
| [wp\_xmlrpc\_server::wp\_deleteComment()](../classes/wp_xmlrpc_server/wp_deletecomment) wp-includes/class-wp-xmlrpc-server.php | Delete a comment. |
| [wp\_xmlrpc\_server::wp\_editComment()](../classes/wp_xmlrpc_server/wp_editcomment) wp-includes/class-wp-xmlrpc-server.php | Edit comment. |
| [wp\_xmlrpc\_server::wp\_newComment()](../classes/wp_xmlrpc_server/wp_newcomment) wp-includes/class-wp-xmlrpc-server.php | Create new comment. |
| [wp\_xmlrpc\_server::wp\_getCommentStatusList()](../classes/wp_xmlrpc_server/wp_getcommentstatuslist) wp-includes/class-wp-xmlrpc-server.php | Retrieve all of the comment status. |
| [wp\_xmlrpc\_server::wp\_getCommentCount()](../classes/wp_xmlrpc_server/wp_getcommentcount) wp-includes/class-wp-xmlrpc-server.php | Retrieve comment count. |
| [wp\_xmlrpc\_server::wp\_getPostStatusList()](../classes/wp_xmlrpc_server/wp_getpoststatuslist) wp-includes/class-wp-xmlrpc-server.php | Retrieve post statuses. |
| [wp\_xmlrpc\_server::wp\_getPageStatusList()](../classes/wp_xmlrpc_server/wp_getpagestatuslist) wp-includes/class-wp-xmlrpc-server.php | Retrieve page statuses. |
| [wp\_xmlrpc\_server::wp\_getPages()](../classes/wp_xmlrpc_server/wp_getpages) wp-includes/class-wp-xmlrpc-server.php | Retrieve Pages. |
| [wp\_xmlrpc\_server::wp\_newPage()](../classes/wp_xmlrpc_server/wp_newpage) wp-includes/class-wp-xmlrpc-server.php | Create new page. |
| [wp\_xmlrpc\_server::wp\_deletePage()](../classes/wp_xmlrpc_server/wp_deletepage) wp-includes/class-wp-xmlrpc-server.php | Delete page. |
| [wp\_xmlrpc\_server::wp\_editPage()](../classes/wp_xmlrpc_server/wp_editpage) wp-includes/class-wp-xmlrpc-server.php | Edit page. |
| [wp\_xmlrpc\_server::wp\_getPageList()](../classes/wp_xmlrpc_server/wp_getpagelist) wp-includes/class-wp-xmlrpc-server.php | Retrieve page list. |
| [wp\_xmlrpc\_server::wp\_getAuthors()](../classes/wp_xmlrpc_server/wp_getauthors) wp-includes/class-wp-xmlrpc-server.php | Retrieve authors list. |
| [wp\_xmlrpc\_server::wp\_getTags()](../classes/wp_xmlrpc_server/wp_gettags) wp-includes/class-wp-xmlrpc-server.php | Get list of all tags |
| [wp\_xmlrpc\_server::wp\_newCategory()](../classes/wp_xmlrpc_server/wp_newcategory) wp-includes/class-wp-xmlrpc-server.php | Create new category. |
| [wp\_xmlrpc\_server::wp\_deleteCategory()](../classes/wp_xmlrpc_server/wp_deletecategory) wp-includes/class-wp-xmlrpc-server.php | Remove category. |
| [wp\_xmlrpc\_server::wp\_suggestCategories()](../classes/wp_xmlrpc_server/wp_suggestcategories) wp-includes/class-wp-xmlrpc-server.php | Retrieve category list. |
| [wp\_xmlrpc\_server::wp\_getComment()](../classes/wp_xmlrpc_server/wp_getcomment) wp-includes/class-wp-xmlrpc-server.php | Retrieve comment. |
| [wp\_xmlrpc\_server::wp\_getPosts()](../classes/wp_xmlrpc_server/wp_getposts) wp-includes/class-wp-xmlrpc-server.php | Retrieve posts. |
| [wp\_xmlrpc\_server::wp\_newTerm()](../classes/wp_xmlrpc_server/wp_newterm) wp-includes/class-wp-xmlrpc-server.php | Create a new term. |
| [wp\_xmlrpc\_server::wp\_editTerm()](../classes/wp_xmlrpc_server/wp_editterm) wp-includes/class-wp-xmlrpc-server.php | Edit a term. |
| [wp\_xmlrpc\_server::wp\_deleteTerm()](../classes/wp_xmlrpc_server/wp_deleteterm) wp-includes/class-wp-xmlrpc-server.php | Delete a term. |
| [wp\_xmlrpc\_server::wp\_getTerm()](../classes/wp_xmlrpc_server/wp_getterm) wp-includes/class-wp-xmlrpc-server.php | Retrieve a term. |
| [wp\_xmlrpc\_server::wp\_getTerms()](../classes/wp_xmlrpc_server/wp_getterms) wp-includes/class-wp-xmlrpc-server.php | Retrieve all terms for a taxonomy. |
| [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. |
| [wp\_xmlrpc\_server::wp\_getUser()](../classes/wp_xmlrpc_server/wp_getuser) wp-includes/class-wp-xmlrpc-server.php | Retrieve a user. |
| [wp\_xmlrpc\_server::wp\_getUsers()](../classes/wp_xmlrpc_server/wp_getusers) wp-includes/class-wp-xmlrpc-server.php | Retrieve users. |
| [wp\_xmlrpc\_server::wp\_getProfile()](../classes/wp_xmlrpc_server/wp_getprofile) wp-includes/class-wp-xmlrpc-server.php | Retrieve information about the requesting user. |
| [wp\_xmlrpc\_server::wp\_editProfile()](../classes/wp_xmlrpc_server/wp_editprofile) wp-includes/class-wp-xmlrpc-server.php | Edit user’s profile. |
| [wp\_xmlrpc\_server::wp\_getPage()](../classes/wp_xmlrpc_server/wp_getpage) wp-includes/class-wp-xmlrpc-server.php | Retrieve page. |
| [wp\_xmlrpc\_server::wp\_newPost()](../classes/wp_xmlrpc_server/wp_newpost) wp-includes/class-wp-xmlrpc-server.php | Create a new post for any registered post type. |
| [wp\_xmlrpc\_server::wp\_editPost()](../classes/wp_xmlrpc_server/wp_editpost) wp-includes/class-wp-xmlrpc-server.php | Edit a post for any registered post type. |
| [wp\_xmlrpc\_server::wp\_deletePost()](../classes/wp_xmlrpc_server/wp_deletepost) wp-includes/class-wp-xmlrpc-server.php | Delete a post for any registered post type. |
| [wp\_xmlrpc\_server::wp\_getPost()](../classes/wp_xmlrpc_server/wp_getpost) wp-includes/class-wp-xmlrpc-server.php | Retrieve a post. |
| [wp\_xmlrpc\_server::wp\_getUsersBlogs()](../classes/wp_xmlrpc_server/wp_getusersblogs) wp-includes/class-wp-xmlrpc-server.php | Retrieve the blogs of the user. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Added the `$args` and `$server` parameters. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress apply_filters( 'theme_row_meta', string[] $theme_meta, string $stylesheet, WP_Theme $theme, string $status ) apply\_filters( 'theme\_row\_meta', string[] $theme\_meta, string $stylesheet, WP\_Theme $theme, string $status )
=================================================================================================================
Filters the array of row meta for each theme in the Multisite themes list table.
`$theme_meta` string[] An array of the theme's metadata, including the version, author, and theme URI. `$stylesheet` string Directory name of the theme. `$theme` [WP\_Theme](../classes/wp_theme) [WP\_Theme](../classes/wp_theme) object. `$status` string Status of the theme. 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/)
```
$theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Themes\_List\_Table::column\_description()](../classes/wp_ms_themes_list_table/column_description) wp-admin/includes/class-wp-ms-themes-list-table.php | Handles the description column output. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'manage_users_custom_column', string $output, string $column_name, int $user_id ) apply\_filters( 'manage\_users\_custom\_column', string $output, string $column\_name, int $user\_id )
======================================================================================================
Filters the display output of custom columns in the Users list table.
`$output` string Custom column output. Default empty. `$column_name` string Column name. `$user_id` int ID of 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/)
```
$row .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Users\_List\_Table::column\_default()](../classes/wp_ms_users_list_table/column_default) wp-admin/includes/class-wp-ms-users-list-table.php | Handles the default column output. |
| [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( 'post_submitbox_minor_actions', WP_Post $post ) do\_action( 'post\_submitbox\_minor\_actions', WP\_Post $post )
===============================================================
Fires after the Save Draft (or Save as Pending) and Preview (or Preview Changes) buttons 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_minor_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/) | Introduced. |
wordpress do_action( "customize_render_control_{$this->id}", WP_Customize_Control $control ) do\_action( "customize\_render\_control\_{$this->id}", WP\_Customize\_Control $control )
========================================================================================
Fires just before a specific Customizer control is rendered.
The dynamic portion of the hook name, `$this->id`, refers to the control ID.
`$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->id}", $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 apply_filters( "site_option_{$option}", mixed $value, string $option, int $network_id ) apply\_filters( "site\_option\_{$option}", mixed $value, string $option, int $network\_id )
===========================================================================================
Filters the value of an existing network option.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$value` mixed Value of network option. `$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/)
```
return apply_filters( "site_option_{$option}", $value, $option, $network_id );
```
| Used By | Description |
| --- | --- |
| [get\_network\_option()](../functions/get_network_option) wp-includes/option.php | Retrieves a network’s option value based on the option 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/) | |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'tiny_mce_plugins', array $plugins, string $editor_id ) apply\_filters( 'tiny\_mce\_plugins', array $plugins, string $editor\_id )
==========================================================================
Filters the list of default TinyMCE plugins.
The filter specifies which of the default plugins included in WordPress should be added to the TinyMCE instance.
`$plugins` array An array of default TinyMCE plugins. `$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/)
```
$plugins = array_unique( apply_filters( 'tiny_mce_plugins', $plugins, $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. |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'fallback_intermediate_image_sizes', string[] $fallback_sizes, array $metadata ) apply\_filters( 'fallback\_intermediate\_image\_sizes', string[] $fallback\_sizes, array $metadata )
====================================================================================================
Filters the image sizes generated for non-image mime types.
`$fallback_sizes` string[] An array of image size names. `$metadata` array Current attachment metadata. File: `wp-admin/includes/image.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image.php/)
```
$fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata );
```
| Used By | Description |
| --- | --- |
| [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 |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'admin_print_styles' ) do\_action( 'admin\_print\_styles' )
====================================
Fires when styles are printed for all admin pages.
`admin_print_styles` should not be used to enqueue styles or scripts on the admin pages. Use `[admin\_enqueue\_scripts](admin_enqueue_scripts "Plugin API/Action Reference/admin enqueue scripts")` instead.
File: `wp-admin/admin-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-header.php/)
```
do_action( 'admin_print_styles' );
```
| 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. |
| [WP\_Customize\_Widgets::print\_styles()](../classes/wp_customize_widgets/print_styles) wp-includes/class-wp-customize-widgets.php | Calls admin\_print\_styles-widgets.php and admin\_print\_styles hooks to allow custom styles from plugins. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'the_content_feed', string $content, string $feed_type ) apply\_filters( 'the\_content\_feed', string $content, string $feed\_type )
===========================================================================
Filters the post content for use in feeds.
`$content` string The current post content. `$feed_type` string Type of feed. Possible values include `'rss2'`, `'atom'`.
Default `'rss2'`. * The “`the_content_feed`” filter is used to filter the content of the post after it is retrieved from the database and filtered by “<the_content>” hook and before it is sent to RSS reader (or browser).
* The filter callback function must return the content after it is finished processing, or feed readers will see a blank item and other plugins also filtering the feed content may generate errors.
File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
return apply_filters( 'the_content_feed', $content, $feed_type );
```
| Used By | Description |
| --- | --- |
| [get\_the\_content\_feed()](../functions/get_the_content_feed) wp-includes/feed.php | Retrieves the post content for feeds. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'post_type_archive_feed_link', string $link, string $feed ) apply\_filters( 'post\_type\_archive\_feed\_link', string $link, string $feed )
===============================================================================
Filters the post type archive feed link.
`$link` string The post type archive 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/)
```
return apply_filters( 'post_type_archive_feed_link', $link, $feed );
```
| Used By | Description |
| --- | --- |
| [get\_post\_type\_archive\_feed\_link()](../functions/get_post_type_archive_feed_link) wp-includes/link-template.php | Retrieves the permalink for a post type archive feed. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( "comment_{$old_status}_to_{$new_status}", WP_Comment $comment ) do\_action( "comment\_{$old\_status}\_to\_{$new\_status}", WP\_Comment $comment )
=================================================================================
Fires when the comment status is in transition from one specific status to another.
The dynamic portions of the hook name, `$old_status`, and `$new_status`, refer to the old and new comment statuses, respectively.
Possible hook names include:
* `comment_unapproved_to_approved`
* `comment_spam_to_approved`
* `comment_approved_to_unapproved`
* `comment_spam_to_unapproved`
* `comment_unapproved_to_spam`
* `comment_approved_to_spam`
`$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_{$old_status}_to_{$new_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( "update_{$meta_type}_metadata", null|bool $check, int $object_id, string $meta_key, mixed $meta_value, mixed $prev_value ) apply\_filters( "update\_{$meta\_type}\_metadata", null|bool $check, int $object\_id, string $meta\_key, mixed $meta\_value, mixed $prev\_value )
=================================================================================================================================================
Short-circuits 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).
Returning a non-null value will effectively short-circuit the function.
Possible hook names include:
* `update_post_metadata`
* `update_comment_metadata`
* `update_term_metadata`
* `update_user_metadata`
`$check` null|bool Whether to allow updating 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. `$prev_value` mixed Previous value to check before updating.
If specified, only update existing metadata entries with this value. Otherwise, update all entries. * This filter is applied before a metadata gets updated; it allows short-circuiting the updating of metadata of a specific type by returning a non-null value.
* The dynamic portion of the hook, `$meta_type`, refers to the meta object type. For example, if a ‘user’ metadata gets updated, the hook would be ‘`update_user_metadata`‘.
* The filter must return a `null` value (the value of `$check`) if the data is be saved to the database. If it returns anything else, the ‘`update_metadata`‘ function (and therefore the ‘`update_{$meta_type}_metadata`‘ filter) will return what the filter callbacks return.
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", null, $object_id, $meta_key, $meta_value, $prev_value );
```
| Used By | Description |
| --- | --- |
| [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 |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'comment_flood_filter', bool $bool, int $time_lastcomment, int $time_newcomment ) apply\_filters( 'comment\_flood\_filter', bool $bool, int $time\_lastcomment, int $time\_newcomment )
=====================================================================================================
Filters the comment flood status.
`$bool` bool Whether a comment flood is occurring. Default false. `$time_lastcomment` int Timestamp of when the last comment was posted. `$time_newcomment` int Timestamp of when the new comment was posted. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment );
```
| Used By | Description |
| --- | --- |
| [wp\_check\_comment\_flood()](../functions/wp_check_comment_flood) wp-includes/comment.php | Checks whether comment flooding is occurring. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( "get_{$taxonomy}", WP_Term $_term, string $taxonomy ) apply\_filters( "get\_{$taxonomy}", WP\_Term $\_term, string $taxonomy )
========================================================================
Filters a taxonomy term object.
The dynamic portion of the hook name, `$taxonomy`, refers to the slug of the term’s taxonomy.
Possible hook names include:
* `get_category`
* `get_post_tag`
`$_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_{$taxonomy}", $_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( 'edit_term_taxonomies', array $edit_tt_ids ) do\_action( 'edit\_term\_taxonomies', array $edit\_tt\_ids )
============================================================
Fires immediately before 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( 'edit_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( 'customize_render_partials_before', WP_Customize_Selective_Refresh $refresh, array $partials ) do\_action( 'customize\_render\_partials\_before', WP\_Customize\_Selective\_Refresh $refresh, array $partials )
================================================================================================================
Fires immediately before partials are rendered.
Plugins may do things like call [wp\_enqueue\_scripts()](../functions/wp_enqueue_scripts) and gather a list of the scripts and styles which may get enqueued in the response.
`$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_before', $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( 'nav_menu_description', string $description ) apply\_filters( 'nav\_menu\_description', string $description )
===============================================================
Filters a navigation menu item’s description.
`$description` string The menu item description. File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
$menu_item->description = apply_filters( 'nav_menu_description', wp_trim_words( $menu_item->post_content, 200 ) );
```
| 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( 'login_headerurl', string $login_header_url ) apply\_filters( 'login\_headerurl', string $login\_header\_url )
================================================================
Filters link URL of the header logo above login form.
`$login_header_url` string Login header logo URL. The **“login\_headerurl”** filter is used to filter the URL of the logo on the WordPress login page. By default, this logo links to the WordPress site.
A plugin can register as a content filter with the code:
```
add_filter("login_headerurl","plugin_function_name");
```
Where “plugin\_function\_name” is the function WordPress should call when the content is being retrieved. Note that the filter function the plugin defines **must** return the URL after it is finished processing, or the logo may not have any links, and other plugins also filtering the same may generate errors.
You can also use this in the theme function.php file within your WordPress page if you don’t wish to use a plugin or want to distribute your theme.
File: `wp-login.php`. [View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
```
$login_header_url = apply_filters( 'login_headerurl', $login_header_url );
```
| 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 do_action( 'auth_cookie_malformed', string $cookie, string $scheme ) do\_action( 'auth\_cookie\_malformed', string $cookie, string $scheme )
=======================================================================
Fires if an authentication cookie is malformed.
`$cookie` string Malformed auth cookie. `$scheme` string Authentication scheme. Values include `'auth'`, `'secure_auth'`, or `'logged_in'`. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
do_action( 'auth_cookie_malformed', $cookie, $scheme );
```
| 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( "gettext_with_context_{$domain}", string $translation, string $text, string $context, string $domain ) apply\_filters( "gettext\_with\_context\_{$domain}", string $translation, string $text, string $context, string $domain )
=========================================================================================================================
Filters text with its translation based on context information for a domain.
The dynamic portion of the hook name, `$domain`, refers to the text domain.
`$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. File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
$translation = apply_filters( "gettext_with_context_{$domain}", $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 |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters_deprecated( 'image_save_pre', resource|GdImage $image, int $attachment_id ) apply\_filters\_deprecated( 'image\_save\_pre', resource|GdImage $image, int $attachment\_id )
==============================================================================================
This hook has been deprecated. Use [‘image\_editor\_save\_pre’](image_editor_save_pre) instead.
Filters the GD image resource to be streamed to the browser.
`$image` resource|GdImage Image resource to be streamed. `$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_deprecated( 'image_save_pre', array( $image, $attachment_id ), '3.5.0', 'image_editor_save_pre' );
```
| 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/) | Use ['image\_editor\_save\_pre'](image_editor_save_pre) instead. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'activity_box_end' ) do\_action( 'activity\_box\_end' )
==================================
Fires at the end of the ‘At a Glance’ dashboard widget.
Prior to 3.8.0, the widget was named ‘Right Now’.
This action adds content to the end of At a Glance widget on the Dashboard. Useful for adding your own notices / information.
File: `wp-admin/includes/dashboard.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
```
do_action( 'activity_box_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.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress apply_filters( 'search_link', string $link, string $search ) apply\_filters( 'search\_link', string $link, string $search )
==============================================================
Filters the search permalink.
`$link` string Search permalink. `$search` string The URL-encoded search term. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'search_link', $link, $search );
```
| Used By | Description |
| --- | --- |
| [get\_search\_link()](../functions/get_search_link) wp-includes/link-template.php | Retrieves the permalink for a search. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'site_search_columns', string[] $search_columns, string $search, WP_Site_Query $query ) apply\_filters( 'site\_search\_columns', string[] $search\_columns, string $search, WP\_Site\_Query $query )
============================================================================================================
Filters the columns to search in a [WP\_Site\_Query](../classes/wp_site_query) search.
The default columns include ‘domain’ and ‘path.
`$search_columns` string[] Array of column names to be searched. `$search` string Text being searched. `$query` [WP\_Site\_Query](../classes/wp_site_query) The current [WP\_Site\_Query](../classes/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/)
```
$search_columns = apply_filters( 'site_search_columns', $search_columns, $this->query_vars['search'], $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 do_action( 'delete_term', int $term, int $tt_id, string $taxonomy, WP_Term $deleted_term, array $object_ids ) do\_action( 'delete\_term', int $term, int $tt\_id, string $taxonomy, WP\_Term $deleted\_term, array $object\_ids )
===================================================================================================================
Fires after a term is deleted from the database and the cache is cleaned.
The [‘delete\_$taxonomy’](delete_taxonomy) hook is also available for targeting a specific taxonomy.
`$term` int Term ID. `$tt_id` int Term taxonomy ID. `$taxonomy` string Taxonomy slug. `$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_term', $term, $tt_id, $taxonomy, $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.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress do_action( 'add_meta_boxes_comment', WP_Comment $comment ) do\_action( 'add\_meta\_boxes\_comment', WP\_Comment $comment )
===============================================================
Fires when comment-specific meta boxes are added.
`$comment` [WP\_Comment](../classes/wp_comment) Comment object. File: `wp-admin/edit-form-comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-form-comment.php/)
```
do_action( 'add_meta_boxes_comment', $comment );
```
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'single_cat_title', string $term_name ) apply\_filters( 'single\_cat\_title', string $term\_name )
==========================================================
Filters the category archive page title.
`$term_name` string Category 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_cat_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.0.10](https://developer.wordpress.org/reference/since/2.0.10/) | Introduced. |
wordpress apply_filters( 'wp_embed_handler_youtube', string $embed, array $attr, string $url, array $rawattr ) apply\_filters( 'wp\_embed\_handler\_youtube', string $embed, array $attr, string $url, array $rawattr )
========================================================================================================
Filters the YoutTube embed output.
* [wp\_embed\_handler\_youtube()](../functions/wp_embed_handler_youtube)
`$embed` string YouTube embed output. `$attr` array An array of embed attributes. `$url` string The original URL that was matched by the regex. `$rawattr` array The original unmodified attributes. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
return apply_filters( 'wp_embed_handler_youtube', $embed, $attr, $url, $rawattr );
```
| Used By | Description |
| --- | --- |
| [wp\_embed\_handler\_youtube()](../functions/wp_embed_handler_youtube) wp-includes/embed.php | YouTube iframe embed handler callback. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress apply_filters( 'wp_is_application_passwords_available', bool $available ) apply\_filters( 'wp\_is\_application\_passwords\_available', bool $available )
==============================================================================
Filters whether Application Passwords is available.
`$available` bool True if available, false otherwise. 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', wp_is_application_passwords_supported() );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_application\_passwords\_available()](../functions/wp_is_application_passwords_available) wp-includes/user.php | Checks if Application Passwords is globally available. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'pre_term_link', string $termlink, WP_Term $term ) apply\_filters( 'pre\_term\_link', string $termlink, WP\_Term $term )
=====================================================================
Filters the permalink structure for a term before token replacement occurs.
`$termlink` string The permalink structure for the term's taxonomy. `$term` [WP\_Term](../classes/wp_term) The term object. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$termlink = apply_filters( 'pre_term_link', $termlink, $term );
```
| Used By | Description |
| --- | --- |
| [get\_term\_link()](../functions/get_term_link) wp-includes/taxonomy.php | Generates a permalink for a taxonomy term archive. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'allowed_redirect_hosts', string[] $hosts, string $host ) apply\_filters( 'allowed\_redirect\_hosts', string[] $hosts, string $host )
===========================================================================
Filters the list of allowed hosts to redirect to.
`$hosts` string[] An array of allowed host names. `$host` string The host name of the redirect destination; empty string if not set. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
```
| Used By | Description |
| --- | --- |
| [wp\_validate\_redirect()](../functions/wp_validate_redirect) wp-includes/pluggable.php | Validates a URL for use in a redirect. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'wpmu_welcome_user_notification', int $user_id, string $password, array $meta ) apply\_filters( 'wpmu\_welcome\_user\_notification', int $user\_id, string $password, array $meta )
===================================================================================================
Filters whether to bypass the welcome email after user activation.
Returning false disables the welcome 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/)
```
if ( ! apply_filters( 'wpmu_welcome_user_notification', $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( 'format_for_editor', string $text, string $default_editor ) apply\_filters( 'format\_for\_editor', string $text, string $default\_editor )
==============================================================================
Filters the text after it is formatted for the editor.
`$text` string The formatted text. `$default_editor` string The default editor for the current user.
It is usually either `'html'` or `'tinymce'`. File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
return apply_filters( 'format_for_editor', $text, $default_editor );
```
| Used By | Description |
| --- | --- |
| [format\_for\_editor()](../functions/format_for_editor) wp-includes/formatting.php | Formats text for the editor. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress do_action_ref_array( 'http_api_curl', resource $handle, array $parsed_args, string $url ) do\_action\_ref\_array( 'http\_api\_curl', resource $handle, array $parsed\_args, string $url )
===============================================================================================
Fires before the cURL request is executed.
Cookies are not currently handled by the HTTP API. This action allows plugins to handle cookies themselves.
`$handle` resource The cURL handle returned by curl\_init() (passed by reference). `$parsed_args` array The HTTP request arguments. `$url` string The request URL. File: `wp-includes/class-wp-http-curl.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-curl.php/)
```
do_action_ref_array( 'http_api_curl', array( &$handle, $parsed_args, $url ) );
```
| 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. |
| [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 |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_rest_search_handlers', array $search_handlers ) apply\_filters( 'wp\_rest\_search\_handlers', array $search\_handlers )
=======================================================================
Filters the search handlers to use in the REST search controller.
`$search_handlers` array List of search handlers to use in the controller. Each search handler instance must extend the `WP_REST_Search_Handler` class.
Default is only a handler for posts. File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
$search_handlers = apply_filters( 'wp_rest_search_handlers', $search_handlers );
```
| 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.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress apply_filters( 'media_row_actions', string[] $actions, WP_Post $post, bool $detached ) apply\_filters( 'media\_row\_actions', string[] $actions, WP\_Post $post, bool $detached )
==========================================================================================
Filters the action links for each attachment in the Media list table.
`$actions` string[] An array of action links for each attachment.
Default `'Edit'`, 'Delete Permanently', `'View'`. `$post` [WP\_Post](../classes/wp_post) [WP\_Post](../classes/wp_post) object for the current attachment. `$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( 'media_row_actions', $actions, $post, $this->detached );
```
| Used By | Description |
| --- | --- |
| [WP\_Media\_List\_Table::\_get\_row\_actions()](../classes/wp_media_list_table/_get_row_actions) wp-admin/includes/class-wp-media-list-table.php | |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'themes_api_args', object $args, string $action ) apply\_filters( 'themes\_api\_args', object $args, string $action )
===================================================================
Filters arguments used to query for installer pages from the WordPress.org Themes API.
Important: An object MUST be returned to this filter.
`$args` object Arguments used to query for installer pages from the WordPress.org Themes API. `$action` string Requested action. Likely values are `'theme_information'`, `'feature_list'`, or `'query_themes'`. File: `wp-admin/includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
```
$args = apply_filters( 'themes_api_args', $args, $action );
```
| 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( 'search_form_format', string $format, array $args ) apply\_filters( 'search\_form\_format', string $format, array $args )
=====================================================================
Filters the HTML format of the search form.
`$format` string The type of markup to use in the search form.
Accepts `'html5'`, `'xhtml'`. `$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.
The filter function **must** return a $format value after it is finished processing or the search form will be empty.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
$format = apply_filters( 'search_form_format', $format, $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/) | Introduced. |
wordpress apply_filters( 'esc_xml', string $safe_text, string $text ) apply\_filters( 'esc\_xml', string $safe\_text, string $text )
==============================================================
Filters a string cleaned and escaped for output in XML.
Text passed to [esc\_xml()](../functions/esc_xml) is stripped of invalid or special characters before output. HTML named character references are converted to their equivalent code points.
`$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( 'esc_xml', $safe_text, $text );
```
| Used By | Description |
| --- | --- |
| [esc\_xml()](../functions/esc_xml) wp-includes/formatting.php | Escaping for XML blocks. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_get_object_terms_args', array $args, int[] $object_ids, string[] $taxonomies ) apply\_filters( 'wp\_get\_object\_terms\_args', array $args, int[] $object\_ids, string[] $taxonomies )
=======================================================================================================
Filters arguments for retrieving object terms.
`$args` array An array of arguments for retrieving terms for the given object(s).
See [wp\_get\_object\_terms()](../functions/wp_get_object_terms) for details. More Arguments from wp\_get\_object\_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.
`$object_ids` int[] Array of object IDs. `$taxonomies` string[] Array of taxonomy names to retrieve terms from. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$args = apply_filters( 'wp_get_object_terms_args', $args, $object_ids, $taxonomies );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_object\_terms()](../functions/wp_get_object_terms) wp-includes/taxonomy.php | Retrieves the terms associated with the given object(s), in the supplied taxonomies. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'wp_img_tag_add_loading_attr', string|bool $value, string $image, string $context ) apply\_filters( 'wp\_img\_tag\_add\_loading\_attr', string|bool $value, string $image, string $context )
========================================================================================================
Filters the `loading` attribute value to add to an image. 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 image. `$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_loading_attr', $value, $image, $context );
```
| Used By | Description |
| --- | --- |
| [wp\_img\_tag\_add\_loading\_attr()](../functions/wp_img_tag_add_loading_attr) wp-includes/media.php | Adds `loading` attribute to an `img` HTML tag. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'the_search_query', mixed $search ) apply\_filters( 'the\_search\_query', mixed $search )
=====================================================
Filters the contents of the search query variable for display.
`$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/)
```
echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );
```
| Used By | Description |
| --- | --- |
| [the\_search\_query()](../functions/the_search_query) wp-includes/general-template.php | Displays the contents of the search query variable. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'xmlrpc_prepare_user', array $_user, WP_User $user, array $fields ) apply\_filters( 'xmlrpc\_prepare\_user', array $\_user, WP\_User $user, array $fields )
=======================================================================================
Filters XML-RPC-prepared data for the given user.
`$_user` array An array of user data. `$user` [WP\_User](../classes/wp_user) User object. `$fields` array An array of user fields. 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_user', $_user, $user, $fields );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::\_prepare\_user()](../classes/wp_xmlrpc_server/_prepare_user) wp-includes/class-wp-xmlrpc-server.php | Prepares user data for return in an XML-RPC object. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'get_the_date', string|int $the_date, string $format, WP_Post $post ) apply\_filters( 'get\_the\_date', string|int $the\_date, string $format, WP\_Post $post )
=========================================================================================
Filters the date a post was published.
`$the_date` string|int Formatted date string or Unix timestamp if `$format` is `'U'` or `'G'`. `$format` string PHP date format. `$post` [WP\_Post](../classes/wp_post) The 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_date', $the_date, $format, $post );
```
| Used By | Description |
| --- | --- |
| [get\_the\_date()](../functions/get_the_date) wp-includes/general-template.php | Retrieves the date on which the post was written. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'retrieve_password_notification_email', array $defaults ) apply\_filters( 'retrieve\_password\_notification\_email', array $defaults )
============================================================================
Filters the contents of the reset password notification email sent to the user.
`$defaults` array The default notification email arguments. Used to build [wp\_mail()](../functions/wp_mail) .
* `to`stringThe intended recipient - user email address.
* `subject`stringThe subject of the email.
* `message`stringThe body of the email.
* `headers`stringThe headers of the email.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
$notification_email = apply_filters( 'retrieve_password_notification_email', $defaults, $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 |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress apply_filters( 'plugin_auto_update_setting_html', string $html, string $plugin_file, array $plugin_data ) apply\_filters( 'plugin\_auto\_update\_setting\_html', string $html, string $plugin\_file, array $plugin\_data )
================================================================================================================
Filters the HTML of the auto-updates setting for each plugin in the Plugins list table.
`$html` string The HTML of the plugin's auto-update column content, including toggle auto-update action links and time to next update. `$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. 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/)
```
echo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data );
```
| 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/) | Introduced. |
wordpress apply_filters( 'wpmu_signup_user_notification_subject', string $subject, string $user_login, string $user_email, string $key, array $meta ) apply\_filters( 'wpmu\_signup\_user\_notification\_subject', string $subject, string $user\_login, string $user\_email, string $key, array $meta )
==================================================================================================================================================
Filters the subject of the notification email of new user signup.
`$subject` string Subject 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_subject',
/* translators: New user notification email subject. 1: Network title, 2: New user login. */
_x( '[%1$s] Activate %2$s', 'New user notification email subject' ),
$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( 'url_to_postid', string $url ) apply\_filters( 'url\_to\_postid', string $url )
================================================
Filters the URL to derive the post ID from.
`$url` string The URL to derive the post ID from. File: `wp-includes/rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rewrite.php/)
```
$url = apply_filters( 'url_to_postid', $url );
```
| Used By | Description |
| --- | --- |
| [url\_to\_postid()](../functions/url_to_postid) wp-includes/rewrite.php | Examines a URL and try to determine the post ID it represents. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action( 'untrash_post', int $post_id, string $previous_status ) do\_action( 'untrash\_post', int $post\_id, string $previous\_status )
======================================================================
Fires before a post is restored from the Trash.
`$post_id` int Post ID. `$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/)
```
do_action( 'untrash_post', $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/) | The `$previous_status` parameter was added. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress do_action( 'wp_trash_post', int $post_id ) do\_action( 'wp\_trash\_post', int $post\_id )
==============================================
Fires before 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( 'wp_trash_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 |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress apply_filters( 'get_main_network_id', int $main_network_id ) apply\_filters( 'get\_main\_network\_id', int $main\_network\_id )
==================================================================
Filters the main network ID.
`$main_network_id` int The ID of the main network. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return (int) apply_filters( 'get_main_network_id', $main_network_id );
```
| Used By | Description |
| --- | --- |
| [get\_main\_network\_id()](../functions/get_main_network_id) wp-includes/functions.php | Gets the main network ID. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress apply_filters( 'themes_auto_update_enabled', bool $enabled ) apply\_filters( 'themes\_auto\_update\_enabled', bool $enabled )
================================================================
Filters whether themes auto-update is enabled.
`$enabled` bool True if themes 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( 'themes_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( 'xmlrpc_pingback_error', IXR_Error $error ) apply\_filters( 'xmlrpc\_pingback\_error', IXR\_Error $error )
==============================================================
Filters the XML-RPC pingback error return.
`$error` [IXR\_Error](../classes/ixr_error) An [IXR\_Error](../classes/ixr_error) object containing the error code and message. 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_pingback_error', new IXR_Error( $code, $message ) );
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::pingback\_error()](../classes/wp_xmlrpc_server/pingback_error) wp-includes/class-wp-xmlrpc-server.php | Sends a pingback error based on the given error code and message. |
| Version | Description |
| --- | --- |
| [3.5.1](https://developer.wordpress.org/reference/since/3.5.1/) | Introduced. |
wordpress apply_filters( 'wpmu_validate_blog_signup', array $result ) apply\_filters( 'wpmu\_validate\_blog\_signup', array $result )
===============================================================
Filters site details and error messages following registration.
`$result` array Array of domain, path, blog name, blog title, user and error messages.
* `domain`stringDomain for the site.
* `path`stringPath for the site. Used in subdirectory installations.
* `blogname`stringThe unique site name (slug).
* `blog_title`stringBlog title.
* `user`string|[WP\_User](../classes/wp_user)By default, an empty string. A user object if provided.
* `errors`[WP\_Error](../classes/wp_error)
[WP\_Error](../classes/wp_error) 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_blog_signup', $result );
```
| 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( 'customize_load_themes', array|stdClass $themes, array $args, WP_Customize_Manager $manager ) apply\_filters( 'customize\_load\_themes', array|stdClass $themes, array $args, WP\_Customize\_Manager $manager )
=================================================================================================================
Filters the theme data loaded in the customizer.
This allows theme data to be loading from an external source, or modification of data loaded from `wp_prepare_themes_for_js()` or WordPress.org via `themes_api()`.
* [wp\_prepare\_themes\_for\_js()](../functions/wp_prepare_themes_for_js)
* [themes\_api()](../functions/themes_api)
* [WP\_Customize\_Manager::\_\_construct()](../classes/wp_customize_manager/__construct)
`$themes` array|stdClass Nested array or object of theme data. `$args` array List of arguments, such as page, search term, and tags to query for. `$manager` [WP\_Customize\_Manager](../classes/wp_customize_manager) Instance of Customize manager. File: `wp-includes/class-wp-customize-manager.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
```
$themes = apply_filters( 'customize_load_themes', $themes, $args, $this );
```
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::handle\_load\_themes\_request()](../classes/wp_customize_manager/handle_load_themes_request) wp-includes/class-wp-customize-manager.php | Loads themes into the theme browsing/installation UI. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress do_action( 'clean_attachment_cache', int $id ) do\_action( 'clean\_attachment\_cache', int $id )
=================================================
Fires after the given attachment’s cache is cleaned.
`$id` int Attachment ID. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
do_action( 'clean_attachment_cache', $id );
```
| Used By | Description |
| --- | --- |
| [clean\_attachment\_cache()](../functions/clean_attachment_cache) wp-includes/post.php | Will clean the attachment in the cache. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'post_embed_url', string $embed_url, WP_Post $post ) apply\_filters( 'post\_embed\_url', string $embed\_url, WP\_Post $post )
========================================================================
Filters the URL to embed a specific post.
`$embed_url` string The post embed URL. `$post` [WP\_Post](../classes/wp_post) The corresponding post object. File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
return sanitize_url( apply_filters( 'post_embed_url', $embed_url, $post ) );
```
| Used By | Description |
| --- | --- |
| [get\_post\_embed\_url()](../functions/get_post_embed_url) wp-includes/embed.php | Retrieves the URL to embed a specific post in an iframe. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress do_action( "after_theme_row_{$stylesheet}", string $stylesheet, WP_Theme $theme, string $status ) do\_action( "after\_theme\_row\_{$stylesheet}", string $stylesheet, WP\_Theme $theme, string $status )
======================================================================================================
Fires after each specific row in the Multisite themes list table.
The dynamic portion of the hook name, `$stylesheet`, refers to the directory name of the theme, most often synonymous with the template name of the theme.
`$stylesheet` string Directory name of the theme. `$theme` [WP\_Theme](../classes/wp_theme) Current [WP\_Theme](../classes/wp_theme) object. `$status` string Status of the theme. 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( "after_theme_row_{$stylesheet}", $stylesheet, $theme, $status );
```
| Used By | Description |
| --- | --- |
| [WP\_MS\_Themes\_List\_Table::single\_row()](../classes/wp_ms_themes_list_table/single_row) wp-admin/includes/class-wp-ms-themes-list-table.php | |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'page_menu_link_attributes', array $atts, WP_Post $page, int $depth, array $args, int $current_page_id ) apply\_filters( 'page\_menu\_link\_attributes', array $atts, WP\_Post $page, int $depth, array $args, int $current\_page\_id )
==============================================================================================================================
Filters the HTML attributes applied to a page menu item’s anchor element.
`$atts` array The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
* `href`stringThe href attribute.
* `aria-current`stringThe aria-current attribute.
`$page` [WP\_Post](../classes/wp_post) Page data object. `$depth` int Depth of page, used for padding. `$args` array An array of arguments. `$current_page_id` int ID of the current page. File: `wp-includes/class-walker-page.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-page.php/)
```
$atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page_id );
```
| Used By | Description |
| --- | --- |
| [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. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress do_action( 'comment_flood_trigger', int $time_lastcomment, int $time_newcomment ) do\_action( 'comment\_flood\_trigger', int $time\_lastcomment, int $time\_newcomment )
======================================================================================
Fires before the comment flood message is triggered.
`$time_lastcomment` int Timestamp of when the last comment was posted. `$time_newcomment` int Timestamp of when the new comment was posted. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment );
```
| Used By | Description |
| --- | --- |
| [wp\_check\_comment\_flood()](../functions/wp_check_comment_flood) wp-includes/comment.php | Checks whether comment flooding is occurring. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress do_action( 'wpmu_delete_user', int $id, WP_User $user ) do\_action( 'wpmu\_delete\_user', int $id, WP\_User $user )
===========================================================
Fires before a user is deleted from the network.
`$id` int ID of the user about to be deleted from the network. `$user` [WP\_User](../classes/wp_user) [WP\_User](../classes/wp_user) object of the user about to be deleted from the network. File: `wp-admin/includes/ms.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ms.php/)
```
do_action( 'wpmu_delete_user', $id, $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. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | MU (3.0.0) |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_link', string $link_html, int|WP_Post $post, string|int[] $size, bool $permalink, bool $icon, string|false $text, array|string $attr ) apply\_filters( 'wp\_get\_attachment\_link', string $link\_html, int|WP\_Post $post, string|int[] $size, bool $permalink, bool $icon, string|false $text, array|string $attr )
==============================================================================================================================================================================
Filters a retrieved attachment page link.
`$link_html` string The page link HTML output. `$post` int|[WP\_Post](../classes/wp_post) Post ID or object. Can be 0 for the current global 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). `$permalink` bool Whether to add permalink to image. Default false. `$icon` bool Whether to include an icon. `$text` string|false If string, will be link text. `$attr` array|string Array or string of attributes. File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
return apply_filters( 'wp_get_attachment_link', $link_html, $post, $size, $permalink, $icon, $text, $attr );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_link()](../functions/wp_get_attachment_link) wp-includes/post-template.php | Retrieves an attachment page link using an image or icon, if possible. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Added the `$attr` parameter. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'http_origin', string $origin ) apply\_filters( 'http\_origin', string $origin )
================================================
Change the origin of an HTTP request.
`$origin` string The original origin for the request. File: `wp-includes/http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/http.php/)
```
return apply_filters( 'http_origin', $origin );
```
| Used By | Description |
| --- | --- |
| [get\_http\_origin()](../functions/get_http_origin) wp-includes/http.php | Get the HTTP Origin of the current request. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'plugin_locale', string $locale, string $domain ) apply\_filters( 'plugin\_locale', string $locale, string $domain )
==================================================================
Filters a plugin’s locale.
`$locale` string The plugin's current locale. `$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/)
```
$locale = apply_filters( 'plugin_locale', determine_locale(), $domain );
```
| Used By | Description |
| --- | --- |
| [load\_plugin\_textdomain()](../functions/load_plugin_textdomain) wp-includes/l10n.php | Loads a plugin’s translated strings. |
| [load\_muplugin\_textdomain()](../functions/load_muplugin_textdomain) wp-includes/l10n.php | Loads the translated strings for a plugin residing in the mu-plugins directory. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'wp_ajax_cropped_attachment_id', int $attachment_id, string $context ) apply\_filters( 'wp\_ajax\_cropped\_attachment\_id', int $attachment\_id, string $context )
===========================================================================================
Filters the attachment ID for a cropped image.
`$attachment_id` int The attachment ID of the cropped image. `$context` string The Customizer control requesting the cropped image. File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
$attachment_id = apply_filters( 'wp_ajax_cropped_attachment_id', $attachment_id, $context );
```
| 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( 'auto_plugin_update_send_email', bool $enabled, array $update_results ) apply\_filters( 'auto\_plugin\_update\_send\_email', bool $enabled, array $update\_results )
============================================================================================
Filters whether to send an email following an automatic background plugin update.
`$enabled` bool True if plugin update notifications are enabled, false otherwise. `$update_results` array The results of plugins 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_plugin_update_send_email', true, $update_results['plugin'] );
```
| 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( 'wp_admin_bar_class', string $wp_admin_bar_class ) apply\_filters( 'wp\_admin\_bar\_class', string $wp\_admin\_bar\_class )
========================================================================
Filters the admin bar class to instantiate.
`$wp_admin_bar_class` string Admin bar class to use. Default '[WP\_Admin\_Bar](../classes/wp_admin_bar)'. File: `wp-includes/admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
```
$admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
```
| Used By | Description |
| --- | --- |
| [\_wp\_admin\_bar\_init()](../functions/_wp_admin_bar_init) wp-includes/admin-bar.php | Instantiates the admin bar object and set it up as a global for access elsewhere. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'pre_comment_author_email', string $author_email_cookie ) apply\_filters( 'pre\_comment\_author\_email', string $author\_email\_cookie )
==============================================================================
Filters the comment author’s email cookie before it is set.
When this filter hook is evaluated in [wp\_filter\_comment()](../functions/wp_filter_comment) , the comment author’s email string is passed.
`$author_email_cookie` string The comment author email cookie. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$comment_author_email = apply_filters( 'pre_comment_author_email', $_COOKIE[ 'comment_author_email_' . 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 apply_filters( 'wp_link_query', array $results, array $query ) apply\_filters( 'wp\_link\_query', array $results, array $query )
=================================================================
Filters the link query results.
Allows modification of the returned link query results.
* [‘wp\_link\_query\_args’](wp_link_query_args): filter
`$results` array An array of associative arrays of query results.
* `...$0`array
+ `ID`intPost ID.
+ `title`stringThe trimmed, escaped post title.
+ `permalink`stringPost permalink.
+ `info`stringA `'Y/m/d'`-formatted date for `'post'` post type, the `'singular_name'` post type label otherwise. `$query` array An array of [WP\_Query](../classes/wp_query) arguments. File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$results = apply_filters( 'wp_link_query', $results, $query );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::wp\_link\_query()](../classes/_wp_editors/wp_link_query) wp-includes/class-wp-editor.php | Performs post queries for internal linking. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'list_terms_exclusions', string $exclusions, array $args, string[] $taxonomies ) apply\_filters( 'list\_terms\_exclusions', string $exclusions, array $args, string[] $taxonomies )
==================================================================================================
Filters the terms to exclude from the terms query.
`$exclusions` string `NOT IN` clause of the terms query. `$args` array An array of terms 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/)
```
$exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $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.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters_ref_array( 'the_preview', WP_Post $post_preview, WP_Query $query ) apply\_filters\_ref\_array( 'the\_preview', WP\_Post $post\_preview, WP\_Query $query )
=======================================================================================
Filters the single post for preview mode.
`$post_preview` [WP\_Post](../classes/wp_post) The Post object. `$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[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$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.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'recovery_mode_email_link_ttl', int $valid_for ) apply\_filters( 'recovery\_mode\_email\_link\_ttl', int $valid\_for )
=====================================================================
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.
`$valid_for` int The number of seconds the link is valid for. File: `wp-includes/class-wp-recovery-mode.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-recovery-mode.php/)
```
$valid_for = apply_filters( 'recovery_mode_email_link_ttl', $valid_for );
```
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::get\_link\_ttl()](../classes/wp_recovery_mode/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 apply_filters( 'block_type_metadata', array $metadata ) apply\_filters( 'block\_type\_metadata', array $metadata )
==========================================================
Filters the metadata provided for registering a block type.
`$metadata` array Metadata for registering a block type. File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
$metadata = apply_filters( 'block_type_metadata', $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 do_action( 'edit_user_profile_update', int $user_id ) do\_action( 'edit\_user\_profile\_update', int $user\_id )
==========================================================
Fires before the page loads on the ‘Edit User’ screen.
`$user_id` int The user ID. This action hook is generally used to save custom fields that have been added to the WordPress profile page.
This hook only triggers when a user is viewing another user’s profile page (not their own). If you want to apply your hook to ALL profile pages (including the current user), you need to use the <personal_options_update> hook.
Note on the the html <input> element name attribute for the “custom meta field”:
Consider the example:
`update_user_meta($user_id, 'custom_meta_key', $_POST['custom_meta_key']);`
Make sure that you give a different key name for the $\_POST data key and the actual user meta key. If you use the same key for both, WordPress for some reason empties the value posted under that key and you’ll always get an empty value in $\_POST[‘custom\_meta\_key’]. To prevent this, you may change the text in the html input element name attribute and append a suffix. After changing, you $\_POST data for the custom meta field will be accessible in $\_POST[‘custom\_meta\_key\_data’] and shall pass the data properly.
File: `wp-admin/user-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/user-edit.php/)
```
do_action( 'edit_user_profile_update', $user_id );
```
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress apply_filters( 'wp_title_rss', string $wp_title_rss, string $deprecated ) apply\_filters( 'wp\_title\_rss', string $wp\_title\_rss, string $deprecated )
==============================================================================
Filters the blog title for display of the feed title.
* [get\_wp\_title\_rss()](../functions/get_wp_title_rss)
`$wp_title_rss` 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/)
```
echo apply_filters( 'wp_title_rss', get_wp_title_rss(), $deprecated );
```
| Used By | Description |
| --- | --- |
| [wp\_title\_rss()](../functions/wp_title_rss) wp-includes/feed.php | Displays the blog title for display of 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. |
| programming_docs |
wordpress apply_filters( 'image_editor_default_mime_type', string $mime_type ) apply\_filters( 'image\_editor\_default\_mime\_type', string $mime\_type )
==========================================================================
Filters default mime type prior to getting the file extension.
* [wp\_get\_mime\_types()](../functions/wp_get_mime_types)
`$mime_type` string Mime type string. File: `wp-includes/class-wp-image-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor.php/)
```
$mime_type = apply_filters( 'image_editor_default_mime_type', $this->default_mime_type );
```
| Used By | Description |
| --- | --- |
| [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. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'get_page_of_comment_query_args', array $comment_args ) apply\_filters( 'get\_page\_of\_comment\_query\_args', array $comment\_args )
=============================================================================
Filters the arguments used to query comments in [get\_page\_of\_comment()](../functions/get_page_of_comment) .
* [WP\_Comment\_Query::\_\_construct()](../classes/wp_comment_query/__construct)
`$comment_args` array Array of [WP\_Comment\_Query](../classes/wp_comment_query) arguments.
* `type`stringLimit paginated comments to those matching a given type.
Accepts `'comment'`, `'trackback'`, `'pingback'`, `'pings'` (trackbacks and pingbacks), or `'all'`. Default `'all'`.
* `post_id`intID of the post.
* `fields`stringComment fields to return.
* `count`boolWhether to return a comment count (true) or array of comment objects (false).
* `status`stringComment status.
* `parent`intParent ID of comment to retrieve children of.
* `date_query`arrayDate query clauses to limit comments by. See [WP\_Date\_Query](../classes/wp_date_query).
* `include_unapproved`arrayArray of IDs or email addresses whose unapproved comments will be included in paginated comments.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$comment_args = apply_filters( 'get_page_of_comment_query_args', $comment_args );
```
| Used By | Description |
| --- | --- |
| [get\_page\_of\_comment()](../functions/get_page_of_comment) wp-includes/comment.php | Calculates what page number a comment will appear on for comment paging. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'get_edit_tag_link', string $link ) apply\_filters( 'get\_edit\_tag\_link', string $link )
======================================================
Filters the edit link for a tag (or term in another taxonomy).
`$link` string The term edit 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_edit_tag_link', get_edit_term_link( $tag, $taxonomy ) );
```
| Used By | Description |
| --- | --- |
| [get\_edit\_tag\_link()](../functions/get_edit_tag_link) wp-includes/link-template.php | Retrieves the edit link for a tag. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress do_action( 'register_new_user', int $user_id ) do\_action( 'register\_new\_user', int $user\_id )
==================================================
Fires after a new user registration has been recorded.
`$user_id` int ID of the newly registered user. File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
do_action( 'register_new_user', $user_id );
```
| Used By | Description |
| --- | --- |
| [register\_new\_user()](../functions/register_new_user) wp-includes/user.php | Handles registering a new user. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'new_admin_email_content', string $email_text, array $new_admin_email ) apply\_filters( 'new\_admin\_email\_content', string $email\_text, array $new\_admin\_email )
=============================================================================================
Filters the text of the email sent when a change of site 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 site admin email address.
* `hash`stringThe secure hash used in the confirmation link URL.
* `newemail`stringThe proposed new site admin email address.
File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
$content = apply_filters( 'new_admin_email_content', $email_text, $new_admin_email );
```
| Used By | Description |
| --- | --- |
| [update\_option\_new\_admin\_email()](../functions/update_option_new_admin_email) wp-admin/includes/misc.php | Sends a confirmation request email when a change of site admin 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 do_action( 'cron_reschedule_event_error', WP_Error $result, string $hook, array $v ) do\_action( 'cron\_reschedule\_event\_error', WP\_Error $result, string $hook, array $v )
=========================================================================================
Fires when an error happens rescheduling 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_reschedule_event_error', $result, $hook, $v );
```
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress do_action( 'spam_comment', int $comment_id, WP_Comment $comment ) do\_action( 'spam\_comment', int $comment\_id, WP\_Comment $comment )
=====================================================================
Fires immediately before a comment is marked as Spam.
`$comment_id` int The comment ID. `$comment` [WP\_Comment](../classes/wp_comment) The comment to be marked as spam. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
do_action( 'spam_comment', $comment->comment_ID, $comment );
```
| Used By | Description |
| --- | --- |
| [wp\_spam\_comment()](../functions/wp_spam_comment) wp-includes/comment.php | Marks a comment as 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( "site_transient_{$transient}", mixed $value, string $transient ) apply\_filters( "site\_transient\_{$transient}", mixed $value, string $transient )
==================================================================================
Filters the value of an existing site transient.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$value` mixed 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/)
```
return apply_filters( "site_transient_{$transient}", $value, $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 apply_filters( 'pre_get_network_by_path', null|false|WP_Network $network, string $domain, string $path, int|null $segments, string[] $paths ) apply\_filters( 'pre\_get\_network\_by\_path', null|false|WP\_Network $network, string $domain, string $path, int|null $segments, string[] $paths )
===================================================================================================================================================
Determines a network 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 network can be found at the requested domain and path. Otherwise, return an object from [wp\_get\_network()](../functions/wp_get_network) .
`$network` null|false|[WP\_Network](../classes/wp_network) Network value to return by path. Default null to continue retrieving the network. `$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[] Array of paths to search for, based on `$path` and `$segments`. File: `wp-includes/class-wp-network.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-network.php/)
```
$pre = apply_filters( 'pre_get_network_by_path', null, $domain, $path, $segments, $paths );
```
| Used By | Description |
| --- | --- |
| [WP\_Network::get\_by\_path()](../classes/wp_network/get_by_path) wp-includes/class-wp-network.php | Retrieves the closest matching network for a domain and path. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'wp_nav_menu_items', string $items, stdClass $args ) apply\_filters( 'wp\_nav\_menu\_items', string $items, stdClass $args )
=======================================================================
Filters the HTML list content for navigation menus.
* [wp\_nav\_menu()](../functions/wp_nav_menu)
`$items` string The HTML list content for the menu items. `$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/)
```
$items = apply_filters( 'wp_nav_menu_items', $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.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'rest_comment_trashable', bool $supports_trash, WP_Comment $comment ) apply\_filters( 'rest\_comment\_trashable', bool $supports\_trash, WP\_Comment $comment )
=========================================================================================
Filters whether a comment can be trashed via the REST API.
Return false to disable trash support for the comment.
`$supports_trash` bool Whether the comment supports trashing. `$comment` [WP\_Comment](../classes/wp_comment) The comment object being considered for trashing support. 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/)
```
$supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::delete\_item()](../classes/wp_rest_comments_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Deletes a comment. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress do_action( 'comment_form_before_fields' ) do\_action( 'comment\_form\_before\_fields' )
=============================================
Fires before 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_before_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. |
wordpress apply_filters( 'mce_buttons', array $mce_buttons, string $editor_id ) apply\_filters( 'mce\_buttons', array $mce\_buttons, string $editor\_id )
=========================================================================
Filters the first-row list of TinyMCE buttons (Visual tab).
`$mce_buttons` array First-row list of buttons. `$editor_id` string Unique editor identifier, e.g. `'content'`. Accepts `'classic-block'` when called from block editor's Classic block. See other relevant mce\_buttons hooks:
* <mce_buttons>
* <mce_buttons_2>
* <mce_buttons_3>
* <mce_buttons_4>
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( 'mce_buttons', $mce_buttons, $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( 'category_list_link_attributes', array $atts, WP_Term $category, int $depth, array $args, int $current_object_id ) apply\_filters( 'category\_list\_link\_attributes', array $atts, WP\_Term $category, int $depth, array $args, int $current\_object\_id )
========================================================================================================================================
Filters the HTML attributes applied to a category list item’s anchor element.
`$atts` array The HTML attributes applied to the list item's `<a>` element, empty strings are ignored.
* `href`stringThe href attribute.
* `title`stringThe title attribute.
`$category` [WP\_Term](../classes/wp_term) Term data object. `$depth` int Depth of category, used for padding. `$args` array An array of arguments. `$current_object_id` int ID of the current category. File: `wp-includes/class-walker-category.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-category.php/)
```
$atts = apply_filters( 'category_list_link_attributes', $atts, $category, $depth, $args, $current_object_id );
```
| Used By | Description |
| --- | --- |
| [Walker\_Category::start\_el()](../classes/walker_category/start_el) wp-includes/class-walker-category.php | Starts the element output. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress apply_filters( 'nocache_headers', array $headers ) apply\_filters( 'nocache\_headers', array $headers )
====================================================
Filters the cache-controlling headers.
* [wp\_get\_nocache\_headers()](../functions/wp_get_nocache_headers)
`$headers` array Header names and field values. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$headers = (array) apply_filters( 'nocache_headers', $headers );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_nocache\_headers()](../functions/wp_get_nocache_headers) wp-includes/functions.php | Gets the header information to prevent caching. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'post_edit_category_parent_dropdown_args', array $parent_dropdown_args ) apply\_filters( 'post\_edit\_category\_parent\_dropdown\_args', array $parent\_dropdown\_args )
===============================================================================================
Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
`$parent_dropdown_args` array Array of arguments to generate parent dropdown.
* `taxonomy`stringName of the taxonomy to retrieve.
* `hide_if_empty`boolTrue to skip generating markup if no categories are found. Default 0.
* `name`stringValue for the `'name'` attribute of the select element.
Default "new{$tax\_name}\_parent".
* `orderby`stringWhich column to use for ordering terms. Default `'name'`.
* `hierarchical`bool|intWhether to traverse the taxonomy hierarchy. Default 1.
* `show_option_none`stringText to display for the "none" option.
Default "— {$parent} —", where `$parent` is `'parent_item'` taxonomy label.
File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
$parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args );
```
| Used By | Description |
| --- | --- |
| [post\_categories\_meta\_box()](../functions/post_categories_meta_box) wp-admin/includes/meta-boxes.php | Displays post categories form fields. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'plugins_api_args', object $args, string $action ) apply\_filters( 'plugins\_api\_args', object $args, string $action )
====================================================================
Filters the WordPress.org Plugin Installation API arguments.
Important: An object MUST be returned to this filter.
`$args` object Plugin API arguments. `$action` string The type of information being requested from the Plugin Installation API. File: `wp-admin/includes/plugin-install.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin-install.php/)
```
$args = apply_filters( 'plugins_api_args', $args, $action );
```
| 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 do_action_deprecated( 'deleted_blog', int $site_id, bool $drop ) do\_action\_deprecated( 'deleted\_blog', int $site\_id, bool $drop )
====================================================================
This hook has been deprecated.
Fires after the site is deleted from the network.
`$site_id` int The site ID. `$drop` bool True if site's tables 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( 'deleted_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. |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |
wordpress apply_filters( 'wp_insert_term_duplicate_term_check', object $duplicate_term, string $term, string $taxonomy, array $args, int $tt_id ) apply\_filters( 'wp\_insert\_term\_duplicate\_term\_check', object $duplicate\_term, string $term, string $taxonomy, array $args, int $tt\_id )
===============================================================================================================================================
Filters the duplicate term check that takes place during term creation.
Term parent + taxonomy + slug combinations are meant to be unique, and [wp\_insert\_term()](../functions/wp_insert_term) performs a last-minute confirmation of this uniqueness before allowing a new term to be created. Plugins with different uniqueness requirements may use this filter to bypass or modify the duplicate-term check.
`$duplicate_term` object Duplicate term row from terms table, if found. `$term` string Term being inserted. `$taxonomy` string Taxonomy name. `$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.
`$tt_id` int term\_taxonomy\_id for the newly created term. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
$duplicate_term = apply_filters( 'wp_insert_term_duplicate_term_check', $duplicate_term, $term, $taxonomy, $args, $tt_id );
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_term()](../functions/wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'site_status_tests', array[] $tests ) apply\_filters( 'site\_status\_tests', array[] $tests )
=======================================================
Filters which site status tests are run on a site.
The site health is determined by a set of tests based on best practices from both the WordPress Hosting Team and web standards in general.
Some sites may not have the same requirements, for example the automatic update checks may be handled by a host, and are therefore disabled in core.
Or maybe you want to introduce a new test, is caching enabled/disabled/stale for example.
Tests may be added either as direct, or asynchronous ones. Any test that may require some time to complete should run asynchronously, to avoid extended loading periods within wp-admin.
`$tests` array[] An associative array of direct and asynchronous tests.
* `direct`array[] An array of direct tests.
+ `...$identifier`array `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid collisions between tests.
- `label`stringThe friendly label to identify the test.
- `test`callableThe callback function that runs the test and returns its result.
- `skip_cron`boolWhether to skip this test when running as cron.
}
- `async`array[] An array of asynchronous tests.
* `...$identifier`array `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid collisions between tests.
+ `label`stringThe friendly label to identify the test.
+ `test`stringAn admin-ajax.php action to be called to perform the test, or if `$has_rest` is true, a URL to a REST API endpoint to perform the test.
+ `has_rest`boolWhether the `$test` property points to a REST API endpoint.
+ `skip_cron`boolWhether to skip this test when running as cron.
+ `async_direct_test`callableA manner of directly calling the test marked as asynchronous, as the scheduled event can not authenticate, and endpoints may require authentication.
} 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/)
```
$tests = apply_filters( 'site_status_tests', $tests );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health::get\_tests()](../classes/wp_site_health/get_tests) wp-admin/includes/class-wp-site-health.php | Returns a set of tests that belong to the site status page. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Added the `async_direct_test` array key for asynchronous tests. Added the `skip_cron` array key for all tests. |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action( 'xmlrpc_call_success_wp_deleteComment', int $comment_ID, array $args ) do\_action( 'xmlrpc\_call\_success\_wp\_deleteComment', int $comment\_ID, array $args )
=======================================================================================
Fires after a comment has been successfully deleted via XML-RPC.
`$comment_ID` int ID of the deleted comment. `$args` array An array of arguments to delete 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_deleteComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::wp\_deleteComment()](../classes/wp_xmlrpc_server/wp_deletecomment) wp-includes/class-wp-xmlrpc-server.php | Delete a comment. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters( 'rest_pre_update_setting', bool $result, string $name, mixed $value, array $args ) apply\_filters( 'rest\_pre\_update\_setting', bool $result, string $name, mixed $value, array $args )
=====================================================================================================
Filters whether to preempt a setting value update via the REST API.
Allows hijacking the setting update logic and overriding the built-in behavior by returning true.
`$result` bool Whether to override the default behavior for updating the value of a setting. `$name` string Setting name (as shown in REST API responses). `$value` mixed Updated setting value. `$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/)
```
$updated = apply_filters( 'rest_pre_update_setting', false, $name, $request[ $name ], $args );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Settings\_Controller::update\_item()](../classes/wp_rest_settings_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php | Updates settings for the settings object. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_update_https_detection_errors', null|WP_Error $pre ) apply\_filters( 'pre\_wp\_update\_https\_detection\_errors', null|WP\_Error $pre )
==================================================================================
Short-circuits the process of detecting errors related to HTTPS support.
Returning a `WP_Error` from the filter will effectively short-circuit the default logic of trying a remote request to the site over HTTPS, storing the errors array from the returned `WP_Error` instead.
`$pre` null|[WP\_Error](../classes/wp_error) Error object to short-circuit detection, or null to continue with the default behavior. File: `wp-includes/https-detection.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/https-detection.php/)
```
$support_errors = apply_filters( 'pre_wp_update_https_detection_errors', null );
```
| Used By | Description |
| --- | --- |
| [wp\_update\_https\_detection\_errors()](../functions/wp_update_https_detection_errors) wp-includes/https-detection.php | Runs a remote HTTPS request to detect whether HTTPS supported, and stores potential errors. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'get_feed_build_date', string|false $max_modified_time, string $format ) apply\_filters( 'get\_feed\_build\_date', string|false $max\_modified\_time, string $format )
=============================================================================================
Filters the date the last post or comment in the query was modified.
`$max_modified_time` string|false Date the last post or comment was modified in the query, in UTC.
False on failure. `$format` string The date format requested in [get\_feed\_build\_date()](../functions/get_feed_build_date) . More Arguments from get\_feed\_build\_date( ... $format ) Date format string to return the time in. File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
return apply_filters( 'get_feed_build_date', $max_modified_time, $format );
```
| Used By | Description |
| --- | --- |
| [get\_feed\_build\_date()](../functions/get_feed_build_date) wp-includes/feed.php | Gets the UTC time of the most recently modified post from [WP\_Query](../classes/wp_query). |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress do_action( 'network_admin_menu', string $context ) do\_action( 'network\_admin\_menu', string $context )
=====================================================
Fires before the administration menu loads in the Network Admin.
`$context` string Empty context. This action is used to add extra submenus and menu options to the network admin panel’s menu structure. The network admin panel is only seen by a super admin in a multisite installation.
The function associated with this action runs after the basic network admin panel menu structure is in place. For example, the function might call [add\_submenu\_page()](../functions/add_submenu_page) to add a submenu page.
File: `wp-admin/includes/menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/menu.php/)
```
do_action( 'network_admin_menu', '' );
```
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( "default_site_option_{$option}", mixed $default, string $option, int $network_id ) apply\_filters( "default\_site\_option\_{$option}", mixed $default, string $option, int $network\_id )
======================================================================================================
Filters the value of a specific default network option.
The dynamic portion of the hook name, `$option`, refers to the option name.
`$default` mixed The value to return if the site option does not exist in the database. `$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/)
```
return apply_filters( "default_site_option_{$option}", $default, $option, $network_id );
```
| Used By | Description |
| --- | --- |
| [get\_network\_option()](../functions/get_network_option) wp-includes/option.php | Retrieves a network’s option value based on the option 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.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress apply_filters_ref_array( 'comment_feed_groupby', string $cgroupby, WP_Query $query ) apply\_filters\_ref\_array( 'comment\_feed\_groupby', string $cgroupby, WP\_Query $query )
==========================================================================================
Filters the GROUP BY clause of the comments feed query before sending.
`$cgroupby` 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/)
```
$cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$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.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress apply_filters( 'should_load_remote_block_patterns', bool $should_load_remote ) apply\_filters( 'should\_load\_remote\_block\_patterns', bool $should\_load\_remote )
=====================================================================================
Filter to disable remote block patterns.
`$should_load_remote` bool File: `wp-includes/block-patterns.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-patterns.php/)
```
$should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );
```
| Used By | Description |
| --- | --- |
| [\_register\_remote\_theme\_patterns()](../functions/_register_remote_theme_patterns) wp-includes/block-patterns.php | Registers patterns from Pattern Directory provided by a theme’s `theme.json` file. |
| [\_load\_remote\_featured\_patterns()](../functions/_load_remote_featured_patterns) wp-includes/block-patterns.php | Register `Featured` (category) patterns from wordpress.org/patterns. |
| [\_load\_remote\_block\_patterns()](../functions/_load_remote_block_patterns) wp-includes/block-patterns.php | Register Core’s official patterns from wordpress.org/patterns. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress do_action( 'make_delete_blog', int $site_id ) do\_action( 'make\_delete\_blog', int $site\_id )
=================================================
Fires when the ‘deleted’ 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_delete_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( 'wp_save_post_revision_check_for_changes', bool $check_for_changes, WP_Post $latest_revision, WP_Post $post ) apply\_filters( 'wp\_save\_post\_revision\_check\_for\_changes', bool $check\_for\_changes, WP\_Post $latest\_revision, WP\_Post $post )
========================================================================================================================================
Filters whether the post has changed since the latest revision.
By default a revision is saved only if one of the revisioned fields has changed.
This filter can override that so a revision is saved even if nothing has changed.
`$check_for_changes` bool Whether to check for changes before saving a new revision.
Default true. `$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/)
```
if ( isset( $latest_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $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 |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'feed_links_extra_show_author_feed', bool $show ) apply\_filters( 'feed\_links\_extra\_show\_author\_feed', bool $show )
======================================================================
Filters whether to display the author feed link.
`$show` bool Whether to display the author 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_author_feed = apply_filters( 'feed_links_extra_show_author_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_checkdate', bool $checkdate, string $source_date ) apply\_filters( 'wp\_checkdate', bool $checkdate, string $source\_date )
========================================================================
Filters whether the given date is valid for the Gregorian calendar.
`$checkdate` bool Whether the given date is valid. `$source_date` string Date to check. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date );
```
| Used By | Description |
| --- | --- |
| [wp\_checkdate()](../functions/wp_checkdate) wp-includes/functions.php | Tests if the supplied date is valid for the Gregorian calendar. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_user', WP_REST_Response $response, WP_User $user, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_user', WP\_REST\_Response $response, WP\_User $user, WP\_REST\_Request $request )
=================================================================================================================
Filters user data returned from the REST API.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$user` [WP\_User](../classes/wp_user) User object used to create response. `$request` [WP\_REST\_Request](../classes/wp_rest_request) Request 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/)
```
return apply_filters( 'rest_prepare_user', $response, $user, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Users\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_users_controller/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 apply_filters( 'x_redirect_by', string $x_redirect_by, int $status, string $location ) apply\_filters( 'x\_redirect\_by', string $x\_redirect\_by, int $status, string $location )
===========================================================================================
Filters the X-Redirect-By header.
Allows applications to identify themselves when they’re doing a redirect.
`$x_redirect_by` string The application doing the redirect. `$status` int Status code to use. `$location` string The path to redirect to. File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$x_redirect_by = apply_filters( 'x_redirect_by', $x_redirect_by, $status, $location );
```
| Used By | Description |
| --- | --- |
| [wp\_redirect()](../functions/wp_redirect) wp-includes/pluggable.php | Redirects to another page. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress do_action( 'comment_loop_start' ) do\_action( 'comment\_loop\_start' )
====================================
Fires once the comment loop is started.
File: `wp-includes/class-wp-query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-query.php/)
```
do_action( 'comment_loop_start' );
```
| Used By | Description |
| --- | --- |
| [WP\_Query::the\_comment()](../classes/wp_query/the_comment) wp-includes/class-wp-query.php | Sets up the current comment. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress do_action( 'page_attributes_misc_attributes', WP_Post $post ) do\_action( 'page\_attributes\_misc\_attributes', WP\_Post $post )
==================================================================
Fires before the help hint text in the ‘Page Attributes’ meta box.
`$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_misc_attributes', $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.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'display_media_states', string[] $media_states, WP_Post $post ) apply\_filters( 'display\_media\_states', string[] $media\_states, WP\_Post $post )
===================================================================================
Filters the default media display states for items in the Media list table.
`$media_states` string[] An array of media states. Default 'Header Image', 'Background Image', 'Site Icon', `'Logo'`. `$post` [WP\_Post](../classes/wp_post) The current attachment object. File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
return apply_filters( 'display_media_states', $media_states, $post );
```
| Used By | Description |
| --- | --- |
| [get\_media\_states()](../functions/get_media_states) wp-admin/includes/template.php | Retrieves an array of media states from an attachment. |
| Version | Description |
| --- | --- |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Added the `$post` parameter. |
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |
wordpress apply_filters( 'wp_anonymize_comment', bool|string $anon_message, WP_Comment $comment, array $anonymized_comment ) apply\_filters( 'wp\_anonymize\_comment', bool|string $anon\_message, WP\_Comment $comment, array $anonymized\_comment )
========================================================================================================================
Filters whether to anonymize the comment.
`$anon_message` bool|string Whether to apply the comment anonymization (bool) or a custom message (string). Default true. `$comment` [WP\_Comment](../classes/wp_comment) [WP\_Comment](../classes/wp_comment) object. `$anonymized_comment` array Anonymized comment data. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$anon_message = apply_filters( 'wp_anonymize_comment', true, $comment, $anonymized_comment );
```
| Used By | Description |
| --- | --- |
| [wp\_comments\_personal\_data\_eraser()](../functions/wp_comments_personal_data_eraser) wp-includes/comment.php | Erases personal data associated with an email address from the comments table. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress apply_filters( 'wp_terms_checklist_args', array|string $args, int $post_id ) apply\_filters( 'wp\_terms\_checklist\_args', array|string $args, int $post\_id )
=================================================================================
Filters the taxonomy terms checklist arguments.
* [wp\_terms\_checklist()](../functions/wp_terms_checklist)
`$args` array|string An array or string of arguments. `$post_id` int The post ID. File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
$params = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
```
| Used By | Description |
| --- | --- |
| [wp\_terms\_checklist()](../functions/wp_terms_checklist) wp-admin/includes/template.php | Outputs an unordered list of checkbox input elements labelled with term names. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress do_action( 'wp_tiny_mce_init', array $mce_settings ) do\_action( 'wp\_tiny\_mce\_init', array $mce\_settings )
=========================================================
Fires after tinymce.js is loaded, but before any 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( 'wp_tiny_mce_init', 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.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'get_lastpostmodified', string|false $lastpostmodified, string $timezone, string $post_type ) apply\_filters( 'get\_lastpostmodified', string|false $lastpostmodified, string $timezone, string $post\_type )
===============================================================================================================
Filters the most recent time that a post on the site was modified.
`$lastpostmodified` string|false The most recent time that a post was modified, in 'Y-m-d H:i:s' format. False on failure. `$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/)
```
return apply_filters( 'get_lastpostmodified', $lastpostmodified, $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 |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$post_type` parameter. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'rest_prepare_application_password', WP_REST_Response $response, array $item, WP_REST_Request $request ) apply\_filters( 'rest\_prepare\_application\_password', WP\_REST\_Response $response, array $item, WP\_REST\_Request $request )
===============================================================================================================================
Filters the REST API response for an application password.
`$response` [WP\_REST\_Response](../classes/wp_rest_response) The response object. `$item` array The application password array. `$request` [WP\_REST\_Request](../classes/wp_rest_request) The 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_prepare_application_password', $response, $item, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Application\_Passwords\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_application_passwords_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php | Prepares the application password for the REST response. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'single_term_title', string $term_name ) apply\_filters( 'single\_term\_title', string $term\_name )
===========================================================
Filters the custom taxonomy archive page title.
`$term_name` string Term 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_term_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 |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress apply_filters( 'wp_get_attachment_url', string $url, int $attachment_id ) apply\_filters( 'wp\_get\_attachment\_url', string $url, int $attachment\_id )
==============================================================================
Filters the attachment URL.
`$url` string URL for the given attachment. `$attachment_id` int Attachment post ID. [wp\_get\_attachment\_url()](../functions/wp_get_attachment_url) doesn’t distinguish whether a page request arrives via HTTP or HTTPS.
Using wp\_get\_attachment\_url filter, we can fix this to avoid the dreaded mixed content browser warning:
```
add_filter('wp_get_attachment_url', 'honor_ssl_for_attachments');
function honor_ssl_for_attachments($url) {
$http = site_url(FALSE, 'http');
$https = site_url(FALSE, 'https');
return ( $_SERVER['HTTPS'] == 'on' ) ? str_replace($http, $https, $url) : $url;
}
```
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
$url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_attachment\_url()](../functions/wp_get_attachment_url) wp-includes/post.php | Retrieves the URL for an attachment. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress apply_filters( 'pre_wp_update_comment_count_now', int|null $new, int $old, int $post_id ) apply\_filters( 'pre\_wp\_update\_comment\_count\_now', int|null $new, int $old, int $post\_id )
================================================================================================
Filters a post’s comment count before it is updated in the database.
`$new` int|null The new comment count. Default null. `$old` int The old comment count. `$post_id` int Post ID. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$new = apply_filters( 'pre_wp_update_comment_count_now', null, $old, $post_id );
```
| 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 |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress apply_filters( 'theme_locale', string $locale, string $domain ) apply\_filters( 'theme\_locale', string $locale, string $domain )
=================================================================
Filters a theme’s locale.
`$locale` string The theme's current locale. `$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/)
```
$locale = apply_filters( 'theme_locale', determine_locale(), $domain );
```
| Used By | Description |
| --- | --- |
| [load\_theme\_textdomain()](../functions/load_theme_textdomain) wp-includes/l10n.php | Loads the theme’s translated strings. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'https_ssl_verify', bool $ssl_verify, string $url ) apply\_filters( 'https\_ssl\_verify', bool $ssl\_verify, string $url )
======================================================================
Filters whether SSL should be verified for non-local requests.
`$ssl_verify` bool Whether to verify the SSL connection. Default true. `$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/)
```
$options['verify'] = apply_filters( 'https_ssl_verify', $options['verify'], $url );
```
| Used By | Description |
| --- | --- |
| [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. |
| [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.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'wp_unique_term_slug_is_bad_slug', bool $needs_suffix, string $slug, object $term ) apply\_filters( 'wp\_unique\_term\_slug\_is\_bad\_slug', bool $needs\_suffix, string $slug, object $term )
==========================================================================================================
Filters whether the proposed unique term slug is bad.
`$needs_suffix` bool Whether the slug needs to be made unique with a suffix. `$slug` string The slug. `$term` object Term object. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
if ( apply_filters( 'wp_unique_term_slug_is_bad_slug', $needs_suffix, $slug, $term ) ) {
```
| 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. |
| programming_docs |
wordpress do_action( 'wp_authorize_application_password_request_errors', WP_Error $error, array $request, WP_User $user ) do\_action( 'wp\_authorize\_application\_password\_request\_errors', WP\_Error $error, array $request, WP\_User $user )
=======================================================================================================================
Fires before application password errors are returned.
`$error` [WP\_Error](../classes/wp_error) The error object. `$request` array The array of request data. `$user` [WP\_User](../classes/wp_user) The user authorizing the application. File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
do_action( 'wp_authorize_application_password_request_errors', $error, $request, $user );
```
| Used By | Description |
| --- | --- |
| [wp\_is\_authorize\_application\_password\_request\_valid()](../functions/wp_is_authorize_application_password_request_valid) wp-admin/includes/user.php | Checks if the Authorize Application Password request is valid. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress apply_filters( 'wp_sitemaps_posts_query_args', array $args, string $post_type ) apply\_filters( 'wp\_sitemaps\_posts\_query\_args', array $args, string $post\_type )
=====================================================================================
Filters the query arguments for post type sitemap queries.
* [WP\_Query](../classes/wp_query): for a full list of arguments.
`$args` array Array of [WP\_Query](../classes/wp_query) arguments. `$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/)
```
$args = apply_filters(
'wp_sitemaps_posts_query_args',
array(
'orderby' => 'ID',
'order' => 'ASC',
'post_type' => $post_type,
'posts_per_page' => wp_sitemaps_get_max_urls( $this->object_type ),
'post_status' => array( 'publish' ),
'no_found_rows' => true,
'update_post_term_cache' => false,
'update_post_meta_cache' => false,
'ignore_sticky_posts' => true, // sticky posts will still appear, but they won't be moved to the front.
),
$post_type
);
```
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Posts::get\_posts\_query\_args()](../classes/wp_sitemaps_posts/get_posts_query_args) wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | Returns the query args for retrieving posts to list in the sitemap. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Added `ignore_sticky_posts` default parameter. |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress apply_filters( 'wp_link_query_args', array $query ) apply\_filters( 'wp\_link\_query\_args', array $query )
=======================================================
Filters the link query arguments.
Allows modification of the link query arguments before querying.
* [WP\_Query](../classes/wp_query): for a full list of arguments
`$query` array An array of [WP\_Query](../classes/wp_query) arguments. The “`wp_link_query_args`” filter is used to filter the array of arguments passed to the `wp_link_query` function which is responsible for building the list of linkable content in the modal window that displays when you insert a link. `wp_link_query_args` allows you to alter the query before the list is rendered on the page.
File: `wp-includes/class-wp-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
```
$query = apply_filters( 'wp_link_query_args', $query );
```
| Used By | Description |
| --- | --- |
| [\_WP\_Editors::wp\_link\_query()](../classes/_wp_editors/wp_link_query) wp-includes/class-wp-editor.php | Performs post queries for internal linking. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'post_type_archive_link', string $link, string $post_type ) apply\_filters( 'post\_type\_archive\_link', string $link, string $post\_type )
===============================================================================
Filters the post type archive permalink.
`$link` string The post type archive permalink. `$post_type` string Post type name. File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
return apply_filters( 'post_type_archive_link', $link, $post_type );
```
| Used By | Description |
| --- | --- |
| [get\_post\_type\_archive\_link()](../functions/get_post_type_archive_link) wp-includes/link-template.php | Retrieves the permalink for a post type archive. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress do_action( 'customize_render_section', WP_Customize_Section $section ) do\_action( 'customize\_render\_section', WP\_Customize\_Section $section )
===========================================================================
Fires before rendering a Customizer section.
`$section` [WP\_Customize\_Section](../classes/wp_customize_section) [WP\_Customize\_Section](../classes/wp_customize_section) instance. 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 );
```
| 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( 'nav_menu_css_class', string[] $classes, WP_Post $menu_item, stdClass $args, int $depth ) apply\_filters( 'nav\_menu\_css\_class', string[] $classes, WP\_Post $menu\_item, stdClass $args, int $depth )
==============================================================================================================
Filters the CSS classes applied to a menu item’s list item element.
`$classes` string[] Array of the CSS classes that are applied to the menu item's `<li>` element. `$menu_item` [WP\_Post](../classes/wp_post) The current menu item object. `$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. This filter hook called by the WordPress [Walker\_Nav\_Menu](../classes/walker_nav_menu) class.
**Usage in WP 3.0 / 3.1+ / 4.1+**:
```
<?php
/* WP 3.0+ */
function filter_handler( $classes , $item ) { ...... }
add_filter( 'nav_menu_css_class', 'filter_handler', 10, 2 );
/* WP 3.1+ */
function filter_handler( $classes , $item, $args ) { ...... }
add_filter( 'nav_menu_css_class', 'filter_handler', 10, 3 );
/* WP 4.1+ */
function filter_handler( $classes, $item, $args, $depth ) { ...... }
add_filter( 'nav_menu_css_class', 'filter_handler', 10, 4 );
?>
```
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_css_class', array_filter( $classes ), $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.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'network_admin_url', string $url, string $path, string|null $scheme ) apply\_filters( 'network\_admin\_url', string $url, string $path, string|null $scheme )
=======================================================================================
Filters the network admin URL.
`$url` string The complete network admin URL including scheme and path. `$path` string Path relative to the network admin 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( 'network_admin_url', $url, $path, $scheme );
```
| Used By | Description |
| --- | --- |
| [network\_admin\_url()](../functions/network_admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for the network. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | The `$scheme` parameter was added. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress apply_filters( 'search_rewrite_rules', string[] $search_rewrite ) apply\_filters( 'search\_rewrite\_rules', string[] $search\_rewrite )
=====================================================================
Filters rewrite rules used for search archives.
Likely search-related archives include `/search/search+query/` as well as pagination and feed paths for a search.
`$search_rewrite` string[] Array of rewrite rules for search queries, 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/)
```
$search_rewrite = apply_filters( 'search_rewrite_rules', $search_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( 'the_author_posts_link', string $link ) apply\_filters( 'the\_author\_posts\_link', string $link )
==========================================================
Filters the link to the author page of the author of the current post.
`$link` string HTML link. 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_posts_link', $link );
```
| Used By | Description |
| --- | --- |
| [get\_the\_author\_posts\_link()](../functions/get_the_author_posts_link) wp-includes/author-template.php | Retrieves an HTML link to the author page of the current post’s author. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'comment_notification_notify_author', bool $notify, string $comment_id ) apply\_filters( 'comment\_notification\_notify\_author', bool $notify, string $comment\_id )
============================================================================================
Filters whether to notify comment authors of their comments on their own posts.
By default, comment authors aren’t notified of their comments on their own posts. This filter allows you to override that.
`$notify` bool Whether to notify the post author of their own comment.
Default false. `$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/)
```
$notify_author = apply_filters( 'comment_notification_notify_author', false, $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.8.0](https://developer.wordpress.org/reference/since/3.8.0/) | Introduced. |
wordpress do_action( "set_site_transient_{$transient}", mixed $value, int $expiration, string $transient ) do\_action( "set\_site\_transient\_{$transient}", mixed $value, int $expiration, string $transient )
====================================================================================================
Fires after the value for a specific site transient has been set.
The dynamic portion of the hook name, `$transient`, refers to the transient name.
`$value` mixed Site transient value. `$expiration` int Time until expiration in seconds. `$transient` string Transient name. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
do_action( "set_site_transient_{$transient}", $value, $expiration, $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( 'wpmu_welcome_notification', int|false $blog_id, int $user_id, string $password, string $title, array $meta ) apply\_filters( 'wpmu\_welcome\_notification', int|false $blog\_id, int $user\_id, string $password, string $title, array $meta )
=================================================================================================================================
Filters whether to bypass the welcome email sent to the site administrator after site activation.
Returning false disables the welcome email.
`$blog_id` int|false Site ID, or false to prevent the email from sending. `$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/)
```
if ( ! apply_filters( 'wpmu_welcome_notification', $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 apply_filters( 'wp_direct_update_https_url', string $direct_update_url ) apply\_filters( 'wp\_direct\_update\_https\_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_update_https_url', $direct_update_url );
```
| Used By | Description |
| --- | --- |
| [wp\_get\_direct\_update\_https\_url()](../functions/wp_get_direct_update_https_url) wp-includes/functions.php | Gets the URL for directly updating the site to use HTTPS. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress apply_filters( 'user_can_richedit', bool $wp_rich_edit ) apply\_filters( 'user\_can\_richedit', bool $wp\_rich\_edit )
=============================================================
Filters whether the user can access the visual editor.
`$wp_rich_edit` bool Whether the user can access the visual editor. File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
return apply_filters( 'user_can_richedit', $wp_rich_edit );
```
| Used By | Description |
| --- | --- |
| [user\_can\_richedit()](../functions/user_can_richedit) wp-includes/general-template.php | Determines whether the user can access the visual editor. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( "uninstall_{$file}" ) do\_action( "uninstall\_{$file}" )
==================================
Fires in [uninstall\_plugin()](../functions/uninstall_plugin) once the plugin has been uninstalled.
The action concatenates the ‘uninstall\_’ prefix with the basename of the plugin passed to [uninstall\_plugin()](../functions/uninstall_plugin) to create a dynamically-named action.
File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
do_action( "uninstall_{$file}" );
```
| Used By | Description |
| --- | --- |
| [uninstall\_plugin()](../functions/uninstall_plugin) wp-admin/includes/plugin.php | Uninstalls a single plugin. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
| programming_docs |
wordpress apply_filters( 'safecss_filter_attr_allow_css', bool $allow_css, string $css_test_string ) apply\_filters( 'safecss\_filter\_attr\_allow\_css', bool $allow\_css, string $css\_test\_string )
==================================================================================================
Filters the check for unsafe CSS in `safecss_filter_attr`.
Enables developers to determine whether a section of CSS should be allowed or discarded.
By default, the value will be false if the part contains \ ( & } = or comments.
Return true to allow the CSS part to be included in the output.
`$allow_css` bool Whether the CSS in the test string is considered safe. `$css_test_string` string The CSS string to test. File: `wp-includes/kses.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/kses.php/)
```
$allow_css = apply_filters( 'safecss_filter_attr_allow_css', $allow_css, $css_test_string );
```
| 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 |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress do_action( 'wp_uninitialize_site', WP_Site $old_site ) do\_action( 'wp\_uninitialize\_site', WP\_Site $old\_site )
===========================================================
Fires when a site’s uninitialization routine should be executed.
`$old_site` [WP\_Site](../classes/wp_site) Deleted 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_uninitialize_site', $old_site );
```
| Used By | Description |
| --- | --- |
| [wp\_delete\_site()](../functions/wp_delete_site) wp-includes/ms-site.php | Deletes a site from the database. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress apply_filters( 'request', array $query_vars ) apply\_filters( 'request', array $query\_vars )
===============================================
Filters the array of parsed query variables.
`$query_vars` array The array of requested query variables. * This filter is applied to the query variables that are passed to the default main SQL query that drives your page’s content. It is applied after additional private query variables have been added in, and is one of the places you can hook into to modify the query that will generate your list of posts (or pages) before the main query is executed and the database is actually accessed.
* Use this hook within `functions.php` as an alternative way to alter the posts returned in your Main Loop (as an alternate to [query\_posts()](../functions/query_posts) ). The advantage of using this filter is that it alters the SQL query before it is executed, reducing the number of database calls.
* While it probably goes without saying, attempts to use this hook from within a template php page will not do anything, as the main query will have already executed at that point.
* As Rarst [mentions](http://wordpress.stackexchange.com/questions/21341/alternative-to-query-posts-for-main-loop/21342#21342), this filter affects all default queries, including calls to the admin Dashboard. You must be extremely careful and test thoroughly to ensure that no other parts of the site break when you modify the query string.
File: `wp-includes/class-wp.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp.php/)
```
$this->query_vars = apply_filters( 'request', $this->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 |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress do_action( 'admin_enqueue_scripts', string $hook_suffix ) do\_action( 'admin\_enqueue\_scripts', string $hook\_suffix )
=============================================================
Enqueue scripts for all admin pages.
`$hook_suffix` string The current admin page. `admin_enqueue_scripts` is the proper hook to use when enqueuing scripts and styles that are meant to be used in the administration panel. Despite the name, it is **used for enqueuing both scripts and styles**.
It provides a single parameter, `$hook_suffix`, that informs the current admin page. This should be used to enqueue scripts and styles only in the pages they are going to be used, and avoid adding script and styles to all admin dashboard unnecessarily.
File: `wp-admin/admin-header.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/admin-header.php/)
```
do_action( 'admin_enqueue_scripts', $hook_suffix );
```
| 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. |
| [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 |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'date_i18n', string $date, string $format, int $timestamp, bool $gmt ) apply\_filters( 'date\_i18n', string $date, string $format, int $timestamp, bool $gmt )
=======================================================================================
Filters the date formatted based on the locale.
`$date` string Formatted date string. `$format` string Format to display the date. `$timestamp` int A sum of Unix timestamp and timezone offset in seconds.
Might be without offset if input omitted timestamp but requested GMT. `$gmt` bool Whether to use GMT timezone. Only applies if timestamp was not provided.
Default false. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
$date = apply_filters( 'date_i18n', $date, $format, $timestamp, $gmt );
```
| Used By | Description |
| --- | --- |
| [date\_i18n()](../functions/date_i18n) wp-includes/functions.php | Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'rest_term_search_query', array $query_args, WP_REST_Request $request ) apply\_filters( 'rest\_term\_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 term 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-term-search-handler.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/search/class-wp-rest-term-search-handler.php/)
```
$query_args = apply_filters( 'rest_term_search_query', $query_args, $request );
```
| Used By | Description |
| --- | --- |
| [WP\_REST\_Term\_Search\_Handler::search\_items()](../classes/wp_rest_term_search_handler/search_items) wp-includes/rest-api/search/class-wp-rest-term-search-handler.php | Searches the object type content for a given search request. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress do_action( 'post-html-upload-ui' ) do\_action( 'post-html-upload-ui' )
===================================
Fires after the upload button in the media upload interface.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
do_action( 'post-html-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. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress apply_filters( 'automatic_updater_disabled', bool $disabled ) apply\_filters( 'automatic\_updater\_disabled', bool $disabled )
================================================================
Filters whether to entirely disable background updates.
There are more fine-grained filters and controls for selective disabling.
This filter parallels the AUTOMATIC\_UPDATER\_DISABLED constant in name.
This also disables update notification emails. That may change in the future.
`$disabled` bool Whether the updater should be disabled. 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/)
```
return apply_filters( 'automatic_updater_disabled', $disabled );
```
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health\_Auto\_Updates::test\_filters\_automatic\_updater\_disabled()](../classes/wp_site_health_auto_updates/test_filters_automatic_updater_disabled) wp-admin/includes/class-wp-site-health-auto-updates.php | Checks if automatic updates are disabled by a filter. |
| [WP\_Automatic\_Updater::is\_disabled()](../classes/wp_automatic_updater/is_disabled) wp-admin/includes/class-wp-automatic-updater.php | Determines whether the entire automatic updater is disabled. |
| Version | Description |
| --- | --- |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress apply_filters( 'get_terms', array $terms, array|null $taxonomies, array $args, WP_Term_Query $term_query ) apply\_filters( 'get\_terms', array $terms, array|null $taxonomies, array $args, WP\_Term\_Query $term\_query )
===============================================================================================================
Filters the found terms.
`$terms` array Array of found terms. `$taxonomies` array|null An array of taxonomies if known. `$args` array An array of [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.
`$term_query` [WP\_Term\_Query](../classes/wp_term_query) The [WP\_Term\_Query](../classes/wp_term_query) object. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
return apply_filters( 'get_terms', $terms, $term_query->query_vars['taxonomy'], $term_query->query_vars, $term_query );
```
| Used By | Description |
| --- | --- |
| [get\_terms()](../functions/get_terms) wp-includes/taxonomy.php | Retrieves the terms in a given taxonomy or list of taxonomies. |
| Version | Description |
| --- | --- |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$term_query` parameter. |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress apply_filters( 'removable_query_args', string[] $removable_query_args ) apply\_filters( 'removable\_query\_args', string[] $removable\_query\_args )
============================================================================
Filters the list of query variable names to remove.
`$removable_query_args` string[] An array of query variable names to remove from a URL. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
return apply_filters( 'removable_query_args', $removable_query_args );
```
| Used By | Description |
| --- | --- |
| [wp\_removable\_query\_args()](../functions/wp_removable_query_args) wp-includes/functions.php | Returns an array of single-use query variable names that can be removed from a URL. |
| Version | Description |
| --- | --- |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |
wordpress apply_filters( 'wp_image_resize_identical_dimensions', bool $proceed, int $orig_w, int $orig_h ) apply\_filters( 'wp\_image\_resize\_identical\_dimensions', bool $proceed, int $orig\_w, int $orig\_h )
=======================================================================================================
Filters whether to proceed with making an image sub-size with identical dimensions with the original/source image. Differences of 1px may be due to rounding and are ignored.
`$proceed` bool The filtered value. `$orig_w` int Original image width. `$orig_h` int Original image height. File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
$proceed = (bool) apply_filters( 'wp_image_resize_identical_dimensions', false, $orig_w, $orig_h );
```
| Used By | Description |
| --- | --- |
| [image\_resize\_dimensions()](../functions/image_resize_dimensions) wp-includes/media.php | Retrieves calculated resize dimensions for use in [WP\_Image\_Editor](../classes/wp_image_editor). |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress apply_filters( 'post_comments_feed_link_html', string $link, int $post_id, string $feed ) apply\_filters( 'post\_comments\_feed\_link\_html', string $link, int $post\_id, string $feed )
===============================================================================================
Filters the post comment feed link anchor tag.
`$link` string The complete anchor tag for the comment feed link. `$post_id` int Post ID. `$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( 'post_comments_feed_link_html', $link, $post_id, $feed );
```
| Used By | Description |
| --- | --- |
| [post\_comments\_feed\_link()](../functions/post_comments_feed_link) wp-includes/link-template.php | Displays the comment feed link for a post. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress do_action( 'edit_user_created_user', int|WP_Error $user_id, string $notify ) do\_action( 'edit\_user\_created\_user', int|WP\_Error $user\_id, string $notify )
==================================================================================
Fires after a new user has been created.
`$user_id` int|[WP\_Error](../classes/wp_error) ID of the newly created user or [WP\_Error](../classes/wp_error) on failure. `$notify` string Type of notification that should happen. See [wp\_send\_new\_user\_notifications()](../functions/wp_send_new_user_notifications) for more information. More Arguments from wp\_send\_new\_user\_notifications( ... $notify ) Type of notification that should happen. Accepts `'admin'` or an empty string (admin only), `'user'`, or `'both'` (admin and user).
Default `'both'`. File: `wp-admin/includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
```
do_action( 'edit_user_created_user', $user_id, $notify );
```
| Used By | Description |
| --- | --- |
| [edit\_user()](../functions/edit_user) wp-admin/includes/user.php | Edit user settings based on contents of $\_POST |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress apply_filters( 'comment_url', string $author_url, string $comment_ID ) apply\_filters( 'comment\_url', string $author\_url, string $comment\_ID )
==========================================================================
Filters the comment author’s URL for display.
`$author_url` string The comment author's URL. `$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_url', $author_url, $comment->comment_ID );
```
| Used By | Description |
| --- | --- |
| [comment\_author\_url()](../functions/comment_author_url) wp-includes/comment-template.php | Displays the URL of the author of the current comment, not linked. |
| 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( 'network_by_path_segments_count', int|null $segments, string $domain, string $path ) apply\_filters( 'network\_by\_path\_segments\_count', int|null $segments, string $domain, string $path )
========================================================================================================
Filters the number of path segments to consider when searching for a site.
`$segments` int|null The number of path segments to consider. WordPress by default looks at one path segment. The function default of null only makes sense when you know the requested path should match a network. `$domain` string The requested domain. `$path` string The requested path, in full. File: `wp-includes/class-wp-network.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-network.php/)
```
$segments = apply_filters( 'network_by_path_segments_count', $segments, $domain, $path );
```
| Used By | Description |
| --- | --- |
| [WP\_Network::get\_by\_path()](../classes/wp_network/get_by_path) wp-includes/class-wp-network.php | Retrieves the closest matching network for a domain and path. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress apply_filters( 'alloptions', array $alloptions ) apply\_filters( 'alloptions', array $alloptions )
=================================================
Filters all options after retrieving them.
`$alloptions` array Array with all options. File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
return apply_filters( 'alloptions', $alloptions );
```
| Used By | Description |
| --- | --- |
| [wp\_load\_alloptions()](../functions/wp_load_alloptions) wp-includes/option.php | Loads and caches all autoloaded options, if available or all options. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress apply_filters( 'authenticate', null|WP_User|WP_Error $user, string $username, string $password ) apply\_filters( 'authenticate', null|WP\_User|WP\_Error $user, string $username, string $password )
===================================================================================================
Filters whether a set of user login credentials are valid.
A [WP\_User](../classes/wp_user) object is returned if the credentials authenticate a user.
[WP\_Error](../classes/wp_error) or null otherwise.
`$user` null|[WP\_User](../classes/wp_user)|[WP\_Error](../classes/wp_error) [WP\_User](../classes/wp_user) if the user is authenticated.
[WP\_Error](../classes/wp_error) or null otherwise. `$username` string Username or email address. `$password` string User password. The authenticate filter hook is used to perform additional validation/authentication any time a user logs in to WordPress.
The <wp_authenticate_user> filter can also be used if you want to perform any additional validation after WordPress’s basic validation, but before a user is logged in.
The default authenticate filters in /wp-includes/default-filters.php
```
add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
add_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 );
add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 );
```
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
$user = apply_filters( 'authenticate', null, $username, $password );
```
| Used By | Description |
| --- | --- |
| [wp\_authenticate()](../functions/wp_authenticate) wp-includes/pluggable.php | Authenticates a user, confirming the login credentials are valid. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | `$username` now accepts an email address. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress apply_filters( 'pingback_useragent', string $concat_useragent, string $useragent, string $pingback_server_url, string $pagelinkedto, string $pagelinkedfrom ) apply\_filters( 'pingback\_useragent', string $concat\_useragent, string $useragent, string $pingback\_server\_url, string $pagelinkedto, string $pagelinkedfrom )
==================================================================================================================================================================
Filters the user agent sent when pinging-back a URL.
`$concat_useragent` string The user agent concatenated with ' -- WordPress/' and the WordPress version. `$useragent` string The useragent. `$pingback_server_url` string The server URL being linked to. `$pagelinkedto` string URL of page linked to. `$pagelinkedfrom` string URL of page linked from. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
$client->useragent = apply_filters( 'pingback_useragent', $client->useragent . ' -- WordPress/' . get_bloginfo( 'version' ), $client->useragent, $pingback_server_url, $pagelinkedto, $pagelinkedfrom );
```
| Used By | Description |
| --- | --- |
| [pingback()](../functions/pingback) wp-includes/comment.php | Pings back the links found in a post. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress apply_filters( 'wp_insert_post_empty_content', bool $maybe_empty, array $postarr ) apply\_filters( 'wp\_insert\_post\_empty\_content', bool $maybe\_empty, array $postarr )
========================================================================================
Filters whether the post should be considered “empty”.
The post is considered "empty" if both:
1. The post type supports the title, editor, and excerpt fields
2. The title, editor, and excerpt fields are all empty
Returning a truthy value from the filter will effectively short-circuit the new post being inserted and return 0. If $wp\_error is true, a [WP\_Error](../classes/wp_error) will be returned instead.
`$maybe_empty` bool Whether the post should be considered "empty". `$postarr` array Array of post data. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
```
| Used By | Description |
| --- | --- |
| [wp\_insert\_post()](../functions/wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress get_pending_comments_num( int|int[] $post_id ): int|int[] get\_pending\_comments\_num( int|int[] $post\_id ): int|int[]
=============================================================
Gets the number of pending comments on a post or posts.
`$post_id` int|int[] Required Either a single Post ID or an array of Post IDs int|int[] Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs
File: `wp-admin/includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/comment.php/)
```
function get_pending_comments_num( $post_id ) {
global $wpdb;
$single = false;
if ( ! is_array( $post_id ) ) {
$post_id_array = (array) $post_id;
$single = true;
} else {
$post_id_array = $post_id;
}
$post_id_array = array_map( 'intval', $post_id_array );
$post_id_in = "'" . implode( "', '", $post_id_array ) . "'";
$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_A );
if ( $single ) {
if ( empty( $pending ) ) {
return 0;
} else {
return absint( $pending[0]['num_comments'] );
}
}
$pending_keyed = array();
// Default to zero pending for all posts in request.
foreach ( $post_id_array as $id ) {
$pending_keyed[ $id ] = 0;
}
if ( ! empty( $pending ) ) {
foreach ( $pending as $pend ) {
$pending_keyed[ $pend['comment_post_ID'] ] = absint( $pend['num_comments'] );
}
}
return $pending_keyed;
}
```
| Uses | Description |
| --- | --- |
| [absint()](absint) wp-includes/functions.php | Converts a value to non-negative integer. |
| [wpdb::get\_results()](../classes/wpdb/get_results) wp-includes/class-wpdb.php | Retrieves an entire SQL result set from the database (i.e., many rows). |
| Used By | Description |
| --- | --- |
| [WP\_Media\_List\_Table::column\_comments()](../classes/wp_media_list_table/column_comments) wp-admin/includes/class-wp-media-list-table.php | Handles the comments column output. |
| [WP\_Media\_List\_Table::display\_rows()](../classes/wp_media_list_table/display_rows) wp-admin/includes/class-wp-media-list-table.php | |
| [WP\_Comments\_List\_Table::column\_response()](../classes/wp_comments_list_table/column_response) wp-admin/includes/class-wp-comments-list-table.php | |
| [WP\_Comments\_List\_Table::prepare\_items()](../classes/wp_comments_list_table/prepare_items) wp-admin/includes/class-wp-comments-list-table.php | |
| [WP\_Posts\_List\_Table::\_display\_rows()](../classes/wp_posts_list_table/_display_rows) wp-admin/includes/class-wp-posts-list-table.php | |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
wordpress wp_is_site_initialized( int|WP_Site $site_id ): bool wp\_is\_site\_initialized( int|WP\_Site $site\_id ): bool
=========================================================
Checks whether a site is initialized.
A site is considered initialized when its database tables are present.
`$site_id` int|[WP\_Site](../classes/wp_site) Required Site ID or object. bool True if the site is initialized, false otherwise.
File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
function wp_is_site_initialized( $site_id ) {
global $wpdb;
if ( is_object( $site_id ) ) {
$site_id = $site_id->blog_id;
}
$site_id = (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.
*
* @since 5.1.0
*
* @param bool|null $pre The value to return instead. Default null
* to continue with the check.
* @param int $site_id The site ID that is being checked.
*/
$pre = apply_filters( 'pre_wp_is_site_initialized', null, $site_id );
if ( null !== $pre ) {
return (bool) $pre;
}
$switch = false;
if ( get_current_blog_id() !== $site_id ) {
$switch = true;
remove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 );
switch_to_blog( $site_id );
}
$suppress = $wpdb->suppress_errors();
$result = (bool) $wpdb->get_results( "DESCRIBE {$wpdb->posts}" );
$wpdb->suppress_errors( $suppress );
if ( $switch ) {
restore_current_blog();
add_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );
}
return $result;
}
```
[apply\_filters( 'pre\_wp\_is\_site\_initialized', bool|null $pre, int $site\_id )](../hooks/pre_wp_is_site_initialized)
Filters the check for whether a site is initialized before the database is accessed.
| Uses | Description |
| --- | --- |
| [remove\_action()](remove_action) wp-includes/plugin.php | Removes a callback function from an action hook. |
| [switch\_to\_blog()](switch_to_blog) wp-includes/ms-blogs.php | Switch the current blog. |
| [restore\_current\_blog()](restore_current_blog) wp-includes/ms-blogs.php | Restore the current blog, after calling [switch\_to\_blog()](switch_to_blog) . |
| [wpdb::suppress\_errors()](../classes/wpdb/suppress_errors) wp-includes/class-wpdb.php | Enables or disables suppressing of database errors. |
| [get\_current\_blog\_id()](get_current_blog_id) wp-includes/load.php | Retrieve the current site ID. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [add\_action()](add_action) wp-includes/plugin.php | Adds a callback function to an action hook. |
| [wpdb::get\_results()](../classes/wpdb/get_results) wp-includes/class-wpdb.php | Retrieves an entire SQL result set from the database (i.e., many rows). |
| Used By | Description |
| --- | --- |
| [wp\_update\_blog\_public\_option\_on\_site\_update()](wp_update_blog_public_option_on_site_update) wp-includes/ms-site.php | Updates the `blog_public` option for a given site ID. |
| [wp\_initialize\_site()](wp_initialize_site) wp-includes/ms-site.php | Runs the initialization routine for a given site. |
| [wp\_uninitialize\_site()](wp_uninitialize_site) wp-includes/ms-site.php | Runs the uninitialization routine for a given site. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress is_blog_admin(): bool is\_blog\_admin(): bool
=======================
Determines whether the current request is for a site’s administrative interface.
e.g. `/wp-admin/`
Does not check if the user is an administrator; use [current\_user\_can()](current_user_can) for checking roles and capabilities.
bool True if inside WordPress site administration pages.
File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
function is_blog_admin() {
if ( isset( $GLOBALS['current_screen'] ) ) {
return $GLOBALS['current_screen']->in_admin( 'site' );
} elseif ( defined( 'WP_BLOG_ADMIN' ) ) {
return WP_BLOG_ADMIN;
}
return false;
}
```
| Used By | Description |
| --- | --- |
| [wp\_dashboard\_setup()](wp_dashboard_setup) wp-admin/includes/dashboard.php | Registers dashboard widgets. |
| [wp\_admin\_bar\_site\_menu()](wp_admin_bar_site_menu) wp-includes/admin-bar.php | Adds the “Site Name” menu. |
| [wp\_validate\_logged\_in\_cookie()](wp_validate_logged_in_cookie) wp-includes/user.php | Validates the logged-in cookie. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress graceful_fail( $message ) graceful\_fail( $message )
==========================
This function has been deprecated. Use [wp\_die()](wp_die) instead.
Deprecated functionality to gracefully fail.
* [wp\_die()](wp_die)
File: `wp-includes/ms-deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-deprecated.php/)
```
function graceful_fail( $message ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_die()' );
$message = apply_filters( 'graceful_fail', $message );
$message_template = apply_filters( 'graceful_fail_template',
'<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Error!</title>
<style type="text/css">
img {
border: 0;
}
body {
line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;
text-align: center;
}
.message {
font-size: 22px;
width: 350px;
margin: auto;
}
</style>
</head>
<body>
<p class="message">%s</p>
</body>
</html>' );
die( sprintf( $message_template, $message ) );
}
```
| Uses | Description |
| --- | --- |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Use [wp\_die()](wp_die) |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress background_color() background\_color()
===================
Displays background color value.
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
function background_color() {
echo get_background_color();
}
```
| Uses | Description |
| --- | --- |
| [get\_background\_color()](get_background_color) wp-includes/theme.php | Retrieves value for custom background color. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress wp_filter_pre_oembed_result( null|string $result, string $url, array $args ): null|string wp\_filter\_pre\_oembed\_result( null|string $result, string $url, array $args ): null|string
=============================================================================================
Filters the oEmbed result before any HTTP requests are made.
If the URL belongs to the current site, the result is fetched directly instead of going through the oEmbed discovery process.
`$result` null|string Required The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Default null. `$url` string Required The URL that should be inspected for discovery `<link>` tags. `$args` array Required oEmbed remote get arguments. null|string The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
Null if the URL does not belong to the current site.
File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
function wp_filter_pre_oembed_result( $result, $url, $args ) {
$data = get_oembed_response_data_for_url( $url, $args );
if ( $data ) {
return _wp_oembed_get_object()->data2html( $data, $url );
}
return $result;
}
```
| Uses | Description |
| --- | --- |
| [get\_oembed\_response\_data\_for\_url()](get_oembed_response_data_for_url) wp-includes/embed.php | Retrieves the oEmbed response data for a given URL. |
| [\_wp\_oembed\_get\_object()](_wp_oembed_get_object) wp-includes/embed.php | Returns the initialized [WP\_oEmbed](../classes/wp_oembed) object. |
| Version | Description |
| --- | --- |
| [4.5.3](https://developer.wordpress.org/reference/since/4.5.3/) | Introduced. |
| programming_docs |
wordpress edit_post( array|null $post_data = null ): int edit\_post( array|null $post\_data = null ): int
================================================
Updates an existing post with values provided in `$_POST`.
If post data is passed as an argument, it is treated as an array of data keyed appropriately for turning into a post object.
If post data is not passed, the `$_POST` global variable is used instead.
`$post_data` array|null Optional The array of post data to process.
Defaults to the `$_POST` superglobal. Default: `null`
int Post ID.
File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
function edit_post( $post_data = null ) {
global $wpdb;
if ( empty( $post_data ) ) {
$post_data = &$_POST;
}
// Clear out any data in internal vars.
unset( $post_data['filter'] );
$post_ID = (int) $post_data['post_ID'];
$post = get_post( $post_ID );
$post_data['post_type'] = $post->post_type;
$post_data['post_mime_type'] = $post->post_mime_type;
if ( ! empty( $post_data['post_status'] ) ) {
$post_data['post_status'] = sanitize_key( $post_data['post_status'] );
if ( 'inherit' === $post_data['post_status'] ) {
unset( $post_data['post_status'] );
}
}
$ptype = get_post_type_object( $post_data['post_type'] );
if ( ! current_user_can( 'edit_post', $post_ID ) ) {
if ( 'page' === $post_data['post_type'] ) {
wp_die( __( 'Sorry, you are not allowed to edit this page.' ) );
} else {
wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
}
}
if ( post_type_supports( $ptype->name, 'revisions' ) ) {
$revisions = wp_get_post_revisions(
$post_ID,
array(
'order' => 'ASC',
'posts_per_page' => 1,
)
);
$revision = current( $revisions );
// Check if the revisions have been upgraded.
if ( $revisions && _wp_get_post_revision_version( $revision ) < 1 ) {
_wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_ID ) );
}
}
if ( isset( $post_data['visibility'] ) ) {
switch ( $post_data['visibility'] ) {
case 'public':
$post_data['post_password'] = '';
break;
case 'password':
unset( $post_data['sticky'] );
break;
case 'private':
$post_data['post_status'] = 'private';
$post_data['post_password'] = '';
unset( $post_data['sticky'] );
break;
}
}
$post_data = _wp_translate_postdata( true, $post_data );
if ( is_wp_error( $post_data ) ) {
wp_die( $post_data->get_error_message() );
}
$translated = _wp_get_allowed_postdata( $post_data );
// Post formats.
if ( isset( $post_data['post_format'] ) ) {
set_post_format( $post_ID, $post_data['post_format'] );
}
$format_meta_urls = array( 'url', 'link_url', 'quote_source_url' );
foreach ( $format_meta_urls as $format_meta_url ) {
$keyed = '_format_' . $format_meta_url;
if ( isset( $post_data[ $keyed ] ) ) {
update_post_meta( $post_ID, $keyed, wp_slash( sanitize_url( wp_unslash( $post_data[ $keyed ] ) ) ) );
}
}
$format_keys = array( 'quote', 'quote_source_name', 'image', 'gallery', 'audio_embed', 'video_embed' );
foreach ( $format_keys as $key ) {
$keyed = '_format_' . $key;
if ( isset( $post_data[ $keyed ] ) ) {
if ( current_user_can( 'unfiltered_html' ) ) {
update_post_meta( $post_ID, $keyed, $post_data[ $keyed ] );
} else {
update_post_meta( $post_ID, $keyed, wp_filter_post_kses( $post_data[ $keyed ] ) );
}
}
}
if ( 'attachment' === $post_data['post_type'] && preg_match( '#^(audio|video)/#', $post_data['post_mime_type'] ) ) {
$id3data = wp_get_attachment_metadata( $post_ID );
if ( ! is_array( $id3data ) ) {
$id3data = array();
}
foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) {
if ( isset( $post_data[ 'id3_' . $key ] ) ) {
$id3data[ $key ] = sanitize_text_field( wp_unslash( $post_data[ 'id3_' . $key ] ) );
}
}
wp_update_attachment_metadata( $post_ID, $id3data );
}
// Meta stuff.
if ( isset( $post_data['meta'] ) && $post_data['meta'] ) {
foreach ( $post_data['meta'] as $key => $value ) {
$meta = get_post_meta_by_id( $key );
if ( ! $meta ) {
continue;
}
if ( $meta->post_id != $post_ID ) {
continue;
}
if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $meta->meta_key ) ) {
continue;
}
if ( is_protected_meta( $value['key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $value['key'] ) ) {
continue;
}
update_meta( $key, $value['key'], $value['value'] );
}
}
if ( isset( $post_data['deletemeta'] ) && $post_data['deletemeta'] ) {
foreach ( $post_data['deletemeta'] as $key => $value ) {
$meta = get_post_meta_by_id( $key );
if ( ! $meta ) {
continue;
}
if ( $meta->post_id != $post_ID ) {
continue;
}
if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $post_ID, $meta->meta_key ) ) {
continue;
}
delete_meta( $key );
}
}
// Attachment stuff.
if ( 'attachment' === $post_data['post_type'] ) {
if ( isset( $post_data['_wp_attachment_image_alt'] ) ) {
$image_alt = wp_unslash( $post_data['_wp_attachment_image_alt'] );
if ( get_post_meta( $post_ID, '_wp_attachment_image_alt', true ) !== $image_alt ) {
$image_alt = wp_strip_all_tags( $image_alt, true );
// update_post_meta() expects slashed.
update_post_meta( $post_ID, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
}
}
$attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array();
/** This filter is documented in wp-admin/includes/media.php */
$translated = apply_filters( 'attachment_fields_to_save', $translated, $attachment_data );
}
// Convert taxonomy input to term IDs, to avoid ambiguity.
if ( isset( $post_data['tax_input'] ) ) {
foreach ( (array) $post_data['tax_input'] as $taxonomy => $terms ) {
$tax_object = get_taxonomy( $taxonomy );
if ( $tax_object && isset( $tax_object->meta_box_sanitize_cb ) ) {
$translated['tax_input'][ $taxonomy ] = call_user_func_array( $tax_object->meta_box_sanitize_cb, array( $taxonomy, $terms ) );
}
}
}
add_meta( $post_ID );
update_post_meta( $post_ID, '_edit_last', get_current_user_id() );
$success = wp_update_post( $translated );
// If the save failed, see if we can sanity check the main fields and try again.
if ( ! $success && is_callable( array( $wpdb, 'strip_invalid_text_for_column' ) ) ) {
$fields = array( 'post_title', 'post_content', 'post_excerpt' );
foreach ( $fields as $field ) {
if ( isset( $translated[ $field ] ) ) {
$translated[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $translated[ $field ] );
}
}
wp_update_post( $translated );
}
// Now that we have an ID we can fix any attachment anchor hrefs.
_fix_attachment_links( $post_ID );
wp_set_post_lock( $post_ID );
if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
if ( ! empty( $post_data['sticky'] ) ) {
stick_post( $post_ID );
} else {
unstick_post( $post_ID );
}
}
return $post_ID;
}
```
[apply\_filters( 'attachment\_fields\_to\_save', array $post, array $attachment )](../hooks/attachment_fields_to_save)
Filters the attachment fields to be saved.
| Uses | Description |
| --- | --- |
| [\_wp\_get\_allowed\_postdata()](_wp_get_allowed_postdata) wp-admin/includes/post.php | Returns only allowed post data fields. |
| [update\_post\_meta()](update_post_meta) wp-includes/post.php | Updates a post meta field based on the given post ID. |
| [unstick\_post()](unstick_post) wp-includes/post.php | Un-sticks a post. |
| [stick\_post()](stick_post) wp-includes/post.php | Makes a post sticky. |
| [wp\_update\_post()](wp_update_post) wp-includes/post.php | Updates a post with new post data. |
| [wp\_update\_attachment\_metadata()](wp_update_attachment_metadata) wp-includes/post.php | Updates metadata for an attachment. |
| [wp\_get\_attachment\_metadata()](wp_get_attachment_metadata) wp-includes/post.php | Retrieves attachment metadata for attachment ID. |
| [wp\_get\_attachment\_id3\_keys()](wp_get_attachment_id3_keys) wp-includes/media.php | Returns useful keys to use to lookup data from an attachment’s stored metadata. |
| [wpdb::strip\_invalid\_text\_for\_column()](../classes/wpdb/strip_invalid_text_for_column) wp-includes/class-wpdb.php | Strips any invalid characters from the string for a given table and column. |
| [wp\_filter\_post\_kses()](wp_filter_post_kses) wp-includes/kses.php | Sanitizes content for allowed HTML tags for post content. |
| [sanitize\_url()](sanitize_url) wp-includes/formatting.php | Sanitizes a URL for database or redirect usage. |
| [wp\_get\_post\_revisions()](wp_get_post_revisions) wp-includes/revision.php | Returns all revisions of specified post. |
| [wp\_strip\_all\_tags()](wp_strip_all_tags) wp-includes/formatting.php | Properly strips all HTML tags including script and style |
| [sanitize\_text\_field()](sanitize_text_field) wp-includes/formatting.php | Sanitizes a string from user input or from the database. |
| [\_wp\_get\_post\_revision\_version()](_wp_get_post_revision_version) wp-includes/revision.php | Gets the post revision version. |
| [\_wp\_upgrade\_revisions\_of\_post()](_wp_upgrade_revisions_of_post) wp-includes/revision.php | Upgrades the revisions author, adds the current post as a revision and sets the revisions version to 1. |
| [set\_post\_format()](set_post_format) wp-includes/post-formats.php | Assign a format to a post |
| [is\_protected\_meta()](is_protected_meta) wp-includes/meta.php | Determines whether a meta key is considered protected. |
| [\_wp\_translate\_postdata()](_wp_translate_postdata) wp-admin/includes/post.php | Renames `$_POST` data from form names to DB post columns. |
| [\_fix\_attachment\_links()](_fix_attachment_links) wp-admin/includes/post.php | Replaces hrefs of attachment anchors with up-to-date permalinks. |
| [add\_meta()](add_meta) wp-admin/includes/post.php | Adds post meta data defined in the `$_POST` superglobal for a post with given ID. |
| [delete\_meta()](delete_meta) wp-admin/includes/post.php | Deletes post meta data by meta ID. |
| [update\_meta()](update_meta) wp-admin/includes/post.php | Updates post meta data by meta ID. |
| [get\_post\_meta\_by\_id()](get_post_meta_by_id) wp-admin/includes/post.php | Returns post meta data by meta ID. |
| [wp\_set\_post\_lock()](wp_set_post_lock) wp-admin/includes/post.php | Marks the post as currently being edited by the current user. |
| [post\_type\_supports()](post_type_supports) wp-includes/post.php | Checks a post type’s support for a given feature. |
| [get\_post\_type\_object()](get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [get\_post\_meta()](get_post_meta) wp-includes/post.php | Retrieves a post meta field for the given post ID. |
| [get\_taxonomy()](get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [get\_current\_user\_id()](get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [sanitize\_key()](sanitize_key) wp-includes/formatting.php | Sanitizes a string key. |
| [wp\_unslash()](wp_unslash) wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| [wp\_slash()](wp_slash) wp-includes/formatting.php | Adds slashes to a string or recursively adds slashes to strings within an array. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Used By | Description |
| --- | --- |
| [post\_preview()](post_preview) wp-admin/includes/post.php | Saves a draft or manually autosaves for the purpose of showing a post preview. |
| [wp\_autosave()](wp_autosave) wp-admin/includes/post.php | Saves a post submitted with XHR. |
| [wp\_write\_post()](wp_write_post) wp-admin/includes/post.php | Creates a new post from the “Write Post” form using `$_POST` information. |
| [wp\_ajax\_wp\_fullscreen\_save\_post()](wp_ajax_wp_fullscreen_save_post) wp-admin/includes/ajax-actions.php | Ajax handler for saving posts from the fullscreen editor. |
| [wp\_ajax\_add\_meta()](wp_ajax_add_meta) wp-admin/includes/ajax-actions.php | Ajax handler for adding meta. |
| [wp\_ajax\_inline\_save()](wp_ajax_inline_save) wp-admin/includes/ajax-actions.php | Ajax handler for Quick Edit saving a post from a list table. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress media_upload_audio(): null|string media\_upload\_audio(): null|string
===================================
This function has been deprecated. Use [wp\_media\_upload\_handler()](wp_media_upload_handler) instead.
Handles uploading an audio file.
* [wp\_media\_upload\_handler()](wp_media_upload_handler)
null|string
File: `wp-admin/includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/deprecated.php/)
```
function media_upload_audio() {
_deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
return wp_media_upload_handler();
}
```
| Uses | Description |
| --- | --- |
| [wp\_media\_upload\_handler()](wp_media_upload_handler) wp-admin/includes/media.php | Handles the process of uploading media. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress get_post_comments_feed_link( int $post_id, string $feed = '' ): string get\_post\_comments\_feed\_link( int $post\_id, string $feed = '' ): string
===========================================================================
Retrieves the permalink for the post comments feed.
`$post_id` int Optional Post ID. Default is the ID of the global `$post`. `$feed` string Optional Feed type. Possible values include `'rss2'`, `'atom'`.
Default is the value of [get\_default\_feed()](get_default_feed) . Default: `''`
string The permalink for the comments feed for the given post on success, empty string on failure.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function get_post_comments_feed_link( $post_id = 0, $feed = '' ) {
$post_id = absint( $post_id );
if ( ! $post_id ) {
$post_id = get_the_ID();
}
if ( empty( $feed ) ) {
$feed = get_default_feed();
}
$post = get_post( $post_id );
// Bail out if the post does not exist.
if ( ! $post instanceof WP_Post ) {
return '';
}
$unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent;
if ( get_option( 'permalink_structure' ) ) {
if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post_id ) {
$url = _get_page_link( $post_id );
} else {
$url = get_permalink( $post_id );
}
if ( $unattached ) {
$url = home_url( '/feed/' );
if ( get_default_feed() !== $feed ) {
$url .= "$feed/";
}
$url = add_query_arg( 'attachment_id', $post_id, $url );
} else {
$url = trailingslashit( $url ) . 'feed';
if ( get_default_feed() != $feed ) {
$url .= "/$feed";
}
$url = user_trailingslashit( $url, 'single_feed' );
}
} else {
if ( $unattached ) {
$url = add_query_arg(
array(
'feed' => $feed,
'attachment_id' => $post_id,
),
home_url( '/' )
);
} elseif ( 'page' === $post->post_type ) {
$url = add_query_arg(
array(
'feed' => $feed,
'page_id' => $post_id,
),
home_url( '/' )
);
} else {
$url = add_query_arg(
array(
'feed' => $feed,
'p' => $post_id,
),
home_url( '/' )
);
}
}
/**
* Filters the post comments feed permalink.
*
* @since 1.5.1
*
* @param string $url Post comments feed permalink.
*/
return apply_filters( 'post_comments_feed_link', $url );
}
```
[apply\_filters( 'post\_comments\_feed\_link', string $url )](../hooks/post_comments_feed_link)
Filters the post comments feed permalink.
| Uses | Description |
| --- | --- |
| [user\_trailingslashit()](user_trailingslashit) wp-includes/link-template.php | Retrieves a trailing-slashed string if the site is set for adding trailing slashes. |
| [\_get\_page\_link()](_get_page_link) wp-includes/link-template.php | Retrieves the page permalink. |
| [get\_default\_feed()](get_default_feed) wp-includes/feed.php | Retrieves the default feed. |
| [get\_the\_ID()](get_the_id) wp-includes/post-template.php | Retrieves the ID of the current item in the WordPress Loop. |
| [trailingslashit()](trailingslashit) wp-includes/formatting.php | Appends a trailing slash. |
| [absint()](absint) wp-includes/functions.php | Converts a value to non-negative integer. |
| [add\_query\_arg()](add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [home\_url()](home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| [get\_permalink()](get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [feed\_links\_extra()](feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| [comments\_rss()](comments_rss) wp-includes/deprecated.php | Return link to the post RSS feed. |
| [post\_comments\_feed\_link()](post_comments_feed_link) wp-includes/link-template.php | Displays the comment feed link for a post. |
| [redirect\_canonical()](redirect_canonical) wp-includes/canonical.php | Redirects incoming links to the proper URL based on the site url. |
| [redirect\_guess\_404\_permalink()](redirect_guess_404_permalink) wp-includes/canonical.php | Attempts to guess the correct URL for a 404 request based on query vars. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress register_and_do_post_meta_boxes( WP_Post $post ) register\_and\_do\_post\_meta\_boxes( WP\_Post $post )
======================================================
Registers the default post meta boxes, and runs the `do_meta_boxes` actions.
`$post` [WP\_Post](../classes/wp_post) Required The post object that these meta boxes are being generated for. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
function register_and_do_post_meta_boxes( $post ) {
$post_type = $post->post_type;
$post_type_object = get_post_type_object( $post_type );
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
if ( wp_attachment_is( 'audio', $post ) ) {
$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
} elseif ( wp_attachment_is( 'video', $post ) ) {
$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
}
}
$publish_callback_args = array( '__back_compat_meta_box' => true );
if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' !== $post->post_status ) {
$revisions = wp_get_latest_revision_id_and_total_count( $post->ID );
// We should aim to show the revisions meta box only when there are revisions.
if ( ! is_wp_error( $revisions ) && $revisions['count'] > 1 ) {
$publish_callback_args = array(
'revisions_count' => $revisions['count'],
'revision_id' => $revisions['latest_id'],
'__back_compat_meta_box' => true,
);
add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
}
if ( 'attachment' === $post_type ) {
wp_enqueue_script( 'image-edit' );
wp_enqueue_style( 'imgareaselect' );
add_meta_box( 'submitdiv', __( 'Save' ), 'attachment_submit_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );
add_action( 'edit_form_after_title', 'edit_form_image_editor' );
if ( wp_attachment_is( 'audio', $post ) ) {
add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
} else {
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );
}
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) {
add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );
}
// All taxonomies.
foreach ( get_object_taxonomies( $post ) as $tax_name ) {
$taxonomy = get_taxonomy( $tax_name );
if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb ) {
continue;
}
$label = $taxonomy->labels->name;
if ( ! is_taxonomy_hierarchical( $tax_name ) ) {
$tax_meta_box_id = 'tagsdiv-' . $tax_name;
} else {
$tax_meta_box_id = $tax_name . 'div';
}
add_meta_box(
$tax_meta_box_id,
$label,
$taxonomy->meta_box_cb,
null,
'side',
'core',
array(
'taxonomy' => $tax_name,
'__back_compat_meta_box' => true,
)
);
}
if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) {
add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );
}
if ( $thumbnail_support && current_user_can( 'upload_files' ) ) {
add_meta_box( 'postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low', array( '__back_compat_meta_box' => true ) );
}
if ( post_type_supports( $post_type, 'excerpt' ) ) {
add_meta_box( 'postexcerpt', __( 'Excerpt' ), 'post_excerpt_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
if ( post_type_supports( $post_type, 'trackbacks' ) ) {
add_meta_box( 'trackbacksdiv', __( 'Send Trackbacks' ), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
if ( post_type_supports( $post_type, 'custom-fields' ) ) {
add_meta_box(
'postcustom',
__( 'Custom Fields' ),
'post_custom_meta_box',
null,
'normal',
'core',
array(
'__back_compat_meta_box' => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
'__block_editor_compatible_meta_box' => true,
)
);
}
/**
* Fires in the middle of built-in meta box registration.
*
* @since 2.1.0
* @deprecated 3.7.0 Use {@see 'add_meta_boxes'} instead.
*
* @param WP_Post $post Post object.
*/
do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' );
// Allow the Discussion meta box to show up if the post type supports comments,
// or if comments or pings are open.
if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
$stati = get_post_stati( array( 'public' => true ) );
if ( empty( $stati ) ) {
$stati = array( 'publish' );
}
$stati[] = 'private';
if ( in_array( get_post_status( $post ), $stati, true ) ) {
// If the post type support comments, or the post has comments,
// allow the Comments meta box.
if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
}
if ( ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
add_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
/**
* Fires after all built-in meta boxes have been added.
*
* @since 3.0.0
*
* @param string $post_type Post type.
* @param WP_Post $post Post object.
*/
do_action( 'add_meta_boxes', $post_type, $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`
*
* @since 3.0.0
*
* @param WP_Post $post Post object.
*/
do_action( "add_meta_boxes_{$post_type}", $post );
/**
* Fires after meta boxes have been added.
*
* Fires once for each of the default meta box contexts: normal, advanced, and side.
*
* @since 3.0.0
*
* @param string $post_type Post type of the post on Edit Post screen, 'link' on Edit Link screen,
* 'dashboard' on Dashboard screen.
* @param string $context Meta box context. Possible values include 'normal', 'advanced', 'side'.
* @param WP_Post|object|string $post Post object on Edit Post screen, link object on Edit Link screen,
* an empty string on Dashboard screen.
*/
do_action( 'do_meta_boxes', $post_type, 'normal', $post );
/** This action is documented in wp-admin/includes/meta-boxes.php */
do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
/** This action is documented in wp-admin/includes/meta-boxes.php */
do_action( 'do_meta_boxes', $post_type, 'side', $post );
}
```
[do\_action( 'add\_meta\_boxes', string $post\_type, WP\_Post $post )](../hooks/add_meta_boxes)
Fires after all built-in meta boxes have been added.
[do\_action( "add\_meta\_boxes\_{$post\_type}", WP\_Post $post )](../hooks/add_meta_boxes_post_type)
Fires after all built-in meta boxes have been added, contextually for the given post type.
[do\_action\_deprecated( 'dbx\_post\_advanced', WP\_Post $post )](../hooks/dbx_post_advanced)
Fires in the middle of built-in meta box registration.
[do\_action( 'do\_meta\_boxes', string $post\_type, string $context, WP\_Post|object|string $post )](../hooks/do_meta_boxes)
Fires after meta boxes have been added.
| Uses | Description |
| --- | --- |
| [wp\_get\_latest\_revision\_id\_and\_total\_count()](wp_get_latest_revision_id_and_total_count) wp-includes/revision.php | Returns the latest revision ID and count of revisions for a post. |
| [get\_object\_taxonomies()](get_object_taxonomies) wp-includes/taxonomy.php | Returns the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name. |
| [pings\_open()](pings_open) wp-includes/comment-template.php | Determines whether the current post is open for pings. |
| [comments\_open()](comments_open) wp-includes/comment-template.php | Determines whether the current post is open for comments. |
| [get\_post\_status()](get_post_status) wp-includes/post.php | Retrieves the post status based on the post ID. |
| [get\_post\_stati()](get_post_stati) wp-includes/post.php | Gets a list of post statuses. |
| [post\_type\_supports()](post_type_supports) wp-includes/post.php | Checks a post type’s support for a given feature. |
| [get\_user\_meta()](get_user_meta) wp-includes/user.php | Retrieves user meta field for a user. |
| [wp\_enqueue\_style()](wp_enqueue_style) wp-includes/functions.wp-styles.php | Enqueue a CSS stylesheet. |
| [do\_action\_deprecated()](do_action_deprecated) wp-includes/plugin.php | Fires functions attached to a deprecated action hook. |
| [is\_taxonomy\_hierarchical()](is_taxonomy_hierarchical) wp-includes/taxonomy.php | Determines whether the taxonomy object is hierarchical. |
| [wp\_enqueue\_script()](wp_enqueue_script) wp-includes/functions.wp-scripts.php | Enqueue a script. |
| [add\_meta\_box()](add_meta_box) wp-admin/includes/template.php | Adds a meta box to one or more screens. |
| [get\_page\_templates()](get_page_templates) wp-admin/includes/theme.php | Gets the page templates available in this theme. |
| [wp\_attachment\_is()](wp_attachment_is) wp-includes/post.php | Verifies an attachment is of a given type. |
| [get\_taxonomy()](get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [esc\_html()](esc_html) wp-includes/formatting.php | Escaping for HTML blocks. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [add\_action()](add_action) wp-includes/plugin.php | Adds a callback function to an action hook. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_current\_user\_id()](get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| [current\_theme\_supports()](current_theme_supports) wp-includes/theme.php | Checks a theme’s support for a given feature. |
| [get\_post\_type\_object()](get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
| programming_docs |
wordpress post_comment_meta_box( WP_Post $post ) post\_comment\_meta\_box( WP\_Post $post )
==========================================
Displays comments for post.
`$post` [WP\_Post](../classes/wp_post) Required Current post object. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
function post_comment_meta_box( $post ) {
wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
?>
<p class="hide-if-no-js" id="add-new-comment"><button type="button" class="button" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);"><?php _e( 'Add Comment' ); ?></button></p>
<?php
$total = get_comments(
array(
'post_id' => $post->ID,
'number' => 1,
'count' => true,
)
);
$wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );
$wp_list_table->display( true );
if ( 1 > $total ) {
echo '<p id="no-comments">' . __( 'No comments yet.' ) . '</p>';
} else {
$hidden = get_hidden_meta_boxes( get_current_screen() );
if ( ! in_array( 'commentsdiv', $hidden, true ) ) {
?>
<script type="text/javascript">jQuery(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
<?php
}
?>
<p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e( 'Show comments' ); ?></a> <span class="spinner"></span></p>
<?php
}
wp_comment_trashnotice();
}
```
| Uses | Description |
| --- | --- |
| [get\_current\_screen()](get_current_screen) wp-admin/includes/screen.php | Get the current screen object |
| [get\_hidden\_meta\_boxes()](get_hidden_meta_boxes) wp-admin/includes/screen.php | Gets an array of IDs of hidden meta boxes. |
| [WP\_List\_Table::display()](../classes/wp_list_table/display) wp-admin/includes/class-wp-list-table.php | Displays the table. |
| [\_get\_list\_table()](_get_list_table) wp-admin/includes/list-table.php | Fetches an instance of a [WP\_List\_Table](../classes/wp_list_table) class. |
| [wp\_comment\_trashnotice()](wp_comment_trashnotice) wp-admin/includes/template.php | Outputs ‘undo move to Trash’ text for comments. |
| [wp\_nonce\_field()](wp_nonce_field) wp-includes/functions.php | Retrieves or display nonce hidden field for forms. |
| [get\_comments()](get_comments) wp-includes/comment.php | Retrieves a list of comments. |
| [\_e()](_e) wp-includes/l10n.php | Displays translated text. |
| [\_\_()](__) 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_plugin_update_rows() wp\_plugin\_update\_rows()
==========================
Adds a callback to display update information for plugins with updates available.
File: `wp-admin/includes/update.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update.php/)
```
function wp_plugin_update_rows() {
if ( ! current_user_can( 'update_plugins' ) ) {
return;
}
$plugins = get_site_transient( 'update_plugins' );
if ( isset( $plugins->response ) && is_array( $plugins->response ) ) {
$plugins = array_keys( $plugins->response );
foreach ( $plugins as $plugin_file ) {
add_action( "after_plugin_row_{$plugin_file}", 'wp_plugin_update_row', 10, 2 );
}
}
}
```
| Uses | Description |
| --- | --- |
| [get\_site\_transient()](get_site_transient) wp-includes/option.php | Retrieves the value of a site transient. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [add\_action()](add_action) wp-includes/plugin.php | Adds a callback function to an action hook. |
| Used By | Description |
| --- | --- |
| [wp\_ajax\_search\_plugins()](wp_ajax_search_plugins) wp-admin/includes/ajax-actions.php | Ajax handler for searching plugins. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress register_theme_directory( string $directory ): bool register\_theme\_directory( string $directory ): bool
=====================================================
Registers a directory that contains themes.
`$directory` string Required Either the full filesystem path to a theme folder or a folder within WP\_CONTENT\_DIR. bool True if successfully registered a directory that contains themes, false if the directory does not exist.
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
function register_theme_directory( $directory ) {
global $wp_theme_directories;
if ( ! file_exists( $directory ) ) {
// Try prepending as the theme directory could be relative to the content directory.
$directory = WP_CONTENT_DIR . '/' . $directory;
// If this directory does not exist, return and do not register.
if ( ! file_exists( $directory ) ) {
return false;
}
}
if ( ! is_array( $wp_theme_directories ) ) {
$wp_theme_directories = array();
}
$untrailed = untrailingslashit( $directory );
if ( ! empty( $untrailed ) && ! in_array( $untrailed, $wp_theme_directories, true ) ) {
$wp_theme_directories[] = $untrailed;
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [untrailingslashit()](untrailingslashit) wp-includes/formatting.php | Removes trailing forward slashes and backslashes if they exist. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress wp_password_change_notification( WP_User $user ) wp\_password\_change\_notification( WP\_User $user )
====================================================
Notifies the blog admin of a user changing password, normally via email.
`$user` [WP\_User](../classes/wp_user) Required User object. * This function is normally called when a user resets a lost password, not if the password is changed on their profile page.
* This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
function wp_password_change_notification( $user ) {
// Send a copy of password change notification to the admin,
// but check to see if it's the admin whose password we're changing, and skip this.
if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
/* translators: %s: User name. */
$message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n";
// The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
// We want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
$wp_password_change_notification_email = array(
'to' => get_option( 'admin_email' ),
/* translators: Password change notification email subject. %s: Site title. */
'subject' => __( '[%s] Password Changed' ),
'message' => $message,
'headers' => '',
);
/**
* Filters the contents of the password change notification email sent to the site admin.
*
* @since 4.9.0
*
* @param array $wp_password_change_notification_email {
* Used to build wp_mail().
*
* @type string $to The intended recipient - site admin email address.
* @type string $subject The subject of the email.
* @type string $message The body of the email.
* @type string $headers The headers of the email.
* }
* @param WP_User $user User object for user whose password was changed.
* @param string $blogname The site title.
*/
$wp_password_change_notification_email = apply_filters( 'wp_password_change_notification_email', $wp_password_change_notification_email, $user, $blogname );
wp_mail(
$wp_password_change_notification_email['to'],
wp_specialchars_decode( sprintf( $wp_password_change_notification_email['subject'], $blogname ) ),
$wp_password_change_notification_email['message'],
$wp_password_change_notification_email['headers']
);
}
}
```
[apply\_filters( 'wp\_password\_change\_notification\_email', array $wp\_password\_change\_notification\_email, WP\_User $user, string $blogname )](../hooks/wp_password_change_notification_email)
Filters the contents of the password change notification email sent to the site admin.
| Uses | Description |
| --- | --- |
| [wp\_mail()](wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| [wp\_specialchars\_decode()](wp_specialchars_decode) wp-includes/formatting.php | Converts a number of HTML entities into their special characters. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress wp_get_image_mime( string $file ): string|false wp\_get\_image\_mime( string $file ): string|false
==================================================
Returns the real mime type of an image file.
This depends on exif\_imagetype() or getimagesize() to determine real mime types.
`$file` string Required Full path to the file. 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/)
```
function wp_get_image_mime( $file ) {
/*
* Use exif_imagetype() to check the mimetype if available or fall back to
* getimagesize() if exif isn't available. If either function throws an Exception
* we assume the file could not be validated.
*/
try {
if ( is_callable( 'exif_imagetype' ) ) {
$imagetype = exif_imagetype( $file );
$mime = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false;
} elseif ( function_exists( 'getimagesize' ) ) {
// Don't silence errors when in debug mode, unless running unit tests.
if ( defined( 'WP_DEBUG' ) && WP_DEBUG
&& ! defined( 'WP_RUN_CORE_TESTS' )
) {
// Not using wp_getimagesize() here to avoid an infinite loop.
$imagesize = getimagesize( $file );
} else {
// phpcs:ignore WordPress.PHP.NoSilencedErrors
$imagesize = @getimagesize( $file );
}
$mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
} else {
$mime = false;
}
if ( false !== $mime ) {
return $mime;
}
$magic = file_get_contents( $file, false, null, 0, 12 );
if ( false === $magic ) {
return false;
}
/*
* Add WebP fallback detection when image library doesn't support WebP.
* Note: detection values come from LibWebP, see
* https://github.com/webmproject/libwebp/blob/master/imageio/image_dec.c#L30
*/
$magic = bin2hex( $magic );
if (
// RIFF.
( 0 === strpos( $magic, '52494646' ) ) &&
// WEBP.
( 16 === strpos( $magic, '57454250' ) )
) {
$mime = 'image/webp';
}
} catch ( Exception $e ) {
$mime = false;
}
return $mime;
}
```
| Used By | Description |
| --- | --- |
| [wp\_get\_webp\_info()](wp_get_webp_info) wp-includes/media.php | Extracts meta information about a WebP file: width, height, and type. |
| [wp\_getimagesize()](wp_getimagesize) wp-includes/media.php | Allows PHP’s getimagesize() to be debuggable when necessary. |
| [wp\_check\_filetype\_and\_ext()](wp_check_filetype_and_ext) wp-includes/functions.php | Attempts to determine the real file type of a file. |
| [WP\_Image\_Editor\_GD::load()](../classes/wp_image_editor_gd/load) wp-includes/class-wp-image-editor-gd.php | Loads image from $this->file into new GD Resource. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Added support for WebP images. |
| [4.7.1](https://developer.wordpress.org/reference/since/4.7.1/) | Introduced. |
wordpress wp_init_targeted_link_rel_filters() wp\_init\_targeted\_link\_rel\_filters()
========================================
Adds all filters modifying the rel attribute of targeted links.
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
function wp_init_targeted_link_rel_filters() {
$filters = array(
'title_save_pre',
'content_save_pre',
'excerpt_save_pre',
'content_filtered_save_pre',
'pre_comment_content',
'pre_term_description',
'pre_link_description',
'pre_link_notes',
'pre_user_description',
);
foreach ( $filters as $filter ) {
add_filter( $filter, 'wp_targeted_link_rel' );
}
}
```
| Uses | Description |
| --- | --- |
| [add\_filter()](add_filter) wp-includes/plugin.php | Adds a callback function to a filter hook. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress wp_trusted_keys(): string[] wp\_trusted\_keys(): string[]
=============================
Retrieves the list of signing keys trusted by WordPress.
string[] Array of base64-encoded signing keys.
File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
function wp_trusted_keys() {
$trusted_keys = array();
if ( time() < 1617235200 ) {
// WordPress.org Key #1 - This key is only valid before April 1st, 2021.
$trusted_keys[] = 'fRPyrxb/MvVLbdsYi+OOEv4xc+Eqpsj+kkAS6gNOkI0=';
}
// TODO: Add key #2 with longer expiration.
/**
* Filters the valid signing keys used to verify the contents of files.
*
* @since 5.2.0
*
* @param string[] $trusted_keys The trusted keys that may sign packages.
*/
return apply_filters( 'wp_trusted_keys', $trusted_keys );
}
```
[apply\_filters( 'wp\_trusted\_keys', string[] $trusted\_keys )](../hooks/wp_trusted_keys)
Filters the valid signing keys used to verify the contents of files.
| Uses | Description |
| --- | --- |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [verify\_file\_signature()](verify_file_signature) wp-admin/includes/file.php | Verifies the contents of a file against its ED25519 signature. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress get_current_blog_id(): int get\_current\_blog\_id(): int
=============================
Retrieve the current site ID.
int Site ID.
File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
function get_current_blog_id() {
global $blog_id;
return absint( $blog_id );
}
```
| Uses | Description |
| --- | --- |
| [absint()](absint) wp-includes/functions.php | Converts a value to non-negative integer. |
| Used By | Description |
| --- | --- |
| [wp\_initialize\_site()](wp_initialize_site) wp-includes/ms-site.php | Runs the initialization routine for a given site. |
| [wp\_uninitialize\_site()](wp_uninitialize_site) wp-includes/ms-site.php | Runs the uninitialization routine for a given site. |
| [wp\_is\_site\_initialized()](wp_is_site_initialized) wp-includes/ms-site.php | Checks whether a site is initialized. |
| [get\_oembed\_response\_data\_for\_url()](get_oembed_response_data_for_url) wp-includes/embed.php | Retrieves the oEmbed response data for a given URL. |
| [WP\_User::for\_site()](../classes/wp_user/for_site) wp-includes/class-wp-user.php | Sets the site to operate on. Defaults to the current site. |
| [WP\_Roles::get\_roles\_data()](../classes/wp_roles/get_roles_data) wp-includes/class-wp-roles.php | Gets the available roles data. |
| [WP\_Roles::for\_site()](../classes/wp_roles/for_site) wp-includes/class-wp-roles.php | Sets the site to operate on. Defaults to the current site. |
| [get\_main\_site\_id()](get_main_site_id) wp-includes/functions.php | Gets the main site ID. |
| [clean\_site\_details\_cache()](clean_site_details_cache) wp-includes/ms-blogs.php | Cleans the site details cache for a site. |
| [get\_site()](get_site) wp-includes/ms-site.php | Retrieves site data given a site ID or site object. |
| [has\_custom\_logo()](has_custom_logo) wp-includes/general-template.php | Determines whether the site has a custom logo. |
| [get\_custom\_logo()](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. |
| [\_wp\_upload\_dir()](_wp_upload_dir) wp-includes/functions.php | A non-filtered, non-cached version of [wp\_upload\_dir()](wp_upload_dir) that doesn’t check the path. |
| [wp\_get\_users\_with\_no\_role()](wp_get_users_with_no_role) wp-includes/user.php | Gets the user IDs of all users with no role on this site. |
| [WP\_User\_Query::fill\_query\_vars()](../classes/wp_user_query/fill_query_vars) wp-includes/class-wp-user-query.php | Fills in missing query variables with default values. |
| [WP\_Customize\_Nav\_Menu\_Setting::filter\_nav\_menu\_options()](../classes/wp_customize_nav_menu_setting/filter_nav_menu_options) wp-includes/customize/class-wp-customize-nav-menu-setting.php | Filters the nav\_menu\_options option to include this menu’s auto\_add preference. |
| [WP\_Customize\_Nav\_Menu\_Setting::value()](../classes/wp_customize_nav_menu_setting/value) wp-includes/customize/class-wp-customize-nav-menu-setting.php | Get the instance data for a given widget setting. |
| [WP\_Customize\_Nav\_Menu\_Setting::preview()](../classes/wp_customize_nav_menu_setting/preview) wp-includes/customize/class-wp-customize-nav-menu-setting.php | Handle previewing the setting. |
| [WP\_Customize\_Nav\_Menu\_Setting::filter\_wp\_get\_nav\_menus()](../classes/wp_customize_nav_menu_setting/filter_wp_get_nav_menus) wp-includes/customize/class-wp-customize-nav-menu-setting.php | Filters the [wp\_get\_nav\_menus()](wp_get_nav_menus) result to ensure the inserted menu object is included, and the deleted one is removed. |
| [WP\_Customize\_Nav\_Menu\_Setting::filter\_wp\_get\_nav\_menu\_object()](../classes/wp_customize_nav_menu_setting/filter_wp_get_nav_menu_object) wp-includes/customize/class-wp-customize-nav-menu-setting.php | Filters the [wp\_get\_nav\_menu\_object()](wp_get_nav_menu_object) result to supply the previewed menu object. |
| [WP\_Customize\_Nav\_Menu\_Item\_Setting::value()](../classes/wp_customize_nav_menu_item_setting/value) wp-includes/customize/class-wp-customize-nav-menu-item-setting.php | Get the instance data for a given nav\_menu\_item setting. |
| [WP\_Customize\_Nav\_Menu\_Item\_Setting::preview()](../classes/wp_customize_nav_menu_item_setting/preview) wp-includes/customize/class-wp-customize-nav-menu-item-setting.php | Handle previewing the setting. |
| [get\_site\_icon\_url()](get_site_icon_url) wp-includes/general-template.php | Returns the Site Icon URL. |
| [WP\_Customize\_Setting::is\_current\_blog\_previewed()](../classes/wp_customize_setting/is_current_blog_previewed) wp-includes/class-wp-customize-setting.php | Return true if the current site is not the same as the previewed site. |
| [\_access\_denied\_splash()](_access_denied_splash) wp-admin/includes/ms.php | Displays an access denied message when a user tries to view a site’s dashboard they do not have access to. |
| [wpmu\_delete\_blog()](wpmu_delete_blog) wp-admin/includes/ms.php | Delete a site. |
| [wp\_dashboard\_quick\_press()](wp_dashboard_quick_press) wp-admin/includes/dashboard.php | The Quick Draft widget display and creation of drafts. |
| [wp\_upgrade()](wp_upgrade) wp-admin/includes/upgrade.php | Runs WordPress Upgrade functions. |
| [wp\_delete\_user()](wp_delete_user) wp-admin/includes/user.php | Remove user and optionally reassign posts and links to another user. |
| [WP\_Themes\_List\_Table::no\_items()](../classes/wp_themes_list_table/no_items) wp-admin/includes/class-wp-themes-list-table.php | |
| [wp\_ajax\_autocomplete\_user()](wp_ajax_autocomplete_user) wp-admin/includes/ajax-actions.php | Ajax handler for user autocomplete. |
| [WP\_User::get\_role\_caps()](../classes/wp_user/get_role_caps) wp-includes/class-wp-user.php | Retrieves all of the capabilities of the user’s roles, and merges them with individual user capabilities. |
| [WP\_Object\_Cache::\_\_construct()](../classes/wp_object_cache/__construct) wp-includes/class-wp-object-cache.php | Sets up object properties; PHP 5 style constructor. |
| [get\_users\_of\_blog()](get_users_of_blog) wp-includes/deprecated.php | Get users for the site. |
| [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. |
| [wp\_start\_object\_cache()](wp_start_object_cache) wp-includes/load.php | Start the WordPress object cache. |
| [is\_main\_site()](is_main_site) wp-includes/functions.php | Determines whether a site is the main site of the current network. |
| [wp\_upload\_dir()](wp_upload_dir) wp-includes/functions.php | Returns an array containing the current upload directory’s path and URL. |
| [get\_dashboard\_url()](get_dashboard_url) wp-includes/link-template.php | Retrieves the URL to the user’s dashboard. |
| [WP\_Admin\_Bar::initialize()](../classes/wp_admin_bar/initialize) wp-includes/class-wp-admin-bar.php | Initializes the admin bar. |
| [wp\_admin\_bar\_site\_menu()](wp_admin_bar_site_menu) wp-includes/admin-bar.php | Adds the “Site Name” menu. |
| [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. |
| [get\_blogs\_of\_user()](get_blogs_of_user) wp-includes/user.php | Gets the sites a user belongs to. |
| [is\_user\_member\_of\_blog()](is_user_member_of_blog) wp-includes/user.php | Finds out whether a user is a member of a given blog. |
| [count\_users()](count_users) wp-includes/user.php | Counts number of users who have each of the user roles. |
| [wp\_dropdown\_users()](wp_dropdown_users) wp-includes/user.php | Creates dropdown HTML content of users. |
| [is\_user\_option\_local()](is_user_option_local) wp-includes/ms-deprecated.php | Check whether a usermeta key has to do with the current blog. |
| [add\_existing\_user\_to\_blog()](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()](maybe_add_existing_user_to_blog) . |
| [update\_blog\_public()](update_blog_public) wp-includes/ms-functions.php | Updates this blog’s ‘public’ setting in the global blogs table. |
| [get\_active\_blog\_for\_user()](get_active_blog_for_user) wp-includes/ms-functions.php | Gets one of a user’s active blogs. |
| [switch\_to\_blog()](switch_to_blog) wp-includes/ms-blogs.php | Switch the current blog. |
| [restore\_current\_blog()](restore_current_blog) wp-includes/ms-blogs.php | Restore the current blog, after calling [switch\_to\_blog()](switch_to_blog) . |
| [refresh\_blog\_details()](refresh_blog_details) wp-includes/ms-blogs.php | Clear the blog details cache. |
| [get\_blog\_option()](get_blog_option) wp-includes/ms-blogs.php | Retrieve option value for a given blog id based on name of option. |
| [add\_blog\_option()](add_blog_option) wp-includes/ms-blogs.php | Add a new option for a given blog ID. |
| [delete\_blog\_option()](delete_blog_option) wp-includes/ms-blogs.php | Removes option by name for a given blog ID. Prevents removal of protected WordPress options. |
| [update\_blog\_option()](update_blog_option) wp-includes/ms-blogs.php | Update an option for a particular blog. |
| [wpmu\_update\_blogs\_date()](wpmu_update_blogs_date) wp-includes/ms-blogs.php | Update the last\_updated field for the current site. |
| [get\_blog\_details()](get_blog_details) wp-includes/ms-blogs.php | Retrieve the details for a blog from the blogs table and blog options. |
| [ms\_upload\_constants()](ms_upload_constants) wp-includes/ms-default-constants.php | Defines Multisite upload constants. |
| [wp\_just\_in\_time\_script\_localization()](wp_just_in_time_script_localization) wp-includes/script-loader.php | Loads localized data on print rather than initialization. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
| programming_docs |
wordpress check_theme_switched() check\_theme\_switched()
========================
Checks if a theme has been changed and runs ‘after\_switch\_theme’ hook on the next WP load.
See [‘after\_switch\_theme’](../hooks/after_switch_theme).
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
function check_theme_switched() {
$stylesheet = get_option( 'theme_switched' );
if ( $stylesheet ) {
$old_theme = wp_get_theme( $stylesheet );
// Prevent widget & menu mapping from running since Customizer already called it up front.
if ( get_option( 'theme_switched_via_customizer' ) ) {
remove_action( 'after_switch_theme', '_wp_menus_changed' );
remove_action( 'after_switch_theme', '_wp_sidebars_changed' );
update_option( 'theme_switched_via_customizer', false );
}
if ( $old_theme->exists() ) {
/**
* 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.
*
* @since 3.3.0
*
* @param string $old_name Old theme name.
* @param WP_Theme $old_theme WP_Theme instance of the old theme.
*/
do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme );
} else {
/** This action is documented in wp-includes/theme.php */
do_action( 'after_switch_theme', $stylesheet, $old_theme );
}
flush_rewrite_rules();
update_option( 'theme_switched', false );
}
}
```
[do\_action( 'after\_switch\_theme', string $old\_name, WP\_Theme $old\_theme )](../hooks/after_switch_theme)
Fires on the first WP load after a theme switch if the old theme still exists.
| Uses | Description |
| --- | --- |
| [remove\_action()](remove_action) wp-includes/plugin.php | Removes a callback function from an action hook. |
| [flush\_rewrite\_rules()](flush_rewrite_rules) wp-includes/rewrite.php | Removes rewrite rules and then recreate rewrite rules. |
| [wp\_get\_theme()](wp_get_theme) wp-includes/theme.php | Gets a [WP\_Theme](../classes/wp_theme) object for a theme. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [update\_option()](update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress wp_get_users_with_no_role( int|null $site_id = null ): string[] wp\_get\_users\_with\_no\_role( int|null $site\_id = null ): string[]
=====================================================================
Gets the user IDs of all users with no role on this site.
`$site_id` int|null Optional The site ID to get users with no role for. Defaults to the current site. Default: `null`
string[] Array of user IDs as strings.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
function wp_get_users_with_no_role( $site_id = null ) {
global $wpdb;
if ( ! $site_id ) {
$site_id = get_current_blog_id();
}
$prefix = $wpdb->get_blog_prefix( $site_id );
if ( is_multisite() && get_current_blog_id() != $site_id ) {
switch_to_blog( $site_id );
$role_names = wp_roles()->get_names();
restore_current_blog();
} else {
$role_names = wp_roles()->get_names();
}
$regex = implode( '|', array_keys( $role_names ) );
$regex = preg_replace( '/[^a-zA-Z_\|-]/', '', $regex );
$users = $wpdb->get_col(
$wpdb->prepare(
"
SELECT user_id
FROM $wpdb->usermeta
WHERE meta_key = '{$prefix}capabilities'
AND meta_value NOT REGEXP %s
",
$regex
)
);
return $users;
}
```
| Uses | Description |
| --- | --- |
| [wp\_roles()](wp_roles) wp-includes/capabilities.php | Retrieves the global [WP\_Roles](../classes/wp_roles) instance and instantiates it if necessary. |
| [WP\_Roles::get\_names()](../classes/wp_roles/get_names) wp-includes/class-wp-roles.php | Retrieves a list of role names. |
| [switch\_to\_blog()](switch_to_blog) wp-includes/ms-blogs.php | Switch the current blog. |
| [restore\_current\_blog()](restore_current_blog) wp-includes/ms-blogs.php | Restore the current blog, after calling [switch\_to\_blog()](switch_to_blog) . |
| [wpdb::get\_col()](../classes/wpdb/get_col) wp-includes/class-wpdb.php | Retrieves one column from the database. |
| [wpdb::get\_blog\_prefix()](../classes/wpdb/get_blog_prefix) wp-includes/class-wpdb.php | Gets blog prefix. |
| [get\_current\_blog\_id()](get_current_blog_id) wp-includes/load.php | Retrieve the current site ID. |
| [is\_multisite()](is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [wpdb::prepare()](../classes/wpdb/prepare) wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
| Used By | Description |
| --- | --- |
| [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.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | The `$site_id` parameter was added to support multisite. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress comment_reply_link( array $args = array(), int|WP_Comment $comment = null, int|WP_Post $post = null ) comment\_reply\_link( array $args = array(), int|WP\_Comment $comment = null, int|WP\_Post $post = null )
=========================================================================================================
Displays the HTML content for reply to comment link.
* [get\_comment\_reply\_link()](get_comment_reply_link)
`$args` array Optional Override default options. Default: `array()`
`$comment` int|[WP\_Comment](../classes/wp_comment) Optional Comment being replied to. Default current comment. Default: `null`
`$post` int|[WP\_Post](../classes/wp_post) Optional Post ID or [WP\_Post](../classes/wp_post) object the comment is going to be displayed on.
Default current post. Default: `null`
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
function comment_reply_link( $args = array(), $comment = null, $post = null ) {
echo get_comment_reply_link( $args, $comment, $post );
}
```
| Uses | Description |
| --- | --- |
| [get\_comment\_reply\_link()](get_comment_reply_link) wp-includes/comment-template.php | Retrieves HTML content for reply to comment link. |
| Used By | Description |
| --- | --- |
| [Walker\_Comment::comment()](../classes/walker_comment/comment) wp-includes/class-walker-comment.php | Outputs a single comment. |
| [Walker\_Comment::html5\_comment()](../classes/walker_comment/html5_comment) wp-includes/class-walker-comment.php | Outputs a comment in the HTML5 format. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress is_comment_feed(): bool is\_comment\_feed(): bool
=========================
Is the query for a comments feed?
bool Whether the query is for a comments feed.
File: `wp-includes/query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/query.php/)
```
function is_comment_feed() {
global $wp_query;
if ( ! isset( $wp_query ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
return false;
}
return $wp_query->is_comment_feed();
}
```
| Uses | Description |
| --- | --- |
| [WP\_Query::is\_comment\_feed()](../classes/wp_query/is_comment_feed) wp-includes/class-wp-query.php | Is the query for a comments feed? |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| Used By | Description |
| --- | --- |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [get\_comment\_text()](get_comment_text) wp-includes/comment-template.php | Retrieves the text of the current comment. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress register_column_headers( string $screen, string[] $columns ) register\_column\_headers( string $screen, string[] $columns )
==============================================================
Register column headers for a particular screen.
* [get\_column\_headers()](get_column_headers) ,: [print\_column\_headers()](print_column_headers) , [get\_hidden\_columns()](get_hidden_columns)
`$screen` string Required The handle for the screen to register column headers for. This is usually the hook name returned by the `add_*_page()` functions. `$columns` string[] Required An array of columns with column IDs as the keys and translated column names as the values. File: `wp-admin/includes/list-table.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/list-table.php/)
```
function register_column_headers( $screen, $columns ) {
new _WP_List_Table_Compat( $screen, $columns );
}
```
| Uses | Description |
| --- | --- |
| [\_WP\_List\_Table\_Compat::\_\_construct()](../classes/_wp_list_table_compat/__construct) wp-admin/includes/class-wp-list-table-compat.php | Constructor. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress add_comment_meta( int $comment_id, string $meta_key, mixed $meta_value, bool $unique = false ): int|false add\_comment\_meta( int $comment\_id, string $meta\_key, mixed $meta\_value, bool $unique = false ): int|false
==============================================================================================================
Adds meta data field to a comment.
`$comment_id` int Required Comment ID. `$meta_key` string Required Metadata name. `$meta_value` mixed Required Metadata value. Must be serializable if non-scalar. `$unique` bool Optional Whether the same key should not be added.
Default: `false`
int|false Meta ID on success, false on failure.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false ) {
return add_metadata( 'comment', $comment_id, $meta_key, $meta_value, $unique );
}
```
| Uses | Description |
| --- | --- |
| [add\_metadata()](add_metadata) wp-includes/meta.php | Adds metadata for the specified object. |
| Used By | Description |
| --- | --- |
| [wp\_spam\_comment()](wp_spam_comment) wp-includes/comment.php | Marks a comment as Spam. |
| [wp\_insert\_comment()](wp_insert_comment) wp-includes/comment.php | Inserts a comment into the database. |
| [wp\_trash\_comment()](wp_trash_comment) wp-includes/comment.php | Moves a comment to the Trash |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress filter_default_metadata( mixed $value, int $object_id, string $meta_key, bool $single, string $meta_type ): mixed filter\_default\_metadata( mixed $value, int $object\_id, string $meta\_key, bool $single, string $meta\_type ): mixed
======================================================================================================================
Filters into default\_{$object\_type}\_metadata and adds in default value.
`$value` mixed Required Current value passed to filter. `$object_id` int Required ID of the object metadata is for. `$meta_key` string Required Metadata key. `$single` bool Required If true, return only the first value of the specified `$meta_key`.
This parameter has no effect if `$meta_key` is not specified. `$meta_type` string Required Type of object metadata is for. Accepts `'post'`, `'comment'`, `'term'`, `'user'`, or any other object type with an associated meta table. mixed An array of default values if `$single` is false.
The default value of the meta field if `$single` is true.
File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
function filter_default_metadata( $value, $object_id, $meta_key, $single, $meta_type ) {
global $wp_meta_keys;
if ( wp_installing() ) {
return $value;
}
if ( ! is_array( $wp_meta_keys ) || ! isset( $wp_meta_keys[ $meta_type ] ) ) {
return $value;
}
$defaults = array();
foreach ( $wp_meta_keys[ $meta_type ] as $sub_type => $meta_data ) {
foreach ( $meta_data as $_meta_key => $args ) {
if ( $_meta_key === $meta_key && array_key_exists( 'default', $args ) ) {
$defaults[ $sub_type ] = $args;
}
}
}
if ( ! $defaults ) {
return $value;
}
// If this meta type does not have subtypes, then the default is keyed as an empty string.
if ( isset( $defaults[''] ) ) {
$metadata = $defaults[''];
} else {
$sub_type = get_object_subtype( $meta_type, $object_id );
if ( ! isset( $defaults[ $sub_type ] ) ) {
return $value;
}
$metadata = $defaults[ $sub_type ];
}
if ( $single ) {
$value = $metadata['default'];
} else {
$value = array( $metadata['default'] );
}
return $value;
}
```
| Uses | Description |
| --- | --- |
| [get\_object\_subtype()](get_object_subtype) wp-includes/meta.php | Returns the object subtype for a given object ID of a specific type. |
| [wp\_installing()](wp_installing) wp-includes/load.php | Check or set whether WordPress is in “installation” mode. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress get_next_posts_page_link( int $max_page ): string|void get\_next\_posts\_page\_link( int $max\_page ): string|void
===========================================================
Retrieves the next posts page link.
Backported from 2.1.3 to 2.0.10.
`$max_page` int Optional Max pages. Default 0. string|void The link URL for next posts page.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function get_next_posts_page_link( $max_page = 0 ) {
global $paged;
if ( ! is_single() ) {
if ( ! $paged ) {
$paged = 1;
}
$nextpage = (int) $paged + 1;
if ( ! $max_page || $max_page >= $nextpage ) {
return get_pagenum_link( $nextpage );
}
}
}
```
| Uses | Description |
| --- | --- |
| [is\_single()](is_single) wp-includes/query.php | Determines whether the query is for an existing single post. |
| [get\_pagenum\_link()](get_pagenum_link) wp-includes/link-template.php | Retrieves the link for a page number. |
| Used By | Description |
| --- | --- |
| [next\_posts()](next_posts) wp-includes/link-template.php | Displays or retrieves the next posts page link. |
| Version | Description |
| --- | --- |
| [2.0.10](https://developer.wordpress.org/reference/since/2.0.10/) | Introduced. |
wordpress link_target_meta_box( object $link ) link\_target\_meta\_box( object $link )
=======================================
Displays form fields for changing link target.
`$link` object Required Current link object. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
function link_target_meta_box( $link ) {
?>
<fieldset><legend class="screen-reader-text"><span><?php _e( 'Target' ); ?></span></legend>
<p><label for="link_target_blank" class="selectit">
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( '_blank' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
<?php _e( '<code>_blank</code> — new window or tab.' ); ?></label></p>
<p><label for="link_target_top" class="selectit">
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( '_top' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
<?php _e( '<code>_top</code> — current window or tab, with no frames.' ); ?></label></p>
<p><label for="link_target_none" class="selectit">
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ( '' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
<?php _e( '<code>_none</code> — same window or tab.' ); ?></label></p>
</fieldset>
<p><?php _e( 'Choose the target frame for your link.' ); ?></p>
<?php
}
```
| Uses | Description |
| --- | --- |
| [\_e()](_e) wp-includes/l10n.php | Displays translated text. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress wp_get_webp_info( string $filename ): array wp\_get\_webp\_info( string $filename ): array
==============================================
Extracts meta information about a WebP file: width, height, and type.
`$filename` string Required Path to a WebP file. array An array of WebP image information.
* `width`int|falseImage width on success, false on failure.
* `height`int|falseImage height on success, false on failure.
* `type`string|falseThe WebP type: one of `'lossy'`, `'lossless'` or `'animated-alpha'`.
False on failure.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
function wp_get_webp_info( $filename ) {
$width = false;
$height = false;
$type = false;
if ( 'image/webp' !== wp_get_image_mime( $filename ) ) {
return compact( 'width', 'height', 'type' );
}
$magic = file_get_contents( $filename, false, null, 0, 40 );
if ( false === $magic ) {
return compact( 'width', 'height', 'type' );
}
// Make sure we got enough bytes.
if ( strlen( $magic ) < 40 ) {
return compact( 'width', 'height', 'type' );
}
// The headers are a little different for each of the three formats.
// Header values based on WebP docs, see https://developers.google.com/speed/webp/docs/riff_container.
switch ( substr( $magic, 12, 4 ) ) {
// Lossy WebP.
case 'VP8 ':
$parts = unpack( 'v2', substr( $magic, 26, 4 ) );
$width = (int) ( $parts[1] & 0x3FFF );
$height = (int) ( $parts[2] & 0x3FFF );
$type = 'lossy';
break;
// Lossless WebP.
case 'VP8L':
$parts = unpack( 'C4', substr( $magic, 21, 4 ) );
$width = (int) ( $parts[1] | ( ( $parts[2] & 0x3F ) << 8 ) ) + 1;
$height = (int) ( ( ( $parts[2] & 0xC0 ) >> 6 ) | ( $parts[3] << 2 ) | ( ( $parts[4] & 0x03 ) << 10 ) ) + 1;
$type = 'lossless';
break;
// Animated/alpha WebP.
case 'VP8X':
// Pad 24-bit int.
$width = unpack( 'V', substr( $magic, 24, 3 ) . "\x00" );
$width = (int) ( $width[1] & 0xFFFFFF ) + 1;
// Pad 24-bit int.
$height = unpack( 'V', substr( $magic, 27, 3 ) . "\x00" );
$height = (int) ( $height[1] & 0xFFFFFF ) + 1;
$type = 'animated-alpha';
break;
}
return compact( 'width', 'height', 'type' );
}
```
| Uses | Description |
| --- | --- |
| [wp\_get\_image\_mime()](wp_get_image_mime) wp-includes/functions.php | Returns the real mime type of an image file. |
| Used By | Description |
| --- | --- |
| [wp\_getimagesize()](wp_getimagesize) wp-includes/media.php | Allows PHP’s getimagesize() to be debuggable when necessary. |
| [WP\_Image\_Editor\_Imagick::set\_quality()](../classes/wp_image_editor_imagick/set_quality) wp-includes/class-wp-image-editor-imagick.php | Sets Image Compression quality on a 1-100% scale. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
| programming_docs |
wordpress convert_to_screen( string $hook_name ): WP_Screen convert\_to\_screen( string $hook\_name ): WP\_Screen
=====================================================
Converts a screen string to a screen object.
`$hook_name` string Required The hook name (also known as the hook suffix) used to determine the screen. [WP\_Screen](../classes/wp_screen) Screen object.
File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
function convert_to_screen( $hook_name ) {
if ( ! class_exists( 'WP_Screen' ) ) {
_doing_it_wrong(
'convert_to_screen(), add_meta_box()',
sprintf(
/* translators: 1: wp-admin/includes/template.php, 2: add_meta_box(), 3: add_meta_boxes */
__( 'Likely direct inclusion of %1$s in order to use %2$s. This is very wrong. Hook the %2$s call into the %3$s action instead.' ),
'<code>wp-admin/includes/template.php</code>',
'<code>add_meta_box()</code>',
'<code>add_meta_boxes</code>'
),
'3.3.0'
);
return (object) array(
'id' => '_invalid',
'base' => '_are_belong_to_us',
);
}
return WP_Screen::get( $hook_name );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Screen::get()](../classes/wp_screen/get) wp-admin/includes/class-wp-screen.php | Fetches a screen object. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| Used By | Description |
| --- | --- |
| [\_WP\_List\_Table\_Compat::\_\_construct()](../classes/_wp_list_table_compat/__construct) wp-admin/includes/class-wp-list-table-compat.php | Constructor. |
| [get\_column\_headers()](get_column_headers) wp-admin/includes/screen.php | Get the column headers for a screen |
| [get\_hidden\_columns()](get_hidden_columns) wp-admin/includes/screen.php | Get a list of hidden columns. |
| [meta\_box\_prefs()](meta_box_prefs) wp-admin/includes/screen.php | Prints the meta box preferences for screen meta. |
| [get\_hidden\_meta\_boxes()](get_hidden_meta_boxes) wp-admin/includes/screen.php | Gets an array of IDs of hidden meta boxes. |
| [add\_contextual\_help()](add_contextual_help) wp-admin/includes/deprecated.php | Add contextual help text for a page. |
| [WP\_List\_Table::\_\_construct()](../classes/wp_list_table/__construct) wp-admin/includes/class-wp-list-table.php | Constructor. |
| [\_get\_list\_table()](_get_list_table) wp-admin/includes/list-table.php | Fetches an instance of a [WP\_List\_Table](../classes/wp_list_table) class. |
| [add\_meta\_box()](add_meta_box) wp-admin/includes/template.php | Adds a meta box to one or more screens. |
| [do\_meta\_boxes()](do_meta_boxes) wp-admin/includes/template.php | Meta-Box template function. |
| [remove\_meta\_box()](remove_meta_box) wp-admin/includes/template.php | Removes a meta box from one or more screens. |
| [do\_accordion\_sections()](do_accordion_sections) wp-admin/includes/template.php | Meta Box Accordion Template Function. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress postbox_classes( string $box_id, string $screen_id ): string postbox\_classes( string $box\_id, string $screen\_id ): string
===============================================================
Returns the list of classes to be used by a meta box.
`$box_id` string Required Meta box ID (used in the `'id'` attribute for the meta box). `$screen_id` string Required The screen on which the meta box is shown. string Space-separated string of class names.
File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
function postbox_classes( $box_id, $screen_id ) {
if ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) {
$classes = array( '' );
} elseif ( get_user_option( 'closedpostboxes_' . $screen_id ) ) {
$closed = get_user_option( 'closedpostboxes_' . $screen_id );
if ( ! is_array( $closed ) ) {
$classes = array( '' );
} else {
$classes = in_array( $box_id, $closed, true ) ? array( 'closed' ) : array( '' );
}
} else {
$classes = array( '' );
}
/**
* 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.
*
* @since 3.2.0
*
* @param string[] $classes An array of postbox classes.
*/
$classes = apply_filters( "postbox_classes_{$screen_id}_{$box_id}", $classes );
return implode( ' ', $classes );
}
```
[apply\_filters( "postbox\_classes\_{$screen\_id}\_{$box\_id}", string[] $classes )](../hooks/postbox_classes_screen_id_box_id)
Filters the postbox classes for a specific screen and box ID combo.
| Uses | Description |
| --- | --- |
| [get\_user\_option()](get_user_option) wp-includes/user.php | Retrieves user option that can be either per Site or per Network. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [do\_meta\_boxes()](do_meta_boxes) wp-admin/includes/template.php | Meta-Box template function. |
| [do\_accordion\_sections()](do_accordion_sections) wp-admin/includes/template.php | Meta Box Accordion Template Function. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress load_script_translations( string|false $file, string $handle, string $domain ): string|false load\_script\_translations( string|false $file, string $handle, string $domain ): string|false
==============================================================================================
Loads the translation data for the given script handle and text domain.
`$file` string|false Required Path to the translation file to load. False if there isn't one. `$handle` string Required Name of the script to register a translation domain to. `$domain` string Required The text domain. string|false The JSON-encoded translated strings for the given script handle and text domain.
False if there are none.
File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
function load_script_translations( $file, $handle, $domain ) {
/**
* Pre-filters script translations for the given file, script handle and text domain.
*
* Returning a non-null value allows to override the default logic, effectively short-circuiting the function.
*
* @since 5.0.2
*
* @param string|false|null $translations JSON-encoded translation data. Default null.
* @param string|false $file Path to the translation file to load. False if there isn't one.
* @param string $handle Name of the script to register a translation domain to.
* @param string $domain The text domain.
*/
$translations = apply_filters( 'pre_load_script_translations', null, $file, $handle, $domain );
if ( null !== $translations ) {
return $translations;
}
/**
* Filters the file path for loading script translations for the given script handle and text domain.
*
* @since 5.0.2
*
* @param string|false $file Path to the translation file to load. False if there isn't one.
* @param string $handle Name of the script to register a translation domain to.
* @param string $domain The text domain.
*/
$file = apply_filters( 'load_script_translation_file', $file, $handle, $domain );
if ( ! $file || ! is_readable( $file ) ) {
return false;
}
$translations = file_get_contents( $file );
/**
* Filters script translations for the given file, script handle and text domain.
*
* @since 5.0.2
*
* @param string $translations JSON-encoded translation data.
* @param string $file Path to the translation file that was loaded.
* @param string $handle Name of the script to register a translation domain to.
* @param string $domain The text domain.
*/
return apply_filters( 'load_script_translations', $translations, $file, $handle, $domain );
}
```
[apply\_filters( 'load\_script\_translations', string $translations, string $file, string $handle, string $domain )](../hooks/load_script_translations)
Filters script translations for the given file, script handle and text domain.
[apply\_filters( 'load\_script\_translation\_file', string|false $file, string $handle, string $domain )](../hooks/load_script_translation_file)
Filters the file path for loading script translations for the given script handle and text domain.
[apply\_filters( 'pre\_load\_script\_translations', string|false|null $translations, string|false $file, string $handle, string $domain )](../hooks/pre_load_script_translations)
Pre-filters script translations for the given file, script handle and text domain.
| Uses | Description |
| --- | --- |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [load\_script\_textdomain()](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 rest_cookie_check_errors( WP_Error|mixed $result ): WP_Error|mixed|bool rest\_cookie\_check\_errors( WP\_Error|mixed $result ): WP\_Error|mixed|bool
============================================================================
Checks for errors when using cookie-based authentication.
WordPress’ built-in cookie authentication is always active for logged in users. However, the API has to check nonces for each request to ensure users are not vulnerable to CSRF.
`$result` [WP\_Error](../classes/wp_error)|mixed Required Error from another authentication handler, null if we should handle it, or another value if not. [WP\_Error](../classes/wp_error)|mixed|bool [WP\_Error](../classes/wp_error) if the cookie is invalid, the $result, otherwise true.
File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
function rest_cookie_check_errors( $result ) {
if ( ! empty( $result ) ) {
return $result;
}
global $wp_rest_auth_cookie;
/*
* Is cookie authentication being used? (If we get an auth
* error, but we're still logged in, another authentication
* must have been used).
*/
if ( true !== $wp_rest_auth_cookie && is_user_logged_in() ) {
return $result;
}
// Determine if there is a nonce.
$nonce = null;
if ( isset( $_REQUEST['_wpnonce'] ) ) {
$nonce = $_REQUEST['_wpnonce'];
} elseif ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) {
$nonce = $_SERVER['HTTP_X_WP_NONCE'];
}
if ( null === $nonce ) {
// No nonce at all, so act as if it's an unauthenticated request.
wp_set_current_user( 0 );
return true;
}
// Check the nonce.
$result = wp_verify_nonce( $nonce, 'wp_rest' );
if ( ! $result ) {
return new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie check failed' ), array( 'status' => 403 ) );
}
// Send a refreshed nonce in header.
rest_get_server()->send_header( 'X-WP-Nonce', wp_create_nonce( 'wp_rest' ) );
return true;
}
```
| Uses | Description |
| --- | --- |
| [rest\_get\_server()](rest_get_server) wp-includes/rest-api.php | Retrieves the current REST server instance. |
| [wp\_verify\_nonce()](wp_verify_nonce) wp-includes/pluggable.php | Verifies that a correct security nonce was used with time limit. |
| [wp\_create\_nonce()](wp_create_nonce) wp-includes/pluggable.php | Creates a cryptographic token tied to a specific action, user, user session, and window of time. |
| [wp\_set\_current\_user()](wp_set_current_user) wp-includes/pluggable.php | Changes the current user by ID or name. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_user\_logged\_in()](is_user_logged_in) wp-includes/pluggable.php | Determines whether the current visitor is a logged in user. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress wp_is_large_user_count( int|null $network_id = null ): bool wp\_is\_large\_user\_count( int|null $network\_id = null ): bool
================================================================
Determines whether the site has a large number of users.
The default criteria for a large site is more than 10,000 users.
`$network_id` int|null Optional ID of the network. Defaults to the current network. Default: `null`
bool Whether the site has a large number of users.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
function wp_is_large_user_count( $network_id = null ) {
if ( ! is_multisite() && null !== $network_id ) {
_doing_it_wrong(
__FUNCTION__,
sprintf(
/* translators: %s: $network_id */
__( 'Unable to pass %s if not using multisite.' ),
'<code>$network_id</code>'
),
'6.0.0'
);
}
$count = get_user_count( $network_id );
/**
* Filters whether the site is considered large, based on its number of users.
*
* @since 6.0.0
*
* @param bool $is_large_user_count Whether the site has a large number of users.
* @param int $count The total number of users.
* @param int|null $network_id ID of the network. `null` represents the current network.
*/
return apply_filters( 'wp_is_large_user_count', $count > 10000, $count, $network_id );
}
```
[apply\_filters( 'wp\_is\_large\_user\_count', bool $is\_large\_user\_count, int $count, int|null $network\_id )](../hooks/wp_is_large_user_count)
Filters whether the site is considered large, based on its number of users.
| Uses | Description |
| --- | --- |
| [get\_user\_count()](get_user_count) wp-includes/user.php | Returns the number of active users in your installation. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_multisite()](is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [wp\_maybe\_update\_user\_counts()](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\_Users\_List\_Table::get\_views()](../classes/wp_users_list_table/get_views) wp-admin/includes/class-wp-users-list-table.php | Return an associative array listing all the views that can be used with this table. |
| [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 |
| [wp\_is\_large\_network()](wp_is_large_network) wp-includes/ms-functions.php | Determines whether or not we have a large network. |
| Version | Description |
| --- | --- |
| [6.0.0](https://developer.wordpress.org/reference/since/6.0.0/) | Introduced. |
wordpress check_ajax_referer( int|string $action = -1, false|string $query_arg = false, bool $die = true ): int|false check\_ajax\_referer( int|string $action = -1, false|string $query\_arg = false, bool $die = true ): int|false
==============================================================================================================
Verifies the Ajax request to prevent processing requests external of the blog.
`$action` int|string Optional Action nonce. Default: `-1`
`$query_arg` false|string Optional Key to check for the nonce in `$_REQUEST` (since 2.5). If false, `$_REQUEST` values will be evaluated for `'_ajax_nonce'`, and `'_wpnonce'` (in that order). Default: `false`
`$die` bool Optional Whether to die early when the nonce cannot be verified.
Default: `true`
int|false 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.
False if the nonce is invalid.
Nonces should never be relied on for authentication, authorization, or access control. Protect your functions using [[current\_user\_can()](current_user_can)](current_user_can "Function Reference/current user can") and always assume that nonces can be compromised.
This function can be replaced via [plugins](https://codex.wordpress.org/Glossary#plugins "Glossary"). If plugins do not redefine these functions, then this will be used instead.
If $query\_arg is not specified (i.e. defaults to false), then the function will look for the nonce in '\_ajax\_nonce'. If that is not set, then it will assume that the nonce is in '\_wpnonce', regardless of whether that query arg actually exists.
If $die is set to true, execution of the script will be stopped if the nonce cannot be verified, and the output will be '-1'.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
if ( -1 == $action ) {
_doing_it_wrong( __FUNCTION__, __( 'You should specify an action to be verified by using the first parameter.' ), '4.7.0' );
}
$nonce = '';
if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) ) {
$nonce = $_REQUEST[ $query_arg ];
} elseif ( isset( $_REQUEST['_ajax_nonce'] ) ) {
$nonce = $_REQUEST['_ajax_nonce'];
} elseif ( isset( $_REQUEST['_wpnonce'] ) ) {
$nonce = $_REQUEST['_wpnonce'];
}
$result = wp_verify_nonce( $nonce, $action );
/**
* Fires once the Ajax request has been validated or not.
*
* @since 2.1.0
*
* @param string $action The Ajax nonce action.
* @param false|int $result 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.
*/
do_action( 'check_ajax_referer', $action, $result );
if ( $die && false === $result ) {
if ( wp_doing_ajax() ) {
wp_die( -1, 403 );
} else {
die( '-1' );
}
}
return $result;
}
```
[do\_action( 'check\_ajax\_referer', string $action, false|int $result )](../hooks/check_ajax_referer)
Fires once the Ajax request has been validated or not.
| Uses | Description |
| --- | --- |
| [wp\_doing\_ajax()](wp_doing_ajax) wp-includes/load.php | Determines whether the current request is a WordPress Ajax request. |
| [wp\_verify\_nonce()](wp_verify_nonce) wp-includes/pluggable.php | Verifies that a correct security nonce was used with time limit. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Used By | Description |
| --- | --- |
| [wp\_ajax\_send\_password\_reset()](wp_ajax_send_password_reset) wp-admin/includes/ajax-actions.php | Ajax handler sends a password reset link. |
| [wp\_ajax\_toggle\_auto\_updates()](wp_ajax_toggle_auto_updates) wp-admin/includes/ajax-actions.php | Ajax handler to enable or disable plugin and theme auto-updates. |
| [wp\_ajax\_media\_create\_image\_subsizes()](wp_ajax_media_create_image_subsizes) wp-admin/includes/ajax-actions.php | Ajax handler for creating missing image sub-sizes for just uploaded images. |
| [wp\_ajax\_health\_check\_get\_sizes()](wp_ajax_health_check_get_sizes) wp-admin/includes/ajax-actions.php | Ajax handler for site health check to get directories and database sizes. |
| [wp\_ajax\_health\_check\_dotorg\_communication()](wp_ajax_health_check_dotorg_communication) wp-admin/includes/ajax-actions.php | Ajax handler for site health checks on server communication. |
| [wp\_ajax\_health\_check\_background\_updates()](wp_ajax_health_check_background_updates) wp-admin/includes/ajax-actions.php | Ajax handler for site health checks on background updates. |
| [wp\_ajax\_health\_check\_loopback\_requests()](wp_ajax_health_check_loopback_requests) wp-admin/includes/ajax-actions.php | Ajax handler for site health checks on loopback requests. |
| [wp\_ajax\_health\_check\_site\_status\_result()](wp_ajax_health_check_site_status_result) wp-admin/includes/ajax-actions.php | Ajax handler for site health check to update the result status. |
| [wp\_ajax\_wp\_privacy\_export\_personal\_data()](wp_ajax_wp_privacy_export_personal_data) wp-admin/includes/ajax-actions.php | Ajax handler for exporting a user’s personal data. |
| [wp\_ajax\_wp\_privacy\_erase\_personal\_data()](wp_ajax_wp_privacy_erase_personal_data) wp-admin/includes/ajax-actions.php | Ajax handler for erasing personal data. |
| [WP\_Customize\_Manager::handle\_load\_themes\_request()](../classes/wp_customize_manager/handle_load_themes_request) wp-includes/class-wp-customize-manager.php | Loads themes into the theme browsing/installation UI. |
| [WP\_Customize\_Manager::handle\_override\_changeset\_lock\_request()](../classes/wp_customize_manager/handle_override_changeset_lock_request) wp-includes/class-wp-customize-manager.php | Removes changeset lock when take over request is sent via Ajax. |
| [WP\_Customize\_Manager::handle\_dismiss\_autosave\_or\_lock\_request()](../classes/wp_customize_manager/handle_dismiss_autosave_or_lock_request) wp-includes/class-wp-customize-manager.php | Deletes a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock. |
| [WP\_Customize\_Manager::handle\_changeset\_trash\_request()](../classes/wp_customize_manager/handle_changeset_trash_request) wp-includes/class-wp-customize-manager.php | Handles request to trash a changeset. |
| [wp\_ajax\_get\_community\_events()](wp_ajax_get_community_events) wp-admin/includes/ajax-actions.php | Handles Ajax requests for community events |
| [WP\_Customize\_Nav\_Menus::ajax\_insert\_auto\_draft\_post()](../classes/wp_customize_nav_menus/ajax_insert_auto_draft_post) wp-includes/class-wp-customize-nav-menus.php | Ajax handler for adding a new auto-draft post. |
| [wp\_ajax\_search\_install\_plugins()](wp_ajax_search_install_plugins) wp-admin/includes/ajax-actions.php | Ajax handler for searching plugins to install. |
| [wp\_ajax\_delete\_plugin()](wp_ajax_delete_plugin) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a plugin. |
| [wp\_ajax\_search\_plugins()](wp_ajax_search_plugins) wp-admin/includes/ajax-actions.php | Ajax handler for searching plugins. |
| [wp\_ajax\_install\_theme()](wp_ajax_install_theme) wp-admin/includes/ajax-actions.php | Ajax handler for installing a theme. |
| [wp\_ajax\_update\_theme()](wp_ajax_update_theme) wp-admin/includes/ajax-actions.php | Ajax handler for updating a theme. |
| [wp\_ajax\_delete\_theme()](wp_ajax_delete_theme) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a theme. |
| [wp\_ajax\_install\_plugin()](wp_ajax_install_plugin) wp-admin/includes/ajax-actions.php | Ajax handler for installing a plugin. |
| [wp\_ajax\_get\_post\_thumbnail\_html()](wp_ajax_get_post_thumbnail_html) wp-admin/includes/ajax-actions.php | Ajax handler for retrieving HTML for the featured image. |
| [wp\_ajax\_save\_wporg\_username()](wp_ajax_save_wporg_username) wp-admin/includes/ajax-actions.php | Ajax handler for saving the user’s WordPress.org username. |
| [wp\_ajax\_delete\_inactive\_widgets()](wp_ajax_delete_inactive_widgets) wp-admin/includes/ajax-actions.php | Ajax handler for removing inactive widgets. |
| [WP\_Customize\_Nav\_Menus::ajax\_load\_available\_items()](../classes/wp_customize_nav_menus/ajax_load_available_items) wp-includes/class-wp-customize-nav-menus.php | Ajax handler for loading available menu items. |
| [WP\_Customize\_Nav\_Menus::ajax\_search\_available\_items()](../classes/wp_customize_nav_menus/ajax_search_available_items) wp-includes/class-wp-customize-nav-menus.php | Ajax handler for searching available menu items. |
| [wp\_ajax\_crop\_image()](wp_ajax_crop_image) wp-admin/includes/ajax-actions.php | Ajax handler for cropping an image. |
| [wp\_ajax\_update\_plugin()](wp_ajax_update_plugin) wp-admin/includes/ajax-actions.php | Ajax handler for updating a plugin. |
| [Custom\_Background::ajax\_background\_add()](../classes/custom_background/ajax_background_add) wp-admin/includes/class-custom-background.php | Handles Ajax request for adding custom background context to an attachment. |
| [wp\_ajax\_save\_attachment\_order()](wp_ajax_save_attachment_order) wp-admin/includes/ajax-actions.php | Ajax handler for saving the attachment order. |
| [wp\_ajax\_send\_attachment\_to\_editor()](wp_ajax_send_attachment_to_editor) wp-admin/includes/ajax-actions.php | Ajax handler for sending an attachment to the editor. |
| [wp\_ajax\_send\_link\_to\_editor()](wp_ajax_send_link_to_editor) wp-admin/includes/ajax-actions.php | Ajax handler for sending a link to the editor. |
| [wp\_ajax\_save\_user\_color\_scheme()](wp_ajax_save_user_color_scheme) wp-admin/includes/ajax-actions.php | Ajax handler for auto-saving the selected color scheme for a user’s own profile. |
| [wp\_ajax\_save\_widget()](wp_ajax_save_widget) wp-admin/includes/ajax-actions.php | Ajax handler for saving a widget. |
| [wp\_ajax\_upload\_attachment()](wp_ajax_upload_attachment) wp-admin/includes/ajax-actions.php | Ajax handler for uploading attachments |
| [wp\_ajax\_image\_editor()](wp_ajax_image_editor) wp-admin/includes/ajax-actions.php | Ajax handler for image editing. |
| [wp\_ajax\_set\_post\_thumbnail()](wp_ajax_set_post_thumbnail) wp-admin/includes/ajax-actions.php | Ajax handler for setting the featured image. |
| [wp\_ajax\_wp\_fullscreen\_save\_post()](wp_ajax_wp_fullscreen_save_post) wp-admin/includes/ajax-actions.php | Ajax handler for saving posts from the fullscreen editor. |
| [wp\_ajax\_wp\_remove\_post\_lock()](wp_ajax_wp_remove_post_lock) wp-admin/includes/ajax-actions.php | Ajax handler for removing a post lock. |
| [wp\_ajax\_save\_attachment()](wp_ajax_save_attachment) wp-admin/includes/ajax-actions.php | Ajax handler for updating attachment attributes. |
| [wp\_ajax\_save\_attachment\_compat()](wp_ajax_save_attachment_compat) wp-admin/includes/ajax-actions.php | Ajax handler for saving backward compatible attachment attributes. |
| [wp\_ajax\_add\_menu\_item()](wp_ajax_add_menu_item) wp-admin/includes/ajax-actions.php | Ajax handler for adding a menu item. |
| [wp\_ajax\_add\_meta()](wp_ajax_add_meta) wp-admin/includes/ajax-actions.php | Ajax handler for adding meta. |
| [wp\_ajax\_add\_user()](wp_ajax_add_user) wp-admin/includes/ajax-actions.php | Ajax handler for adding a user. |
| [wp\_ajax\_closed\_postboxes()](wp_ajax_closed_postboxes) wp-admin/includes/ajax-actions.php | Ajax handler for closed post boxes. |
| [wp\_ajax\_hidden\_columns()](wp_ajax_hidden_columns) wp-admin/includes/ajax-actions.php | Ajax handler for hidden columns. |
| [wp\_ajax\_update\_welcome\_panel()](wp_ajax_update_welcome_panel) wp-admin/includes/ajax-actions.php | Ajax handler for updating whether to display the welcome panel. |
| [wp\_ajax\_wp\_link\_ajax()](wp_ajax_wp_link_ajax) wp-admin/includes/ajax-actions.php | Ajax handler for internal linking. |
| [wp\_ajax\_menu\_locations\_save()](wp_ajax_menu_locations_save) wp-admin/includes/ajax-actions.php | Ajax handler for menu locations save. |
| [wp\_ajax\_meta\_box\_order()](wp_ajax_meta_box_order) wp-admin/includes/ajax-actions.php | Ajax handler for saving the meta box order. |
| [wp\_ajax\_get\_permalink()](wp_ajax_get_permalink) wp-admin/includes/ajax-actions.php | Ajax handler to retrieve a permalink. |
| [wp\_ajax\_sample\_permalink()](wp_ajax_sample_permalink) wp-admin/includes/ajax-actions.php | Ajax handler to retrieve a sample permalink. |
| [wp\_ajax\_inline\_save()](wp_ajax_inline_save) wp-admin/includes/ajax-actions.php | Ajax handler for Quick Edit saving a post from a list table. |
| [wp\_ajax\_inline\_save\_tax()](wp_ajax_inline_save_tax) wp-admin/includes/ajax-actions.php | Ajax handler for quick edit saving for a term. |
| [wp\_ajax\_find\_posts()](wp_ajax_find_posts) wp-admin/includes/ajax-actions.php | Ajax handler for querying posts for the Find Posts modal. |
| [wp\_ajax\_widgets\_order()](wp_ajax_widgets_order) wp-admin/includes/ajax-actions.php | Ajax handler for saving the widgets order. |
| [\_wp\_ajax\_add\_hierarchical\_term()](_wp_ajax_add_hierarchical_term) wp-admin/includes/ajax-actions.php | Ajax handler for adding a hierarchical term. |
| [wp\_ajax\_delete\_comment()](wp_ajax_delete_comment) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a comment. |
| [wp\_ajax\_delete\_tag()](wp_ajax_delete_tag) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a tag. |
| [wp\_ajax\_delete\_link()](wp_ajax_delete_link) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a link. |
| [wp\_ajax\_delete\_meta()](wp_ajax_delete_meta) wp-admin/includes/ajax-actions.php | Ajax handler for deleting meta. |
| [wp\_ajax\_delete\_post()](wp_ajax_delete_post) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a post. |
| [wp\_ajax\_trash\_post()](wp_ajax_trash_post) wp-admin/includes/ajax-actions.php | Ajax handler for sending a post to the Trash. |
| [wp\_ajax\_delete\_page()](wp_ajax_delete_page) wp-admin/includes/ajax-actions.php | Ajax handler to delete a page. |
| [wp\_ajax\_dim\_comment()](wp_ajax_dim_comment) wp-admin/includes/ajax-actions.php | Ajax handler to dim a comment. |
| [wp\_ajax\_add\_link\_category()](wp_ajax_add_link_category) wp-admin/includes/ajax-actions.php | Ajax handler for adding a link category. |
| [wp\_ajax\_add\_tag()](wp_ajax_add_tag) wp-admin/includes/ajax-actions.php | Ajax handler to add a tag. |
| [wp\_ajax\_get\_comments()](wp_ajax_get_comments) wp-admin/includes/ajax-actions.php | Ajax handler for getting comments. |
| [wp\_ajax\_replyto\_comment()](wp_ajax_replyto_comment) wp-admin/includes/ajax-actions.php | Ajax handler for replying to a comment. |
| [wp\_ajax\_edit\_comment()](wp_ajax_edit_comment) wp-admin/includes/ajax-actions.php | Ajax handler for editing a comment. |
| [wp\_ajax\_fetch\_list()](wp_ajax_fetch_list) wp-admin/includes/ajax-actions.php | Ajax handler for fetching a list table. |
| [wp\_ajax\_wp\_compression\_test()](wp_ajax_wp_compression_test) wp-admin/includes/ajax-actions.php | Ajax handler for compression testing. |
| [wp\_ajax\_imgedit\_preview()](wp_ajax_imgedit_preview) wp-admin/includes/ajax-actions.php | Ajax handler for image editor previews. |
| [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::ajax\_header\_add()](../classes/custom_image_header/ajax_header_add) wp-admin/includes/class-custom-image-header.php | Given an attachment ID for a header image, updates its “last used” timestamp to now. |
| [Custom\_Image\_Header::ajax\_header\_remove()](../classes/custom_image_header/ajax_header_remove) wp-admin/includes/class-custom-image-header.php | Given an attachment ID for a header image, unsets it as a user-uploaded header image for the active theme. |
| [Custom\_Background::wp\_set\_background\_image()](../classes/custom_background/wp_set_background_image) wp-admin/includes/class-custom-background.php | |
| [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. |
| [WP\_Customize\_Manager::setup\_theme()](../classes/wp_customize_manager/setup_theme) wp-includes/class-wp-customize-manager.php | Starts preview and customize theme. |
| [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. |
| Version | Description |
| --- | --- |
| [2.0.3](https://developer.wordpress.org/reference/since/2.0.3/) | Introduced. |
| programming_docs |
wordpress wp_validate_redirect( string $location, string $default = '' ): string wp\_validate\_redirect( string $location, string $default = '' ): string
========================================================================
Validates a URL for use in a redirect.
Checks whether the $location is using an allowed host, if it has an absolute path. A plugin can therefore set or remove allowed host(s) to or from the list.
If the host is not allowed, then the redirect is to $default supplied.
`$location` string Required The redirect to validate. `$default` string Optional The value to return if $location is not allowed. Default: `''`
string redirect-sanitized URL.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
function wp_validate_redirect( $location, $default = '' ) {
$location = wp_sanitize_redirect( trim( $location, " \t\n\r\0\x08\x0B" ) );
// Browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'.
if ( '//' === substr( $location, 0, 2 ) ) {
$location = 'http:' . $location;
}
// In PHP 5 parse_url() may fail if the URL query part contains 'http://'.
// See https://bugs.php.net/bug.php?id=38143
$cut = strpos( $location, '?' );
$test = $cut ? substr( $location, 0, $cut ) : $location;
$lp = parse_url( $test );
// Give up if malformed URL.
if ( false === $lp ) {
return $default;
}
// Allow only 'http' and 'https' schemes. No 'data:', etc.
if ( isset( $lp['scheme'] ) && ! ( 'http' === $lp['scheme'] || 'https' === $lp['scheme'] ) ) {
return $default;
}
if ( ! isset( $lp['host'] ) && ! empty( $lp['path'] ) && '/' !== $lp['path'][0] ) {
$path = '';
if ( ! empty( $_SERVER['REQUEST_URI'] ) ) {
$path = dirname( parse_url( 'http://placeholder' . $_SERVER['REQUEST_URI'], PHP_URL_PATH ) . '?' );
$path = wp_normalize_path( $path );
}
$location = '/' . ltrim( $path . '/', '/' ) . $location;
}
// Reject if certain components are set but host is not.
// This catches URLs like https:host.com for which parse_url() does not set the host field.
if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
return $default;
}
// Reject malformed components parse_url() can return on odd inputs.
foreach ( array( 'user', 'pass', 'host' ) as $component ) {
if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {
return $default;
}
}
$wpp = parse_url( home_url() );
/**
* Filters the list of allowed hosts to redirect to.
*
* @since 2.3.0
*
* @param string[] $hosts An array of allowed host names.
* @param string $host The host name of the redirect destination; empty string if not set.
*/
$allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts, true ) && strtolower( $wpp['host'] ) !== $lp['host'] ) ) {
$location = $default;
}
return $location;
}
```
[apply\_filters( 'allowed\_redirect\_hosts', string[] $hosts, string $host )](../hooks/allowed_redirect_hosts)
Filters the list of allowed hosts to redirect to.
| Uses | Description |
| --- | --- |
| [wp\_sanitize\_redirect()](wp_sanitize_redirect) wp-includes/pluggable.php | Sanitizes a URL for use in a redirect. |
| [wp\_normalize\_path()](wp_normalize_path) wp-includes/functions.php | Normalizes a filesystem path. |
| [home\_url()](home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::set\_return\_url()](../classes/wp_customize_manager/set_return_url) wp-includes/class-wp-customize-manager.php | Sets URL to link the user to when closing the Customizer. |
| [WP\_Customize\_Manager::set\_preview\_url()](../classes/wp_customize_manager/set_preview_url) wp-includes/class-wp-customize-manager.php | Sets the initial URL to be previewed. |
| [wp\_safe\_redirect()](wp_safe_redirect) wp-includes/pluggable.php | Performs a safe (local) redirect, using [wp\_redirect()](wp_redirect) . |
| [wp\_nonce\_ays()](wp_nonce_ays) wp-includes/functions.php | Displays “Are You Sure” message to confirm the action being taken. |
| [wp\_get\_referer()](wp_get_referer) wp-includes/functions.php | Retrieves referer from ‘\_wp\_http\_referer’ or HTTP referer. |
| [wp\_get\_original\_referer()](wp_get_original_referer) wp-includes/functions.php | Retrieves original referer that was posted, if it exists. |
| [allowed\_http\_request\_hosts()](allowed_http_request_hosts) wp-includes/http.php | Mark allowed redirect hosts safe for HTTP requests as well. |
| Version | Description |
| --- | --- |
| [2.8.1](https://developer.wordpress.org/reference/since/2.8.1/) | Introduced. |
wordpress wpmu_menu() wpmu\_menu()
============
This function has been deprecated.
Outputs the WPMU menu.
File: `wp-admin/includes/ms-deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ms-deprecated.php/)
```
function wpmu_menu() {
_deprecated_function( __FUNCTION__, '3.0.0' );
// Deprecated. See #11763.
}
```
| Uses | Description |
| --- | --- |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function 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 wp_get_environment_type(): string wp\_get\_environment\_type(): string
====================================
Retrieves the current environment type.
The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable, or a constant of the same name.
Possible values are ‘local’, ‘development’, ‘staging’, and ‘production’.
If not set, the type defaults to ‘production’.
string The current environment type.
* This function allows plugin and theme authors to more easily differentiate how they handle specific functionality between production and development sites in a standardized way.
* When `development` is returned by [wp\_get\_environment\_type()](wp_get_environment_type) , `WP_DEBUG` will be set to `true` if it is not defined in the `wp-config.php` file of the site.
* All hosts that support setting up staging environments are requested to set this feature to `staging` on those staging environments. Similarly, all developers with development environments shall set this value to `development` appropriately.
Example Usage:
```
switch ( wp_get_environment_type() ) {
case 'local':
case 'development':
do_nothing();
break;
case 'staging':
do_staging_thing();
break;
case 'production':
default:
do_production_thing();
break;
}
```
File: `wp-includes/load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
```
function wp_get_environment_type() {
static $current_env = '';
if ( ! defined( 'WP_RUN_CORE_TESTS' ) && $current_env ) {
return $current_env;
}
$wp_environments = array(
'local',
'development',
'staging',
'production',
);
// Add a note about the deprecated WP_ENVIRONMENT_TYPES constant.
if ( defined( 'WP_ENVIRONMENT_TYPES' ) && function_exists( '_deprecated_argument' ) ) {
if ( function_exists( '__' ) ) {
/* translators: %s: WP_ENVIRONMENT_TYPES */
$message = sprintf( __( 'The %s constant is no longer supported.' ), 'WP_ENVIRONMENT_TYPES' );
} else {
$message = sprintf( 'The %s constant is no longer supported.', 'WP_ENVIRONMENT_TYPES' );
}
_deprecated_argument(
'define()',
'5.5.1',
$message
);
}
// Check if the environment variable has been set, if `getenv` is available on the system.
if ( function_exists( 'getenv' ) ) {
$has_env = getenv( 'WP_ENVIRONMENT_TYPE' );
if ( false !== $has_env ) {
$current_env = $has_env;
}
}
// Fetch the environment from a constant, this overrides the global system variable.
if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) {
$current_env = WP_ENVIRONMENT_TYPE;
}
// Make sure the environment is an allowed one, and not accidentally set to an invalid value.
if ( ! in_array( $current_env, $wp_environments, true ) ) {
$current_env = 'production';
}
return $current_env;
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_deprecated\_argument()](_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| Used By | Description |
| --- | --- |
| [wp\_is\_application\_passwords\_supported()](wp_is_application_passwords_supported) wp-includes/user.php | Checks if Application Passwords is supported. |
| [WP\_Site\_Health::is\_development\_environment()](../classes/wp_site_health/is_development_environment) wp-admin/includes/class-wp-site-health.php | Checks if the current environment type is set to ‘development’ or ‘local’. |
| [WP\_Debug\_Data::debug\_data()](../classes/wp_debug_data/debug_data) wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required. |
| [WP\_Site\_Health::get\_tests()](../classes/wp_site_health/get_tests) wp-admin/includes/class-wp-site-health.php | Returns a set of tests that belong to the site status page. |
| [wp\_initial\_constants()](wp_initial_constants) wp-includes/default-constants.php | Defines initial WordPress constants. |
| Version | Description |
| --- | --- |
| [5.5.1](https://developer.wordpress.org/reference/since/5.5.1/) | Removed the ability to alter the list of types. |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress the_time( string $format = '' ) the\_time( string $format = '' )
================================
Displays the time at which the post was written.
`$format` string Optional Format to use for retrieving the time the post was written. Accepts `'G'`, `'U'`, or PHP date format.
Defaults to the `'time_format'` option. Default: `''`
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
function the_time( $format = '' ) {
/**
* Filters the time a post was written for display.
*
* @since 0.71
*
* @param string $get_the_time The formatted time.
* @param string $format Format to use for retrieving the time the post
* was written. Accepts 'G', 'U', or PHP date format.
*/
echo apply_filters( 'the_time', get_the_time( $format ), $format );
}
```
[apply\_filters( 'the\_time', string $get\_the\_time, string $format )](../hooks/the_time)
Filters the time a post was written for display.
| Uses | Description |
| --- | --- |
| [get\_the\_time()](get_the_time) wp-includes/general-template.php | Retrieves the time at which the post was written. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress _get_page_link( int|WP_Post $post = false, bool $leavename = false, bool $sample = false ): string \_get\_page\_link( int|WP\_Post $post = false, bool $leavename = false, bool $sample = false ): 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.
Retrieves the page permalink.
Ignores page\_on\_front. Internal use only.
`$post` int|[WP\_Post](../classes/wp_post) Optional Post ID or object. Default uses the global `$post`. Default: `false`
`$leavename` bool Optional Whether to keep the page name. Default: `false`
`$sample` bool Optional Whether it should be treated as a sample permalink.
Default: `false`
string The page permalink.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function _get_page_link( $post = false, $leavename = false, $sample = false ) {
global $wp_rewrite;
$post = get_post( $post );
$force_plain_link = wp_force_plain_post_permalink( $post );
$link = $wp_rewrite->get_page_permastruct();
if ( ! empty( $link ) && ( ( isset( $post->post_status ) && ! $force_plain_link ) || $sample ) ) {
if ( ! $leavename ) {
$link = str_replace( '%pagename%', get_page_uri( $post ), $link );
}
$link = home_url( $link );
$link = user_trailingslashit( $link, 'page' );
} else {
$link = home_url( '?page_id=' . $post->ID );
}
/**
* Filters the permalink for a non-page_on_front page.
*
* @since 2.1.0
*
* @param string $link The page's permalink.
* @param int $post_id The ID of the page.
*/
return apply_filters( '_get_page_link', $link, $post->ID );
}
```
[apply\_filters( '\_get\_page\_link', string $link, int $post\_id )](../hooks/_get_page_link)
Filters the permalink for a non-page\_on\_front page.
| Uses | Description |
| --- | --- |
| [wp\_force\_plain\_post\_permalink()](wp_force_plain_post_permalink) wp-includes/link-template.php | Determine whether post should always use a plain permalink structure. |
| [user\_trailingslashit()](user_trailingslashit) wp-includes/link-template.php | Retrieves a trailing-slashed string if the site is set for adding trailing slashes. |
| [get\_page\_uri()](get_page_uri) wp-includes/post.php | Builds the URI path for a page. |
| [WP\_Rewrite::get\_page\_permastruct()](../classes/wp_rewrite/get_page_permastruct) wp-includes/class-wp-rewrite.php | Retrieves the page permalink structure. |
| [home\_url()](home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [get\_post\_comments\_feed\_link()](get_post_comments_feed_link) wp-includes/link-template.php | Retrieves the permalink for the post comments feed. |
| [get\_page\_link()](get_page_link) wp-includes/link-template.php | Retrieves the permalink for the current page or page ID. |
| [get\_attachment\_link()](get_attachment_link) wp-includes/link-template.php | Retrieves the permalink for an attachment. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress register_setting( string $option_group, string $option_name, array $args = array() ) register\_setting( string $option\_group, string $option\_name, array $args = array() )
=======================================================================================
Registers a setting and its data.
`$option_group` string Required A settings group name. Should correspond to an allowed option key name.
Default allowed option key names include `'general'`, `'discussion'`, `'media'`, `'reading'`, `'writing'`, and `'options'`. `$option_name` string Required The name of an option to sanitize and save. `$args` array Optional 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()`.
Default: `array()`
File: `wp-includes/option.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
```
function register_setting( $option_group, $option_name, $args = array() ) {
global $new_allowed_options, $wp_registered_settings;
/*
* In 5.5.0, the `$new_whitelist_options` global variable was renamed to `$new_allowed_options`.
* Please consider writing more inclusive code.
*/
$GLOBALS['new_whitelist_options'] = &$new_allowed_options;
$defaults = array(
'type' => 'string',
'group' => $option_group,
'description' => '',
'sanitize_callback' => null,
'show_in_rest' => false,
);
// Back-compat: old sanitize callback is added.
if ( is_callable( $args ) ) {
$args = array(
'sanitize_callback' => $args,
);
}
/**
* Filters the registration arguments when registering a setting.
*
* @since 4.7.0
*
* @param array $args Array of setting registration arguments.
* @param array $defaults Array of default arguments.
* @param string $option_group Setting group.
* @param string $option_name Setting name.
*/
$args = apply_filters( 'register_setting_args', $args, $defaults, $option_group, $option_name );
$args = wp_parse_args( $args, $defaults );
// Require an item schema when registering settings with an array type.
if ( false !== $args['show_in_rest'] && 'array' === $args['type'] && ( ! is_array( $args['show_in_rest'] ) || ! isset( $args['show_in_rest']['schema']['items'] ) ) ) {
_doing_it_wrong( __FUNCTION__, __( 'When registering an "array" setting to show in the REST API, you must specify the schema for each array item in "show_in_rest.schema.items".' ), '5.4.0' );
}
if ( ! is_array( $wp_registered_settings ) ) {
$wp_registered_settings = array();
}
if ( 'misc' === $option_group ) {
_deprecated_argument(
__FUNCTION__,
'3.0.0',
sprintf(
/* translators: %s: misc */
__( 'The "%s" options group has been removed. Use another settings group.' ),
'misc'
)
);
$option_group = 'general';
}
if ( 'privacy' === $option_group ) {
_deprecated_argument(
__FUNCTION__,
'3.5.0',
sprintf(
/* translators: %s: privacy */
__( 'The "%s" options group has been removed. Use another settings group.' ),
'privacy'
)
);
$option_group = 'reading';
}
$new_allowed_options[ $option_group ][] = $option_name;
if ( ! empty( $args['sanitize_callback'] ) ) {
add_filter( "sanitize_option_{$option_name}", $args['sanitize_callback'] );
}
if ( array_key_exists( 'default', $args ) ) {
add_filter( "default_option_{$option_name}", 'filter_default_option', 10, 3 );
}
/**
* Fires immediately before the setting is registered but after its filters are in place.
*
* @since 5.5.0
*
* @param string $option_group Setting group.
* @param string $option_name Setting name.
* @param array $args Array of setting registration arguments.
*/
do_action( 'register_setting', $option_group, $option_name, $args );
$wp_registered_settings[ $option_name ] = $args;
}
```
[do\_action( 'register\_setting', string $option\_group, string $option\_name, array $args )](../hooks/register_setting)
Fires immediately before the setting is registered but after its filters are in place.
[apply\_filters( 'register\_setting\_args', array $args, array $defaults, string $option\_group, string $option\_name )](../hooks/register_setting_args)
Filters the registration arguments when registering a setting.
| Uses | Description |
| --- | --- |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| [\_deprecated\_argument()](_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [add\_filter()](add_filter) wp-includes/plugin.php | Adds a callback function to a filter hook. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Used By | Description |
| --- | --- |
| [register\_initial\_settings()](register_initial_settings) wp-includes/option.php | Registers default settings available in WordPress. |
| [add\_option\_update\_handler()](add_option_update_handler) wp-admin/includes/deprecated.php | Register a setting and its sanitization callback |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | `$new_whitelist_options` was renamed to `$new_allowed_options`. Please consider writing more inclusive code. |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | `$args` can be passed to set flags on the setting, similar to `register_meta()`. |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | The `privacy` option group was deprecated. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | The `misc` option group was deprecated. |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
| programming_docs |
wordpress get_preview_post_link( int|WP_Post $post = null, array $query_args = array(), string $preview_link = '' ): string|null get\_preview\_post\_link( int|WP\_Post $post = null, array $query\_args = array(), string $preview\_link = '' ): string|null
============================================================================================================================
Retrieves the URL used for the post preview.
Allows additional query args to be appended.
`$post` int|[WP\_Post](../classes/wp_post) Optional Post ID or `WP_Post` object. Defaults to global `$post`. Default: `null`
`$query_args` array Optional Array of additional query args to be appended to the link.
Default: `array()`
`$preview_link` string Optional Base preview link to be used if it should differ from the post permalink. Default: `''`
string|null URL used for the post preview, or null if the post does not exist.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function get_preview_post_link( $post = null, $query_args = array(), $preview_link = '' ) {
$post = get_post( $post );
if ( ! $post ) {
return;
}
$post_type_object = get_post_type_object( $post->post_type );
if ( is_post_type_viewable( $post_type_object ) ) {
if ( ! $preview_link ) {
$preview_link = set_url_scheme( get_permalink( $post ) );
}
$query_args['preview'] = 'true';
$preview_link = add_query_arg( $query_args, $preview_link );
}
/**
* Filters the URL used for a post preview.
*
* @since 2.0.5
* @since 4.0.0 Added the `$post` parameter.
*
* @param string $preview_link URL used for the post preview.
* @param WP_Post $post Post object.
*/
return apply_filters( 'preview_post_link', $preview_link, $post );
}
```
[apply\_filters( 'preview\_post\_link', string $preview\_link, WP\_Post $post )](../hooks/preview_post_link)
Filters the URL used for a post preview.
| Uses | Description |
| --- | --- |
| [is\_post\_type\_viewable()](is_post_type_viewable) wp-includes/post.php | Determines whether a post type is considered “viewable”. |
| [set\_url\_scheme()](set_url_scheme) wp-includes/link-template.php | Sets the scheme for a URL. |
| [add\_query\_arg()](add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [get\_permalink()](get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [get\_post\_type\_object()](get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Autosaves\_Controller::prepare\_item\_for\_response()](../classes/wp_rest_autosaves_controller/prepare_item_for_response) wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php | Prepares the revision for the REST response. |
| [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. |
| [get\_sample\_permalink\_html()](get_sample_permalink_html) wp-admin/includes/post.php | Returns the HTML of the sample permalink slug editor. |
| [\_admin\_notice\_post\_locked()](_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. |
| [post\_preview()](post_preview) wp-admin/includes/post.php | Saves a draft or manually autosaves for the purpose of showing a post preview. |
| [wp\_ajax\_get\_permalink()](wp_ajax_get_permalink) wp-admin/includes/ajax-actions.php | Ajax handler to retrieve a permalink. |
| [post\_submit\_meta\_box()](post_submit_meta_box) wp-admin/includes/meta-boxes.php | Displays post submit form fields. |
| [wp\_admin\_bar\_edit\_menu()](wp_admin_bar_edit_menu) wp-includes/admin-bar.php | Provides an edit link for posts and terms. |
| [\_wp\_link\_page()](_wp_link_page) wp-includes/post-template.php | Helper function for [wp\_link\_pages()](wp_link_pages) . |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress rest_find_matching_pattern_property_schema( string $property, array $args ): array|null rest\_find\_matching\_pattern\_property\_schema( string $property, array $args ): array|null
============================================================================================
Finds the schema for a property using the patternProperties keyword.
`$property` string Required The property name to check. `$args` array Required The schema array to use. array|null The schema of matching pattern property, or null if no patterns match.
File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
function rest_find_matching_pattern_property_schema( $property, $args ) {
if ( isset( $args['patternProperties'] ) ) {
foreach ( $args['patternProperties'] as $pattern => $child_schema ) {
if ( rest_validate_json_schema_pattern( $pattern, $property ) ) {
return $child_schema;
}
}
}
return null;
}
```
| Uses | Description |
| --- | --- |
| [rest\_validate\_json\_schema\_pattern()](rest_validate_json_schema_pattern) wp-includes/rest-api.php | Validates if the JSON Schema pattern matches a value. |
| Used By | Description |
| --- | --- |
| [rest\_validate\_object\_value\_from\_schema()](rest_validate_object_value_from_schema) wp-includes/rest-api.php | Validates an object value based on a schema. |
| [rest\_filter\_response\_by\_context()](rest_filter_response_by_context) wp-includes/rest-api.php | Filters the response to remove any fields not available in the given context. |
| [rest\_sanitize\_value\_from\_schema()](rest_sanitize_value_from_schema) wp-includes/rest-api.php | Sanitize a value based on a schema. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress wp_cache_set_terms_last_changed() wp\_cache\_set\_terms\_last\_changed()
======================================
Sets the last changed time for the ‘terms’ cache group.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
function wp_cache_set_terms_last_changed() {
wp_cache_set( 'last_changed', microtime(), 'terms' );
}
```
| Uses | Description |
| --- | --- |
| [wp\_cache\_set()](wp_cache_set) wp-includes/cache.php | Saves the data to the cache. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress populate_roles_160() populate\_roles\_160()
======================
Create the roles for WordPress 2.0
File: `wp-admin/includes/schema.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/schema.php/)
```
function populate_roles_160() {
// Add roles.
add_role( 'administrator', 'Administrator' );
add_role( 'editor', 'Editor' );
add_role( 'author', 'Author' );
add_role( 'contributor', 'Contributor' );
add_role( 'subscriber', 'Subscriber' );
// Add caps for Administrator role.
$role = get_role( 'administrator' );
$role->add_cap( 'switch_themes' );
$role->add_cap( 'edit_themes' );
$role->add_cap( 'activate_plugins' );
$role->add_cap( 'edit_plugins' );
$role->add_cap( 'edit_users' );
$role->add_cap( 'edit_files' );
$role->add_cap( 'manage_options' );
$role->add_cap( 'moderate_comments' );
$role->add_cap( 'manage_categories' );
$role->add_cap( 'manage_links' );
$role->add_cap( 'upload_files' );
$role->add_cap( 'import' );
$role->add_cap( 'unfiltered_html' );
$role->add_cap( 'edit_posts' );
$role->add_cap( 'edit_others_posts' );
$role->add_cap( 'edit_published_posts' );
$role->add_cap( 'publish_posts' );
$role->add_cap( 'edit_pages' );
$role->add_cap( 'read' );
$role->add_cap( 'level_10' );
$role->add_cap( 'level_9' );
$role->add_cap( 'level_8' );
$role->add_cap( 'level_7' );
$role->add_cap( 'level_6' );
$role->add_cap( 'level_5' );
$role->add_cap( 'level_4' );
$role->add_cap( 'level_3' );
$role->add_cap( 'level_2' );
$role->add_cap( 'level_1' );
$role->add_cap( 'level_0' );
// Add caps for Editor role.
$role = get_role( 'editor' );
$role->add_cap( 'moderate_comments' );
$role->add_cap( 'manage_categories' );
$role->add_cap( 'manage_links' );
$role->add_cap( 'upload_files' );
$role->add_cap( 'unfiltered_html' );
$role->add_cap( 'edit_posts' );
$role->add_cap( 'edit_others_posts' );
$role->add_cap( 'edit_published_posts' );
$role->add_cap( 'publish_posts' );
$role->add_cap( 'edit_pages' );
$role->add_cap( 'read' );
$role->add_cap( 'level_7' );
$role->add_cap( 'level_6' );
$role->add_cap( 'level_5' );
$role->add_cap( 'level_4' );
$role->add_cap( 'level_3' );
$role->add_cap( 'level_2' );
$role->add_cap( 'level_1' );
$role->add_cap( 'level_0' );
// Add caps for Author role.
$role = get_role( 'author' );
$role->add_cap( 'upload_files' );
$role->add_cap( 'edit_posts' );
$role->add_cap( 'edit_published_posts' );
$role->add_cap( 'publish_posts' );
$role->add_cap( 'read' );
$role->add_cap( 'level_2' );
$role->add_cap( 'level_1' );
$role->add_cap( 'level_0' );
// Add caps for Contributor role.
$role = get_role( 'contributor' );
$role->add_cap( 'edit_posts' );
$role->add_cap( 'read' );
$role->add_cap( 'level_1' );
$role->add_cap( 'level_0' );
// Add caps for Subscriber role.
$role = get_role( 'subscriber' );
$role->add_cap( 'read' );
$role->add_cap( 'level_0' );
}
```
| Uses | Description |
| --- | --- |
| [add\_role()](add_role) wp-includes/capabilities.php | Adds a role, if it does not exist. |
| [get\_role()](get_role) wp-includes/capabilities.php | Retrieves role object. |
| Used By | Description |
| --- | --- |
| [populate\_roles()](populate_roles) wp-admin/includes/schema.php | Execute WordPress role creation for the various WordPress versions. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress get_user_option( string $option, int $user, string $deprecated = '' ): mixed get\_user\_option( string $option, int $user, string $deprecated = '' ): mixed
==============================================================================
Retrieves user option that can be either per Site or per Network.
If the user ID is not given, then the current user will be used instead. If the user ID is given, then the user data will be retrieved. The filter for the result, will also pass the original option name and finally the user data object as the third parameter.
The option will first check for the per site name and then the per Network name.
`$option` string Required User option name. `$user` int Optional User ID. `$deprecated` string Optional Use [get\_option()](get_option) to check for an option in the options table. Default: `''`
mixed User option value on success, false on failure.
##### Usage:
```
get_user_option( $option, $user );
```
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
function get_user_option( $option, $user = 0, $deprecated = '' ) {
global $wpdb;
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '3.0.0' );
}
if ( empty( $user ) ) {
$user = get_current_user_id();
}
$user = get_userdata( $user );
if ( ! $user ) {
return false;
}
$prefix = $wpdb->get_blog_prefix();
if ( $user->has_prop( $prefix . $option ) ) { // Blog-specific.
$result = $user->get( $prefix . $option );
} elseif ( $user->has_prop( $option ) ) { // User-specific and cross-blog.
$result = $user->get( $option );
} else {
$result = false;
}
/**
* Filters a specific user option value.
*
* The dynamic portion of the hook name, `$option`, refers to the user option name.
*
* @since 2.5.0
*
* @param mixed $result Value for the user's option.
* @param string $option Name of the option being retrieved.
* @param WP_User $user WP_User object of the user whose option is being retrieved.
*/
return apply_filters( "get_user_option_{$option}", $result, $option, $user );
}
```
[apply\_filters( "get\_user\_option\_{$option}", mixed $result, string $option, WP\_User $user )](../hooks/get_user_option_option)
Filters a specific user option value.
| Uses | Description |
| --- | --- |
| [wpdb::get\_blog\_prefix()](../classes/wpdb/get_blog_prefix) wp-includes/class-wpdb.php | Gets blog prefix. |
| [get\_userdata()](get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| [\_deprecated\_argument()](_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_current\_user\_id()](get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| Used By | Description |
| --- | --- |
| [wp\_localize\_community\_events()](wp_localize_community_events) wp-includes/script-loader.php | Localizes community events data that needs to be passed to dashboard.js. |
| [wp\_ajax\_get\_community\_events()](wp_ajax_get_community_events) wp-admin/includes/ajax-actions.php | Handles Ajax requests for community events |
| [wp\_edit\_attachments\_query\_vars()](wp_edit_attachments_query_vars) wp-admin/includes/post.php | Returns the query variables for the current attachments request. |
| [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\_Screen::render\_screen\_meta()](../classes/wp_screen/render_screen_meta) wp-admin/includes/class-wp-screen.php | Renders the screen’s help section. |
| [get\_hidden\_columns()](get_hidden_columns) wp-admin/includes/screen.php | Get a list of hidden columns. |
| [get\_hidden\_meta\_boxes()](get_hidden_meta_boxes) wp-admin/includes/screen.php | Gets an array of IDs of hidden meta boxes. |
| [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. |
| [admin\_color\_scheme\_picker()](admin_color_scheme_picker) wp-admin/includes/misc.php | Displays the default admin color scheme picker (Used in user-edit.php). |
| [wp\_color\_scheme\_settings()](wp_color_scheme_settings) wp-admin/includes/misc.php | |
| [install\_plugins\_favorites\_form()](install_plugins_favorites_form) wp-admin/includes/plugin-install.php | Shows a username form for the favorites page. |
| [display\_plugins\_table()](display_plugins_table) wp-admin/includes/plugin-install.php | Displays plugin content based on plugin list. |
| [wp\_dashboard\_quick\_press()](wp_dashboard_quick_press) wp-admin/includes/dashboard.php | The Quick Draft widget display and creation of drafts. |
| [default\_password\_nag\_handler()](default_password_nag_handler) wp-admin/includes/user.php | |
| [default\_password\_nag\_edit\_user()](default_password_nag_edit_user) wp-admin/includes/user.php | |
| [default\_password\_nag()](default_password_nag) wp-admin/includes/user.php | |
| [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 | |
| [do\_meta\_boxes()](do_meta_boxes) wp-admin/includes/template.php | Meta-Box template function. |
| [wp\_edit\_posts\_query()](wp_edit_posts_query) wp-admin/includes/post.php | Runs the query to fetch the posts for listing on the edit posts page. |
| [postbox\_classes()](postbox_classes) wp-admin/includes/post.php | Returns the list of classes to be used by a meta box. |
| [wp\_ajax\_query\_themes()](wp_ajax_query_themes) wp-admin/includes/ajax-actions.php | Ajax handler for getting themes from [themes\_api()](themes_api) . |
| [wp\_nav\_menu\_setup()](wp_nav_menu_setup) wp-admin/includes/nav-menu.php | Register nav menu meta boxes and advanced menu items. |
| [wp\_initial\_nav\_menu\_meta\_boxes()](wp_initial_nav_menu_meta_boxes) wp-admin/includes/nav-menu.php | Limit the amount of meta boxes to pages, posts, links, and categories for first time users. |
| [enqueue\_comment\_hotkeys\_js()](enqueue_comment_hotkeys_js) wp-admin/includes/comment.php | Enqueues comment shortcuts jQuery script. |
| [auth\_redirect()](auth_redirect) wp-includes/pluggable.php | Checks if a user is logged in, if not it redirects them to the login page. |
| [user\_can\_richedit()](user_can_richedit) wp-includes/general-template.php | Determines whether the user can access the visual editor. |
| [\_get\_admin\_bar\_pref()](_get_admin_bar_pref) wp-includes/admin-bar.php | Retrieves the admin bar display preference of a user. |
| [wp\_user\_settings()](wp_user_settings) wp-includes/option.php | Saves and restores user interface settings stored in a cookie. |
| [get\_all\_user\_settings()](get_all_user_settings) wp-includes/option.php | Retrieves all user interface settings. |
| [wp\_style\_loader\_src()](wp_style_loader_src) wp-includes/script-loader.php | Administration Screen CSS for changing the styles. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress themes_api( string $action, array|object $args = array() ): object|array|WP_Error themes\_api( string $action, array|object $args = array() ): object|array|WP\_Error
===================================================================================
Retrieves theme installer pages from the WordPress.org Themes API.
It is possible for a theme to override the Themes API result with three filters. Assume this is for themes, which can extend on the Theme Info to offer more choices. This is very powerful and must be used with care, when overriding the filters.
The first filter, [‘themes\_api\_args’](../hooks/themes_api_args), is for the args and gives the action as the second parameter. The hook for [‘themes\_api\_args’](../hooks/themes_api_args) must ensure that an object is returned.
The second filter, [‘themes\_api’](../hooks/themes_api), allows a plugin to override the WordPress.org Theme API entirely. 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.
Finally, the third filter, [‘themes\_api\_result’](../hooks/themes_api_result), makes it possible to filter the response object or array, depending on the `$action` type.
Supported arguments per action:
| Argument Name | ‘query\_themes’ | ‘theme\_information’ | ‘hot\_tags’ | ‘feature\_list’ |
| --- | --- | --- | --- | --- |
| `$slug` | No | Yes | No | No |
| `$per_page` | Yes | No | No | No |
| `$page` | Yes | No | No | No |
| `$number` | No | No | Yes | No |
| `$search` | Yes | No | No | No |
| `$tag` | Yes | No | No | No |
| `$author` | Yes | No | No | No |
| `$user` | Yes | No | No | No |
| `$browse` | Yes | No | No | No |
| `$locale` | Yes | Yes | No | No |
| `$fields` | Yes | Yes | No | No |
`$action` string Required API action to perform: `'query_themes'`, `'theme_information'`, `'hot_tags'` or `'feature_list'`. `$args` array|object Optional Array or object of arguments to serialize for the Themes API.
* `slug`stringThe theme slug.
* `per_page`intNumber of themes per page. Default 24.
* `page`intNumber of current page. Default 1.
* `number`intNumber of tags to be queried.
* `search`stringA search term.
* `tag`stringTag to filter themes.
* `author`stringUsername of an author to filter themes.
* `user`stringUsername to query for their favorites.
* `browse`stringBrowse view: `'featured'`, `'popular'`, `'updated'`, `'favorites'`.
* `locale`stringLocale to provide context-sensitive results. Default is the value of [get\_locale()](get_locale) .
* `fields`array Array of fields which should or should not be returned.
+ `description`boolWhether to return the theme full description. Default false.
+ `sections`boolWhether to return the theme readme sections: description, installation, FAQ, screenshots, other notes, and changelog. Default false.
+ `rating`boolWhether to return the rating in percent and total number of ratings.
Default false.
+ `ratings`boolWhether to return the number of rating for each star (1-5). Default false.
+ `downloaded`boolWhether to return the download count. Default false.
+ `downloadlink`boolWhether to return the download link for the package. Default false.
+ `last_updated`boolWhether to return the date of the last update. Default false.
+ `tags`boolWhether to return the assigned tags. Default false.
+ `homepage`boolWhether to return the theme homepage link. Default false.
+ `screenshots`boolWhether to return the screenshots. Default false.
+ `screenshot_count`intNumber of screenshots to return. Default 1.
+ `screenshot_url`boolWhether to return the URL of the first screenshot. Default false.
+ `photon_screenshots`boolWhether to return the screenshots via Photon. Default false.
+ `template`boolWhether to return the slug of the parent theme. Default false.
+ `parent`boolWhether to return the slug, name and homepage of the parent theme. Default false.
+ `versions`boolWhether to return the list of all available versions. Default false.
+ `theme_url`boolWhether to return theme's URL. Default false.
+ `extended_author`boolWhether to return nicename or nicename and display name. Default false. Default: `array()`
object|array|[WP\_Error](../classes/wp_error) Response object or array on success, [WP\_Error](../classes/wp_error) on failure. See the [function reference article](themes_api) for more information on the make-up of possible return objects depending on the value of `$action`.
File: `wp-admin/includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
```
function themes_api( $action, $args = array() ) {
// Include an unmodified $wp_version.
require ABSPATH . WPINC . '/version.php';
if ( is_array( $args ) ) {
$args = (object) $args;
}
if ( 'query_themes' === $action ) {
if ( ! isset( $args->per_page ) ) {
$args->per_page = 24;
}
}
if ( ! isset( $args->locale ) ) {
$args->locale = get_user_locale();
}
if ( ! isset( $args->wp_version ) ) {
$args->wp_version = substr( $wp_version, 0, 3 ); // x.y
}
/**
* Filters arguments used to query for installer pages from the WordPress.org Themes API.
*
* Important: An object MUST be returned to this filter.
*
* @since 2.8.0
*
* @param object $args Arguments used to query for installer pages from the WordPress.org Themes API.
* @param string $action Requested action. Likely values are 'theme_information',
* 'feature_list', or 'query_themes'.
*/
$args = apply_filters( 'themes_api_args', $args, $action );
/**
* 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.
*
* @since 2.8.0
*
* @param false|object|array $override Whether to override the WordPress.org Themes API. Default false.
* @param string $action Requested action. Likely values are 'theme_information',
* 'feature_list', or 'query_themes'.
* @param object $args Arguments used to query for installer pages from the Themes API.
*/
$res = apply_filters( 'themes_api', false, $action, $args );
if ( ! $res ) {
$url = 'http://api.wordpress.org/themes/info/1.2/';
$url = add_query_arg(
array(
'action' => $action,
'request' => $args,
),
$url
);
$http_url = $url;
$ssl = wp_http_supports( array( 'ssl' ) );
if ( $ssl ) {
$url = set_url_scheme( $url, 'https' );
}
$http_args = array(
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);
$request = wp_remote_get( $url, $http_args );
if ( $ssl && is_wp_error( $request ) ) {
if ( ! wp_doing_ajax() ) {
trigger_error(
sprintf(
/* translators: %s: Support forums URL. */
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
__( 'https://wordpress.org/support/forums/' )
) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
);
}
$request = wp_remote_get( $http_url, $http_args );
}
if ( is_wp_error( $request ) ) {
$res = new WP_Error(
'themes_api_failed',
sprintf(
/* translators: %s: Support forums URL. */
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
__( 'https://wordpress.org/support/forums/' )
),
$request->get_error_message()
);
} else {
$res = json_decode( wp_remote_retrieve_body( $request ), true );
if ( is_array( $res ) ) {
// Object casting is required in order to match the info/1.0 format.
$res = (object) $res;
} elseif ( null === $res ) {
$res = new WP_Error(
'themes_api_failed',
sprintf(
/* translators: %s: Support forums URL. */
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
__( 'https://wordpress.org/support/forums/' )
),
wp_remote_retrieve_body( $request )
);
}
if ( isset( $res->error ) ) {
$res = new WP_Error( 'themes_api_failed', $res->error );
}
}
if ( ! is_wp_error( $res ) ) {
// Back-compat for info/1.2 API, upgrade the theme objects in query_themes to objects.
if ( 'query_themes' === $action ) {
foreach ( $res->themes as $i => $theme ) {
$res->themes[ $i ] = (object) $theme;
}
}
// Back-compat for info/1.2 API, downgrade the feature_list result back to an array.
if ( 'feature_list' === $action ) {
$res = (array) $res;
}
}
}
/**
* Filters the returned WordPress.org Themes API response.
*
* @since 2.8.0
*
* @param array|stdClass|WP_Error $res WordPress.org Themes API response.
* @param string $action Requested action. Likely values are 'theme_information',
* 'feature_list', or 'query_themes'.
* @param stdClass $args Arguments used to query for installer pages from the WordPress.org Themes API.
*/
return apply_filters( 'themes_api_result', $res, $action, $args );
}
```
[apply\_filters( 'themes\_api', false|object|array $override, string $action, object $args )](../hooks/themes_api)
Filters whether to override the WordPress.org Themes API.
[apply\_filters( 'themes\_api\_args', object $args, string $action )](../hooks/themes_api_args)
Filters arguments used to query for installer pages from the WordPress.org Themes API.
[apply\_filters( 'themes\_api\_result', array|stdClass|WP\_Error $res, string $action, stdClass $args )](../hooks/themes_api_result)
Filters the returned WordPress.org Themes API response.
| Uses | Description |
| --- | --- |
| [wp\_doing\_ajax()](wp_doing_ajax) wp-includes/load.php | Determines whether the current request is a WordPress Ajax request. |
| [get\_user\_locale()](get_user_locale) wp-includes/l10n.php | Retrieves the locale of a user. |
| [set\_url\_scheme()](set_url_scheme) wp-includes/link-template.php | Sets the scheme for a URL. |
| [wp\_http\_supports()](wp_http_supports) wp-includes/http.php | Determines if there is an HTTP Transport that can process this request. |
| [wp\_remote\_get()](wp_remote_get) wp-includes/http.php | Performs an HTTP request using the GET method and returns its response. |
| [wp\_remote\_retrieve\_body()](wp_remote_retrieve_body) wp-includes/http.php | Retrieve only the body from the raw response. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [add\_query\_arg()](add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [home\_url()](home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Manager::handle\_load\_themes\_request()](../classes/wp_customize_manager/handle_load_themes_request) wp-includes/class-wp-customize-manager.php | Loads themes into the theme browsing/installation UI. |
| [wp\_ajax\_install\_theme()](wp_ajax_install_theme) wp-admin/includes/ajax-actions.php | Ajax handler for installing a theme. |
| [Theme\_Upgrader::check\_parent\_theme\_filter()](../classes/theme_upgrader/check_parent_theme_filter) wp-admin/includes/class-theme-upgrader.php | Check if a child theme is being installed and we need to install its parent. |
| [get\_theme\_feature\_list()](get_theme_feature_list) wp-admin/includes/theme.php | Retrieves list of WordPress theme features (aka theme tags). |
| [install\_themes\_feature\_list()](install_themes_feature_list) wp-admin/includes/theme-install.php | Retrieves the list of WordPress theme features (aka theme tags). |
| [install\_theme\_information()](install_theme_information) wp-admin/includes/theme-install.php | Displays theme information in dialog box form. |
| [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 | |
| [wp\_ajax\_query\_themes()](wp_ajax_query_themes) wp-admin/includes/ajax-actions.php | Ajax handler for getting themes from [themes\_api()](themes_api) . |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress get_page_link( int|WP_Post $post = false, bool $leavename = false, bool $sample = false ): string get\_page\_link( int|WP\_Post $post = false, bool $leavename = false, bool $sample = false ): string
====================================================================================================
Retrieves the permalink for the current page or page ID.
Respects page\_on\_front. Use this one.
`$post` int|[WP\_Post](../classes/wp_post) Optional Post ID or object. Default uses the global `$post`. Default: `false`
`$leavename` bool Optional Whether to keep the page name. Default: `false`
`$sample` bool Optional Whether it should be treated as a sample permalink.
Default: `false`
string The page permalink.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function get_page_link( $post = false, $leavename = false, $sample = false ) {
$post = get_post( $post );
if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {
$link = home_url( '/' );
} else {
$link = _get_page_link( $post, $leavename, $sample );
}
/**
* Filters the permalink for a page.
*
* @since 1.5.0
*
* @param string $link The page's permalink.
* @param int $post_id The ID of the page.
* @param bool $sample Is it a sample permalink.
*/
return apply_filters( 'page_link', $link, $post->ID, $sample );
}
```
[apply\_filters( 'page\_link', string $link, int $post\_id, bool $sample )](../hooks/page_link)
Filters the permalink for a page.
| Uses | Description |
| --- | --- |
| [\_get\_page\_link()](_get_page_link) wp-includes/link-template.php | Retrieves the page permalink. |
| [home\_url()](home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [get\_permalink()](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 wp_comments_personal_data_exporter( string $email_address, int $page = 1 ): array wp\_comments\_personal\_data\_exporter( string $email\_address, int $page = 1 ): array
======================================================================================
Finds and exports personal data associated with an email address from the comments table.
`$email_address` string Required The comment author email address. `$page` int Optional Comment page. Default: `1`
array An array of personal data.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
// Limit us to 500 comments at a time to avoid timing out.
$number = 500;
$page = (int) $page;
$data_to_export = array();
$comments = get_comments(
array(
'author_email' => $email_address,
'number' => $number,
'paged' => $page,
'order_by' => 'comment_ID',
'order' => 'ASC',
'update_comment_meta_cache' => false,
)
);
$comment_prop_to_export = array(
'comment_author' => __( 'Comment Author' ),
'comment_author_email' => __( 'Comment Author Email' ),
'comment_author_url' => __( 'Comment Author URL' ),
'comment_author_IP' => __( 'Comment Author IP' ),
'comment_agent' => __( 'Comment Author User Agent' ),
'comment_date' => __( 'Comment Date' ),
'comment_content' => __( 'Comment Content' ),
'comment_link' => __( 'Comment URL' ),
);
foreach ( (array) $comments as $comment ) {
$comment_data_to_export = array();
foreach ( $comment_prop_to_export as $key => $name ) {
$value = '';
switch ( $key ) {
case 'comment_author':
case 'comment_author_email':
case 'comment_author_url':
case 'comment_author_IP':
case 'comment_agent':
case 'comment_date':
$value = $comment->{$key};
break;
case 'comment_content':
$value = get_comment_text( $comment->comment_ID );
break;
case 'comment_link':
$value = get_comment_link( $comment->comment_ID );
$value = sprintf(
'<a href="%s" target="_blank" rel="noopener">%s</a>',
esc_url( $value ),
esc_html( $value )
);
break;
}
if ( ! empty( $value ) ) {
$comment_data_to_export[] = array(
'name' => $name,
'value' => $value,
);
}
}
$data_to_export[] = array(
'group_id' => 'comments',
'group_label' => __( 'Comments' ),
'group_description' => __( 'User’s comment data.' ),
'item_id' => "comment-{$comment->comment_ID}",
'data' => $comment_data_to_export,
);
}
$done = count( $comments ) < $number;
return array(
'data' => $data_to_export,
'done' => $done,
);
}
```
| Uses | Description |
| --- | --- |
| [get\_comment\_text()](get_comment_text) wp-includes/comment-template.php | Retrieves the text of the current comment. |
| [get\_comment\_link()](get_comment_link) wp-includes/comment-template.php | Retrieves the link to a given comment. |
| [get\_comments()](get_comments) wp-includes/comment.php | Retrieves a list of comments. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [esc\_html()](esc_html) wp-includes/formatting.php | Escaping for HTML blocks. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress wp_unspam_comment( int|WP_Comment $comment_id ): bool wp\_unspam\_comment( int|WP\_Comment $comment\_id ): bool
=========================================================
Removes a comment from the Spam.
`$comment_id` int|[WP\_Comment](../classes/wp_comment) Required Comment ID or [WP\_Comment](../classes/wp_comment) object. bool True on success, false on failure.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
function wp_unspam_comment( $comment_id ) {
$comment = get_comment( $comment_id );
if ( ! $comment ) {
return false;
}
/**
* Fires immediately before a comment is unmarked as Spam.
*
* @since 2.9.0
* @since 4.9.0 Added the `$comment` parameter.
*
* @param string $comment_id The comment ID as a numeric string.
* @param WP_Comment $comment The comment to be unmarked as spam.
*/
do_action( 'unspam_comment', $comment->comment_ID, $comment );
$status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );
if ( empty( $status ) ) {
$status = '0';
}
if ( wp_set_comment_status( $comment, $status ) ) {
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
/**
* Fires immediately after a comment is unmarked as Spam.
*
* @since 2.9.0
* @since 4.9.0 Added the `$comment` parameter.
*
* @param string $comment_id The comment ID as a numeric string.
* @param WP_Comment $comment The comment unmarked as spam.
*/
do_action( 'unspammed_comment', $comment->comment_ID, $comment );
return true;
}
return false;
}
```
[do\_action( 'unspammed\_comment', string $comment\_id, WP\_Comment $comment )](../hooks/unspammed_comment)
Fires immediately after a comment is unmarked as Spam.
[do\_action( 'unspam\_comment', string $comment\_id, WP\_Comment $comment )](../hooks/unspam_comment)
Fires immediately before a comment is unmarked as Spam.
| Uses | Description |
| --- | --- |
| [get\_comment\_meta()](get_comment_meta) wp-includes/comment.php | Retrieves comment meta field for a comment. |
| [wp\_set\_comment\_status()](wp_set_comment_status) wp-includes/comment.php | Sets the status of a comment. |
| [delete\_comment\_meta()](delete_comment_meta) wp-includes/comment.php | Removes metadata matching criteria from a comment. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [get\_comment()](get_comment) wp-includes/comment.php | Retrieves comment data given a comment ID or comment object. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::handle\_status\_param()](../classes/wp_rest_comments_controller/handle_status_param) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Sets the comment\_status of a given comment object when creating or updating a comment. |
| [wp\_ajax\_delete\_comment()](wp_ajax_delete_comment) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a comment. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress wp_targeted_link_rel_callback( array $matches ): string wp\_targeted\_link\_rel\_callback( array $matches ): string
===========================================================
Callback to add `rel="noopener"` string to HTML A element.
Will not duplicate an existing ‘noopener’ value to avoid invalidating the HTML.
`$matches` array Required Single match. string HTML A Element with `rel="noopener"` in addition to any existing values.
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
function wp_targeted_link_rel_callback( $matches ) {
$link_html = $matches[1];
$original_link_html = $link_html;
// Consider the HTML escaped if there are no unescaped quotes.
$is_escaped = ! preg_match( '/(^|[^\\\\])[\'"]/', $link_html );
if ( $is_escaped ) {
// Replace only the quotes so that they are parsable by wp_kses_hair(), leave the rest as is.
$link_html = preg_replace( '/\\\\([\'"])/', '$1', $link_html );
}
$atts = wp_kses_hair( $link_html, wp_allowed_protocols() );
/**
* Filters the rel values that are added to links with `target` attribute.
*
* @since 5.1.0
*
* @param string $rel The rel values.
* @param string $link_html The matched content of the link tag including all HTML attributes.
*/
$rel = apply_filters( 'wp_targeted_link_rel', 'noopener', $link_html );
// Return early if no rel values to be added or if no actual target attribute.
if ( ! $rel || ! isset( $atts['target'] ) ) {
return "<a $original_link_html>";
}
if ( isset( $atts['rel'] ) ) {
$all_parts = preg_split( '/\s/', "{$atts['rel']['value']} $rel", -1, PREG_SPLIT_NO_EMPTY );
$rel = implode( ' ', array_unique( $all_parts ) );
}
$atts['rel']['whole'] = 'rel="' . esc_attr( $rel ) . '"';
$link_html = implode( ' ', array_column( $atts, 'whole' ) );
if ( $is_escaped ) {
$link_html = preg_replace( '/[\'"]/', '\\\\$0', $link_html );
}
return "<a $link_html>";
}
```
[apply\_filters( 'wp\_targeted\_link\_rel', string $rel, string $link\_html )](../hooks/wp_targeted_link_rel)
Filters the rel values that are added to links with `target` attribute.
| Uses | Description |
| --- | --- |
| [wp\_allowed\_protocols()](wp_allowed_protocols) wp-includes/functions.php | Retrieves a list of protocols to allow in HTML attributes. |
| [wp\_kses\_hair()](wp_kses_hair) wp-includes/kses.php | Builds an attribute list from string containing attributes. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Removed `'noreferrer'` relationship. |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress wp_print_file_editor_templates() wp\_print\_file\_editor\_templates()
====================================
Prints file editor templates (for plugins and themes).
File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
function wp_print_file_editor_templates() {
?>
<script type="text/html" id="tmpl-wp-file-editor-notice">
<div class="notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}">
<# if ( 'php_error' === data.code ) { #>
<p>
<?php
printf(
/* translators: 1: Line number, 2: File path. */
__( 'Your PHP code changes were rolled back due to an error on line %1$s of file %2$s. Please fix and try saving again.' ),
'{{ data.line }}',
'{{ data.file }}'
);
?>
</p>
<pre>{{ data.message }}</pre>
<# } else if ( 'file_not_writable' === data.code ) { #>
<p>
<?php
printf(
/* translators: %s: Documentation URL. */
__( 'You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.' ),
__( 'https://wordpress.org/support/article/changing-file-permissions/' )
);
?>
</p>
<# } else { #>
<p>{{ data.message || data.code }}</p>
<# if ( 'lint_errors' === data.code ) { #>
<p>
<# var elementId = 'el-' + String( Math.random() ); #>
<input id="{{ elementId }}" type="checkbox">
<label for="{{ elementId }}"><?php _e( 'Update anyway, even though it might break your site?' ); ?></label>
</p>
<# } #>
<# } #>
<# if ( data.dismissible ) { #>
<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php _e( 'Dismiss' ); ?></span></button>
<# } #>
</div>
</script>
<?php
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_e()](_e) wp-includes/l10n.php | Displays translated text. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress do_dismiss_core_update() do\_dismiss\_core\_update()
===========================
Dismiss a core update.
File: `wp-admin/update-core.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/update-core.php/)
```
function do_dismiss_core_update() {
$version = isset( $_POST['version'] ) ? $_POST['version'] : false;
$locale = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US';
$update = find_core_update( $version, $locale );
if ( ! $update ) {
return;
}
dismiss_core_update( $update );
wp_redirect( wp_nonce_url( 'update-core.php?action=upgrade-core', 'upgrade-core' ) );
exit;
}
```
| Uses | Description |
| --- | --- |
| [find\_core\_update()](find_core_update) wp-admin/includes/update.php | Finds the available update for WordPress core. |
| [dismiss\_core\_update()](dismiss_core_update) wp-admin/includes/update.php | Dismisses core update. |
| [wp\_redirect()](wp_redirect) wp-includes/pluggable.php | Redirects to another page. |
| [wp\_nonce\_url()](wp_nonce_url) wp-includes/functions.php | Retrieves URL with nonce added to URL query. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress wp_sitemaps_get_server(): WP_Sitemaps wp\_sitemaps\_get\_server(): WP\_Sitemaps
=========================================
Retrieves the current Sitemaps server instance.
[WP\_Sitemaps](../classes/wp_sitemaps) Sitemaps instance.
File: `wp-includes/sitemaps.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps.php/)
```
function wp_sitemaps_get_server() {
global $wp_sitemaps;
// If there isn't a global instance, set and bootstrap the sitemaps system.
if ( empty( $wp_sitemaps ) ) {
$wp_sitemaps = new WP_Sitemaps();
$wp_sitemaps->init();
/**
* Fires when initializing the Sitemaps object.
*
* Additional sitemaps should be registered on this hook.
*
* @since 5.5.0
*
* @param WP_Sitemaps $wp_sitemaps Sitemaps object.
*/
do_action( 'wp_sitemaps_init', $wp_sitemaps );
}
return $wp_sitemaps;
}
```
[do\_action( 'wp\_sitemaps\_init', WP\_Sitemaps $wp\_sitemaps )](../hooks/wp_sitemaps_init)
Fires when initializing the Sitemaps object.
| Uses | Description |
| --- | --- |
| [WP\_Sitemaps::\_\_construct()](../classes/wp_sitemaps/__construct) wp-includes/sitemaps/class-wp-sitemaps.php | [WP\_Sitemaps](../classes/wp_sitemaps) constructor. |
| [WP\_Sitemaps::init()](../classes/wp_sitemaps/init) wp-includes/sitemaps/class-wp-sitemaps.php | Initiates all sitemap functionality. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Used By | Description |
| --- | --- |
| [get\_sitemap\_url()](get_sitemap_url) wp-includes/sitemaps.php | Retrieves the full URL for a sitemap. |
| [wp\_get\_sitemap\_providers()](wp_get_sitemap_providers) wp-includes/sitemaps.php | Gets an array of sitemap providers. |
| [wp\_register\_sitemap\_provider()](wp_register_sitemap_provider) wp-includes/sitemaps.php | Registers a new sitemap provider. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress wp_check_locked_posts( array $response, array $data, string $screen_id ): array wp\_check\_locked\_posts( array $response, array $data, string $screen\_id ): array
===================================================================================
Checks lock status for posts displayed on the Posts screen.
`$response` array Required The Heartbeat response. `$data` array Required The $\_POST data sent. `$screen_id` string Required The screen ID. array The Heartbeat response.
File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
function wp_check_locked_posts( $response, $data, $screen_id ) {
$checked = array();
if ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {
foreach ( $data['wp-check-locked-posts'] as $key ) {
$post_id = absint( substr( $key, 5 ) );
if ( ! $post_id ) {
continue;
}
$user_id = wp_check_post_lock( $post_id );
if ( $user_id ) {
$user = get_userdata( $user_id );
if ( $user && current_user_can( 'edit_post', $post_id ) ) {
$send = array(
'name' => $user->display_name,
/* translators: %s: User's display name. */
'text' => sprintf( __( '%s is currently editing' ), $user->display_name ),
);
if ( get_option( 'show_avatars' ) ) {
$send['avatar_src'] = get_avatar_url( $user->ID, array( 'size' => 18 ) );
$send['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 36 ) );
}
$checked[ $key ] = $send;
}
}
}
}
if ( ! empty( $checked ) ) {
$response['wp-check-locked-posts'] = $checked;
}
return $response;
}
```
| Uses | Description |
| --- | --- |
| [get\_avatar\_url()](get_avatar_url) wp-includes/link-template.php | Retrieves the avatar URL. |
| [wp\_check\_post\_lock()](wp_check_post_lock) wp-admin/includes/post.php | Determines whether the post is currently being edited by another user. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_userdata()](get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| [absint()](absint) wp-includes/functions.php | Converts a value to non-negative integer. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
| programming_docs |
wordpress delete_blog_option( int $id, string $option ): bool delete\_blog\_option( int $id, string $option ): bool
=====================================================
Removes option by name for a given blog ID. Prevents removal of protected WordPress options.
`$id` int Required A blog ID. Can be null to refer to the current blog. `$option` string Required Name of option to remove. Expected to not be SQL-escaped. bool True if the option was deleted, false otherwise.
File: `wp-includes/ms-blogs.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-blogs.php/)
```
function delete_blog_option( $id, $option ) {
$id = (int) $id;
if ( empty( $id ) ) {
$id = get_current_blog_id();
}
if ( get_current_blog_id() == $id ) {
return delete_option( $option );
}
switch_to_blog( $id );
$return = delete_option( $option );
restore_current_blog();
return $return;
}
```
| Uses | Description |
| --- | --- |
| [switch\_to\_blog()](switch_to_blog) wp-includes/ms-blogs.php | Switch the current blog. |
| [delete\_option()](delete_option) wp-includes/option.php | Removes option by name. Prevents removal of protected WordPress options. |
| [restore\_current\_blog()](restore_current_blog) wp-includes/ms-blogs.php | Restore the current blog, after calling [switch\_to\_blog()](switch_to_blog) . |
| [get\_current\_blog\_id()](get_current_blog_id) wp-includes/load.php | Retrieve the current site ID. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress comment_form( array $args = array(), int|WP_Post $post = null ) comment\_form( array $args = array(), int|WP\_Post $post = null )
=================================================================
Outputs a complete commenting form for use within a template.
Most strings and form fields may be controlled through the `$args` array passed into the function, while you may also choose to use the [‘comment\_form\_default\_fields’](../hooks/comment_form_default_fields) filter to modify the array of default fields if you’d just like to add a new one or remove a single field. All fields are also individually passed through a filter of the [‘comment\_form\_field\_$name’](../hooks/comment_form_field_name) where `$name` is the key used in the array of fields.
`$args` array Optional Default arguments and form fields to override.
* `fields`array Default comment fields, filterable by default via the ['comment\_form\_default\_fields'](../hooks/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'`. Default: `array()`
`$post` int|[WP\_Post](../classes/wp_post) Optional Post ID or [WP\_Post](../classes/wp_post) object to generate the form for. Default current post. Default: `null`
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
function comment_form( $args = array(), $post = null ) {
$post = get_post( $post );
// Exit the function if the post is invalid or comments are closed.
if ( ! $post || ! comments_open( $post ) ) {
/**
* Fires after the comment form if comments are closed.
*
* For backward compatibility, this action also fires if comment_form()
* is called with an invalid post object or ID.
*
* @since 3.0.0
*/
do_action( 'comment_form_comments_closed' );
return;
}
$post_id = $post->ID;
$commenter = wp_get_current_commenter();
$user = wp_get_current_user();
$user_identity = $user->exists() ? $user->display_name : '';
$args = wp_parse_args( $args );
if ( ! isset( $args['format'] ) ) {
$args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
}
$req = get_option( 'require_name_email' );
$html5 = 'html5' === $args['format'];
// Define attributes in HTML5 or XHTML syntax.
$required_attribute = ( $html5 ? ' required' : ' required="required"' );
$checked_attribute = ( $html5 ? ' checked' : ' checked="checked"' );
// Identify required fields visually and create a message about the indicator.
$required_indicator = ' ' . wp_required_field_indicator();
$required_text = ' ' . wp_required_field_message();
$fields = array(
'author' => sprintf(
'<p class="comment-form-author">%s %s</p>',
sprintf(
'<label for="author">%s%s</label>',
__( 'Name' ),
( $req ? $required_indicator : '' )
),
sprintf(
'<input id="author" name="author" type="text" value="%s" size="30" maxlength="245" autocomplete="name"%s />',
esc_attr( $commenter['comment_author'] ),
( $req ? $required_attribute : '' )
)
),
'email' => sprintf(
'<p class="comment-form-email">%s %s</p>',
sprintf(
'<label for="email">%s%s</label>',
__( 'Email' ),
( $req ? $required_indicator : '' )
),
sprintf(
'<input id="email" name="email" %s value="%s" size="30" maxlength="100" aria-describedby="email-notes" autocomplete="email"%s />',
( $html5 ? 'type="email"' : 'type="text"' ),
esc_attr( $commenter['comment_author_email'] ),
( $req ? $required_attribute : '' )
)
),
'url' => sprintf(
'<p class="comment-form-url">%s %s</p>',
sprintf(
'<label for="url">%s</label>',
__( 'Website' )
),
sprintf(
'<input id="url" name="url" %s value="%s" size="30" maxlength="200" autocomplete="url" />',
( $html5 ? 'type="url"' : 'type="text"' ),
esc_attr( $commenter['comment_author_url'] )
)
),
);
if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) && get_option( 'show_comments_cookies_opt_in' ) ) {
$consent = empty( $commenter['comment_author_email'] ) ? '' : $checked_attribute;
$fields['cookies'] = sprintf(
'<p class="comment-form-cookies-consent">%s %s</p>',
sprintf(
'<input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"%s />',
$consent
),
sprintf(
'<label for="wp-comment-cookies-consent">%s</label>',
__( 'Save my name, email, and website in this browser for the next time I comment.' )
)
);
// Ensure that the passed fields include cookies consent.
if ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) {
$args['fields']['cookies'] = $fields['cookies'];
}
}
/**
* Filters the default comment form fields.
*
* @since 3.0.0
*
* @param string[] $fields Array of the default comment fields.
*/
$fields = apply_filters( 'comment_form_default_fields', $fields );
$defaults = array(
'fields' => $fields,
'comment_field' => sprintf(
'<p class="comment-form-comment">%s %s</p>',
sprintf(
'<label for="comment">%s%s</label>',
_x( 'Comment', 'noun' ),
$required_indicator
),
'<textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525"' . $required_attribute . '></textarea>'
),
'must_log_in' => sprintf(
'<p class="must-log-in">%s</p>',
sprintf(
/* translators: %s: Login URL. */
__( 'You must be <a href="%s">logged in</a> to post a comment.' ),
/** This filter is documented in wp-includes/link-template.php */
wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
)
),
'logged_in_as' => sprintf(
'<p class="logged-in-as">%s%s</p>',
sprintf(
/* translators: 1: User name, 2: Edit user link, 3: Logout URL. */
__( 'Logged in as %1$s. <a href="%2$s">Edit your profile</a>. <a href="%3$s">Log out?</a>' ),
$user_identity,
get_edit_user_link(),
/** This filter is documented in wp-includes/link-template.php */
wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
),
$required_text
),
'comment_notes_before' => sprintf(
'<p class="comment-notes">%s%s</p>',
sprintf(
'<span id="email-notes">%s</span>',
__( 'Your email address will not be published.' )
),
$required_text
),
'comment_notes_after' => '',
'action' => site_url( '/wp-comments-post.php' ),
'id_form' => 'commentform',
'id_submit' => 'submit',
'class_container' => 'comment-respond',
'class_form' => 'comment-form',
'class_submit' => 'submit',
'name_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
/* translators: %s: Author of the comment being replied to. */
'title_reply_to' => __( 'Leave a Reply to %s' ),
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h3>',
'cancel_reply_before' => ' <small>',
'cancel_reply_after' => '</small>',
'cancel_reply_link' => __( 'Cancel reply' ),
'label_submit' => __( 'Post Comment' ),
'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />',
'submit_field' => '<p class="form-submit">%1$s %2$s</p>',
'format' => 'xhtml',
);
/**
* Filters the comment form default arguments.
*
* Use {@see 'comment_form_default_fields'} to filter the comment fields.
*
* @since 3.0.0
*
* @param array $defaults The default comment form arguments.
*/
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
// Ensure that the filtered arguments contain all required default values.
$args = array_merge( $defaults, $args );
// Remove `aria-describedby` from the email field if there's no associated description.
if ( isset( $args['fields']['email'] ) && false === strpos( $args['comment_notes_before'], 'id="email-notes"' ) ) {
$args['fields']['email'] = str_replace(
' aria-describedby="email-notes"',
'',
$args['fields']['email']
);
}
/**
* Fires before the comment form.
*
* @since 3.0.0
*/
do_action( 'comment_form_before' );
?>
<div id="respond" class="<?php echo esc_attr( $args['class_container'] ); ?>">
<?php
echo $args['title_reply_before'];
comment_form_title( $args['title_reply'], $args['title_reply_to'] );
if ( get_option( 'thread_comments' ) ) {
echo $args['cancel_reply_before'];
cancel_comment_reply_link( $args['cancel_reply_link'] );
echo $args['cancel_reply_after'];
}
echo $args['title_reply_after'];
if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) :
echo $args['must_log_in'];
/**
* Fires after the HTML-formatted 'must log in after' message in the comment form.
*
* @since 3.0.0
*/
do_action( 'comment_form_must_log_in_after' );
else :
printf(
'<form action="%s" method="post" id="%s" class="%s"%s>',
esc_url( $args['action'] ),
esc_attr( $args['id_form'] ),
esc_attr( $args['class_form'] ),
( $html5 ? ' novalidate' : '' )
);
/**
* Fires at the top of the comment form, inside the form tag.
*
* @since 3.0.0
*/
do_action( 'comment_form_top' );
if ( is_user_logged_in() ) :
/**
* Filters the 'logged in' message for the comment form for display.
*
* @since 3.0.0
*
* @param string $args_logged_in The HTML for the 'logged in as [user]' message,
* the Edit profile link, and the Log out link.
* @param array $commenter An array containing the comment author's
* username, email, and URL.
* @param string $user_identity If the commenter is a registered user,
* the display name, blank otherwise.
*/
echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity );
/**
* Fires after the is_user_logged_in() check in the comment form.
*
* @since 3.0.0
*
* @param array $commenter An array containing the comment author's
* username, email, and URL.
* @param string $user_identity If the commenter is a registered user,
* the display name, blank otherwise.
*/
do_action( 'comment_form_logged_in_after', $commenter, $user_identity );
else :
echo $args['comment_notes_before'];
endif;
// Prepare an array of all fields, including the textarea.
$comment_fields = array( 'comment' => $args['comment_field'] ) + (array) $args['fields'];
/**
* Filters the comment form fields, including the textarea.
*
* @since 4.4.0
*
* @param array $comment_fields The comment fields.
*/
$comment_fields = apply_filters( 'comment_form_fields', $comment_fields );
// Get an array of field names, excluding the textarea.
$comment_field_keys = array_diff( array_keys( $comment_fields ), array( 'comment' ) );
// Get the first and the last field name, excluding the textarea.
$first_field = reset( $comment_field_keys );
$last_field = end( $comment_field_keys );
foreach ( $comment_fields as $name => $field ) {
if ( 'comment' === $name ) {
/**
* Filters the content of the comment textarea field for display.
*
* @since 3.0.0
*
* @param string $args_comment_field The content of the comment textarea field.
*/
echo apply_filters( 'comment_form_field_comment', $field );
echo $args['comment_notes_after'];
} elseif ( ! is_user_logged_in() ) {
if ( $first_field === $name ) {
/**
* Fires before the comment fields in the comment form, excluding the textarea.
*
* @since 3.0.0
*/
do_action( 'comment_form_before_fields' );
}
/**
* 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`
*
* @since 3.0.0
*
* @param string $field The HTML-formatted output of the comment form field.
*/
echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
if ( $last_field === $name ) {
/**
* Fires after the comment fields in the comment form, excluding the textarea.
*
* @since 3.0.0
*/
do_action( 'comment_form_after_fields' );
}
}
}
$submit_button = sprintf(
$args['submit_button'],
esc_attr( $args['name_submit'] ),
esc_attr( $args['id_submit'] ),
esc_attr( $args['class_submit'] ),
esc_attr( $args['label_submit'] )
);
/**
* Filters the submit button for the comment form to display.
*
* @since 4.2.0
*
* @param string $submit_button HTML markup for the submit button.
* @param array $args Arguments passed to comment_form().
*/
$submit_button = apply_filters( 'comment_form_submit_button', $submit_button, $args );
$submit_field = sprintf(
$args['submit_field'],
$submit_button,
get_comment_id_fields( $post_id )
);
/**
* Filters the submit field for the comment form to display.
*
* The submit field includes the submit button, hidden fields for the
* comment form, and any wrapper markup.
*
* @since 4.2.0
*
* @param string $submit_field HTML markup for the submit field.
* @param array $args Arguments passed to comment_form().
*/
echo apply_filters( 'comment_form_submit_field', $submit_field, $args );
/**
* Fires at the bottom of the comment form, inside the closing form tag.
*
* @since 1.5.0
*
* @param int $post_id The post ID.
*/
do_action( 'comment_form', $post_id );
echo '</form>';
endif;
?>
</div><!-- #respond -->
<?php
/**
* Fires after the comment form.
*
* @since 3.0.0
*/
do_action( 'comment_form_after' );
}
```
[do\_action( 'comment\_form', int $post\_id )](../hooks/comment_form)
Fires at the bottom of the comment form, inside the closing form tag.
[do\_action( 'comment\_form\_after' )](../hooks/comment_form_after)
Fires after the comment form.
[do\_action( 'comment\_form\_after\_fields' )](../hooks/comment_form_after_fields)
Fires after the comment fields in the comment form, excluding the textarea.
[do\_action( 'comment\_form\_before' )](../hooks/comment_form_before)
Fires before the comment form.
[do\_action( 'comment\_form\_before\_fields' )](../hooks/comment_form_before_fields)
Fires before the comment fields in the comment form, excluding the textarea.
[do\_action( 'comment\_form\_comments\_closed' )](../hooks/comment_form_comments_closed)
Fires after the comment form if comments are closed.
[apply\_filters( 'comment\_form\_defaults', array $defaults )](../hooks/comment_form_defaults)
Filters the comment form default arguments.
[apply\_filters( 'comment\_form\_default\_fields', string[] $fields )](../hooks/comment_form_default_fields)
Filters the default comment form fields.
[apply\_filters( 'comment\_form\_fields', array $comment\_fields )](../hooks/comment_form_fields)
Filters the comment form fields, including the textarea.
[apply\_filters( 'comment\_form\_field\_comment', string $args\_comment\_field )](../hooks/comment_form_field_comment)
Filters the content of the comment textarea field for display.
[apply\_filters( "comment\_form\_field\_{$name}", string $field )](../hooks/comment_form_field_name)
Filters a comment form field for display.
[apply\_filters( 'comment\_form\_logged\_in', string $args\_logged\_in, array $commenter, string $user\_identity )](../hooks/comment_form_logged_in)
Filters the ‘logged in’ message for the comment form for display.
[do\_action( 'comment\_form\_logged\_in\_after', array $commenter, string $user\_identity )](../hooks/comment_form_logged_in_after)
Fires after the [is\_user\_logged\_in()](is_user_logged_in) check in the comment form.
[do\_action( 'comment\_form\_must\_log\_in\_after' )](../hooks/comment_form_must_log_in_after)
Fires after the HTML-formatted ‘must log in after’ message in the comment form.
[apply\_filters( 'comment\_form\_submit\_button', string $submit\_button, array $args )](../hooks/comment_form_submit_button)
Filters the submit button for the comment form to display.
[apply\_filters( 'comment\_form\_submit\_field', string $submit\_field, array $args )](../hooks/comment_form_submit_field)
Filters the submit field for the comment form to display.
[do\_action( 'comment\_form\_top' )](../hooks/comment_form_top)
Fires at the top of the comment form, inside the form tag.
[apply\_filters( 'the\_permalink', string $permalink, int|WP\_Post $post )](../hooks/the_permalink)
Filters the display of the permalink for the current post.
| Uses | Description |
| --- | --- |
| [wp\_required\_field\_message()](wp_required_field_message) wp-includes/general-template.php | Creates a message to explain required form fields. |
| [wp\_logout\_url()](wp_logout_url) wp-includes/general-template.php | Retrieves the logout URL. |
| [comments\_open()](comments_open) wp-includes/comment-template.php | Determines whether the current post is open for comments. |
| [get\_comment\_id\_fields()](get_comment_id_fields) wp-includes/comment-template.php | Retrieves hidden input HTML for replying to comments. |
| [cancel\_comment\_reply\_link()](cancel_comment_reply_link) wp-includes/comment-template.php | Displays HTML content for cancel comment reply link. |
| [comment\_form\_title()](comment_form_title) wp-includes/comment-template.php | Displays text based on comment reply status. |
| [has\_action()](has_action) wp-includes/plugin.php | Checks if any action has been registered for a hook. |
| [get\_edit\_user\_link()](get_edit_user_link) wp-includes/link-template.php | Retrieves the edit user link. |
| [wp\_required\_field\_indicator()](wp_required_field_indicator) wp-includes/general-template.php | Assigns a visual indicator for required form fields. |
| [site\_url()](site_url) wp-includes/link-template.php | Retrieves the URL for the current site where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible. |
| [wp\_login\_url()](wp_login_url) wp-includes/general-template.php | Retrieves the login URL. |
| [wp\_get\_current\_user()](wp_get_current_user) wp-includes/pluggable.php | Retrieves the current user object. |
| [wp\_get\_current\_commenter()](wp_get_current_commenter) wp-includes/comment.php | Gets current commenter’s name, email, and URL. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [is\_user\_logged\_in()](is_user_logged_in) wp-includes/pluggable.php | Determines whether the current visitor is a logged in user. |
| [get\_permalink()](get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [current\_theme\_supports()](current_theme_supports) wp-includes/theme.php | Checks a theme’s support for a given feature. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced the `'class_container'` argument. |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced the `'cookies'` default comment field. |
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced the `'action'` argument. |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | The `'author'`, `'email'`, and `'url'` form fields are limited to 245, 100, and 200 characters, respectively. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced the `'class_form'`, `'title_reply_before'`, `'title_reply_after'`, `'cancel_reply_before'`, and `'cancel_reply_after'` arguments. |
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced the `'submit_button'` and `'submit_fields'` arguments. |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced the `'class_submit'` argument. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress wp_get_referer(): string|false wp\_get\_referer(): string|false
================================
Retrieves referer from ‘\_wp\_http\_referer’ or HTTP referer.
If it’s the same as the current request URL, will return false.
string|false Referer URL on success, false on failure.
HTTP referer is a server variable. ‘referer’ is deliberately misspelled.
If page “refered” (form posted) to itself, returns false (because $\_SERVER[‘HTTP\_REFERER’] == $\_REQUEST[‘\_wp\_http\_referer’])
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function wp_get_referer() {
if ( ! function_exists( 'wp_validate_redirect' ) ) {
return false;
}
$ref = wp_get_raw_referer();
if ( $ref && wp_unslash( $_SERVER['REQUEST_URI'] ) !== $ref && home_url() . wp_unslash( $_SERVER['REQUEST_URI'] ) !== $ref ) {
return wp_validate_redirect( $ref, false );
}
return false;
}
```
| Uses | Description |
| --- | --- |
| [wp\_get\_raw\_referer()](wp_get_raw_referer) wp-includes/functions.php | Retrieves unvalidated referer from ‘\_wp\_http\_referer’ or HTTP referer. |
| [wp\_validate\_redirect()](wp_validate_redirect) wp-includes/pluggable.php | Validates a URL for use in a redirect. |
| [wp\_unslash()](wp_unslash) wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| [home\_url()](home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| Used By | Description |
| --- | --- |
| [WP\_Recovery\_Mode::handle\_exit\_recovery\_mode()](../classes/wp_recovery_mode/handle_exit_recovery_mode) wp-includes/class-wp-recovery-mode.php | Handles a request to exit Recovery Mode. |
| [the\_block\_editor\_meta\_box\_post\_form\_hidden\_fields()](the_block_editor_meta_box_post_form_hidden_fields) wp-admin/includes/post.php | Renders the hidden form required for the meta boxes form. |
| [WP\_Customize\_Manager::get\_return\_url()](../classes/wp_customize_manager/get_return_url) wp-includes/class-wp-customize-manager.php | Gets URL to link the user to when closing the Customizer. |
| [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. |
| [wp\_media\_attach\_action()](wp_media_attach_action) wp-admin/includes/media.php | Encapsulates the logic for Attach/Detach actions. |
| [set\_screen\_options()](set_screen_options) wp-admin/includes/misc.php | Saves option for number of rows when listing posts, pages, comments, etc. |
| [\_admin\_notice\_post\_locked()](_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. |
| [WP\_Terms\_List\_Table::column\_name()](../classes/wp_terms_list_table/column_name) wp-admin/includes/class-wp-terms-list-table.php | |
| [redirect\_post()](redirect_post) wp-admin/includes/post.php | Redirects to previous page. |
| [auth\_redirect()](auth_redirect) wp-includes/pluggable.php | Checks if a user is logged in, if not it redirects them to the login page. |
| [check\_admin\_referer()](check_admin_referer) wp-includes/pluggable.php | Ensures intent by verifying that a user was referred from another admin page with the correct security nonce. |
| [wp\_nonce\_ays()](wp_nonce_ays) wp-includes/functions.php | Displays “Are You Sure” message to confirm the action being taken. |
| [wp\_original\_referer\_field()](wp_original_referer_field) wp-includes/functions.php | Retrieves or displays original referer hidden field for forms. |
| Version | Description |
| --- | --- |
| [2.0.4](https://developer.wordpress.org/reference/since/2.0.4/) | Introduced. |
wordpress rest_get_queried_resource_route(): string rest\_get\_queried\_resource\_route(): string
=============================================
Gets the REST route for the currently queried object.
string The REST route of the resource, or an empty string if no resource identified.
File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
function rest_get_queried_resource_route() {
if ( is_singular() ) {
$route = rest_get_route_for_post( get_queried_object() );
} elseif ( is_category() || is_tag() || is_tax() ) {
$route = rest_get_route_for_term( get_queried_object() );
} elseif ( is_author() ) {
$route = '/wp/v2/users/' . get_queried_object_id();
} else {
$route = '';
}
/**
* Filters the REST route for the currently queried object.
*
* @since 5.5.0
*
* @param string $link The route with a leading slash, or an empty string.
*/
return apply_filters( 'rest_queried_resource_route', $route );
}
```
[apply\_filters( 'rest\_queried\_resource\_route', string $link )](../hooks/rest_queried_resource_route)
Filters the REST route for the currently queried object.
| Uses | Description |
| --- | --- |
| [rest\_get\_route\_for\_post()](rest_get_route_for_post) wp-includes/rest-api.php | Gets the REST API route for a post. |
| [rest\_get\_route\_for\_term()](rest_get_route_for_term) wp-includes/rest-api.php | Gets the REST API route for a term. |
| [is\_singular()](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). |
| [is\_category()](is_category) wp-includes/query.php | Determines whether the query is for an existing category archive page. |
| [is\_tag()](is_tag) wp-includes/query.php | Determines whether the query is for an existing tag archive page. |
| [is\_tax()](is_tax) wp-includes/query.php | Determines whether the query is for an existing custom taxonomy archive page. |
| [is\_author()](is_author) wp-includes/query.php | Determines whether the query is for an existing author archive page. |
| [get\_queried\_object()](get_queried_object) wp-includes/query.php | Retrieves the currently queried object. |
| [get\_queried\_object\_id()](get_queried_object_id) wp-includes/query.php | Retrieves the ID of the currently queried object. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [rest\_output\_link\_wp\_head()](rest_output_link_wp_head) wp-includes/rest-api.php | Outputs the REST API link tag into page header. |
| [rest\_output\_link\_header()](rest_output_link_header) wp-includes/rest-api.php | Sends a Link header for the REST API. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress wp_write_post(): int|WP_Error wp\_write\_post(): int|WP\_Error
================================
Creates a new post from the “Write Post” form using `$_POST` information.
int|[WP\_Error](../classes/wp_error) Post ID on success, [WP\_Error](../classes/wp_error) on failure.
File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
function wp_write_post() {
if ( isset( $_POST['post_type'] ) ) {
$ptype = get_post_type_object( $_POST['post_type'] );
} else {
$ptype = get_post_type_object( 'post' );
}
if ( ! current_user_can( $ptype->cap->edit_posts ) ) {
if ( 'page' === $ptype->name ) {
return new WP_Error( 'edit_pages', __( 'Sorry, you are not allowed to create pages on this site.' ) );
} else {
return new WP_Error( 'edit_posts', __( 'Sorry, you are not allowed to create posts or drafts on this site.' ) );
}
}
$_POST['post_mime_type'] = '';
// Clear out any data in internal vars.
unset( $_POST['filter'] );
// Edit, don't write, if we have a post ID.
if ( isset( $_POST['post_ID'] ) ) {
return edit_post();
}
if ( isset( $_POST['visibility'] ) ) {
switch ( $_POST['visibility'] ) {
case 'public':
$_POST['post_password'] = '';
break;
case 'password':
unset( $_POST['sticky'] );
break;
case 'private':
$_POST['post_status'] = 'private';
$_POST['post_password'] = '';
unset( $_POST['sticky'] );
break;
}
}
$translated = _wp_translate_postdata( false );
if ( is_wp_error( $translated ) ) {
return $translated;
}
$translated = _wp_get_allowed_postdata( $translated );
// Create the post.
$post_ID = wp_insert_post( $translated );
if ( is_wp_error( $post_ID ) ) {
return $post_ID;
}
if ( empty( $post_ID ) ) {
return 0;
}
add_meta( $post_ID );
add_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID );
// Now that we have an ID we can fix any attachment anchor hrefs.
_fix_attachment_links( $post_ID );
wp_set_post_lock( $post_ID );
return $post_ID;
}
```
| Uses | Description |
| --- | --- |
| [\_wp\_get\_allowed\_postdata()](_wp_get_allowed_postdata) wp-admin/includes/post.php | Returns only allowed post data fields. |
| [wp\_set\_post\_lock()](wp_set_post_lock) wp-admin/includes/post.php | Marks the post as currently being edited by the current user. |
| [add\_meta()](add_meta) wp-admin/includes/post.php | Adds post meta data defined in the `$_POST` superglobal for a post with given ID. |
| [\_fix\_attachment\_links()](_fix_attachment_links) wp-admin/includes/post.php | Replaces hrefs of attachment anchors with up-to-date permalinks. |
| [edit\_post()](edit_post) wp-admin/includes/post.php | Updates an existing post with values provided in `$_POST`. |
| [\_wp\_translate\_postdata()](_wp_translate_postdata) wp-admin/includes/post.php | Renames `$_POST` data from form names to DB post columns. |
| [wp\_insert\_post()](wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| [add\_post\_meta()](add_post_meta) wp-includes/post.php | Adds a meta field to the given post. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_post\_type\_object()](get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [write\_post()](write_post) wp-admin/includes/post.php | Calls [wp\_write\_post()](wp_write_post) and handles the errors. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress wp_ssl_constants() wp\_ssl\_constants()
====================
Defines SSL-related WordPress constants.
File: `wp-includes/default-constants.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/default-constants.php/)
```
function wp_ssl_constants() {
/**
* @since 2.6.0
*/
if ( ! defined( 'FORCE_SSL_ADMIN' ) ) {
if ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) {
define( 'FORCE_SSL_ADMIN', true );
} else {
define( 'FORCE_SSL_ADMIN', false );
}
}
force_ssl_admin( FORCE_SSL_ADMIN );
/**
* @since 2.6.0
* @deprecated 4.0.0
*/
if ( defined( 'FORCE_SSL_LOGIN' ) && FORCE_SSL_LOGIN ) {
force_ssl_admin( true );
}
}
```
| Uses | Description |
| --- | --- |
| [force\_ssl\_admin()](force_ssl_admin) wp-includes/functions.php | Determines whether to force SSL used for the Administration Screens. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress load_default_textdomain( string $locale = null ): bool load\_default\_textdomain( string $locale = null ): bool
========================================================
Loads default translated strings based on locale.
Loads the .mo file in WP\_LANG\_DIR constant path from WordPress root.
The translated (.mo) file is named based on the locale.
* [load\_textdomain()](load_textdomain)
`$locale` string Optional Locale to load. Default is the value of [get\_locale()](get_locale) . Default: `null`
bool Whether the textdomain was loaded.
File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
function load_default_textdomain( $locale = null ) {
if ( null === $locale ) {
$locale = determine_locale();
}
// Unload previously loaded strings so we can switch translations.
unload_textdomain( 'default' );
$return = load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo", $locale );
if ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists( WP_LANG_DIR . "/admin-$locale.mo" ) ) {
load_textdomain( 'default', WP_LANG_DIR . "/ms-$locale.mo", $locale );
return $return;
}
if ( is_admin() || wp_installing() || ( defined( 'WP_REPAIRING' ) && WP_REPAIRING ) ) {
load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo", $locale );
}
if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) {
load_textdomain( 'default', WP_LANG_DIR . "/admin-network-$locale.mo", $locale );
}
return $return;
}
```
| Uses | Description |
| --- | --- |
| [determine\_locale()](determine_locale) wp-includes/l10n.php | Determines the current locale desired for the request. |
| [wp\_installing()](wp_installing) wp-includes/load.php | Check or set whether WordPress is in “installation” mode. |
| [unload\_textdomain()](unload_textdomain) wp-includes/l10n.php | Unloads translations for a text domain. |
| [load\_textdomain()](load_textdomain) wp-includes/l10n.php | Loads a .mo file into the text domain $domain. |
| [is\_network\_admin()](is_network_admin) wp-includes/load.php | Determines whether the current request is for the network administrative interface. |
| [is\_multisite()](is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [is\_admin()](is_admin) wp-includes/load.php | Determines whether the current request is for an administrative interface page. |
| Used By | Description |
| --- | --- |
| [WP\_Fatal\_Error\_Handler::handle()](../classes/wp_fatal_error_handler/handle) wp-includes/class-wp-fatal-error-handler.php | Runs the shutdown handler. |
| [WP\_Locale\_Switcher::load\_translations()](../classes/wp_locale_switcher/load_translations) wp-includes/class-wp-locale-switcher.php | Load translations for a given locale. |
| [\_redirect\_to\_about\_wordpress()](_redirect_to_about_wordpress) wp-admin/includes/update-core.php | Redirect to the About WordPress page after a successful upgrade. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress apply_filters_ref_array( string $hook_name, array $args ): mixed apply\_filters\_ref\_array( string $hook\_name, array $args ): mixed
====================================================================
Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
* [apply\_filters()](apply_filters) : This function is identical, but the arguments passed to the functions hooked to `$hook_name` are supplied using an array.
`$hook_name` string Required The name of the filter hook. `$args` array Required The arguments supplied to the functions hooked to `$hook_name`. mixed The filtered value after all hooked functions are applied to it.
* This function can be useful when your arguments are already in an array, and/or when there are many arguments to pass. Just make sure that your arguments are in the proper order!
* Before PHP 5.4, your callback is passed a reference pointer to the array. Your callback can use this pointer to access all the array elements. Adding a filter and declaring a call back that hooks the above example filter could look like this:
```
add_filter('my_filter', 'my_callback');
function my_callback( $args ) {
//access values with $args[0], $args[1] etc.
}
```
Because the array was passed by reference, any changes to the array elements are applied to the original array outside of the function’s scope.
* Regardless of PHP version, you can specify the number of array elements when adding the filter, and receive each element in a separate parameter in the callback function declaration like so:
```
add_action('my_filter', 'my_callback', 10, 4 );
function my_callback( $arg1, $arg2, $arg3, $arg4 ) {
//access values with $args1, $args2 etc.
}
```
This method copies the array elements into the parameter variables. Any changes to the parameter variables do not affect the original array.
* As of PHP 5.4, the array is no longer passed by reference despite the function’s name. You cannot even use the reference sign ‘&’ because call time pass by reference now throws an error. What you can do is pass the reference pointer as an array element. Doing so does require all callbacks added to the filter to expect a reference pointer. This is not something you will see in WordPress actions. This technique is provided for informational purposes only.
```
apply_filters_ref_array( 'my_filter', array( &$args ));
add_action('my_filter', 'my_callback');
function my_callback( &$args ) {
//access values with $args[0], $args[1] etc.
}
```
Because the original array was passed by reference, any changes to the array elements are applied to the original array outside of the function’s scope.
File: `wp-includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/plugin.php/)
```
function apply_filters_ref_array( $hook_name, $args ) {
global $wp_filter, $wp_filters, $wp_current_filter;
if ( ! isset( $wp_filters[ $hook_name ] ) ) {
$wp_filters[ $hook_name ] = 1;
} else {
++$wp_filters[ $hook_name ];
}
// Do 'all' actions first.
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $args[0];
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
$filtered = $wp_filter[ $hook_name ]->apply_filters( $args[0], $args );
array_pop( $wp_current_filter );
return $filtered;
}
```
| Uses | Description |
| --- | --- |
| [\_wp\_call\_all\_hook()](_wp_call_all_hook) wp-includes/plugin.php | Calls the ‘all’ hook, which will process the functions hooked into it. |
| 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. |
| [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. |
| [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. |
| [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. |
| [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. |
| [apply\_filters\_deprecated()](apply_filters_deprecated) wp-includes/plugin.php | Fires functions attached to a deprecated filter hook. |
| [WP\_Comment\_Query::get\_comment\_ids()](../classes/wp_comment_query/get_comment_ids) wp-includes/class-wp-comment-query.php | Used internally to get a list of comment IDs matching the query vars. |
| [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. |
| [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. |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| [WP\_User\_Query::query()](../classes/wp_user_query/query) wp-includes/class-wp-user-query.php | Executes the query, with the current variables. |
| [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.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress wp_list_categories( array|string $args = '' ): void|string|false wp\_list\_categories( array|string $args = '' ): void|string|false
==================================================================
Displays or retrieves the HTML list of categories.
`$args` array|string Optional Array of optional arguments. See [get\_categories()](get_categories) , [get\_terms()](get_terms) , and [WP\_Term\_Query::\_\_construct()](../classes/wp_term_query/__construct) for information on additional accepted arguments.
* `current_category`int|int[]ID of category, or array of IDs of categories, that should get the `'current-cat'` class. Default 0.
* `depth`intCategory depth. Used for tab indentation. Default 0.
* `echo`bool|intWhether to echo or return the generated markup. Accepts 0, 1, or their bool equivalents. Default 1.
* `exclude`int[]|stringArray or comma/space-separated string of term IDs to exclude.
If `$hierarchical` is true, descendants of `$exclude` terms will also be excluded; see `$exclude_tree`. See [get\_terms()](get_terms) .
* `exclude_tree`int[]|stringArray or comma/space-separated string of term IDs to exclude, along with their descendants. See [get\_terms()](get_terms) .
* `feed`stringText to use for the feed link. Default 'Feed for all posts filed under [cat name]'.
* `feed_image`stringURL of an image to use for the feed link.
* `feed_type`stringFeed type. Used to build feed link. See [get\_term\_feed\_link()](get_term_feed_link) .
Default empty string (default feed).
* `hide_title_if_empty`boolWhether to hide the `$title_li` element if there are no terms in the list. Default false (title will always be shown).
* `separator`stringSeparator between links. Default `<br />`.
* `show_count`bool|intWhether to include post counts. Accepts 0, 1, or their bool equivalents.
Default 0.
* `show_option_all`stringText to display for showing all categories.
* `show_option_none`stringText to display for the 'no categories' option.
Default 'No categories'.
* `style`stringThe style used to display the categories list. If `'list'`, categories will be output as an unordered list. If left empty or another value, categories will be output separated by tags. Default `'list'`.
* `taxonomy`stringName of the taxonomy to retrieve. Default `'category'`.
* `title_li`stringText to use for the list title `<li>` element. Pass an empty string to disable. Default `'Categories'`.
* `use_desc_for_title`bool|intWhether to use the category description as the title attribute.
Accepts 0, 1, or their bool equivalents. Default 0.
* `walker`[Walker](../classes/walker)
[Walker](../classes/walker) object to use to build the output. Default empty which results in a [Walker\_Category](../classes/walker_category) instance being used.
More Arguments from get\_categories( ... $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.
Default: `''`
void|string|false Void if `'echo'` argument is true, HTML list of categories if `'echo'` is false.
False if the taxonomy does not exist.
If you need a function that does not format the results, try [get\_categories()](get_categories) .
By default, [wp\_list\_categories()](wp_list_categories) displays:
* No link to all categories
* Sorts the list of Categories by the Category name in ascending order
* Displayed in an unordered list style
* Does not show the post count
* Displays only Categories with posts
* Sets the title attribute to the Category Description
* Is not restricted to the child\_of any Category
* No feed or feed image used
* Does not exclude any Category and includes all Categories
* Displays the active Category with the CSS Class-Suffix ‘ current-cat’
* Shows the Categories in hierarchical indented fashion
* Display Category as the heading over the list
* No SQL LIMIT is imposed (‘number’ => 0 is not shown above)
* Displays (echos) the categories
* No limit to depth
* All categories.
* The list is rendered using a new walker object of the the [Walker\_Category](../classes/walker_category) class
File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
function wp_list_categories( $args = '' ) {
$defaults = array(
'child_of' => 0,
'current_category' => 0,
'depth' => 0,
'echo' => 1,
'exclude' => '',
'exclude_tree' => '',
'feed' => '',
'feed_image' => '',
'feed_type' => '',
'hide_empty' => 1,
'hide_title_if_empty' => false,
'hierarchical' => true,
'order' => 'ASC',
'orderby' => 'name',
'separator' => '<br />',
'show_count' => 0,
'show_option_all' => '',
'show_option_none' => __( 'No categories' ),
'style' => 'list',
'taxonomy' => 'category',
'title_li' => __( 'Categories' ),
'use_desc_for_title' => 0,
);
$parsed_args = wp_parse_args( $args, $defaults );
if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {
$parsed_args['pad_counts'] = true;
}
// Descendants of exclusions should be excluded too.
if ( true == $parsed_args['hierarchical'] ) {
$exclude_tree = array();
if ( $parsed_args['exclude_tree'] ) {
$exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude_tree'] ) );
}
if ( $parsed_args['exclude'] ) {
$exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude'] ) );
}
$parsed_args['exclude_tree'] = $exclude_tree;
$parsed_args['exclude'] = '';
}
if ( ! isset( $parsed_args['class'] ) ) {
$parsed_args['class'] = ( 'category' === $parsed_args['taxonomy'] ) ? 'categories' : $parsed_args['taxonomy'];
}
if ( ! taxonomy_exists( $parsed_args['taxonomy'] ) ) {
return false;
}
$show_option_all = $parsed_args['show_option_all'];
$show_option_none = $parsed_args['show_option_none'];
$categories = get_categories( $parsed_args );
$output = '';
if ( $parsed_args['title_li'] && 'list' === $parsed_args['style']
&& ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] )
) {
$output = '<li class="' . esc_attr( $parsed_args['class'] ) . '">' . $parsed_args['title_li'] . '<ul>';
}
if ( empty( $categories ) ) {
if ( ! empty( $show_option_none ) ) {
if ( 'list' === $parsed_args['style'] ) {
$output .= '<li class="cat-item-none">' . $show_option_none . '</li>';
} else {
$output .= $show_option_none;
}
}
} else {
if ( ! empty( $show_option_all ) ) {
$posts_page = '';
// For taxonomies that belong only to custom post types, point to a valid archive.
$taxonomy_object = get_taxonomy( $parsed_args['taxonomy'] );
if ( ! in_array( 'post', $taxonomy_object->object_type, true ) && ! in_array( 'page', $taxonomy_object->object_type, true ) ) {
foreach ( $taxonomy_object->object_type as $object_type ) {
$_object_type = get_post_type_object( $object_type );
// Grab the first one.
if ( ! empty( $_object_type->has_archive ) ) {
$posts_page = get_post_type_archive_link( $object_type );
break;
}
}
}
// Fallback for the 'All' link is the posts page.
if ( ! $posts_page ) {
if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) ) {
$posts_page = get_permalink( get_option( 'page_for_posts' ) );
} else {
$posts_page = home_url( '/' );
}
}
$posts_page = esc_url( $posts_page );
if ( 'list' === $parsed_args['style'] ) {
$output .= "<li class='cat-item-all'><a href='$posts_page'>$show_option_all</a></li>";
} else {
$output .= "<a href='$posts_page'>$show_option_all</a>";
}
}
if ( empty( $parsed_args['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
$current_term_object = get_queried_object();
if ( $current_term_object && $parsed_args['taxonomy'] === $current_term_object->taxonomy ) {
$parsed_args['current_category'] = get_queried_object_id();
}
}
if ( $parsed_args['hierarchical'] ) {
$depth = $parsed_args['depth'];
} else {
$depth = -1; // Flat.
}
$output .= walk_category_tree( $categories, $depth, $parsed_args );
}
if ( $parsed_args['title_li'] && 'list' === $parsed_args['style']
&& ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] )
) {
$output .= '</ul></li>';
}
/**
* Filters the HTML output of a taxonomy list.
*
* @since 2.1.0
*
* @param string $output HTML output.
* @param array|string $args An array or query string of taxonomy-listing arguments. See
* wp_list_categories() for information on accepted arguments.
*/
$html = apply_filters( 'wp_list_categories', $output, $args );
if ( $parsed_args['echo'] ) {
echo $html;
} else {
return $html;
}
}
```
[apply\_filters( 'wp\_list\_categories', string $output, array|string $args )](../hooks/wp_list_categories)
Filters the HTML output of a taxonomy list.
| Uses | Description |
| --- | --- |
| [walk\_category\_tree()](walk_category_tree) wp-includes/category-template.php | Retrieves HTML list content for category list. |
| [get\_post\_type\_archive\_link()](get_post_type_archive_link) wp-includes/link-template.php | Retrieves the permalink for a post type archive. |
| [is\_category()](is_category) wp-includes/query.php | Determines whether the query is for an existing category archive page. |
| [is\_tax()](is_tax) wp-includes/query.php | Determines whether the query is for an existing custom taxonomy archive page. |
| [is\_tag()](is_tag) wp-includes/query.php | Determines whether the query is for an existing tag archive page. |
| [get\_queried\_object()](get_queried_object) wp-includes/query.php | Retrieves the currently queried object. |
| [get\_queried\_object\_id()](get_queried_object_id) wp-includes/query.php | Retrieves the ID of the currently queried object. |
| [get\_categories()](get_categories) wp-includes/category.php | Retrieves a list of category objects. |
| [wp\_parse\_id\_list()](wp_parse_id_list) wp-includes/functions.php | Cleans up an array, comma- or space-separated list of IDs. |
| [taxonomy\_exists()](taxonomy_exists) wp-includes/taxonomy.php | Determines whether the taxonomy name exists. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_permalink()](get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [home\_url()](home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| [get\_taxonomy()](get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [get\_post\_type\_object()](get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| Used By | Description |
| --- | --- |
| [wp\_list\_cats()](wp_list_cats) wp-includes/deprecated.php | Lists categories. |
| [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 |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Default value of the `'use_desc_for_title'` argument was changed from 1 to 0. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `current_category` argument was modified to optionally accept an array of values. |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress wp_embed_unregister_handler( string $id, int $priority = 10 ) wp\_embed\_unregister\_handler( string $id, int $priority = 10 )
================================================================
Unregisters a previously-registered embed handler.
`$id` string Required The handler ID that should be removed. `$priority` int Optional The priority of the handler to be removed. Default: `10`
File: `wp-includes/embed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
```
function wp_embed_unregister_handler( $id, $priority = 10 ) {
global $wp_embed;
$wp_embed->unregister_handler( $id, $priority );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Embed::unregister\_handler()](../classes/wp_embed/unregister_handler) wp-includes/class-wp-embed.php | Unregisters a previously-registered embed handler. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress populate_options( array $options = array() ) populate\_options( array $options = array() )
=============================================
Create WordPress options and set the default values.
`$options` array Optional Custom option $key => $value pairs to use. Default: `array()`
File: `wp-admin/includes/schema.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/schema.php/)
```
function populate_options( array $options = array() ) {
global $wpdb, $wp_db_version, $wp_current_db_version;
$guessurl = wp_guess_url();
/**
* Fires before creating WordPress options and populating their default values.
*
* @since 2.6.0
*/
do_action( 'populate_options' );
// If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme.
$stylesheet = WP_DEFAULT_THEME;
$template = WP_DEFAULT_THEME;
$theme = wp_get_theme( WP_DEFAULT_THEME );
if ( ! $theme->exists() ) {
$theme = WP_Theme::get_core_default_theme();
}
// If we can't find a core default theme, WP_DEFAULT_THEME is the best we can do.
if ( $theme ) {
$stylesheet = $theme->get_stylesheet();
$template = $theme->get_template();
}
$timezone_string = '';
$gmt_offset = 0;
/*
* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
* or a valid timezone string (America/New_York). See https://www.php.net/manual/en/timezones.php
* for all timezone strings currently supported by PHP.
*
* Important: When a previous timezone string, like `Europe/Kiev`, has been superseded by an
* updated one, like `Europe/Kyiv`, as a rule of thumb, the **old** timezone name should be used
* in the "translation" to allow for the default timezone setting to be PHP cross-version compatible,
* as old timezone names will be recognized in new PHP versions, while new timezone names cannot
* be recognized in old PHP versions.
*
* To verify which timezone strings are available in the _oldest_ PHP version supported, you can
* use https://3v4l.org/6YQAt#v5.6.20 and replace the "BR" (Brazil) in the code line with the
* country code for which you want to look up the supported timezone names.
*/
$offset_or_tz = _x( '0', 'default GMT offset or timezone string' );
if ( is_numeric( $offset_or_tz ) ) {
$gmt_offset = $offset_or_tz;
} elseif ( $offset_or_tz && in_array( $offset_or_tz, timezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true ) ) {
$timezone_string = $offset_or_tz;
}
$defaults = array(
'siteurl' => $guessurl,
'home' => $guessurl,
'blogname' => __( 'My Site' ),
'blogdescription' => '',
'users_can_register' => 0,
'admin_email' => '[email protected]',
/* translators: Default start of the week. 0 = Sunday, 1 = Monday. */
'start_of_week' => _x( '1', 'start of week' ),
'use_balanceTags' => 0,
'use_smilies' => 1,
'require_name_email' => 1,
'comments_notify' => 1,
'posts_per_rss' => 10,
'rss_use_excerpt' => 0,
'mailserver_url' => 'mail.example.com',
'mailserver_login' => '[email protected]',
'mailserver_pass' => 'password',
'mailserver_port' => 110,
'default_category' => 1,
'default_comment_status' => 'open',
'default_ping_status' => 'open',
'default_pingback_flag' => 1,
'posts_per_page' => 10,
/* translators: Default date format, see https://www.php.net/manual/datetime.format.php */
'date_format' => __( 'F j, Y' ),
/* translators: Default time format, see https://www.php.net/manual/datetime.format.php */
'time_format' => __( 'g:i a' ),
/* translators: Links last updated date format, see https://www.php.net/manual/datetime.format.php */
'links_updated_date_format' => __( 'F j, Y g:i a' ),
'comment_moderation' => 0,
'moderation_notify' => 1,
'permalink_structure' => '',
'rewrite_rules' => '',
'hack_file' => 0,
'blog_charset' => 'UTF-8',
'moderation_keys' => '',
'active_plugins' => array(),
'category_base' => '',
'ping_sites' => 'http://rpc.pingomatic.com/',
'comment_max_links' => 2,
'gmt_offset' => $gmt_offset,
// 1.5.0
'default_email_category' => 1,
'recently_edited' => '',
'template' => $template,
'stylesheet' => $stylesheet,
'comment_registration' => 0,
'html_type' => 'text/html',
// 1.5.1
'use_trackback' => 0,
// 2.0.0
'default_role' => 'subscriber',
'db_version' => $wp_db_version,
// 2.0.1
'uploads_use_yearmonth_folders' => 1,
'upload_path' => '',
// 2.1.0
'blog_public' => '1',
'default_link_category' => 2,
'show_on_front' => 'posts',
// 2.2.0
'tag_base' => '',
// 2.5.0
'show_avatars' => '1',
'avatar_rating' => 'G',
'upload_url_path' => '',
'thumbnail_size_w' => 150,
'thumbnail_size_h' => 150,
'thumbnail_crop' => 1,
'medium_size_w' => 300,
'medium_size_h' => 300,
// 2.6.0
'avatar_default' => 'mystery',
// 2.7.0
'large_size_w' => 1024,
'large_size_h' => 1024,
'image_default_link_type' => 'none',
'image_default_size' => '',
'image_default_align' => '',
'close_comments_for_old_posts' => 0,
'close_comments_days_old' => 14,
'thread_comments' => 1,
'thread_comments_depth' => 5,
'page_comments' => 0,
'comments_per_page' => 50,
'default_comments_page' => 'newest',
'comment_order' => 'asc',
'sticky_posts' => array(),
'widget_categories' => array(),
'widget_text' => array(),
'widget_rss' => array(),
'uninstall_plugins' => array(),
// 2.8.0
'timezone_string' => $timezone_string,
// 3.0.0
'page_for_posts' => 0,
'page_on_front' => 0,
// 3.1.0
'default_post_format' => 0,
// 3.5.0
'link_manager_enabled' => 0,
// 4.3.0
'finished_splitting_shared_terms' => 1,
'site_icon' => 0,
// 4.4.0
'medium_large_size_w' => 768,
'medium_large_size_h' => 0,
// 4.9.6
'wp_page_for_privacy_policy' => 0,
// 4.9.8
'show_comments_cookies_opt_in' => 1,
// 5.3.0
'admin_email_lifespan' => ( time() + 6 * MONTH_IN_SECONDS ),
// 5.5.0
'disallowed_keys' => '',
'comment_previously_approved' => 1,
'auto_plugin_theme_update_emails' => array(),
// 5.6.0
'auto_update_core_dev' => 'enabled',
'auto_update_core_minor' => 'enabled',
// Default to enabled for new installs.
// See https://core.trac.wordpress.org/ticket/51742.
'auto_update_core_major' => 'enabled',
// 5.8.0
'wp_force_deactivated_plugins' => array(),
);
// 3.3.0
if ( ! is_multisite() ) {
$defaults['initial_db_version'] = ! empty( $wp_current_db_version ) && $wp_current_db_version < $wp_db_version
? $wp_current_db_version : $wp_db_version;
}
// 3.0.0 multisite.
if ( is_multisite() ) {
$defaults['permalink_structure'] = '/%year%/%monthnum%/%day%/%postname%/';
}
$options = wp_parse_args( $options, $defaults );
// Set autoload to no for these options.
$fat_options = array(
'moderation_keys',
'recently_edited',
'disallowed_keys',
'uninstall_plugins',
'auto_plugin_theme_update_emails',
);
$keys = "'" . implode( "', '", array_keys( $options ) ) . "'";
$existing_options = $wpdb->get_col( "SELECT option_name FROM $wpdb->options WHERE option_name in ( $keys )" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
$insert = '';
foreach ( $options as $option => $value ) {
if ( in_array( $option, $existing_options, true ) ) {
continue;
}
if ( in_array( $option, $fat_options, true ) ) {
$autoload = 'no';
} else {
$autoload = 'yes';
}
if ( is_array( $value ) ) {
$value = serialize( $value );
}
if ( ! empty( $insert ) ) {
$insert .= ', ';
}
$insert .= $wpdb->prepare( '(%s, %s, %s)', $option, $value, $autoload );
}
if ( ! empty( $insert ) ) {
$wpdb->query( "INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES " . $insert ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}
// In case it is set, but blank, update "home".
if ( ! __get_option( 'home' ) ) {
update_option( 'home', $guessurl );
}
// Delete unused options.
$unusedoptions = array(
'blodotgsping_url',
'bodyterminator',
'emailtestonly',
'phoneemail_separator',
'smilies_directory',
'subjectprefix',
'use_bbcode',
'use_blodotgsping',
'use_phoneemail',
'use_quicktags',
'use_weblogsping',
'weblogs_cache_file',
'use_preview',
'use_htmltrans',
'smilies_directory',
'fileupload_allowedusers',
'use_phoneemail',
'default_post_status',
'default_post_category',
'archive_mode',
'time_difference',
'links_minadminlevel',
'links_use_adminlevels',
'links_rating_type',
'links_rating_char',
'links_rating_ignore_zero',
'links_rating_single_image',
'links_rating_image0',
'links_rating_image1',
'links_rating_image2',
'links_rating_image3',
'links_rating_image4',
'links_rating_image5',
'links_rating_image6',
'links_rating_image7',
'links_rating_image8',
'links_rating_image9',
'links_recently_updated_time',
'links_recently_updated_prepend',
'links_recently_updated_append',
'weblogs_cacheminutes',
'comment_allowed_tags',
'search_engine_friendly_urls',
'default_geourl_lat',
'default_geourl_lon',
'use_default_geourl',
'weblogs_xml_url',
'new_users_can_blog',
'_wpnonce',
'_wp_http_referer',
'Update',
'action',
'rich_editing',
'autosave_interval',
'deactivated_plugins',
'can_compress_scripts',
'page_uris',
'update_core',
'update_plugins',
'update_themes',
'doing_cron',
'random_seed',
'rss_excerpt_length',
'secret',
'use_linksupdate',
'default_comment_status_page',
'wporg_popular_tags',
'what_to_show',
'rss_language',
'language',
'enable_xmlrpc',
'enable_app',
'embed_autourls',
'default_post_edit_rows',
'gzipcompression',
'advanced_edit',
);
foreach ( $unusedoptions as $option ) {
delete_option( $option );
}
// Delete obsolete magpie stuff.
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'" );
// Clear expired transients.
delete_expired_transients( true );
}
```
[do\_action( 'populate\_options' )](../hooks/populate_options)
Fires before creating WordPress options and populating their default values.
| Uses | Description |
| --- | --- |
| [delete\_expired\_transients()](delete_expired_transients) wp-includes/option.php | Deletes all expired transients. |
| [WP\_Theme::get\_core\_default\_theme()](../classes/wp_theme/get_core_default_theme) wp-includes/class-wp-theme.php | Determines the latest WordPress default theme that is installed. |
| [wp\_guess\_url()](wp_guess_url) wp-includes/functions.php | Guesses the URL for the site. |
| [delete\_option()](delete_option) wp-includes/option.php | Removes option by name. Prevents removal of protected WordPress options. |
| [wpdb::get\_col()](../classes/wpdb/get_col) wp-includes/class-wpdb.php | Retrieves one column from the database. |
| [wpdb::query()](../classes/wpdb/query) wp-includes/class-wpdb.php | Performs a database query, using current database connection. |
| [wp\_get\_theme()](wp_get_theme) wp-includes/theme.php | Gets a [WP\_Theme](../classes/wp_theme) object for a theme. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [is\_multisite()](is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [update\_option()](update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| [wpdb::prepare()](../classes/wpdb/prepare) wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
| Used By | Description |
| --- | --- |
| [wp\_initialize\_site()](wp_initialize_site) wp-includes/ms-site.php | Runs the initialization routine for a given site. |
| [wp\_install()](wp_install) wp-admin/includes/upgrade.php | Installs the site. |
| [install\_blog()](install_blog) wp-includes/ms-deprecated.php | Install an empty blog. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | The $options parameter has been added. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress iframe_header( string $title = '', bool $deprecated = false ) iframe\_header( string $title = '', bool $deprecated = false )
==============================================================
Generic Iframe header for use with Thickbox.
`$title` string Optional Title of the Iframe page. Default: `''`
`$deprecated` bool Optional Not used. Default: `false`
File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
function iframe_header( $title = '', $deprecated = false ) {
show_admin_bar( false );
global $hook_suffix, $admin_body_class, $wp_locale;
$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
$current_screen = get_current_screen();
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
_wp_admin_html_begin();
?>
<title><?php bloginfo( 'name' ); ?> › <?php echo $title; ?> — <?php _e( 'WordPress' ); ?></title>
<?php
wp_enqueue_style( 'colors' );
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
pagenow = '<?php echo esc_js( $current_screen->id ); ?>',
typenow = '<?php echo esc_js( $current_screen->post_type ); ?>',
adminpage = '<?php echo esc_js( $admin_body_class ); ?>',
thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>',
decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>',
isRtl = <?php echo (int) is_rtl(); ?>;
</script>
<?php
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_enqueue_scripts', $hook_suffix );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_print_styles-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_print_styles' );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_print_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_print_scripts' );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_head' );
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
if ( is_rtl() ) {
$admin_body_class .= ' rtl';
}
?>
</head>
<?php
/**
* @global string $body_id
*/
$admin_body_id = isset( $GLOBALS['body_id'] ) ? 'id="' . $GLOBALS['body_id'] . '" ' : '';
/** This filter is documented in wp-admin/admin-header.php */
$admin_body_classes = apply_filters( 'admin_body_class', '' );
$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
?>
<body <?php echo $admin_body_id; ?>class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes; ?>">
<script type="text/javascript">
(function(){
var c = document.body.className;
c = c.replace(/no-js/, 'js');
document.body.className = c;
})();
</script>
<?php
}
```
[apply\_filters( 'admin\_body\_class', string $classes )](../hooks/admin_body_class)
Filters the CSS classes for the body tag in the admin.
[do\_action( 'admin\_enqueue\_scripts', string $hook\_suffix )](../hooks/admin_enqueue_scripts)
Enqueue scripts for all admin pages.
[do\_action( 'admin\_head' )](../hooks/admin_head)
Fires in head section for all admin pages.
[do\_action( "admin\_head-{$hook\_suffix}" )](../hooks/admin_head-hook_suffix)
Fires in head section for a specific admin page.
[do\_action( 'admin\_print\_scripts' )](../hooks/admin_print_scripts)
Fires when scripts are printed for all admin pages.
[do\_action( "admin\_print\_scripts-{$hook\_suffix}" )](../hooks/admin_print_scripts-hook_suffix)
Fires when scripts are printed for a specific admin page based on $hook\_suffix.
[do\_action( 'admin\_print\_styles' )](../hooks/admin_print_styles)
Fires when styles are printed for all admin pages.
[do\_action( "admin\_print\_styles-{$hook\_suffix}" )](../hooks/admin_print_styles-hook_suffix)
Fires when styles are printed for a specific admin page based on $hook\_suffix.
| Uses | Description |
| --- | --- |
| [get\_user\_locale()](get_user_locale) wp-includes/l10n.php | Retrieves the locale of a user. |
| [get\_current\_screen()](get_current_screen) wp-admin/includes/screen.php | Get the current screen object |
| [\_wp\_admin\_html\_begin()](_wp_admin_html_begin) wp-admin/includes/template.php | Prints out the beginning of the admin HTML header. |
| [esc\_js()](esc_js) wp-includes/formatting.php | Escapes single quotes, `"`, , `&`, and fixes line endings. |
| [sanitize\_html\_class()](sanitize_html_class) wp-includes/formatting.php | Sanitizes an HTML classname to ensure it only contains valid characters. |
| [bloginfo()](bloginfo) wp-includes/general-template.php | Displays information about the current site. |
| [is\_rtl()](is_rtl) wp-includes/l10n.php | Determines whether the current locale is right-to-left (RTL). |
| [wp\_enqueue\_style()](wp_enqueue_style) wp-includes/functions.wp-styles.php | Enqueue a CSS stylesheet. |
| [show\_admin\_bar()](show_admin_bar) wp-includes/admin-bar.php | Sets the display status of the admin bar. |
| [\_e()](_e) wp-includes/l10n.php | Displays translated text. |
| [admin\_url()](admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for the current site. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Used By | Description |
| --- | --- |
| [install\_theme\_information()](install_theme_information) wp-admin/includes/theme-install.php | Displays theme information in dialog box form. |
| [install\_plugin\_information()](install_plugin_information) wp-admin/includes/plugin-install.php | Displays plugin information in dialog box form. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress wp_delete_attachment( int $post_id, bool $force_delete = false ): WP_Post|false|null wp\_delete\_attachment( int $post\_id, bool $force\_delete = false ): WP\_Post|false|null
=========================================================================================
Trashes or deletes an attachment.
When an attachment is permanently deleted, the file will also be removed.
Deletion removes all post meta fields, taxonomy, comments, etc. associated with the attachment (except the main post).
The attachment is moved to the Trash instead of permanently deleted unless Trash for media is disabled, item is already in the Trash, or $force\_delete is true.
`$post_id` int Required Attachment ID. `$force_delete` bool Optional Whether to bypass Trash and force deletion.
Default: `false`
[WP\_Post](../classes/wp_post)|false|null Post data on success, false or null on failure.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
function wp_delete_attachment( $post_id, $force_delete = false ) {
global $wpdb;
$post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id ) );
if ( ! $post ) {
return $post;
}
$post = get_post( $post );
if ( 'attachment' !== $post->post_type ) {
return false;
}
if ( ! $force_delete && EMPTY_TRASH_DAYS && MEDIA_TRASH && 'trash' !== $post->post_status ) {
return wp_trash_post( $post_id );
}
/**
* Filters whether an attachment deletion should take place.
*
* @since 5.5.0
*
* @param WP_Post|false|null $delete Whether to go forward with deletion.
* @param WP_Post $post Post object.
* @param bool $force_delete Whether to bypass the Trash.
*/
$check = apply_filters( 'pre_delete_attachment', null, $post, $force_delete );
if ( null !== $check ) {
return $check;
}
delete_post_meta( $post_id, '_wp_trash_meta_status' );
delete_post_meta( $post_id, '_wp_trash_meta_time' );
$meta = wp_get_attachment_metadata( $post_id );
$backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );
$file = get_attached_file( $post_id );
if ( is_multisite() && is_string( $file ) && ! empty( $file ) ) {
clean_dirsize_cache( $file );
}
/**
* Fires before an attachment is deleted, at the start of wp_delete_attachment().
*
* @since 2.0.0
* @since 5.5.0 Added the `$post` parameter.
*
* @param int $post_id Attachment ID.
* @param WP_Post $post Post object.
*/
do_action( 'delete_attachment', $post_id, $post );
wp_delete_object_term_relationships( $post_id, array( 'category', 'post_tag' ) );
wp_delete_object_term_relationships( $post_id, get_object_taxonomies( $post->post_type ) );
// Delete all for any posts.
delete_metadata( 'post', null, '_thumbnail_id', $post_id, true );
wp_defer_comment_counting( true );
$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_ID DESC", $post_id ) );
foreach ( $comment_ids as $comment_id ) {
wp_delete_comment( $comment_id, true );
}
wp_defer_comment_counting( false );
$post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $post_id ) );
foreach ( $post_meta_ids as $mid ) {
delete_metadata_by_mid( 'post', $mid );
}
/** This action is documented in wp-includes/post.php */
do_action( 'delete_post', $post_id, $post );
$result = $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
if ( ! $result ) {
return false;
}
/** This action is documented in wp-includes/post.php */
do_action( 'deleted_post', $post_id, $post );
wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file );
clean_post_cache( $post );
return $post;
}
```
[do\_action( 'deleted\_post', int $postid, WP\_Post $post )](../hooks/deleted_post)
Fires immediately after a post is deleted from the database.
[do\_action( 'delete\_attachment', int $post\_id, WP\_Post $post )](../hooks/delete_attachment)
Fires before an attachment is deleted, at the start of [wp\_delete\_attachment()](wp_delete_attachment) .
[do\_action( 'delete\_post', int $postid, WP\_Post $post )](../hooks/delete_post)
Fires immediately before a post is deleted from the database.
[apply\_filters( 'pre\_delete\_attachment', WP\_Post|false|null $delete, WP\_Post $post, bool $force\_delete )](../hooks/pre_delete_attachment)
Filters whether an attachment deletion should take place.
| Uses | Description |
| --- | --- |
| [clean\_dirsize\_cache()](clean_dirsize_cache) wp-includes/functions.php | Cleans directory size cache used by [recurse\_dirsize()](recurse_dirsize) . |
| [wp\_delete\_attachment\_files()](wp_delete_attachment_files) wp-includes/post.php | Deletes all files that belong to the given attachment. |
| [delete\_metadata()](delete_metadata) wp-includes/meta.php | Deletes metadata for the specified object. |
| [wp\_delete\_comment()](wp_delete_comment) wp-includes/comment.php | Trashes or deletes a comment. |
| [wp\_defer\_comment\_counting()](wp_defer_comment_counting) wp-includes/comment.php | Determines whether to defer comment counting. |
| [wpdb::delete()](../classes/wpdb/delete) wp-includes/class-wpdb.php | Deletes a row in the table. |
| [wpdb::get\_col()](../classes/wpdb/get_col) wp-includes/class-wpdb.php | Retrieves one column from the database. |
| [wpdb::get\_row()](../classes/wpdb/get_row) wp-includes/class-wpdb.php | Retrieves one row from the database. |
| [get\_attached\_file()](get_attached_file) wp-includes/post.php | Retrieves attached file path based on attachment ID. |
| [delete\_metadata\_by\_mid()](delete_metadata_by_mid) wp-includes/meta.php | Deletes metadata by meta ID. |
| [delete\_post\_meta()](delete_post_meta) wp-includes/post.php | Deletes a post meta field for the given post ID. |
| [wp\_trash\_post()](wp_trash_post) wp-includes/post.php | Moves a post or page to the Trash |
| [wp\_get\_attachment\_metadata()](wp_get_attachment_metadata) wp-includes/post.php | Retrieves attachment metadata for attachment ID. |
| [clean\_post\_cache()](clean_post_cache) wp-includes/post.php | Will clean the post in the cache. |
| [get\_object\_taxonomies()](get_object_taxonomies) wp-includes/taxonomy.php | Returns the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name. |
| [wp\_delete\_object\_term\_relationships()](wp_delete_object_term_relationships) wp-includes/taxonomy.php | Unlinks the object from the taxonomy or taxonomies. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [wpdb::prepare()](../classes/wpdb/prepare) wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
| [is\_multisite()](is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [get\_post\_meta()](get_post_meta) wp-includes/post.php | Retrieves a post meta field for the given post ID. |
| Used By | Description |
| --- | --- |
| [wp\_ajax\_media\_create\_image\_subsizes()](wp_ajax_media_create_image_subsizes) wp-admin/includes/ajax-actions.php | Ajax handler for creating missing image sub-sizes for just uploaded images. |
| [File\_Upload\_Upgrader::cleanup()](../classes/file_upload_upgrader/cleanup) wp-admin/includes/class-file-upload-upgrader.php | Delete the attachment/uploaded file. |
| [wp\_import\_cleanup()](wp_import_cleanup) wp-admin/includes/import.php | Cleanup importer. |
| [wp\_delete\_post()](wp_delete_post) wp-includes/post.php | Trashes or deletes a post or page. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress current_action(): string current\_action(): string
=========================
Retrieves the name of the current action hook.
string Hook name of the current action.
File: `wp-includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/plugin.php/)
```
function current_action() {
return current_filter();
}
```
| Uses | Description |
| --- | --- |
| [current\_filter()](current_filter) wp-includes/plugin.php | Retrieves the name of the current filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Block\_Patterns\_Registry::register()](../classes/wp_block_patterns_registry/register) wp-includes/class-wp-block-patterns-registry.php | Registers a block pattern. |
| [WP\_Block\_Pattern\_Categories\_Registry::register()](../classes/wp_block_pattern_categories_registry/register) wp-includes/class-wp-block-pattern-categories-registry.php | Registers a pattern category. |
| [rest\_cookie\_collect\_status()](rest_cookie_collect_status) wp-includes/rest-api.php | Collects cookie authentication status. |
| [switch\_theme()](switch_theme) wp-includes/theme.php | Switches the theme. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress get_settings_errors( string $setting = '', bool $sanitize = false ): array get\_settings\_errors( string $setting = '', bool $sanitize = false ): array
============================================================================
Fetches settings errors registered by [add\_settings\_error()](add_settings_error) .
Checks the $wp\_settings\_errors array for any errors declared during the current pageload and returns them.
If changes were just submitted ($\_GET[‘settings-updated’]) and settings errors were saved to the ‘settings\_errors’ transient then those errors will be returned instead. This is used to pass errors back across pageloads.
Use the $sanitize argument to manually re-sanitize the option before returning errors.
This is useful if you have errors or notices you want to show even when the user hasn’t submitted data (i.e. when they first load an options page, or in the [‘admin\_notices’](../hooks/admin_notices) action hook).
`$setting` string Optional Slug title of a specific setting whose errors you want. Default: `''`
`$sanitize` bool Optional Whether to re-sanitize the setting value before returning errors. Default: `false`
array Array of settings errors.
* `setting`stringSlug title of the setting to which this error applies.
* `code`stringSlug-name to identify the error. Used as part of `'id'` attribute in HTML output.
* `message`stringThe formatted message text to display to the user (will be shown inside styled `<div>` and `<p>` tags).
* `type`stringOptional. Message type, controls HTML class. Possible values include `'error'`, `'success'`, `'warning'`, `'info'`. Default `'error'`.
File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
function get_settings_errors( $setting = '', $sanitize = false ) {
global $wp_settings_errors;
/*
* If $sanitize is true, manually re-run the sanitization for this option
* This allows the $sanitize_callback from register_setting() to run, adding
* any settings errors you want to show by default.
*/
if ( $sanitize ) {
sanitize_option( $setting, get_option( $setting ) );
}
// If settings were passed back from options.php then use them.
if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) {
$wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) );
delete_transient( 'settings_errors' );
}
// Check global in case errors have been added on this pageload.
if ( empty( $wp_settings_errors ) ) {
return array();
}
// Filter the results to those of a specific setting if one was set.
if ( $setting ) {
$setting_errors = array();
foreach ( (array) $wp_settings_errors as $key => $details ) {
if ( $setting === $details['setting'] ) {
$setting_errors[] = $wp_settings_errors[ $key ];
}
}
return $setting_errors;
}
return $wp_settings_errors;
}
```
| Uses | Description |
| --- | --- |
| [sanitize\_option()](sanitize_option) wp-includes/formatting.php | Sanitizes various option values based on the nature of the option. |
| [get\_transient()](get_transient) wp-includes/option.php | Retrieves the value of a transient. |
| [delete\_transient()](delete_transient) wp-includes/option.php | Deletes a transient. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Used By | Description |
| --- | --- |
| [settings\_errors()](settings_errors) wp-admin/includes/template.php | Displays settings errors registered by [add\_settings\_error()](add_settings_error) . |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
| programming_docs |
wordpress wp_ajax_add_tag() wp\_ajax\_add\_tag()
====================
Ajax handler to add a tag.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
function wp_ajax_add_tag() {
check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
$taxonomy = ! empty( $_POST['taxonomy'] ) ? $_POST['taxonomy'] : 'post_tag';
$taxonomy_object = get_taxonomy( $taxonomy );
if ( ! current_user_can( $taxonomy_object->cap->edit_terms ) ) {
wp_die( -1 );
}
$x = new WP_Ajax_Response();
$tag = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
if ( $tag && ! is_wp_error( $tag ) ) {
$tag = get_term( $tag['term_id'], $taxonomy );
}
if ( ! $tag || is_wp_error( $tag ) ) {
$message = __( 'An error has occurred. Please reload the page and try again.' );
$error_code = 'error';
if ( is_wp_error( $tag ) && $tag->get_error_message() ) {
$message = $tag->get_error_message();
}
if ( is_wp_error( $tag ) && $tag->get_error_code() ) {
$error_code = $tag->get_error_code();
}
$x->add(
array(
'what' => 'taxonomy',
'data' => new WP_Error( $error_code, $message ),
)
);
$x->send();
}
$wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => $_POST['screen'] ) );
$level = 0;
$noparents = '';
if ( is_taxonomy_hierarchical( $taxonomy ) ) {
$level = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );
ob_start();
$wp_list_table->single_row( $tag, $level );
$noparents = ob_get_clean();
}
ob_start();
$wp_list_table->single_row( $tag );
$parents = ob_get_clean();
require ABSPATH . 'wp-admin/includes/edit-tag-messages.php';
$message = '';
if ( isset( $messages[ $taxonomy_object->name ][1] ) ) {
$message = $messages[ $taxonomy_object->name ][1];
} elseif ( isset( $messages['_item'][1] ) ) {
$message = $messages['_item'][1];
}
$x->add(
array(
'what' => 'taxonomy',
'data' => $message,
'supplemental' => array(
'parents' => $parents,
'noparents' => $noparents,
'notice' => $message,
),
)
);
$x->add(
array(
'what' => 'term',
'position' => $level,
'supplemental' => (array) $tag,
)
);
$x->send();
}
```
| Uses | Description |
| --- | --- |
| [WP\_List\_Table::single\_row()](../classes/wp_list_table/single_row) wp-admin/includes/class-wp-list-table.php | Generates content for a single row of the table. |
| [\_get\_list\_table()](_get_list_table) wp-admin/includes/list-table.php | Fetches an instance of a [WP\_List\_Table](../classes/wp_list_table) class. |
| [get\_ancestors()](get_ancestors) wp-includes/taxonomy.php | Gets an array of ancestor IDs for a given object. |
| [wp\_insert\_term()](wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| [is\_taxonomy\_hierarchical()](is_taxonomy_hierarchical) wp-includes/taxonomy.php | Determines whether the taxonomy object is hierarchical. |
| [WP\_Ajax\_Response::\_\_construct()](../classes/wp_ajax_response/__construct) wp-includes/class-wp-ajax-response.php | Constructor – Passes args to [WP\_Ajax\_Response::add()](../classes/wp_ajax_response/add). |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [check\_ajax\_referer()](check_ajax_referer) wp-includes/pluggable.php | Verifies the Ajax request to prevent processing requests external of the blog. |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [get\_taxonomy()](get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [get\_term()](get_term) wp-includes/taxonomy.php | Gets all term data from database by term ID. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress wp_get_nav_menus( array $args = array() ): WP_Term[] wp\_get\_nav\_menus( array $args = array() ): WP\_Term[]
========================================================
Returns all navigation menu objects.
`$args` array Optional Array of arguments passed on to [get\_terms()](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.
Default: `array()`
[WP\_Term](../classes/wp_term)[] An array of menu objects.
File: `wp-includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/nav-menu.php/)
```
function wp_get_nav_menus( $args = array() ) {
$defaults = array(
'taxonomy' => 'nav_menu',
'hide_empty' => false,
'orderby' => 'name',
);
$args = wp_parse_args( $args, $defaults );
/**
* Filters the navigation menu objects being returned.
*
* @since 3.0.0
*
* @see get_terms()
*
* @param WP_Term[] $menus An array of menu objects.
* @param array $args An array of arguments used to retrieve menu objects.
*/
return apply_filters( 'wp_get_nav_menus', get_terms( $args ), $args );
}
```
[apply\_filters( 'wp\_get\_nav\_menus', WP\_Term[] $menus, array $args )](../hooks/wp_get_nav_menus)
Filters the navigation menu objects being returned.
| Uses | Description |
| --- | --- |
| [get\_terms()](get_terms) wp-includes/taxonomy.php | Retrieves the terms in a given taxonomy or list of taxonomies. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Nav\_Menus::enqueue\_scripts()](../classes/wp_customize_nav_menus/enqueue_scripts) wp-includes/class-wp-customize-nav-menus.php | Enqueues scripts and styles for Customizer pane. |
| [WP\_Customize\_Nav\_Menus::customize\_register()](../classes/wp_customize_nav_menus/customize_register) wp-includes/class-wp-customize-nav-menus.php | Adds the customizer settings and controls. |
| [wxr\_nav\_menu\_terms()](wxr_nav_menu_terms) wp-admin/includes/export.php | Outputs all navigation menu terms. |
| [wp\_nav\_menu\_update\_menu\_items()](wp_nav_menu_update_menu_items) wp-admin/includes/nav-menu.php | Saves nav menu items |
| [WP\_Nav\_Menu\_Widget::form()](../classes/wp_nav_menu_widget/form) wp-includes/widgets/class-wp-nav-menu-widget.php | Outputs the settings form for the Navigation Menu widget. |
| [wp\_nav\_menu()](wp_nav_menu) wp-includes/nav-menu-template.php | Displays a navigation menu. |
| Version | Description |
| --- | --- |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Default value of the `'orderby'` argument was changed from `'none'` to `'name'`. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress xmlrpc_getpostcategory( string $content ): string|array xmlrpc\_getpostcategory( string $content ): string|array
========================================================
Retrieves the post category or categories from XMLRPC XML.
If the category element is not found, then the default post category will be used. The return type then would be what $post\_default\_category. If the category is found, then it will always be an array.
`$content` string Required XMLRPC XML Request content string|array List of categories or category name.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function xmlrpc_getpostcategory( $content ) {
global $post_default_category;
if ( preg_match( '/<category>(.+?)<\/category>/is', $content, $matchcat ) ) {
$post_category = trim( $matchcat[1], ',' );
$post_category = explode( ',', $post_category );
} else {
$post_category = $post_default_category;
}
return $post_category;
}
```
| Used By | Description |
| --- | --- |
| [wp\_xmlrpc\_server::blogger\_newPost()](../classes/wp_xmlrpc_server/blogger_newpost) wp-includes/class-wp-xmlrpc-server.php | Creates new post. |
| [wp\_xmlrpc\_server::blogger\_editPost()](../classes/wp_xmlrpc_server/blogger_editpost) wp-includes/class-wp-xmlrpc-server.php | Edit a post. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress get_network_by_path( string $domain, string $path, int|null $segments = null ): WP_Network|false get\_network\_by\_path( string $domain, string $path, int|null $segments = null ): WP\_Network|false
====================================================================================================
Retrieves the closest matching network for a domain and path.
`$domain` string Required Domain to check. `$path` string Required Path to check. `$segments` int|null Optional Path segments to use. Defaults to null, or the full path. Default: `null`
[WP\_Network](../classes/wp_network)|false Network object if successful. False when no network is found.
File: `wp-includes/ms-load.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-load.php/)
```
function get_network_by_path( $domain, $path, $segments = null ) {
return WP_Network::get_by_path( $domain, $path, $segments );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Network::get\_by\_path()](../classes/wp_network/get_by_path) wp-includes/class-wp-network.php | Retrieves the closest matching network for a domain and path. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress get_post_mime_types(): array get\_post\_mime\_types(): array
===============================
Gets default post mime types.
array List of post mime types.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
function get_post_mime_types() {
$post_mime_types = array( // array( adj, noun )
'image' => array(
__( 'Images' ),
__( 'Manage Images' ),
/* translators: %s: Number of images. */
_n_noop(
'Image <span class="count">(%s)</span>',
'Images <span class="count">(%s)</span>'
),
),
'audio' => array(
_x( 'Audio', 'file type group' ),
__( 'Manage Audio' ),
/* translators: %s: Number of audio files. */
_n_noop(
'Audio <span class="count">(%s)</span>',
'Audio <span class="count">(%s)</span>'
),
),
'video' => array(
_x( 'Video', 'file type group' ),
__( 'Manage Video' ),
/* translators: %s: Number of video files. */
_n_noop(
'Video <span class="count">(%s)</span>',
'Video <span class="count">(%s)</span>'
),
),
'document' => array(
__( 'Documents' ),
__( 'Manage Documents' ),
/* translators: %s: Number of documents. */
_n_noop(
'Document <span class="count">(%s)</span>',
'Documents <span class="count">(%s)</span>'
),
),
'spreadsheet' => array(
__( 'Spreadsheets' ),
__( 'Manage Spreadsheets' ),
/* translators: %s: Number of spreadsheets. */
_n_noop(
'Spreadsheet <span class="count">(%s)</span>',
'Spreadsheets <span class="count">(%s)</span>'
),
),
'archive' => array(
_x( 'Archives', 'file type group' ),
__( 'Manage Archives' ),
/* translators: %s: Number of archives. */
_n_noop(
'Archive <span class="count">(%s)</span>',
'Archives <span class="count">(%s)</span>'
),
),
);
$ext_types = wp_get_ext_types();
$mime_types = wp_get_mime_types();
foreach ( $post_mime_types as $group => $labels ) {
if ( in_array( $group, array( 'image', 'audio', 'video' ), true ) ) {
continue;
}
if ( ! isset( $ext_types[ $group ] ) ) {
unset( $post_mime_types[ $group ] );
continue;
}
$group_mime_types = array();
foreach ( $ext_types[ $group ] as $extension ) {
foreach ( $mime_types as $exts => $mime ) {
if ( preg_match( '!^(' . $exts . ')$!i', $extension ) ) {
$group_mime_types[] = $mime;
break;
}
}
}
$group_mime_types = implode( ',', array_unique( $group_mime_types ) );
$post_mime_types[ $group_mime_types ] = $labels;
unset( $post_mime_types[ $group ] );
}
/**
* Filters the default list of post mime types.
*
* @since 2.5.0
*
* @param array $post_mime_types Default list of post mime types.
*/
return apply_filters( 'post_mime_types', $post_mime_types );
}
```
[apply\_filters( 'post\_mime\_types', array $post\_mime\_types )](../hooks/post_mime_types)
Filters the default list of post mime types.
| Uses | Description |
| --- | --- |
| [wp\_get\_ext\_types()](wp_get_ext_types) wp-includes/functions.php | Retrieves the list of common file extensions and their types. |
| [\_n\_noop()](_n_noop) wp-includes/l10n.php | Registers plural strings in POT file, but does not translate them. |
| [wp\_get\_mime\_types()](wp_get_mime_types) wp-includes/functions.php | Retrieves the list of mime types and file extensions. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [wp\_edit\_attachments\_query\_vars()](wp_edit_attachments_query_vars) wp-admin/includes/post.php | Returns the query variables for the current attachments request. |
| [get\_media\_item()](get_media_item) wp-admin/includes/media.php | Retrieves HTML form for modifying the image attachment. |
| [wp\_edit\_attachments\_query()](wp_edit_attachments_query) wp-admin/includes/post.php | Executes a query for attachments. An array of [WP\_Query](../classes/wp_query) arguments can be passed in, which will override the arguments set by this function. |
| [wp\_enqueue\_media()](wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Added the `'Documents'`, `'Spreadsheets'`, and `'Archives'` mime type groups. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
| programming_docs |
wordpress get_block_editor_settings( array $custom_settings, WP_Block_Editor_Context $block_editor_context ): array get\_block\_editor\_settings( array $custom\_settings, WP\_Block\_Editor\_Context $block\_editor\_context ): array
==================================================================================================================
Returns the contextualized block editor settings for a selected editor context.
`$custom_settings` array Required Custom settings to use with the given editor type. `$block_editor_context` [WP\_Block\_Editor\_Context](../classes/wp_block_editor_context) Required The current block editor context. array The contextualized block editor settings.
File: `wp-includes/block-editor.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
```
function get_block_editor_settings( array $custom_settings, $block_editor_context ) {
$editor_settings = array_merge(
get_default_block_editor_settings(),
array(
'allowedBlockTypes' => get_allowed_block_types( $block_editor_context ),
'blockCategories' => get_block_categories( $block_editor_context ),
),
$custom_settings
);
$global_styles = array();
$presets = array(
array(
'css' => 'variables',
'__unstableType' => 'presets',
'isGlobalStyles' => true,
),
array(
'css' => 'presets',
'__unstableType' => 'presets',
'isGlobalStyles' => true,
),
);
foreach ( $presets as $preset_style ) {
$actual_css = wp_get_global_stylesheet( array( $preset_style['css'] ) );
if ( '' !== $actual_css ) {
$preset_style['css'] = $actual_css;
$global_styles[] = $preset_style;
}
}
if ( WP_Theme_JSON_Resolver::theme_has_support() ) {
$block_classes = array(
'css' => 'styles',
'__unstableType' => 'theme',
'isGlobalStyles' => true,
);
$actual_css = wp_get_global_stylesheet( array( $block_classes['css'] ) );
if ( '' !== $actual_css ) {
$block_classes['css'] = $actual_css;
$global_styles[] = $block_classes;
}
} else {
// If there is no `theme.json` file, ensure base layout styles are still available.
$block_classes = array(
'css' => 'base-layout-styles',
'__unstableType' => 'base-layout',
'isGlobalStyles' => true,
);
$actual_css = wp_get_global_stylesheet( array( $block_classes['css'] ) );
if ( '' !== $actual_css ) {
$block_classes['css'] = $actual_css;
$global_styles[] = $block_classes;
}
}
$editor_settings['styles'] = array_merge( $global_styles, get_block_editor_theme_styles() );
$editor_settings['__experimentalFeatures'] = wp_get_global_settings();
// These settings may need to be updated based on data coming from theme.json sources.
if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) {
$colors_by_origin = $editor_settings['__experimentalFeatures']['color']['palette'];
$editor_settings['colors'] = isset( $colors_by_origin['custom'] ) ?
$colors_by_origin['custom'] : (
isset( $colors_by_origin['theme'] ) ?
$colors_by_origin['theme'] :
$colors_by_origin['default']
);
}
if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) {
$gradients_by_origin = $editor_settings['__experimentalFeatures']['color']['gradients'];
$editor_settings['gradients'] = isset( $gradients_by_origin['custom'] ) ?
$gradients_by_origin['custom'] : (
isset( $gradients_by_origin['theme'] ) ?
$gradients_by_origin['theme'] :
$gradients_by_origin['default']
);
}
if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {
$font_sizes_by_origin = $editor_settings['__experimentalFeatures']['typography']['fontSizes'];
$editor_settings['fontSizes'] = isset( $font_sizes_by_origin['custom'] ) ?
$font_sizes_by_origin['custom'] : (
isset( $font_sizes_by_origin['theme'] ) ?
$font_sizes_by_origin['theme'] :
$font_sizes_by_origin['default']
);
}
if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) {
$editor_settings['disableCustomColors'] = ! $editor_settings['__experimentalFeatures']['color']['custom'];
unset( $editor_settings['__experimentalFeatures']['color']['custom'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ) ) {
$editor_settings['disableCustomGradients'] = ! $editor_settings['__experimentalFeatures']['color']['customGradient'];
unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) {
$editor_settings['disableCustomFontSizes'] = ! $editor_settings['__experimentalFeatures']['typography']['customFontSize'];
unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['typography']['lineHeight'] ) ) {
$editor_settings['enableCustomLineHeight'] = $editor_settings['__experimentalFeatures']['typography']['lineHeight'];
unset( $editor_settings['__experimentalFeatures']['typography']['lineHeight'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) {
$editor_settings['enableCustomUnits'] = $editor_settings['__experimentalFeatures']['spacing']['units'];
unset( $editor_settings['__experimentalFeatures']['spacing']['units'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['spacing']['padding'] ) ) {
$editor_settings['enableCustomSpacing'] = $editor_settings['__experimentalFeatures']['spacing']['padding'];
unset( $editor_settings['__experimentalFeatures']['spacing']['padding'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['spacing']['customSpacingSize'] ) ) {
$editor_settings['disableCustomSpacingSizes'] = ! $editor_settings['__experimentalFeatures']['spacing']['customSpacingSize'];
unset( $editor_settings['__experimentalFeatures']['spacing']['customSpacingSize'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['spacing']['spacingSizes'] ) ) {
$spacing_sizes_by_origin = $editor_settings['__experimentalFeatures']['spacing']['spacingSizes'];
$editor_settings['spacingSizes'] = isset( $spacing_sizes_by_origin['custom'] ) ?
$spacing_sizes_by_origin['custom'] : (
isset( $spacing_sizes_by_origin['theme'] ) ?
$spacing_sizes_by_origin['theme'] :
$spacing_sizes_by_origin['default']
);
}
$editor_settings['__unstableResolvedAssets'] = _wp_get_iframed_editor_assets();
$editor_settings['localAutosaveInterval'] = 15;
$editor_settings['disableLayoutStyles'] = current_theme_supports( 'disable-layout-styles' );
$editor_settings['__experimentalDiscussionSettings'] = array(
'commentOrder' => get_option( 'comment_order' ),
'commentsPerPage' => get_option( 'comments_per_page' ),
'defaultCommentsPage' => get_option( 'default_comments_page' ),
'pageComments' => get_option( 'page_comments' ),
'threadComments' => get_option( 'thread_comments' ),
'threadCommentsDepth' => get_option( 'thread_comments_depth' ),
'defaultCommentStatus' => get_option( 'default_comment_status' ),
'avatarURL' => get_avatar_url(
'',
array(
'size' => 96,
'force_default' => true,
'default' => get_option( 'avatar_default' ),
)
),
);
/**
* Filters the settings to pass to the block editor for all editor type.
*
* @since 5.8.0
*
* @param array $editor_settings Default editor settings.
* @param WP_Block_Editor_Context $block_editor_context The current block editor context.
*/
$editor_settings = apply_filters( 'block_editor_settings_all', $editor_settings, $block_editor_context );
if ( ! empty( $block_editor_context->post ) ) {
$post = $block_editor_context->post;
/**
* Filters the settings to pass to the block editor.
*
* @since 5.0.0
* @deprecated 5.8.0 Use the {@see 'block_editor_settings_all'} filter instead.
*
* @param array $editor_settings Default editor settings.
* @param WP_Post $post Post being edited.
*/
$editor_settings = apply_filters_deprecated( 'block_editor_settings', array( $editor_settings, $post ), '5.8.0', 'block_editor_settings_all' );
}
return $editor_settings;
}
```
[apply\_filters\_deprecated( 'block\_editor\_settings', array $editor\_settings, WP\_Post $post )](../hooks/block_editor_settings)
Filters the settings to pass to the block editor.
[apply\_filters( 'block\_editor\_settings\_all', array $editor\_settings, WP\_Block\_Editor\_Context $block\_editor\_context )](../hooks/block_editor_settings_all)
Filters the settings to pass to the block editor for all editor type.
| Uses | Description |
| --- | --- |
| [\_wp\_get\_iframed\_editor\_assets()](_wp_get_iframed_editor_assets) wp-includes/block-editor.php | Collect the block editor assets that need to be loaded into the editor’s iframe. |
| [wp\_get\_global\_stylesheet()](wp_get_global_stylesheet) wp-includes/global-styles-and-settings.php | Returns the stylesheet resulting of merging core, theme, and user data. |
| [wp\_get\_global\_settings()](wp_get_global_settings) wp-includes/global-styles-and-settings.php | Gets the settings resulting of merging core, theme, and user data. |
| [WP\_Theme\_JSON\_Resolver::theme\_has\_support()](../classes/wp_theme_json_resolver/theme_has_support) wp-includes/class-wp-theme-json-resolver.php | Determines whether the active theme has a theme.json file. |
| [get\_block\_editor\_theme\_styles()](get_block_editor_theme_styles) wp-includes/block-editor.php | Creates an array of theme styles to load into the block editor. |
| [get\_default\_block\_editor\_settings()](get_default_block_editor_settings) wp-includes/block-editor.php | Returns the default block editor settings. |
| [get\_allowed\_block\_types()](get_allowed_block_types) wp-includes/block-editor.php | Gets the list of allowed block types to use in the block editor. |
| [get\_block\_categories()](get_block_categories) wp-includes/block-editor.php | Returns all the categories for block types that will be shown in the block editor. |
| [apply\_filters\_deprecated()](apply_filters_deprecated) wp-includes/plugin.php | Fires functions attached to a deprecated filter hook. |
| [get\_avatar\_url()](get_avatar_url) wp-includes/link-template.php | Retrieves the avatar URL. |
| [current\_theme\_supports()](current_theme_supports) wp-includes/theme.php | Checks a theme’s support for a given feature. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| 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.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress get_hidden_meta_boxes( string|WP_Screen $screen ): string[] get\_hidden\_meta\_boxes( string|WP\_Screen $screen ): string[]
===============================================================
Gets an array of IDs of hidden meta boxes.
`$screen` string|[WP\_Screen](../classes/wp_screen) Required Screen identifier string[] IDs of hidden meta boxes.
File: `wp-admin/includes/screen.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/screen.php/)
```
function get_hidden_meta_boxes( $screen ) {
if ( is_string( $screen ) ) {
$screen = convert_to_screen( $screen );
}
$hidden = get_user_option( "metaboxhidden_{$screen->id}" );
$use_defaults = ! is_array( $hidden );
// Hide slug boxes by default.
if ( $use_defaults ) {
$hidden = array();
if ( 'post' === $screen->base ) {
if ( in_array( $screen->post_type, array( 'post', 'page', 'attachment' ), true ) ) {
$hidden = array( 'slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv' );
} else {
$hidden = array( 'slugdiv' );
}
}
/**
* Filters the default list of hidden meta boxes.
*
* @since 3.1.0
*
* @param string[] $hidden An array of IDs of meta boxes hidden by default.
* @param WP_Screen $screen WP_Screen object of the current screen.
*/
$hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );
}
/**
* Filters the list of hidden meta boxes.
*
* @since 3.3.0
*
* @param string[] $hidden An array of IDs of hidden meta boxes.
* @param WP_Screen $screen WP_Screen object of the current screen.
* @param bool $use_defaults Whether to show the default meta boxes.
* Default true.
*/
return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );
}
```
[apply\_filters( 'default\_hidden\_meta\_boxes', string[] $hidden, WP\_Screen $screen )](../hooks/default_hidden_meta_boxes)
Filters the default list of hidden meta boxes.
[apply\_filters( 'hidden\_meta\_boxes', string[] $hidden, WP\_Screen $screen, bool $use\_defaults )](../hooks/hidden_meta_boxes)
Filters the list of hidden meta boxes.
| Uses | Description |
| --- | --- |
| [convert\_to\_screen()](convert_to_screen) wp-admin/includes/template.php | Converts a screen string to a screen object. |
| [get\_user\_option()](get_user_option) wp-includes/user.php | Retrieves user option that can be either per Site or per Network. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [meta\_box\_prefs()](meta_box_prefs) wp-admin/includes/screen.php | Prints the meta box preferences for screen meta. |
| [do\_meta\_boxes()](do_meta_boxes) wp-admin/includes/template.php | Meta-Box template function. |
| [do\_accordion\_sections()](do_accordion_sections) wp-admin/includes/template.php | Meta Box Accordion Template Function. |
| [post\_comment\_meta\_box()](post_comment_meta_box) wp-admin/includes/meta-boxes.php | Displays comments for post. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress path_join( string $base, string $path ): string path\_join( string $base, string $path ): string
================================================
Joins two filesystem paths together.
For example, ‘give me $path relative to $base’. If the $path is absolute, then it the full path is returned.
`$base` string Required Base path. `$path` string Required Path relative to $base. string The path with the base or absolute path.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function path_join( $base, $path ) {
if ( path_is_absolute( $path ) ) {
return $path;
}
return rtrim( $base, '/' ) . '/' . $path;
}
```
| Uses | Description |
| --- | --- |
| [path\_is\_absolute()](path_is_absolute) wp-includes/functions.php | Tests if a given filesystem path is absolute. |
| Used By | Description |
| --- | --- |
| [wp\_get\_original\_image\_path()](wp_get_original_image_path) wp-includes/post.php | Retrieves the path to an uploaded image file. |
| [wp\_get\_original\_image\_url()](wp_get_original_image_url) wp-includes/post.php | Retrieves the URL to an original attachment image. |
| [wp\_delete\_attachment\_files()](wp_delete_attachment_files) wp-includes/post.php | Deletes all files that belong to the given attachment. |
| [\_wp\_upload\_dir()](_wp_upload_dir) wp-includes/functions.php | A non-filtered, non-cached version of [wp\_upload\_dir()](wp_upload_dir) that doesn’t check the path. |
| [wp\_restore\_image()](wp_restore_image) wp-admin/includes/image-edit.php | Restores the metadata for a given attachment. |
| [wp\_save\_image()](wp_save_image) wp-admin/includes/image-edit.php | Saves image to post, along with enqueued changes in `$_REQUEST['history']`. |
| [WP\_Filesystem\_Base::search\_for\_folder()](../classes/wp_filesystem_base/search_for_folder) wp-admin/includes/class-wp-filesystem-base.php | Locates a folder on the remote filesystem. |
| [\_load\_image\_to\_edit\_path()](_load_image_to_edit_path) wp-admin/includes/image.php | Retrieves the path or URL of an attachment’s attached file. |
| [image\_get\_intermediate\_size()](image_get_intermediate_size) wp-includes/media.php | Retrieves the image’s intermediate size (resized) path, width, and height. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress wp_unregister_sidebar_widget( int|string $id ) wp\_unregister\_sidebar\_widget( int|string $id )
=================================================
Remove widget from sidebar.
`$id` int|string Required Widget ID. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
function wp_unregister_sidebar_widget( $id ) {
/**
* Fires just before a widget is removed from a sidebar.
*
* @since 3.0.0
*
* @param int|string $id The widget ID.
*/
do_action( 'wp_unregister_sidebar_widget', $id );
wp_register_sidebar_widget( $id, '', '' );
wp_unregister_widget_control( $id );
}
```
[do\_action( 'wp\_unregister\_sidebar\_widget', int|string $id )](../hooks/wp_unregister_sidebar_widget)
Fires just before a widget is removed from a sidebar.
| Uses | Description |
| --- | --- |
| [wp\_register\_sidebar\_widget()](wp_register_sidebar_widget) wp-includes/widgets.php | Register an instance of a widget. |
| [wp\_unregister\_widget\_control()](wp_unregister_widget_control) wp-includes/widgets.php | Remove control callback for widget. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Used By | Description |
| --- | --- |
| [unregister\_sidebar\_widget()](unregister_sidebar_widget) wp-includes/deprecated.php | Serves as an alias of [wp\_unregister\_sidebar\_widget()](wp_unregister_sidebar_widget) . |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress _load_remote_block_patterns( WP_Screen $deprecated = null ) \_load\_remote\_block\_patterns( WP\_Screen $deprecated = null )
================================================================
Register Core’s official patterns from wordpress.org/patterns.
`$deprecated` [WP\_Screen](../classes/wp_screen) Optional Unused. Formerly the screen that the current request was triggered from. Default: `null`
File: `wp-includes/block-patterns.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-patterns.php/)
```
function _load_remote_block_patterns( $deprecated = null ) {
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '5.9.0' );
$current_screen = $deprecated;
if ( ! $current_screen->is_block_editor ) {
return;
}
}
$supports_core_patterns = get_theme_support( 'core-block-patterns' );
/**
* Filter to disable remote block patterns.
*
* @since 5.8.0
*
* @param bool $should_load_remote
*/
$should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );
if ( $supports_core_patterns && $should_load_remote ) {
$request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );
$core_keyword_id = 11; // 11 is the ID for "core".
$request->set_param( 'keyword', $core_keyword_id );
$response = rest_do_request( $request );
if ( $response->is_error() ) {
return;
}
$patterns = $response->get_data();
foreach ( $patterns as $settings ) {
$pattern_name = 'core/' . sanitize_title( $settings['title'] );
register_block_pattern( $pattern_name, (array) $settings );
}
}
}
```
[apply\_filters( 'should\_load\_remote\_block\_patterns', bool $should\_load\_remote )](../hooks/should_load_remote_block_patterns)
Filter to disable remote block patterns.
| Uses | Description |
| --- | --- |
| [register\_block\_pattern()](register_block_pattern) wp-includes/class-wp-block-patterns-registry.php | Registers a new block pattern. |
| [rest\_do\_request()](rest_do_request) wp-includes/rest-api.php | Do a REST request. |
| [WP\_REST\_Request::\_\_construct()](../classes/wp_rest_request/__construct) wp-includes/rest-api/class-wp-rest-request.php | Constructor. |
| [get\_theme\_support()](get_theme_support) wp-includes/theme.php | Gets the theme support arguments passed when registering that support. |
| [sanitize\_title()](sanitize_title) wp-includes/formatting.php | Sanitizes a string into a slug, which can be used in URLs or HTML attributes. |
| [\_deprecated\_argument()](_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Block\_Patterns\_Controller::get\_items()](../classes/wp_rest_block_patterns_controller/get_items) wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php | Retrieves all block patterns. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | The $current\_screen argument was removed. |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
| programming_docs |
wordpress wp_htmledit_pre( string $output ): string wp\_htmledit\_pre( string $output ): string
===========================================
This function has been deprecated. Use [format\_for\_editor()](format_for_editor) instead.
Formats text for the HTML editor.
Unless $output is empty it will pass through htmlspecialchars before the [‘htmledit\_pre’](../hooks/htmledit_pre) filter is applied.
* [format\_for\_editor()](format_for_editor)
`$output` string Required The text to be formatted. string Formatted text after filter applied.
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function wp_htmledit_pre($output) {
_deprecated_function( __FUNCTION__, '4.3.0', 'format_for_editor()' );
if ( !empty($output) )
$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // Convert only '< > &'.
/**
* Filters the text before it is formatted for the HTML editor.
*
* @since 2.5.0
* @deprecated 4.3.0
*
* @param string $output The HTML-formatted text.
*/
return apply_filters( 'htmledit_pre', $output );
}
```
[apply\_filters( 'htmledit\_pre', string $output )](../hooks/htmledit_pre)
Filters the text before it is formatted for the HTML editor.
| Uses | Description |
| --- | --- |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Use [format\_for\_editor()](format_for_editor) |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress wp_nav_menu_disabled_check( int|string $nav_menu_selected_id, bool $display = true ): string|false wp\_nav\_menu\_disabled\_check( int|string $nav\_menu\_selected\_id, bool $display = true ): string|false
=========================================================================================================
Check whether to disable the Menu Locations meta box submit button and inputs.
`$nav_menu_selected_id` int|string Required ID, name, or slug of the currently selected menu. `$display` bool Optional Whether to display or just return the string. Default: `true`
string|false Disabled attribute if at least one menu exists, false if not.
File: `wp-admin/includes/nav-menu.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/nav-menu.php/)
```
function wp_nav_menu_disabled_check( $nav_menu_selected_id, $display = true ) {
global $one_theme_location_no_menus;
if ( $one_theme_location_no_menus ) {
return false;
}
return disabled( $nav_menu_selected_id, 0, $display );
}
```
| Uses | Description |
| --- | --- |
| [disabled()](disabled) wp-includes/general-template.php | Outputs the HTML disabled attribute. |
| Used By | Description |
| --- | --- |
| [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\_nav\_menu\_item\_link\_meta\_box()](wp_nav_menu_item_link_meta_box) wp-admin/includes/nav-menu.php | Displays a meta box for the custom links menu item. |
| [wp\_nav\_menu\_item\_post\_type\_meta\_box()](wp_nav_menu_item_post_type_meta_box) wp-admin/includes/nav-menu.php | Displays a meta box for a post type menu item. |
| [wp\_nav\_menu\_item\_taxonomy\_meta\_box()](wp_nav_menu_item_taxonomy_meta_box) wp-admin/includes/nav-menu.php | Displays a meta box for a taxonomy menu item. |
| Version | Description |
| --- | --- |
| [5.3.1](https://developer.wordpress.org/reference/since/5.3.1/) | The `$display` parameter was added. |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress wp_generate_user_request_key( int $request_id ): string wp\_generate\_user\_request\_key( int $request\_id ): string
============================================================
Returns a confirmation key for a user action and stores the hashed version for future comparison.
`$request_id` int Required Request ID. string Confirmation key.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
function wp_generate_user_request_key( $request_id ) {
global $wp_hasher;
// Generate something random for a confirmation key.
$key = wp_generate_password( 20, false );
// Return the key, hashed.
if ( empty( $wp_hasher ) ) {
require_once ABSPATH . WPINC . '/class-phpass.php';
$wp_hasher = new PasswordHash( 8, true );
}
wp_update_post(
array(
'ID' => $request_id,
'post_status' => 'request-pending',
'post_password' => $wp_hasher->HashPassword( $key ),
)
);
return $key;
}
```
| Uses | Description |
| --- | --- |
| [wp\_generate\_password()](wp_generate_password) wp-includes/pluggable.php | Generates a random password drawn from the defined set of characters. |
| [wp\_update\_post()](wp_update_post) wp-includes/post.php | Updates a post with new post data. |
| Used By | Description |
| --- | --- |
| [wp\_send\_user\_request()](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 wp_safe_remote_head( string $url, array $args = array() ): array|WP_Error wp\_safe\_remote\_head( string $url, array $args = array() ): array|WP\_Error
=============================================================================
Retrieve the raw response from a safe HTTP request using the HEAD method.
This function is ideal when the HTTP request is being made to an arbitrary URL. The URL is validated to avoid redirection and request forgery attacks.
* [wp\_remote\_request()](wp_remote_request) : For more information on the response array format.
* [WP\_Http::request()](../classes/wp_http/request): For default arguments information.
`$url` string Required URL to retrieve. `$args` array Optional Request arguments. Default: `array()`
array|[WP\_Error](../classes/wp_error) The response or [WP\_Error](../classes/wp_error) on failure.
File: `wp-includes/http.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/http.php/)
```
function wp_safe_remote_head( $url, $args = array() ) {
$args['reject_unsafe_urls'] = true;
$http = _wp_http_get_object();
return $http->head( $url, $args );
}
```
| Uses | Description |
| --- | --- |
| [\_wp\_http\_get\_object()](_wp_http_get_object) wp-includes/http.php | Returns the initialized [WP\_Http](../classes/wp_http) Object |
| Used By | Description |
| --- | --- |
| [wp\_get\_http\_headers()](wp_get_http_headers) wp-includes/functions.php | Retrieves HTTP Headers from URL. |
| [discover\_pingback\_server\_uri()](discover_pingback_server_uri) wp-includes/comment.php | Finds a pingback server URI based on the given URL. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress get_comment_author_rss(): string get\_comment\_author\_rss(): string
===================================
Retrieves the current comment author for use in the feeds.
string Comment Author.
File: `wp-includes/feed.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/feed.php/)
```
function get_comment_author_rss() {
/**
* Filters the current comment author for use in a feed.
*
* @since 1.5.0
*
* @see get_comment_author()
*
* @param string $comment_author The current comment author.
*/
return apply_filters( 'comment_author_rss', get_comment_author() );
}
```
[apply\_filters( 'comment\_author\_rss', string $comment\_author )](../hooks/comment_author_rss)
Filters the current comment author for use in a feed.
| Uses | Description |
| --- | --- |
| [get\_comment\_author()](get_comment_author) wp-includes/comment-template.php | Retrieves the author of the current comment. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [comment\_author\_rss()](comment_author_rss) wp-includes/feed.php | Displays the current comment author in the feed. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress wp_register_widget_control( int|string $id, string $name, callable $control_callback, array $options = array(), mixed $params ) wp\_register\_widget\_control( int|string $id, string $name, callable $control\_callback, array $options = array(), mixed $params )
===================================================================================================================================
Registers widget control callback for customizing options.
`$id` int|string Required Sidebar ID. `$name` string Required Sidebar display name. `$control_callback` callable Required Run when sidebar is displayed. `$options` array Optional Array or string of control options.
* `height`intNever used. Default 200.
* `width`intWidth of the fully expanded control form (but try hard to use the default width).
Default 250.
* `id_base`int|stringRequired for multi-widgets, i.e widgets that allow multiple instances such as the text widget. The widget ID will end up looking like `{$id_base}-{$unique_number}`.
Default: `array()`
`$params` mixed Optional additional parameters to pass to the callback function when it's called. File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
function wp_register_widget_control( $id, $name, $control_callback, $options = array(), ...$params ) {
global $wp_registered_widget_controls, $wp_registered_widget_updates, $wp_registered_widgets, $_wp_deprecated_widgets_callbacks;
$id = strtolower( $id );
$id_base = _get_widget_id_base( $id );
if ( empty( $control_callback ) ) {
unset( $wp_registered_widget_controls[ $id ] );
unset( $wp_registered_widget_updates[ $id_base ] );
return;
}
if ( in_array( $control_callback, $_wp_deprecated_widgets_callbacks, true ) && ! is_callable( $control_callback ) ) {
unset( $wp_registered_widgets[ $id ] );
return;
}
if ( isset( $wp_registered_widget_controls[ $id ] ) && ! did_action( 'widgets_init' ) ) {
return;
}
$defaults = array(
'width' => 250,
'height' => 200,
); // Height is never used.
$options = wp_parse_args( $options, $defaults );
$options['width'] = (int) $options['width'];
$options['height'] = (int) $options['height'];
$widget = array(
'name' => $name,
'id' => $id,
'callback' => $control_callback,
'params' => $params,
);
$widget = array_merge( $widget, $options );
$wp_registered_widget_controls[ $id ] = $widget;
if ( isset( $wp_registered_widget_updates[ $id_base ] ) ) {
return;
}
if ( isset( $widget['params'][0]['number'] ) ) {
$widget['params'][0]['number'] = -1;
}
unset( $widget['width'], $widget['height'], $widget['name'], $widget['id'] );
$wp_registered_widget_updates[ $id_base ] = $widget;
}
```
| Uses | Description |
| --- | --- |
| [\_get\_widget\_id\_base()](_get_widget_id_base) wp-includes/widgets.php | Retrieves the widget ID base value. |
| [did\_action()](did_action) wp-includes/plugin.php | Retrieves the number of times an action has been fired during the current request. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| Used By | Description |
| --- | --- |
| [register\_widget\_control()](register_widget_control) wp-includes/deprecated.php | Registers widget control callback for customizing options. |
| [wp\_unregister\_widget\_control()](wp_unregister_widget_control) wp-includes/widgets.php | Remove control callback for widget. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Formalized the existing and already documented `...$params` parameter by adding it to the function signature. |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress update_post_author_caches( WP_Post[] $posts ) update\_post\_author\_caches( WP\_Post[] $posts )
=================================================
Updates post author user caches for a list of post objects.
`$posts` [WP\_Post](../classes/wp_post)[] Required Array of post objects. File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
function update_post_author_caches( $posts ) {
$author_ids = wp_list_pluck( $posts, 'post_author' );
$author_ids = array_map( 'absint', $author_ids );
$author_ids = array_unique( array_filter( $author_ids ) );
cache_users( $author_ids );
}
```
| Uses | Description |
| --- | --- |
| [cache\_users()](cache_users) wp-includes/pluggable.php | Retrieves info for user lists to prevent multiple queries by [get\_userdata()](get_userdata) . |
| [wp\_list\_pluck()](wp_list_pluck) wp-includes/functions.php | Plucks a certain field out of each object or array in an array. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Posts\_Controller::get\_items()](../classes/wp_rest_posts_controller/get_items) wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Retrieves a collection of posts. |
| [WP\_Posts\_List\_Table::\_display\_rows()](../classes/wp_posts_list_table/_display_rows) wp-admin/includes/class-wp-posts-list-table.php | |
| [WP\_Posts\_List\_Table::\_display\_rows\_hierarchical()](../classes/wp_posts_list_table/_display_rows_hierarchical) wp-admin/includes/class-wp-posts-list-table.php | |
| [WP\_Query::the\_post()](../classes/wp_query/the_post) wp-includes/class-wp-query.php | Sets up the current post. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress post_revisions_meta_box( WP_Post $post ) post\_revisions\_meta\_box( WP\_Post $post )
============================================
Displays list of revisions.
`$post` [WP\_Post](../classes/wp_post) Required Current post object. File: `wp-admin/includes/meta-boxes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
```
function post_revisions_meta_box( $post ) {
wp_list_post_revisions( $post );
}
```
| Uses | Description |
| --- | --- |
| [wp\_list\_post\_revisions()](wp_list_post_revisions) wp-includes/post-template.php | Displays a list of a post’s revisions. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress wp_ajax_widgets_order() wp\_ajax\_widgets\_order()
==========================
Ajax handler for saving the widgets order.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
function wp_ajax_widgets_order() {
check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die( -1 );
}
unset( $_POST['savewidgets'], $_POST['action'] );
// Save widgets order for all sidebars.
if ( is_array( $_POST['sidebars'] ) ) {
$sidebars = array();
foreach ( wp_unslash( $_POST['sidebars'] ) as $key => $val ) {
$sb = array();
if ( ! empty( $val ) ) {
$val = explode( ',', $val );
foreach ( $val as $k => $v ) {
if ( strpos( $v, 'widget-' ) === false ) {
continue;
}
$sb[ $k ] = substr( $v, strpos( $v, '_' ) + 1 );
}
}
$sidebars[ $key ] = $sb;
}
wp_set_sidebars_widgets( $sidebars );
wp_die( 1 );
}
wp_die( -1 );
}
```
| Uses | Description |
| --- | --- |
| [wp\_set\_sidebars\_widgets()](wp_set_sidebars_widgets) wp-includes/widgets.php | Set the sidebar widget option to update sidebars. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [wp\_unslash()](wp_unslash) wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| [check\_ajax\_referer()](check_ajax_referer) wp-includes/pluggable.php | Verifies the Ajax request to prevent processing requests external of the blog. |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress print_head_scripts(): array print\_head\_scripts(): array
=============================
Prints the script queue in the HTML head on admin pages.
Postpones the scripts that were queued for the footer.
[print\_footer\_scripts()](print_footer_scripts) is called in the footer to print these scripts.
* [wp\_print\_scripts()](wp_print_scripts)
array
File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
function print_head_scripts() {
global $concatenate_scripts;
if ( ! did_action( 'wp_print_scripts' ) ) {
/** This action is documented in wp-includes/functions.wp-scripts.php */
do_action( 'wp_print_scripts' );
}
$wp_scripts = wp_scripts();
script_concat_settings();
$wp_scripts->do_concat = $concatenate_scripts;
$wp_scripts->do_head_items();
/**
* Filters whether to print the head scripts.
*
* @since 2.8.0
*
* @param bool $print Whether to print the head scripts. Default true.
*/
if ( apply_filters( 'print_head_scripts', true ) ) {
_print_scripts();
}
$wp_scripts->reset();
return $wp_scripts->done;
}
```
[apply\_filters( 'print\_head\_scripts', bool $print )](../hooks/print_head_scripts)
Filters whether to print the head scripts.
[do\_action( 'wp\_print\_scripts' )](../hooks/wp_print_scripts)
Fires before scripts in the $handles queue are printed.
| Uses | Description |
| --- | --- |
| [wp\_scripts()](wp_scripts) wp-includes/functions.wp-scripts.php | Initialize $wp\_scripts if it has not been set. |
| [did\_action()](did_action) wp-includes/plugin.php | Retrieves the number of times an action has been fired during the current request. |
| [WP\_Scripts::do\_head\_items()](../classes/wp_scripts/do_head_items) wp-includes/class-wp-scripts.php | Processes items and dependencies for the head group. |
| [WP\_Scripts::reset()](../classes/wp_scripts/reset) wp-includes/class-wp-scripts.php | Resets class properties. |
| [script\_concat\_settings()](script_concat_settings) wp-includes/script-loader.php | Determines the concatenation and compression settings for scripts and styles. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [wp\_print\_head\_scripts()](wp_print_head_scripts) wp-includes/script-loader.php | Prints the script queue in the HTML head on the front end. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress feed_links_extra( array $args = array() ) feed\_links\_extra( array $args = array() )
===========================================
Displays the links to the extra feeds such as category feeds.
`$args` array Optional arguments. Default: `array()`
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
function feed_links_extra( $args = array() ) {
$defaults = array(
/* translators: Separator between blog name and feed type in feed links. */
'separator' => _x( '»', 'feed link' ),
/* translators: 1: Blog name, 2: Separator (raquo), 3: Post title. */
'singletitle' => __( '%1$s %2$s %3$s Comments Feed' ),
/* translators: 1: Blog name, 2: Separator (raquo), 3: Category name. */
'cattitle' => __( '%1$s %2$s %3$s Category Feed' ),
/* translators: 1: Blog name, 2: Separator (raquo), 3: Tag name. */
'tagtitle' => __( '%1$s %2$s %3$s Tag Feed' ),
/* translators: 1: Blog name, 2: Separator (raquo), 3: Term name, 4: Taxonomy singular name. */
'taxtitle' => __( '%1$s %2$s %3$s %4$s Feed' ),
/* translators: 1: Blog name, 2: Separator (raquo), 3: Author name. */
'authortitle' => __( '%1$s %2$s Posts by %3$s Feed' ),
/* translators: 1: Blog name, 2: Separator (raquo), 3: Search query. */
'searchtitle' => __( '%1$s %2$s Search Results for “%3$s” Feed' ),
/* translators: 1: Blog name, 2: Separator (raquo), 3: Post type name. */
'posttypetitle' => __( '%1$s %2$s %3$s Feed' ),
);
$args = wp_parse_args( $args, $defaults );
if ( is_singular() ) {
$id = 0;
$post = get_post( $id );
/** This filter is documented in wp-includes/general-template.php */
$show_comments_feed = apply_filters( 'feed_links_show_comments_feed', true );
/**
* 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 {@see 'feed_links_show_comments_feed'}
* (which controls the global comments feed). The result of that filter
* is accepted as a parameter.
*
* @since 6.1.0
*
* @param bool $show_comments_feed Whether to display the post comments feed link. Defaults to
* the {@see 'feed_links_show_comments_feed'} filter result.
*/
$show_post_comments_feed = apply_filters( 'feed_links_extra_show_post_comments_feed', $show_comments_feed );
if ( $show_post_comments_feed && ( comments_open() || pings_open() || $post->comment_count > 0 ) ) {
$title = sprintf(
$args['singletitle'],
get_bloginfo( 'name' ),
$args['separator'],
the_title_attribute( array( 'echo' => false ) )
);
$feed_link = get_post_comments_feed_link( $post->ID );
if ( $feed_link ) {
$href = $feed_link;
}
}
} elseif ( is_post_type_archive() ) {
/**
* Filters whether to display the post type archive feed link.
*
* @since 6.1.0
*
* @param bool $show Whether to display the post type archive feed link. Default true.
*/
$show_post_type_archive_feed = apply_filters( 'feed_links_extra_show_post_type_archive_feed', true );
if ( $show_post_type_archive_feed ) {
$post_type = get_query_var( 'post_type' );
if ( is_array( $post_type ) ) {
$post_type = reset( $post_type );
}
$post_type_obj = get_post_type_object( $post_type );
$title = sprintf(
$args['posttypetitle'],
get_bloginfo( 'name' ),
$args['separator'],
$post_type_obj->labels->name
);
$href = get_post_type_archive_feed_link( $post_type_obj->name );
}
} elseif ( is_category() ) {
/**
* Filters whether to display the category feed link.
*
* @since 6.1.0
*
* @param bool $show Whether to display the category feed link. Default true.
*/
$show_category_feed = apply_filters( 'feed_links_extra_show_category_feed', true );
if ( $show_category_feed ) {
$term = get_queried_object();
if ( $term ) {
$title = sprintf(
$args['cattitle'],
get_bloginfo( 'name' ),
$args['separator'],
$term->name
);
$href = get_category_feed_link( $term->term_id );
}
}
} elseif ( is_tag() ) {
/**
* Filters whether to display the tag feed link.
*
* @since 6.1.0
*
* @param bool $show Whether to display the tag feed link. Default true.
*/
$show_tag_feed = apply_filters( 'feed_links_extra_show_tag_feed', true );
if ( $show_tag_feed ) {
$term = get_queried_object();
if ( $term ) {
$title = sprintf(
$args['tagtitle'],
get_bloginfo( 'name' ),
$args['separator'],
$term->name
);
$href = get_tag_feed_link( $term->term_id );
}
}
} elseif ( is_tax() ) {
/**
* Filters whether to display the custom taxonomy feed link.
*
* @since 6.1.0
*
* @param bool $show Whether to display the custom taxonomy feed link. Default true.
*/
$show_tax_feed = apply_filters( 'feed_links_extra_show_tax_feed', true );
if ( $show_tax_feed ) {
$term = get_queried_object();
if ( $term ) {
$tax = get_taxonomy( $term->taxonomy );
$title = sprintf(
$args['taxtitle'],
get_bloginfo( 'name' ),
$args['separator'],
$term->name,
$tax->labels->singular_name
);
$href = get_term_feed_link( $term->term_id, $term->taxonomy );
}
}
} elseif ( is_author() ) {
/**
* Filters whether to display the author feed link.
*
* @since 6.1.0
*
* @param bool $show Whether to display the author feed link. Default true.
*/
$show_author_feed = apply_filters( 'feed_links_extra_show_author_feed', true );
if ( $show_author_feed ) {
$author_id = (int) get_query_var( 'author' );
$title = sprintf(
$args['authortitle'],
get_bloginfo( 'name' ),
$args['separator'],
get_the_author_meta( 'display_name', $author_id )
);
$href = get_author_feed_link( $author_id );
}
} elseif ( is_search() ) {
/**
* Filters whether to display the search results feed link.
*
* @since 6.1.0
*
* @param bool $show Whether to display the search results feed link. Default true.
*/
$show_search_feed = apply_filters( 'feed_links_extra_show_search_feed', true );
if ( $show_search_feed ) {
$title = sprintf(
$args['searchtitle'],
get_bloginfo( 'name' ),
$args['separator'],
get_search_query( false )
);
$href = get_search_feed_link();
}
}
if ( isset( $title ) && isset( $href ) ) {
printf(
'<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n",
feed_content_type(),
esc_attr( $title ),
esc_url( $href )
);
}
}
```
[apply\_filters( 'feed\_links\_extra\_show\_author\_feed', bool $show )](../hooks/feed_links_extra_show_author_feed)
Filters whether to display the author feed link.
[apply\_filters( 'feed\_links\_extra\_show\_category\_feed', bool $show )](../hooks/feed_links_extra_show_category_feed)
Filters whether to display the category feed link.
[apply\_filters( 'feed\_links\_extra\_show\_post\_comments\_feed', bool $show\_comments\_feed )](../hooks/feed_links_extra_show_post_comments_feed)
Filters whether to display the post comments feed link.
[apply\_filters( 'feed\_links\_extra\_show\_post\_type\_archive\_feed', bool $show )](../hooks/feed_links_extra_show_post_type_archive_feed)
Filters whether to display the post type archive feed link.
[apply\_filters( 'feed\_links\_extra\_show\_search\_feed', bool $show )](../hooks/feed_links_extra_show_search_feed)
Filters whether to display the search results feed link.
[apply\_filters( 'feed\_links\_extra\_show\_tag\_feed', bool $show )](../hooks/feed_links_extra_show_tag_feed)
Filters whether to display the tag feed link.
[apply\_filters( 'feed\_links\_extra\_show\_tax\_feed', bool $show )](../hooks/feed_links_extra_show_tax_feed)
Filters whether to display the custom taxonomy feed link.
[apply\_filters( 'feed\_links\_show\_comments\_feed', bool $show )](../hooks/feed_links_show_comments_feed)
Filters whether to display the comments feed link.
| Uses | Description |
| --- | --- |
| [pings\_open()](pings_open) wp-includes/comment-template.php | Determines whether the current post is open for pings. |
| [feed\_content\_type()](feed_content_type) wp-includes/feed.php | Returns the content type for specified feed type. |
| [get\_category\_feed\_link()](get_category_feed_link) wp-includes/link-template.php | Retrieves the feed link for a category. |
| [get\_post\_comments\_feed\_link()](get_post_comments_feed_link) wp-includes/link-template.php | Retrieves the permalink for the post comments feed. |
| [get\_search\_feed\_link()](get_search_feed_link) wp-includes/link-template.php | Retrieves the permalink for the search results feed. |
| [get\_term\_feed\_link()](get_term_feed_link) wp-includes/link-template.php | Retrieves the feed link for a term. |
| [get\_tag\_feed\_link()](get_tag_feed_link) wp-includes/link-template.php | Retrieves the permalink for a tag feed. |
| [get\_post\_type\_archive\_feed\_link()](get_post_type_archive_feed_link) wp-includes/link-template.php | Retrieves the permalink for a post type archive feed. |
| [the\_title\_attribute()](the_title_attribute) wp-includes/post-template.php | Sanitizes the current title when retrieving or displaying. |
| [get\_queried\_object()](get_queried_object) wp-includes/query.php | Retrieves the currently queried object. |
| [get\_query\_var()](get_query_var) wp-includes/query.php | Retrieves the value of a query variable in the [WP\_Query](../classes/wp_query) class. |
| [is\_post\_type\_archive()](is_post_type_archive) wp-includes/query.php | Determines whether the query is for an existing post type archive page. |
| [is\_tax()](is_tax) wp-includes/query.php | Determines whether the query is for an existing custom taxonomy archive page. |
| [is\_author()](is_author) wp-includes/query.php | Determines whether the query is for an existing author archive page. |
| [is\_tag()](is_tag) wp-includes/query.php | Determines whether the query is for an existing tag archive page. |
| [is\_category()](is_category) wp-includes/query.php | Determines whether the query is for an existing category archive page. |
| [is\_search()](is_search) wp-includes/query.php | Determines whether the query is for a search. |
| [is\_singular()](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\_search\_query()](get_search_query) wp-includes/general-template.php | Retrieves the contents of the search WordPress query variable. |
| [get\_the\_author\_meta()](get_the_author_meta) wp-includes/author-template.php | Retrieves the requested data of the author of the current post. |
| [comments\_open()](comments_open) wp-includes/comment-template.php | Determines whether the current post is open for comments. |
| [get\_author\_feed\_link()](get_author_feed_link) wp-includes/link-template.php | Retrieves the feed link for a given author. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [get\_post\_type\_object()](get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [get\_bloginfo()](get_bloginfo) wp-includes/general-template.php | Retrieves information about the current site. |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [get\_taxonomy()](get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress _nx( string $single, string $plural, int $number, string $context, string $domain = 'default' ): string \_nx( string $single, string $plural, int $number, string $context, string $domain = 'default' ): string
========================================================================================================
Translates and retrieves the singular or plural form based on the supplied number, with gettext context.
This is a hybrid of [\_n()](_n) and [\_x()](_x) . It supports context and plurals.
Used when you want to use the appropriate form of a string with context based on whether a number is singular or plural.
Example of a generic phrase which is disambiguated via the context parameter:
```
printf( _nx( '%s group', '%s groups', $people, 'group of people', 'text-domain' ), number_format_i18n( $people ) );
printf( _nx( '%s group', '%s groups', $animals, 'group of animals', 'text-domain' ), number_format_i18n( $animals ) );
```
`$single` string Required The text to be used if the number is singular. `$plural` string Required The text to be used if the number is plural. `$number` int Required The number to compare against to use either the singular or plural form. `$context` string Required Context information for the translators. `$domain` string Optional Text domain. Unique identifier for retrieving translated strings.
Default `'default'`. Default: `'default'`
string The translated singular or plural form.
File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
function _nx( $single, $plural, $number, $context, $domain = 'default' ) {
$translations = get_translations_for_domain( $domain );
$translation = $translations->translate_plural( $single, $plural, $number, $context );
/**
* Filters the singular or plural form of a string with gettext context.
*
* @since 2.8.0
*
* @param string $translation Translated text.
* @param string $single The text to be used if the number is singular.
* @param string $plural The text to be used if the number is plural.
* @param int $number The number to compare against to use either the singular or plural form.
* @param string $context Context information for the translators.
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
*/
$translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );
/**
* Filters the singular or plural form of a string with gettext context for a domain.
*
* The dynamic portion of the hook name, `$domain`, refers to the text domain.
*
* @since 5.5.0
*
* @param string $translation Translated text.
* @param string $single The text to be used if the number is singular.
* @param string $plural The text to be used if the number is plural.
* @param int $number The number to compare against to use either the singular or plural form.
* @param string $context Context information for the translators.
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
*/
$translation = apply_filters( "ngettext_with_context_{$domain}", $translation, $single, $plural, $number, $context, $domain );
return $translation;
}
```
[apply\_filters( 'ngettext\_with\_context', string $translation, string $single, string $plural, int $number, string $context, string $domain )](../hooks/ngettext_with_context)
Filters the singular or plural form of a string with gettext context.
[apply\_filters( "ngettext\_with\_context\_{$domain}", string $translation, string $single, string $plural, int $number, string $context, string $domain )](../hooks/ngettext_with_context_domain)
Filters the singular or plural form of a string with gettext context for a domain.
| Uses | Description |
| --- | --- |
| [get\_translations\_for\_domain()](get_translations_for_domain) wp-includes/l10n.php | Returns the Translations instance for a text domain. |
| [Translations::translate\_plural()](../classes/translations/translate_plural) wp-includes/pomo/translations.php | |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Privacy\_Requests\_Table::get\_views()](../classes/wp_privacy_requests_table/get_views) wp-admin/includes/class-wp-privacy-requests-table.php | Get an associative array ( id => link ) with the list of views available on this table. |
| [WP\_MS\_Users\_List\_Table::get\_views()](../classes/wp_ms_users_list_table/get_views) wp-admin/includes/class-wp-ms-users-list-table.php | |
| [WP\_Plugins\_List\_Table::get\_views()](../classes/wp_plugins_list_table/get_views) wp-admin/includes/class-wp-plugins-list-table.php | |
| [WP\_MS\_Themes\_List\_Table::get\_views()](../classes/wp_ms_themes_list_table/get_views) wp-admin/includes/class-wp-ms-themes-list-table.php | |
| [install\_plugin\_information()](install_plugin_information) wp-admin/includes/plugin-install.php | Displays plugin information in dialog box form. |
| [WP\_Plugin\_Install\_List\_Table::display\_rows()](../classes/wp_plugin_install_list_table/display_rows) wp-admin/includes/class-wp-plugin-install-list-table.php | |
| [WP\_Users\_List\_Table::get\_views()](../classes/wp_users_list_table/get_views) wp-admin/includes/class-wp-users-list-table.php | Return an associative array listing all the views that can be used with this table. |
| [WP\_Posts\_List\_Table::get\_views()](../classes/wp_posts_list_table/get_views) wp-admin/includes/class-wp-posts-list-table.php | |
| [translate\_nooped\_plural()](translate_nooped_plural) wp-includes/l10n.php | Translates and returns the singular or plural form of a string that’s been registered with [\_n\_noop()](_n_noop) or [\_nx\_noop()](_nx_noop) . |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced ngettext\_with\_context-{$domain} filter. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress WP_Filesystem( array|false $args = false, string|false $context = false, bool $allow_relaxed_file_ownership = false ): bool|null WP\_Filesystem( array|false $args = false, string|false $context = false, bool $allow\_relaxed\_file\_ownership = false ): bool|null
====================================================================================================================================
Initializes and connects the WordPress Filesystem Abstraction classes.
This function will include the chosen transport and attempt connecting.
Plugins may add extra transports, And force WordPress to use them by returning the filename via the [‘filesystem\_method\_file’](../hooks/filesystem_method_file) filter.
`$args` array|false Optional Connection args, These are passed directly to the `WP_Filesystem_*()` classes.
Default: `false`
`$context` string|false Optional Context for [get\_filesystem\_method()](get_filesystem_method) .
More Arguments from get\_filesystem\_method( ... $context ) Full path to the directory that is tested for being writable. Default: `false`
`$allow_relaxed_file_ownership` bool Optional Whether to allow Group/World writable.
Default: `false`
bool|null True on success, false on failure, null if the filesystem method class file does not exist.
If no parameters are specified, the “direct” method is used. The method is determined using the [get\_filesystem\_method()](get_filesystem_method) function.
One of the initial challenges for developers using the WP Filesystem API is you cannot initialize it just anywhere. The [`request_filesystem_credentials()`](request_filesystem_credentials) function isn’t available until AFTER the `wp_loaded` action hook, and is only included in the admin area. One of the earliest hooks you can utilize is `admin_init`.
Filesystem API on Common APIs Handbook:
<https://developer.wordpress.org/apis/handbook/filesystem/>
Filesystem API Class Reference:
Class: [WP\_Filesystem\_Base](../classes/wp_filesystem_base)
Class: [WP\_Filesystem\_Direct](../classes/wp_filesystem_direct)
Class: [WP\_Filesystem\_FTPext](../classes/wp_filesystem_ftpext)
Class: [WP\_Filesystem\_ftpsocket](../classes/wp_filesystem_ftpsockets)
Class: [WP\_Filesystem\_SSH2](../classes/wp_filesystem_ssh2)
File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
global $wp_filesystem;
require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';
$method = get_filesystem_method( $args, $context, $allow_relaxed_file_ownership );
if ( ! $method ) {
return false;
}
if ( ! class_exists( "WP_Filesystem_$method" ) ) {
/**
* Filters the path for a specific filesystem method class file.
*
* @since 2.6.0
*
* @see get_filesystem_method()
*
* @param string $path Path to the specific filesystem method class file.
* @param string $method The filesystem method to use.
*/
$abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
if ( ! file_exists( $abstraction_file ) ) {
return;
}
require_once $abstraction_file;
}
$method = "WP_Filesystem_$method";
$wp_filesystem = new $method( $args );
/*
* Define the timeouts for the connections. Only available after the constructor is called
* to allow for per-transport overriding of the default.
*/
if ( ! defined( 'FS_CONNECT_TIMEOUT' ) ) {
define( 'FS_CONNECT_TIMEOUT', 30 ); // 30 seconds.
}
if ( ! defined( 'FS_TIMEOUT' ) ) {
define( 'FS_TIMEOUT', 30 ); // 30 seconds.
}
if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
return false;
}
if ( ! $wp_filesystem->connect() ) {
return false; // There was an error connecting to the server.
}
// Set the permission constants if not already set.
if ( ! defined( 'FS_CHMOD_DIR' ) ) {
define( 'FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0755 ) );
}
if ( ! defined( 'FS_CHMOD_FILE' ) ) {
define( 'FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ) );
}
return true;
}
```
[apply\_filters( 'filesystem\_method\_file', string $path, string $method )](../hooks/filesystem_method_file)
Filters the path for a specific filesystem method class file.
| Uses | Description |
| --- | --- |
| [get\_filesystem\_method()](get_filesystem_method) wp-admin/includes/file.php | Determines which method to use for reading, writing, modifying, or deleting files on the filesystem. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Used By | Description |
| --- | --- |
| [WP\_Site\_Health\_Auto\_Updates::test\_all\_files\_writable()](../classes/wp_site_health_auto_updates/test_all_files_writable) wp-admin/includes/class-wp-site-health-auto-updates.php | Checks if core files are writable by the web user/group. |
| [wp\_ajax\_delete\_plugin()](wp_ajax_delete_plugin) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a plugin. |
| [wp\_ajax\_delete\_theme()](wp_ajax_delete_theme) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a theme. |
| [WP\_Upgrader::fs\_connect()](../classes/wp_upgrader/fs_connect) wp-admin/includes/class-wp-upgrader.php | Connect to the filesystem. |
| [delete\_theme()](delete_theme) wp-admin/includes/theme.php | Removes a theme. |
| [delete\_plugins()](delete_plugins) wp-admin/includes/plugin.php | Removes directory and files of a plugin for a list of plugins. |
| [do\_core\_upgrade()](do_core_upgrade) wp-admin/update-core.php | Upgrade WordPress core display. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
| programming_docs |
wordpress wp_find_hierarchy_loop_tortoise_hare( callable $callback, int $start, array $override = array(), array $callback_args = array(), bool $_return_loop = false ): mixed wp\_find\_hierarchy\_loop\_tortoise\_hare( callable $callback, int $start, array $override = array(), array $callback\_args = array(), bool $\_return\_loop = false ): mixed
============================================================================================================================================================================
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.
Uses the “The Tortoise and the Hare” algorithm to detect loops.
For every step of the algorithm, the hare takes two steps and the tortoise one.
If the hare ever laps the tortoise, there must be a loop.
`$callback` callable Required Function that accepts ( ID, callback\_arg, ... ) and outputs parent\_ID. `$start` int Required The ID to start the loop check at. `$override` array Optional An array of ( ID => parent\_ID, ... ) to use instead of $callback.
Default: `array()`
`$callback_args` array Optional Additional arguments to send to $callback. Default: `array()`
`$_return_loop` bool Optional Return loop members or just detect presence of loop? Only set to true if you already know the given $start is part of a loop (otherwise the returned array might include branches). Default: `false`
mixed Scalar ID of some arbitrary member of the loop, or array of IDs of all members of loop if $\_return\_loop
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override = array(), $callback_args = array(), $_return_loop = false ) {
$tortoise = $start;
$hare = $start;
$evanescent_hare = $start;
$return = array();
// Set evanescent_hare to one past hare.
// Increment hare two steps.
while (
$tortoise
&&
( $evanescent_hare = isset( $override[ $hare ] ) ? $override[ $hare ] : call_user_func_array( $callback, array_merge( array( $hare ), $callback_args ) ) )
&&
( $hare = isset( $override[ $evanescent_hare ] ) ? $override[ $evanescent_hare ] : call_user_func_array( $callback, array_merge( array( $evanescent_hare ), $callback_args ) ) )
) {
if ( $_return_loop ) {
$return[ $tortoise ] = true;
$return[ $evanescent_hare ] = true;
$return[ $hare ] = true;
}
// Tortoise got lapped - must be a loop.
if ( $tortoise == $evanescent_hare || $tortoise == $hare ) {
return $_return_loop ? $return : $tortoise;
}
// Increment tortoise by one step.
$tortoise = isset( $override[ $tortoise ] ) ? $override[ $tortoise ] : call_user_func_array( $callback, array_merge( array( $tortoise ), $callback_args ) );
}
return false;
}
```
| Used By | Description |
| --- | --- |
| [wp\_find\_hierarchy\_loop()](wp_find_hierarchy_loop) wp-includes/functions.php | Finds hierarchy loops using a callback function that maps object IDs to parent IDs. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress register_uninstall_hook( string $file, callable $callback ) register\_uninstall\_hook( string $file, callable $callback )
=============================================================
Sets the uninstallation hook for a plugin.
Registers the uninstall hook that will be called when the user clicks on the uninstall link that calls for the plugin to uninstall itself. The link won’t be active unless the plugin hooks into the action.
The plugin should not run arbitrary code outside of functions, when registering the uninstall hook. In order to run using the hook, the plugin will have to be included, which means that any code laying outside of a function will be run during the uninstallation process. The plugin should not hinder the uninstallation process.
If the plugin can not be written without running code within the plugin, then the plugin should create a file named ‘uninstall.php’ in the base plugin folder. This file will be called, if it exists, during the uninstallation process bypassing the uninstall hook. The plugin, when using the ‘uninstall.php’ should always check for the ‘WP\_UNINSTALL\_PLUGIN’ constant, before executing.
`$file` string Required Plugin file. `$callback` callable Required The callback to run when the hook is called. Must be a static method or function. File: `wp-includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/plugin.php/)
```
function register_uninstall_hook( $file, $callback ) {
if ( is_array( $callback ) && is_object( $callback[0] ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Only a static class method or function can be used in an uninstall hook.' ), '3.1.0' );
return;
}
/*
* The option should not be autoloaded, because it is not needed in most
* cases. Emphasis should be put on using the 'uninstall.php' way of
* uninstalling the plugin.
*/
$uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
$plugin_basename = plugin_basename( $file );
if ( ! isset( $uninstallable_plugins[ $plugin_basename ] ) || $uninstallable_plugins[ $plugin_basename ] !== $callback ) {
$uninstallable_plugins[ $plugin_basename ] = $callback;
update_option( 'uninstall_plugins', $uninstallable_plugins );
}
}
```
| Uses | Description |
| --- | --- |
| [plugin\_basename()](plugin_basename) wp-includes/plugin.php | Gets the basename of a plugin. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| [update\_option()](update_option) wp-includes/option.php | Updates the value of an option that was already added. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress wxr_category_description( WP_Term $category ) wxr\_category\_description( WP\_Term $category )
================================================
Outputs a category\_description XML tag from a given category object.
`$category` [WP\_Term](../classes/wp_term) Required Category Object. File: `wp-admin/includes/export.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/export.php/)
```
function wxr_category_description( $category ) {
if ( empty( $category->description ) ) {
return;
}
echo '<wp:category_description>' . wxr_cdata( $category->description ) . "</wp:category_description>\n";
}
```
| Uses | Description |
| --- | --- |
| [wxr\_cdata()](wxr_cdata) wp-admin/includes/export.php | Wraps given string in XML CDATA tag. |
| Used By | Description |
| --- | --- |
| [export\_wp()](export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
wordpress wp_ajax_query_attachments() wp\_ajax\_query\_attachments()
==============================
Ajax handler for querying attachments.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
function wp_ajax_query_attachments() {
if ( ! current_user_can( 'upload_files' ) ) {
wp_send_json_error();
}
$query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
$keys = array(
's',
'order',
'orderby',
'posts_per_page',
'paged',
'post_mime_type',
'post_parent',
'author',
'post__in',
'post__not_in',
'year',
'monthnum',
);
foreach ( get_taxonomies_for_attachments( 'objects' ) as $t ) {
if ( $t->query_var && isset( $query[ $t->query_var ] ) ) {
$keys[] = $t->query_var;
}
}
$query = array_intersect_key( $query, array_flip( $keys ) );
$query['post_type'] = 'attachment';
if (
MEDIA_TRASH &&
! empty( $_REQUEST['query']['post_status'] ) &&
'trash' === $_REQUEST['query']['post_status']
) {
$query['post_status'] = 'trash';
} else {
$query['post_status'] = 'inherit';
}
if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) ) {
$query['post_status'] .= ',private';
}
// Filter query clauses to include filenames.
if ( isset( $query['s'] ) ) {
add_filter( 'wp_allow_query_attachment_by_filename', '__return_true' );
}
/**
* Filters the arguments passed to WP_Query during an Ajax
* call for querying attachments.
*
* @since 3.7.0
*
* @see WP_Query::parse_query()
*
* @param array $query An array of query variables.
*/
$query = apply_filters( 'ajax_query_attachments_args', $query );
$attachments_query = new WP_Query( $query );
update_post_parent_caches( $attachments_query->posts );
$posts = array_map( 'wp_prepare_attachment_for_js', $attachments_query->posts );
$posts = array_filter( $posts );
$total_posts = $attachments_query->found_posts;
if ( $total_posts < 1 ) {
// Out-of-bounds, run the query again without LIMIT for total count.
unset( $query['paged'] );
$count_query = new WP_Query();
$count_query->query( $query );
$total_posts = $count_query->found_posts;
}
$posts_per_page = (int) $attachments_query->get( 'posts_per_page' );
$max_pages = $posts_per_page ? ceil( $total_posts / $posts_per_page ) : 0;
header( 'X-WP-Total: ' . (int) $total_posts );
header( 'X-WP-TotalPages: ' . (int) $max_pages );
wp_send_json_success( $posts );
}
```
[apply\_filters( 'ajax\_query\_attachments\_args', array $query )](../hooks/ajax_query_attachments_args)
Filters the arguments passed to [WP\_Query](../classes/wp_query) during an Ajax call for querying attachments.
| Uses | Description |
| --- | --- |
| [update\_post\_parent\_caches()](update_post_parent_caches) wp-includes/post.php | Updates parent post caches for a list of post objects. |
| [WP\_Query::\_\_construct()](../classes/wp_query/__construct) wp-includes/class-wp-query.php | Constructor. |
| [get\_taxonomies\_for\_attachments()](get_taxonomies_for_attachments) wp-includes/media.php | Retrieves all of the taxonomies that are registered for attachments. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [wp\_send\_json\_error()](wp_send_json_error) wp-includes/functions.php | Sends a JSON response back to an Ajax request, indicating failure. |
| [wp\_send\_json\_success()](wp_send_json_success) wp-includes/functions.php | Sends a JSON response back to an Ajax request, indicating success. |
| [add\_filter()](add_filter) wp-includes/plugin.php | Adds a callback function to a filter hook. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post\_type\_object()](get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress get_the_posts_navigation( array $args = array() ): string get\_the\_posts\_navigation( array $args = array() ): string
============================================================
Returns the navigation to next/previous set of posts, when applicable.
`$args` array Optional Default posts navigation arguments.
* `prev_text`stringAnchor text to display in the previous posts link.
Default 'Older posts'.
* `next_text`stringAnchor text to display in the next posts link.
Default 'Newer posts'.
* `screen_reader_text`stringScreen reader text for the nav element.
Default 'Posts navigation'.
* `aria_label`stringARIA label text for the nav element. Default `'Posts'`.
* `class`stringCustom class for the nav element. Default `'posts-navigation'`.
Default: `array()`
string Markup for posts links.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function get_the_posts_navigation( $args = array() ) {
global $wp_query;
$navigation = '';
// Don't print empty markup if there's only one page.
if ( $wp_query->max_num_pages > 1 ) {
// Make sure the nav element has an aria-label attribute: fallback to the screen reader text.
if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) {
$args['aria_label'] = $args['screen_reader_text'];
}
$args = wp_parse_args(
$args,
array(
'prev_text' => __( 'Older posts' ),
'next_text' => __( 'Newer posts' ),
'screen_reader_text' => __( 'Posts navigation' ),
'aria_label' => __( 'Posts' ),
'class' => 'posts-navigation',
)
);
$next_link = get_previous_posts_link( $args['next_text'] );
$prev_link = get_next_posts_link( $args['prev_text'] );
if ( $prev_link ) {
$navigation .= '<div class="nav-previous">' . $prev_link . '</div>';
}
if ( $next_link ) {
$navigation .= '<div class="nav-next">' . $next_link . '</div>';
}
$navigation = _navigation_markup( $navigation, $args['class'], $args['screen_reader_text'], $args['aria_label'] );
}
return $navigation;
}
```
| Uses | Description |
| --- | --- |
| [\_navigation\_markup()](_navigation_markup) wp-includes/link-template.php | Wraps passed links in navigational markup. |
| [get\_previous\_posts\_link()](get_previous_posts_link) wp-includes/link-template.php | Retrieves the previous posts page link. |
| [get\_next\_posts\_link()](get_next_posts_link) wp-includes/link-template.php | Retrieves the next posts page link. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| Used By | Description |
| --- | --- |
| [the\_posts\_navigation()](the_posts_navigation) wp-includes/link-template.php | Displays the navigation to next/previous set of posts, when applicable. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `class` parameter. |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Added the `aria_label` parameter. |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress pingback( string $content, int|WP_Post $post ) pingback( string $content, int|WP\_Post $post )
===============================================
Pings back the links found in a post.
`$content` string Required Post content to check for links. If empty will retrieve from post. `$post` int|[WP\_Post](../classes/wp_post) Required Post ID or object. File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
function pingback( $content, $post ) {
include_once ABSPATH . WPINC . '/class-IXR.php';
include_once ABSPATH . WPINC . '/class-wp-http-ixr-client.php';
// Original code by Mort (http://mort.mine.nu:8080).
$post_links = array();
$post = get_post( $post );
if ( ! $post ) {
return;
}
$pung = get_pung( $post );
if ( empty( $content ) ) {
$content = $post->post_content;
}
/*
* Step 1.
* Parsing the post, external links (if any) are stored in the $post_links array.
*/
$post_links_temp = wp_extract_urls( $content );
/*
* Step 2.
* Walking through the links array.
* First we get rid of links pointing to sites, not to specific files.
* Example:
* http://dummy-weblog.org
* http://dummy-weblog.org/
* http://dummy-weblog.org/post.php
* We don't wanna ping first and second types, even if they have a valid <link/>.
*/
foreach ( (array) $post_links_temp as $link_test ) {
// If we haven't pung it already and it isn't a link to itself.
if ( ! in_array( $link_test, $pung, true ) && ( url_to_postid( $link_test ) != $post->ID )
// Also, let's never ping local attachments.
&& ! is_local_attachment( $link_test )
) {
$test = parse_url( $link_test );
if ( $test ) {
if ( isset( $test['query'] ) ) {
$post_links[] = $link_test;
} elseif ( isset( $test['path'] ) && ( '/' !== $test['path'] ) && ( '' !== $test['path'] ) ) {
$post_links[] = $link_test;
}
}
}
}
$post_links = array_unique( $post_links );
/**
* Fires just before pinging back links found in a post.
*
* @since 2.0.0
*
* @param string[] $post_links Array of link URLs to be checked (passed by reference).
* @param string[] $pung Array of link URLs already pinged (passed by reference).
* @param int $post_id The post ID.
*/
do_action_ref_array( 'pre_ping', array( &$post_links, &$pung, $post->ID ) );
foreach ( (array) $post_links as $pagelinkedto ) {
$pingback_server_url = discover_pingback_server_uri( $pagelinkedto );
if ( $pingback_server_url ) {
set_time_limit( 60 );
// Now, the RPC call.
$pagelinkedfrom = get_permalink( $post );
// Using a timeout of 3 seconds should be enough to cover slow servers.
$client = new WP_HTTP_IXR_Client( $pingback_server_url );
$client->timeout = 3;
/**
* Filters the user agent sent when pinging-back a URL.
*
* @since 2.9.0
*
* @param string $concat_useragent The user agent concatenated with ' -- WordPress/'
* and the WordPress version.
* @param string $useragent The useragent.
* @param string $pingback_server_url The server URL being linked to.
* @param string $pagelinkedto URL of page linked to.
* @param string $pagelinkedfrom URL of page linked from.
*/
$client->useragent = apply_filters( 'pingback_useragent', $client->useragent . ' -- WordPress/' . get_bloginfo( 'version' ), $client->useragent, $pingback_server_url, $pagelinkedto, $pagelinkedfrom );
// When set to true, this outputs debug messages by itself.
$client->debug = false;
if ( $client->query( 'pingback.ping', $pagelinkedfrom, $pagelinkedto ) || ( isset( $client->error->code ) && 48 == $client->error->code ) ) { // Already registered.
add_ping( $post, $pagelinkedto );
}
}
}
}
```
[apply\_filters( 'pingback\_useragent', string $concat\_useragent, string $useragent, string $pingback\_server\_url, string $pagelinkedto, string $pagelinkedfrom )](../hooks/pingback_useragent)
Filters the user agent sent when pinging-back a URL.
[do\_action\_ref\_array( 'pre\_ping', string[] $post\_links, string[] $pung, int $post\_id )](../hooks/pre_ping)
Fires just before pinging back links found in a post.
| Uses | Description |
| --- | --- |
| [wp\_extract\_urls()](wp_extract_urls) wp-includes/functions.php | Uses RegEx to extract URLs from arbitrary content. |
| [do\_action\_ref\_array()](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. |
| [get\_pung()](get_pung) wp-includes/post.php | Retrieves URLs already pinged for a post. |
| [is\_local\_attachment()](is_local_attachment) wp-includes/post.php | Determines whether an attachment URI is local and really an attachment. |
| [add\_ping()](add_ping) wp-includes/post.php | Adds a URL to those already pinged. |
| [url\_to\_postid()](url_to_postid) wp-includes/rewrite.php | Examines a URL and try to determine the post ID it represents. |
| [WP\_HTTP\_IXR\_Client::\_\_construct()](../classes/wp_http_ixr_client/__construct) wp-includes/class-wp-http-ixr-client.php | |
| [discover\_pingback\_server\_uri()](discover_pingback_server_uri) wp-includes/comment.php | Finds a pingback server URI based on the given URL. |
| [get\_bloginfo()](get_bloginfo) wp-includes/general-template.php | Retrieves information about the current site. |
| [get\_permalink()](get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [do\_all\_pingbacks()](do_all_pingbacks) wp-includes/comment.php | Performs all pingbacks. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | `$post` can be a [WP\_Post](../classes/wp_post) object. |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
| programming_docs |
wordpress update_termmeta_cache( array $term_ids ): array|false update\_termmeta\_cache( array $term\_ids ): array|false
========================================================
Updates metadata cache for list of term IDs.
Performs SQL query to retrieve all metadata for the terms matching `$term_ids` and stores them in the cache.
Subsequent calls to `get_term_meta()` will not need to query the database.
`$term_ids` array Required List of term IDs. array|false An array of metadata on success, false if there is nothing to update.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
function update_termmeta_cache( $term_ids ) {
return update_meta_cache( 'term', $term_ids );
}
```
| Uses | Description |
| --- | --- |
| [update\_meta\_cache()](update_meta_cache) wp-includes/meta.php | Updates the metadata cache for the specified objects. |
| 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. |
| [\_prime\_term\_caches()](_prime_term_caches) wp-includes/taxonomy.php | Adds any terms from the given IDs to the cache that do not already exist in cache. |
| [WP\_Metadata\_Lazyloader::lazyload\_term\_meta()](../classes/wp_metadata_lazyloader/lazyload_term_meta) wp-includes/class-wp-metadata-lazyloader.php | Lazy-loads term meta for queued terms. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress menu_page_url( string $menu_slug, bool $display = true ): string menu\_page\_url( string $menu\_slug, bool $display = true ): string
===================================================================
Gets the URL to access a particular menu page based on the slug it was registered with.
If the slug hasn’t been registered properly, no URL will be returned.
`$menu_slug` string Required The slug name to refer to this menu by (should be unique for this menu). `$display` bool Optional Whether or not to display the URL. Default: `true`
string The menu page URL.
File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
function menu_page_url( $menu_slug, $display = true ) {
global $_parent_pages;
if ( isset( $_parent_pages[ $menu_slug ] ) ) {
$parent_slug = $_parent_pages[ $menu_slug ];
if ( $parent_slug && ! isset( $_parent_pages[ $parent_slug ] ) ) {
$url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );
} else {
$url = admin_url( 'admin.php?page=' . $menu_slug );
}
} else {
$url = '';
}
$url = esc_url( $url );
if ( $display ) {
echo $url;
}
return $url;
}
```
| Uses | Description |
| --- | --- |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [add\_query\_arg()](add_query_arg) wp-includes/functions.php | Retrieves a modified URL query string. |
| [admin\_url()](admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for the current site. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress get_postdata( int $postid ): array get\_postdata( int $postid ): array
===================================
This function has been deprecated. Use [get\_post()](get_post) instead.
Retrieves all post data for a given post.
* [get\_post()](get_post)
`$postid` int Required Post ID. array Post data.
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function get_postdata($postid) {
_deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' );
$post = get_post($postid);
$postdata = array (
'ID' => $post->ID,
'Author_ID' => $post->post_author,
'Date' => $post->post_date,
'Content' => $post->post_content,
'Excerpt' => $post->post_excerpt,
'Title' => $post->post_title,
'Category' => $post->post_category,
'post_status' => $post->post_status,
'comment_status' => $post->comment_status,
'ping_status' => $post->ping_status,
'post_password' => $post->post_password,
'to_ping' => $post->to_ping,
'pinged' => $post->pinged,
'post_type' => $post->post_type,
'post_name' => $post->post_name
);
return $postdata;
}
```
| Uses | Description |
| --- | --- |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Version | Description |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Use [get\_post()](get_post) |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress wp_check_site_meta_support_prefilter( mixed $check ): mixed wp\_check\_site\_meta\_support\_prefilter( mixed $check ): mixed
================================================================
Aborts calls to site meta if it is not supported.
`$check` mixed Required Skip-value for whether to proceed site meta function execution. mixed Original value of $check, or false if site meta is not supported.
File: `wp-includes/ms-site.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-site.php/)
```
function wp_check_site_meta_support_prefilter( $check ) {
if ( ! is_site_meta_supported() ) {
/* translators: %s: Database table name. */
_doing_it_wrong( __FUNCTION__, sprintf( __( 'The %s table is not installed. Please run the network database upgrade.' ), $GLOBALS['wpdb']->blogmeta ), '5.1.0' );
return false;
}
return $check;
}
```
| Uses | Description |
| --- | --- |
| [is\_site\_meta\_supported()](is_site_meta_supported) wp-includes/functions.php | Determines whether site meta is enabled. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |
wordpress bulk_edit_posts( array|null $post_data = null ): array bulk\_edit\_posts( array|null $post\_data = null ): array
=========================================================
Processes the post data for the bulk editing of posts.
Updates all bulk edited posts/pages, adding (but not removing) tags and categories. Skips pages when they would be their own parent or child.
`$post_data` array|null Optional The array of post data to process.
Defaults to the `$_POST` superglobal. Default: `null`
array
File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
function bulk_edit_posts( $post_data = null ) {
global $wpdb;
if ( empty( $post_data ) ) {
$post_data = &$_POST;
}
if ( isset( $post_data['post_type'] ) ) {
$ptype = get_post_type_object( $post_data['post_type'] );
} else {
$ptype = get_post_type_object( 'post' );
}
if ( ! current_user_can( $ptype->cap->edit_posts ) ) {
if ( 'page' === $ptype->name ) {
wp_die( __( 'Sorry, you are not allowed to edit pages.' ) );
} else {
wp_die( __( 'Sorry, you are not allowed to edit posts.' ) );
}
}
if ( -1 == $post_data['_status'] ) {
$post_data['post_status'] = null;
unset( $post_data['post_status'] );
} else {
$post_data['post_status'] = $post_data['_status'];
}
unset( $post_data['_status'] );
if ( ! empty( $post_data['post_status'] ) ) {
$post_data['post_status'] = sanitize_key( $post_data['post_status'] );
if ( 'inherit' === $post_data['post_status'] ) {
unset( $post_data['post_status'] );
}
}
$post_IDs = array_map( 'intval', (array) $post_data['post'] );
$reset = array(
'post_author',
'post_status',
'post_password',
'post_parent',
'page_template',
'comment_status',
'ping_status',
'keep_private',
'tax_input',
'post_category',
'sticky',
'post_format',
);
foreach ( $reset as $field ) {
if ( isset( $post_data[ $field ] ) && ( '' === $post_data[ $field ] || -1 == $post_data[ $field ] ) ) {
unset( $post_data[ $field ] );
}
}
if ( isset( $post_data['post_category'] ) ) {
if ( is_array( $post_data['post_category'] ) && ! empty( $post_data['post_category'] ) ) {
$new_cats = array_map( 'absint', $post_data['post_category'] );
} else {
unset( $post_data['post_category'] );
}
}
$tax_input = array();
if ( isset( $post_data['tax_input'] ) ) {
foreach ( $post_data['tax_input'] as $tax_name => $terms ) {
if ( empty( $terms ) ) {
continue;
}
if ( is_taxonomy_hierarchical( $tax_name ) ) {
$tax_input[ $tax_name ] = array_map( 'absint', $terms );
} else {
$comma = _x( ',', 'tag delimiter' );
if ( ',' !== $comma ) {
$terms = str_replace( $comma, ',', $terms );
}
$tax_input[ $tax_name ] = explode( ',', trim( $terms, " \n\t\r\0\x0B," ) );
}
}
}
if ( isset( $post_data['post_parent'] ) && (int) $post_data['post_parent'] ) {
$parent = (int) $post_data['post_parent'];
$pages = $wpdb->get_results( "SELECT ID, post_parent FROM $wpdb->posts WHERE post_type = 'page'" );
$children = array();
for ( $i = 0; $i < 50 && $parent > 0; $i++ ) {
$children[] = $parent;
foreach ( $pages as $page ) {
if ( (int) $page->ID === $parent ) {
$parent = (int) $page->post_parent;
break;
}
}
}
}
$updated = array();
$skipped = array();
$locked = array();
$shared_post_data = $post_data;
foreach ( $post_IDs as $post_ID ) {
// Start with fresh post data with each iteration.
$post_data = $shared_post_data;
$post_type_object = get_post_type_object( get_post_type( $post_ID ) );
if ( ! isset( $post_type_object )
|| ( isset( $children ) && in_array( $post_ID, $children, true ) )
|| ! current_user_can( 'edit_post', $post_ID )
) {
$skipped[] = $post_ID;
continue;
}
if ( wp_check_post_lock( $post_ID ) ) {
$locked[] = $post_ID;
continue;
}
$post = get_post( $post_ID );
$tax_names = get_object_taxonomies( $post );
foreach ( $tax_names as $tax_name ) {
$taxonomy_obj = get_taxonomy( $tax_name );
if ( ! $taxonomy_obj->show_in_quick_edit ) {
continue;
}
if ( isset( $tax_input[ $tax_name ] ) && current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
$new_terms = $tax_input[ $tax_name ];
} else {
$new_terms = array();
}
if ( $taxonomy_obj->hierarchical ) {
$current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'ids' ) );
} else {
$current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'names' ) );
}
$post_data['tax_input'][ $tax_name ] = array_merge( $current_terms, $new_terms );
}
if ( isset( $new_cats ) && in_array( 'category', $tax_names, true ) ) {
$cats = (array) wp_get_post_categories( $post_ID );
$post_data['post_category'] = array_unique( array_merge( $cats, $new_cats ) );
unset( $post_data['tax_input']['category'] );
}
$post_data['post_ID'] = $post_ID;
$post_data['post_type'] = $post->post_type;
$post_data['post_mime_type'] = $post->post_mime_type;
foreach ( array( 'comment_status', 'ping_status', 'post_author' ) as $field ) {
if ( ! isset( $post_data[ $field ] ) ) {
$post_data[ $field ] = $post->$field;
}
}
$post_data = _wp_translate_postdata( true, $post_data );
if ( is_wp_error( $post_data ) ) {
$skipped[] = $post_ID;
continue;
}
$post_data = _wp_get_allowed_postdata( $post_data );
if ( isset( $shared_post_data['post_format'] ) ) {
set_post_format( $post_ID, $shared_post_data['post_format'] );
}
// Prevent wp_insert_post() from overwriting post format with the old data.
unset( $post_data['tax_input']['post_format'] );
$post_id = wp_update_post( $post_data );
update_post_meta( $post_id, '_edit_last', get_current_user_id() );
$updated[] = $post_id;
if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
if ( 'sticky' === $post_data['sticky'] ) {
stick_post( $post_ID );
} else {
unstick_post( $post_ID );
}
}
}
return array(
'updated' => $updated,
'skipped' => $skipped,
'locked' => $locked,
);
}
```
| Uses | Description |
| --- | --- |
| [\_wp\_get\_allowed\_postdata()](_wp_get_allowed_postdata) wp-admin/includes/post.php | Returns only allowed post data fields. |
| [unstick\_post()](unstick_post) wp-includes/post.php | Un-sticks a post. |
| [\_wp\_translate\_postdata()](_wp_translate_postdata) wp-admin/includes/post.php | Renames `$_POST` data from form names to DB post columns. |
| [set\_post\_format()](set_post_format) wp-includes/post-formats.php | Assign a format to a post |
| [get\_post\_type()](get_post_type) wp-includes/post.php | Retrieves the post type of the current post or of a given post. |
| [wp\_get\_object\_terms()](wp_get_object_terms) wp-includes/taxonomy.php | Retrieves the terms associated with the given object(s), in the supplied taxonomies. |
| [is\_taxonomy\_hierarchical()](is_taxonomy_hierarchical) wp-includes/taxonomy.php | Determines whether the taxonomy object is hierarchical. |
| [get\_object\_taxonomies()](get_object_taxonomies) wp-includes/taxonomy.php | Returns the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name. |
| [update\_post\_meta()](update_post_meta) wp-includes/post.php | Updates a post meta field based on the given post ID. |
| [wp\_check\_post\_lock()](wp_check_post_lock) wp-admin/includes/post.php | Determines whether the post is currently being edited by another user. |
| [wp\_get\_post\_categories()](wp_get_post_categories) wp-includes/post.php | Retrieves the list of categories for a post. |
| [wp\_update\_post()](wp_update_post) wp-includes/post.php | Updates a post with new post data. |
| [stick\_post()](stick_post) wp-includes/post.php | Makes a post sticky. |
| [wpdb::get\_results()](../classes/wpdb/get_results) wp-includes/class-wpdb.php | Retrieves an entire SQL result set from the database (i.e., many rows). |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [get\_post\_type\_object()](get_post_type_object) wp-includes/post.php | Retrieves a post type object by name. |
| [get\_current\_user\_id()](get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| [get\_taxonomy()](get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [sanitize\_key()](sanitize_key) wp-includes/formatting.php | Sanitizes a string key. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
wordpress global_terms( int $term_id, string $deprecated = '' ): int global\_terms( int $term\_id, string $deprecated = '' ): int
============================================================
This function has been deprecated.
Maintains a canonical list of terms by syncing terms created for each blog with the global terms table.
`$term_id` int Required An ID for a term on the current blog. `$deprecated` string Optional Not used. Default: `''`
int An ID from the global terms table mapped from $term\_id.
File: `wp-includes/ms-deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-deprecated.php/)
```
function global_terms( $term_id, $deprecated = '' ) {
_deprecated_function( __FUNCTION__, '6.1.0' );
return $term_id;
}
```
| Uses | Description |
| --- | --- |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | This function has been deprecated. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress codepress_get_lang( string $filename ) codepress\_get\_lang( string $filename )
========================================
This function has been deprecated.
Determines the language to use for CodePress syntax highlighting.
`$filename` string Required File: `wp-admin/includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/deprecated.php/)
```
function codepress_get_lang( $filename ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
}
```
| Uses | Description |
| --- | --- |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | This function has been deprecated. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress comment_text( int|WP_Comment $comment_ID, array $args = array() ) comment\_text( int|WP\_Comment $comment\_ID, array $args = array() )
====================================================================
Displays the text of the current comment.
* [Walker\_Comment::comment()](../classes/walker_comment/comment)
`$comment_ID` int|[WP\_Comment](../classes/wp_comment) Required [WP\_Comment](../classes/wp_comment) or ID of the comment for which to print the text.
Default current comment. `$args` array Optional An array of arguments. Default: `array()`
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
function comment_text( $comment_ID = 0, $args = array() ) {
$comment = get_comment( $comment_ID );
$comment_text = get_comment_text( $comment, $args );
/**
* Filters the text of a comment to be displayed.
*
* @since 1.2.0
*
* @see Walker_Comment::comment()
*
* @param string $comment_text Text of the current comment.
* @param WP_Comment|null $comment The comment object. Null if not found.
* @param array $args An array of arguments.
*/
echo apply_filters( 'comment_text', $comment_text, $comment, $args );
}
```
[apply\_filters( 'comment\_text', string $comment\_text, WP\_Comment|null $comment, array $args )](../hooks/comment_text)
Filters the text of a comment to be displayed.
| Uses | Description |
| --- | --- |
| [get\_comment\_text()](get_comment_text) wp-includes/comment-template.php | Retrieves the text of the current comment. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_comment()](get_comment) wp-includes/comment.php | Retrieves comment data given a comment ID or comment object. |
| 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 | |
| [Walker\_Comment::comment()](../classes/walker_comment/comment) wp-includes/class-walker-comment.php | Outputs a single comment. |
| [Walker\_Comment::html5\_comment()](../classes/walker_comment/html5_comment) wp-includes/class-walker-comment.php | Outputs a comment in the HTML5 format. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the ability for `$comment_ID` to also accept a [WP\_Comment](../classes/wp_comment) object. |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
| programming_docs |
wordpress get_body_class( string|string[] $class = '' ): string[] get\_body\_class( string|string[] $class = '' ): string[]
=========================================================
Retrieves an array of the class names for the body element.
`$class` string|string[] Optional Space-separated string or array of class names to add to the class list. Default: `''`
string[] Array of class names.
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
function get_body_class( $class = '' ) {
global $wp_query;
$classes = array();
if ( is_rtl() ) {
$classes[] = 'rtl';
}
if ( is_front_page() ) {
$classes[] = 'home';
}
if ( is_home() ) {
$classes[] = 'blog';
}
if ( is_privacy_policy() ) {
$classes[] = 'privacy-policy';
}
if ( is_archive() ) {
$classes[] = 'archive';
}
if ( is_date() ) {
$classes[] = 'date';
}
if ( is_search() ) {
$classes[] = 'search';
$classes[] = $wp_query->posts ? 'search-results' : 'search-no-results';
}
if ( is_paged() ) {
$classes[] = 'paged';
}
if ( is_attachment() ) {
$classes[] = 'attachment';
}
if ( is_404() ) {
$classes[] = 'error404';
}
if ( is_singular() ) {
$post_id = $wp_query->get_queried_object_id();
$post = $wp_query->get_queried_object();
$post_type = $post->post_type;
if ( is_page_template() ) {
$classes[] = "{$post_type}-template";
$template_slug = get_page_template_slug( $post_id );
$template_parts = explode( '/', $template_slug );
foreach ( $template_parts as $part ) {
$classes[] = "{$post_type}-template-" . sanitize_html_class( str_replace( array( '.', '/' ), '-', basename( $part, '.php' ) ) );
}
$classes[] = "{$post_type}-template-" . sanitize_html_class( str_replace( '.', '-', $template_slug ) );
} else {
$classes[] = "{$post_type}-template-default";
}
if ( is_single() ) {
$classes[] = 'single';
if ( isset( $post->post_type ) ) {
$classes[] = 'single-' . sanitize_html_class( $post->post_type, $post_id );
$classes[] = 'postid-' . $post_id;
// Post Format.
if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
$post_format = get_post_format( $post->ID );
if ( $post_format && ! is_wp_error( $post_format ) ) {
$classes[] = 'single-format-' . sanitize_html_class( $post_format );
} else {
$classes[] = 'single-format-standard';
}
}
}
}
if ( is_attachment() ) {
$mime_type = get_post_mime_type( $post_id );
$mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' );
$classes[] = 'attachmentid-' . $post_id;
$classes[] = 'attachment-' . str_replace( $mime_prefix, '', $mime_type );
} elseif ( is_page() ) {
$classes[] = 'page';
$page_id = $wp_query->get_queried_object_id();
$post = get_post( $page_id );
$classes[] = 'page-id-' . $page_id;
if ( get_pages(
array(
'parent' => $page_id,
'number' => 1,
)
) ) {
$classes[] = 'page-parent';
}
if ( $post->post_parent ) {
$classes[] = 'page-child';
$classes[] = 'parent-pageid-' . $post->post_parent;
}
}
} elseif ( is_archive() ) {
if ( is_post_type_archive() ) {
$classes[] = 'post-type-archive';
$post_type = get_query_var( 'post_type' );
if ( is_array( $post_type ) ) {
$post_type = reset( $post_type );
}
$classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
} elseif ( is_author() ) {
$author = $wp_query->get_queried_object();
$classes[] = 'author';
if ( isset( $author->user_nicename ) ) {
$classes[] = 'author-' . sanitize_html_class( $author->user_nicename, $author->ID );
$classes[] = 'author-' . $author->ID;
}
} elseif ( is_category() ) {
$cat = $wp_query->get_queried_object();
$classes[] = 'category';
if ( isset( $cat->term_id ) ) {
$cat_class = sanitize_html_class( $cat->slug, $cat->term_id );
if ( is_numeric( $cat_class ) || ! trim( $cat_class, '-' ) ) {
$cat_class = $cat->term_id;
}
$classes[] = 'category-' . $cat_class;
$classes[] = 'category-' . $cat->term_id;
}
} elseif ( is_tag() ) {
$tag = $wp_query->get_queried_object();
$classes[] = 'tag';
if ( isset( $tag->term_id ) ) {
$tag_class = sanitize_html_class( $tag->slug, $tag->term_id );
if ( is_numeric( $tag_class ) || ! trim( $tag_class, '-' ) ) {
$tag_class = $tag->term_id;
}
$classes[] = 'tag-' . $tag_class;
$classes[] = 'tag-' . $tag->term_id;
}
} elseif ( is_tax() ) {
$term = $wp_query->get_queried_object();
if ( isset( $term->term_id ) ) {
$term_class = sanitize_html_class( $term->slug, $term->term_id );
if ( is_numeric( $term_class ) || ! trim( $term_class, '-' ) ) {
$term_class = $term->term_id;
}
$classes[] = 'tax-' . sanitize_html_class( $term->taxonomy );
$classes[] = 'term-' . $term_class;
$classes[] = 'term-' . $term->term_id;
}
}
}
if ( is_user_logged_in() ) {
$classes[] = 'logged-in';
}
if ( is_admin_bar_showing() ) {
$classes[] = 'admin-bar';
$classes[] = 'no-customize-support';
}
if ( current_theme_supports( 'custom-background' )
&& ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() ) ) {
$classes[] = 'custom-background';
}
if ( has_custom_logo() ) {
$classes[] = 'wp-custom-logo';
}
if ( current_theme_supports( 'responsive-embeds' ) ) {
$classes[] = 'wp-embed-responsive';
}
$page = $wp_query->get( 'page' );
if ( ! $page || $page < 2 ) {
$page = $wp_query->get( 'paged' );
}
if ( $page && $page > 1 && ! is_404() ) {
$classes[] = 'paged-' . $page;
if ( is_single() ) {
$classes[] = 'single-paged-' . $page;
} elseif ( is_page() ) {
$classes[] = 'page-paged-' . $page;
} elseif ( is_category() ) {
$classes[] = 'category-paged-' . $page;
} elseif ( is_tag() ) {
$classes[] = 'tag-paged-' . $page;
} elseif ( is_date() ) {
$classes[] = 'date-paged-' . $page;
} elseif ( is_author() ) {
$classes[] = 'author-paged-' . $page;
} elseif ( is_search() ) {
$classes[] = 'search-paged-' . $page;
} elseif ( is_post_type_archive() ) {
$classes[] = 'post-type-paged-' . $page;
}
}
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
} else {
// Ensure that we always coerce class to being an array.
$class = array();
}
$classes = array_map( 'esc_attr', $classes );
/**
* Filters the list of CSS body class names for the current post or page.
*
* @since 2.8.0
*
* @param string[] $classes An array of body class names.
* @param string[] $class An array of additional class names added to the body.
*/
$classes = apply_filters( 'body_class', $classes, $class );
return array_unique( $classes );
}
```
[apply\_filters( 'body\_class', string[] $classes, string[] $class )](../hooks/body_class)
Filters the list of CSS body class names for the current post or page.
| Uses | Description |
| --- | --- |
| [is\_privacy\_policy()](is_privacy_policy) wp-includes/query.php | Determines whether the query is for the Privacy Policy page. |
| [get\_query\_var()](get_query_var) wp-includes/query.php | Retrieves the value of a query variable in the [WP\_Query](../classes/wp_query) class. |
| [is\_author()](is_author) wp-includes/query.php | Determines whether the query is for an existing author archive page. |
| [is\_category()](is_category) wp-includes/query.php | Determines whether the query is for an existing category archive page. |
| [is\_tag()](is_tag) wp-includes/query.php | Determines whether the query is for an existing tag archive page. |
| [is\_tax()](is_tax) wp-includes/query.php | Determines whether the query is for an existing custom taxonomy archive page. |
| [is\_archive()](is_archive) wp-includes/query.php | Determines whether the query is for an existing archive page. |
| [is\_post\_type\_archive()](is_post_type_archive) wp-includes/query.php | Determines whether the query is for an existing post type archive page. |
| [is\_rtl()](is_rtl) wp-includes/l10n.php | Determines whether the current locale is right-to-left (RTL). |
| [has\_custom\_logo()](has_custom_logo) wp-includes/general-template.php | Determines whether the site has a custom logo. |
| [is\_admin\_bar\_showing()](is_admin_bar_showing) wp-includes/admin-bar.php | Determines whether the admin bar should be showing. |
| [is\_page\_template()](is_page_template) wp-includes/post-template.php | Determines whether the current post uses a page template. |
| [get\_page\_template\_slug()](get_page_template_slug) wp-includes/post-template.php | Gets the specific template filename for a given post. |
| [get\_pages()](get_pages) wp-includes/post.php | Retrieves an array of pages (or hierarchical post type items). |
| [post\_type\_supports()](post_type_supports) wp-includes/post.php | Checks a post type’s support for a given feature. |
| [get\_post\_mime\_type()](get_post_mime_type) wp-includes/post.php | Retrieves the mime type of an attachment based on the ID. |
| [get\_post\_format()](get_post_format) wp-includes/post-formats.php | Retrieve the format slug for a post |
| [is\_page()](is_page) wp-includes/query.php | Determines whether the query is for an existing single page. |
| [is\_attachment()](is_attachment) wp-includes/query.php | Determines whether the query is for an existing attachment page. |
| [is\_paged()](is_paged) wp-includes/query.php | Determines whether the query is for a paged result and not for the first page. |
| [WP\_Query::get\_queried\_object()](../classes/wp_query/get_queried_object) wp-includes/class-wp-query.php | Retrieves the currently queried object. |
| [get\_background\_color()](get_background_color) wp-includes/theme.php | Retrieves value for custom background color. |
| [get\_theme\_support()](get_theme_support) wp-includes/theme.php | Gets the theme support arguments passed when registering that support. |
| [get\_background\_image()](get_background_image) wp-includes/theme.php | Retrieves background image for custom background. |
| [sanitize\_html\_class()](sanitize_html_class) wp-includes/formatting.php | Sanitizes an HTML classname to ensure it only contains valid characters. |
| [is\_date()](is_date) wp-includes/query.php | Determines whether the query is for an existing date archive. |
| [WP\_Query::get\_queried\_object\_id()](../classes/wp_query/get_queried_object_id) wp-includes/class-wp-query.php | Retrieves the ID of the currently queried object. |
| [WP\_Query::get()](../classes/wp_query/get) wp-includes/class-wp-query.php | Retrieves the value of a query variable. |
| [is\_search()](is_search) wp-includes/query.php | Determines whether the query is for a search. |
| [is\_404()](is_404) wp-includes/query.php | Determines whether the query has resulted in a 404 (returns no results). |
| [is\_singular()](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). |
| [is\_single()](is_single) wp-includes/query.php | Determines whether the query is for an existing single post. |
| [is\_front\_page()](is_front_page) wp-includes/query.php | Determines whether the query is for the front page of the site. |
| [is\_home()](is_home) wp-includes/query.php | Determines whether the query is for the blog homepage. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [is\_user\_logged\_in()](is_user_logged_in) wp-includes/pluggable.php | Determines whether the current visitor is a logged in user. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [current\_theme\_supports()](current_theme_supports) wp-includes/theme.php | Checks a theme’s support for a given feature. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Used By | Description |
| --- | --- |
| [body\_class()](body_class) wp-includes/post-template.php | Displays the class names for the body element. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress comment_author_email_link( string $linktext = '', string $before = '', string $after = '', int|WP_Comment $comment = null ) comment\_author\_email\_link( string $linktext = '', string $before = '', string $after = '', int|WP\_Comment $comment = null )
===============================================================================================================================
Displays the HTML email link to the author of the current comment.
Care should be taken to protect the email address and assure that email harvesters do not capture your commenter’s email address. Most assume that their email address will not appear in raw form on the site. Doing so will enable anyone, including those that people don’t want to get the email address and use it for their own means good and bad.
`$linktext` string Optional Text to display instead of the comment author's email address.
Default: `''`
`$before` string Optional Text or HTML to display before the email link. Default: `''`
`$after` string Optional Text or HTML to display after the email link. Default: `''`
`$comment` int|[WP\_Comment](../classes/wp_comment) Optional Comment ID or [WP\_Comment](../classes/wp_comment) object. Default is the current comment. Default: `null`
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
function comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) {
$link = get_comment_author_email_link( $linktext, $before, $after, $comment );
if ( $link ) {
echo $link;
}
}
```
| Uses | Description |
| --- | --- |
| [get\_comment\_author\_email\_link()](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.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$comment` parameter. |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress wp_notify_postauthor( int|WP_Comment $comment_id, string $deprecated = null ): bool wp\_notify\_postauthor( int|WP\_Comment $comment\_id, string $deprecated = null ): bool
=======================================================================================
Notifies an author (and/or others) of a comment/trackback/pingback on a post.
`$comment_id` int|[WP\_Comment](../classes/wp_comment) Required Comment ID or [WP\_Comment](../classes/wp_comment) object. `$deprecated` string Optional Not used. Default: `null`
bool True on completion. False if no email addresses were specified.
* This function can be replaced via [plugins](https://wordpress.org/support/article/glossary/). If plugins do not redefine these functions, then this will be used instead.
* This function is pluggable using the following filters:
+ comment\_notification\_text
+ comment\_notification\_subject
+ comment\_notification\_headersIf the plugins do not redefine the functions using filters, then the default functionality will be used.
To modify the content of the email that is sent when a reader leaves a comment, you may provide filters for each of the above functions in your plugin.
This function also sanitizes a URL for use in a redirect.
File: `wp-includes/pluggable.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
```
function wp_notify_postauthor( $comment_id, $deprecated = null ) {
if ( null !== $deprecated ) {
_deprecated_argument( __FUNCTION__, '3.8.0' );
}
$comment = get_comment( $comment_id );
if ( empty( $comment ) || empty( $comment->comment_post_ID ) ) {
return false;
}
$post = get_post( $comment->comment_post_ID );
$author = get_userdata( $post->post_author );
// Who to notify? By default, just the post author, but others can be added.
$emails = array();
if ( $author ) {
$emails[] = $author->user_email;
}
/**
* 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.
*
* @since 3.7.0
*
* @param string[] $emails An array of email addresses to receive a comment notification.
* @param string $comment_id The comment ID as a numeric string.
*/
$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );
$emails = array_filter( $emails );
// If there are no addresses to send the comment to, bail.
if ( ! count( $emails ) ) {
return false;
}
// Facilitate unsetting below without knowing the keys.
$emails = array_flip( $emails );
/**
* Filters whether to notify comment authors of their comments on their own posts.
*
* By default, comment authors aren't notified of their comments on their own
* posts. This filter allows you to override that.
*
* @since 3.8.0
*
* @param bool $notify Whether to notify the post author of their own comment.
* Default false.
* @param string $comment_id The comment ID as a numeric string.
*/
$notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );
// The comment was left by the author.
if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {
unset( $emails[ $author->user_email ] );
}
// The author moderated a comment on their own post.
if ( $author && ! $notify_author && get_current_user_id() == $post->post_author ) {
unset( $emails[ $author->user_email ] );
}
// The post author is no longer a member of the blog.
if ( $author && ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) ) {
unset( $emails[ $author->user_email ] );
}
// If there's no email to send the comment to, bail, otherwise flip array back around for use below.
if ( ! count( $emails ) ) {
return false;
} else {
$emails = array_flip( $emails );
}
$switched_locale = switch_to_locale( get_locale() );
$comment_author_domain = '';
if ( WP_Http::is_ip_address( $comment->comment_author_IP ) ) {
$comment_author_domain = gethostbyaddr( $comment->comment_author_IP );
}
// The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
// We want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
$comment_content = wp_specialchars_decode( $comment->comment_content );
switch ( $comment->comment_type ) {
case 'trackback':
/* translators: %s: Post title. */
$notify_message = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "\r\n";
/* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */
$notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
/* translators: %s: Trackback/pingback/comment author URL. */
$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
/* translators: %s: Comment text. */
$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
$notify_message .= __( 'You can see all trackbacks on this post here:' ) . "\r\n";
/* translators: Trackback notification email subject. 1: Site title, 2: Post title. */
$subject = sprintf( __( '[%1$s] Trackback: "%2$s"' ), $blogname, $post->post_title );
break;
case 'pingback':
/* translators: %s: Post title. */
$notify_message = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "\r\n";
/* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */
$notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
/* translators: %s: Trackback/pingback/comment author URL. */
$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
/* translators: %s: Comment text. */
$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
$notify_message .= __( 'You can see all pingbacks on this post here:' ) . "\r\n";
/* translators: Pingback notification email subject. 1: Site title, 2: Post title. */
$subject = sprintf( __( '[%1$s] Pingback: "%2$s"' ), $blogname, $post->post_title );
break;
default: // Comments.
/* translators: %s: Post title. */
$notify_message = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n";
/* translators: 1: Comment author's name, 2: Comment author's IP address, 3: Comment author's hostname. */
$notify_message .= sprintf( __( 'Author: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
/* translators: %s: Comment author email. */
$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
/* translators: %s: Trackback/pingback/comment author URL. */
$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
if ( $comment->comment_parent && user_can( $post->post_author, 'edit_comment', $comment->comment_parent ) ) {
/* translators: Comment moderation. %s: Parent comment edit URL. */
$notify_message .= sprintf( __( 'In reply to: %s' ), admin_url( "comment.php?action=editcomment&c={$comment->comment_parent}#wpbody-content" ) ) . "\r\n";
}
/* translators: %s: Comment text. */
$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
$notify_message .= __( 'You can see all comments on this post here:' ) . "\r\n";
/* translators: Comment notification email subject. 1: Site title, 2: Post title. */
$subject = sprintf( __( '[%1$s] Comment: "%2$s"' ), $blogname, $post->post_title );
break;
}
$notify_message .= get_permalink( $comment->comment_post_ID ) . "#comments\r\n\r\n";
/* translators: %s: Comment URL. */
$notify_message .= sprintf( __( 'Permalink: %s' ), get_comment_link( $comment ) ) . "\r\n";
if ( user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) {
if ( EMPTY_TRASH_DAYS ) {
/* translators: Comment moderation. %s: Comment action URL. */
$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
} else {
/* translators: Comment moderation. %s: Comment action URL. */
$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
}
/* translators: Comment moderation. %s: Comment action URL. */
$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
}
$wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', wp_parse_url( network_home_url(), PHP_URL_HOST ) );
if ( '' === $comment->comment_author ) {
$from = "From: \"$blogname\" <$wp_email>";
if ( '' !== $comment->comment_author_email ) {
$reply_to = "Reply-To: $comment->comment_author_email";
}
} else {
$from = "From: \"$comment->comment_author\" <$wp_email>";
if ( '' !== $comment->comment_author_email ) {
$reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
}
}
$message_headers = "$from\n"
. 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
if ( isset( $reply_to ) ) {
$message_headers .= $reply_to . "\n";
}
/**
* Filters the comment notification email text.
*
* @since 1.5.2
*
* @param string $notify_message The comment notification email text.
* @param string $comment_id Comment ID as a numeric string.
*/
$notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID );
/**
* Filters the comment notification email subject.
*
* @since 1.5.2
*
* @param string $subject The comment notification email subject.
* @param string $comment_id Comment ID as a numeric string.
*/
$subject = apply_filters( 'comment_notification_subject', $subject, $comment->comment_ID );
/**
* Filters the comment notification email headers.
*
* @since 1.5.2
*
* @param string $message_headers Headers for the comment notification email.
* @param string $comment_id Comment ID as a numeric string.
*/
$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment->comment_ID );
foreach ( $emails as $email ) {
wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
}
if ( $switched_locale ) {
restore_previous_locale();
}
return true;
}
```
[apply\_filters( 'comment\_notification\_headers', string $message\_headers, string $comment\_id )](../hooks/comment_notification_headers)
Filters the comment notification email headers.
[apply\_filters( 'comment\_notification\_notify\_author', bool $notify, string $comment\_id )](../hooks/comment_notification_notify_author)
Filters whether to notify comment authors of their comments on their own posts.
[apply\_filters( 'comment\_notification\_recipients', string[] $emails, string $comment\_id )](../hooks/comment_notification_recipients)
Filters the list of email addresses to receive a comment notification.
[apply\_filters( 'comment\_notification\_subject', string $subject, string $comment\_id )](../hooks/comment_notification_subject)
Filters the comment notification email subject.
[apply\_filters( 'comment\_notification\_text', string $notify\_message, string $comment\_id )](../hooks/comment_notification_text)
Filters the comment notification email text.
| Uses | Description |
| --- | --- |
| [restore\_previous\_locale()](restore_previous_locale) wp-includes/l10n.php | Restores the translations according to the previous locale. |
| [wp\_parse\_url()](wp_parse_url) wp-includes/http.php | A wrapper for PHP’s parse\_url() function that handles consistency in the return values across PHP versions. |
| [user\_can()](user_can) wp-includes/capabilities.php | Returns whether a particular user has the specified capability. |
| [get\_comment\_link()](get_comment_link) wp-includes/comment-template.php | Retrieves the link to a given comment. |
| [get\_locale()](get_locale) wp-includes/l10n.php | Retrieves the current locale. |
| [wp\_specialchars\_decode()](wp_specialchars_decode) wp-includes/formatting.php | Converts a number of HTML entities into their special characters. |
| [wp\_mail()](wp_mail) wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
| [WP\_Http::is\_ip\_address()](../classes/wp_http/is_ip_address) wp-includes/class-wp-http.php | Determines if a specified string represents an IP address or not. |
| [switch\_to\_locale()](switch_to_locale) wp-includes/l10n.php | Switches the translations according to the given locale. |
| [network\_home\_url()](network_home_url) wp-includes/link-template.php | Retrieves the home URL for the current network. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [get\_current\_user\_id()](get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| [\_deprecated\_argument()](_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_permalink()](get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| [admin\_url()](admin_url) wp-includes/link-template.php | Retrieves the URL to the admin area for the current site. |
| [get\_userdata()](get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [get\_comment()](get_comment) wp-includes/comment.php | Retrieves comment data given a comment ID or comment object. |
| Used By | Description |
| --- | --- |
| [wp\_new\_comment\_notify\_postauthor()](wp_new_comment_notify_postauthor) wp-includes/comment.php | Sends a notification of a new comment to the post author. |
| Version | Description |
| --- | --- |
| [1.0.0](https://developer.wordpress.org/reference/since/1.0.0/) | Introduced. |
| programming_docs |
wordpress remove_rewrite_tag( string $tag ) remove\_rewrite\_tag( string $tag )
===================================
Removes an existing rewrite tag (like %postname%).
`$tag` string Required Name of the rewrite tag. File: `wp-includes/rewrite.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rewrite.php/)
```
function remove_rewrite_tag( $tag ) {
global $wp_rewrite;
$wp_rewrite->remove_rewrite_tag( $tag );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Rewrite::remove\_rewrite\_tag()](../classes/wp_rewrite/remove_rewrite_tag) wp-includes/class-wp-rewrite.php | Removes an existing rewrite tag. |
| Used By | Description |
| --- | --- |
| [WP\_Taxonomy::remove\_rewrite\_rules()](../classes/wp_taxonomy/remove_rewrite_rules) wp-includes/class-wp-taxonomy.php | Removes any rewrite rules, permastructs, and rules for the taxonomy. |
| [WP\_Post\_Type::remove\_rewrite\_rules()](../classes/wp_post_type/remove_rewrite_rules) wp-includes/class-wp-post-type.php | Removes any rewrite rules, permastructs, and rules for the post type. |
| Version | Description |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress update_user_meta( int $user_id, string $meta_key, mixed $meta_value, mixed $prev_value = '' ): int|bool update\_user\_meta( int $user\_id, string $meta\_key, mixed $meta\_value, mixed $prev\_value = '' ): int|bool
=============================================================================================================
Updates user meta field based on user ID.
Use the $prev\_value parameter to differentiate between meta fields with the same key and user ID.
If the meta field for the user does not exist, it will be added.
`$user_id` int Required User ID. `$meta_key` string Required Metadata key. `$meta_value` mixed Required Metadata value. Must be serializable if non-scalar. `$prev_value` mixed Optional Previous value to check before updating.
If specified, only update existing metadata entries with this value. Otherwise, update all entries. Default: `''`
int|bool Meta ID if the key didn't exist, true on successful update, false on failure or if the value passed to the function is the same as the one that is already in the database.
Changes in behavior from the now deprecated update\_usermeta:
Update\_user\_meta does not delete the meta if the new value is empty.
The actions are different.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
function update_user_meta( $user_id, $meta_key, $meta_value, $prev_value = '' ) {
return update_metadata( 'user', $user_id, $meta_key, $meta_value, $prev_value );
}
```
| Uses | Description |
| --- | --- |
| [update\_metadata()](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. |
| Used By | Description |
| --- | --- |
| [WP\_Application\_Passwords::set\_user\_application\_passwords()](../classes/wp_application_passwords/set_user_application_passwords) wp-includes/class-wp-application-passwords.php | Sets a user’s application passwords. |
| [wp\_initialize\_site()](wp_initialize_site) wp-includes/ms-site.php | Runs the initialization routine for a given site. |
| [wp\_localize\_community\_events()](wp_localize_community_events) wp-includes/script-loader.php | Localizes community events data that needs to be passed to dashboard.js. |
| [wp\_ajax\_get\_community\_events()](wp_ajax_get_community_events) wp-admin/includes/ajax-actions.php | Handles Ajax requests for community events |
| [WP\_Screen::render\_meta\_boxes\_preferences()](../classes/wp_screen/render_meta_boxes_preferences) wp-admin/includes/class-wp-screen.php | Renders the meta boxes preferences. |
| [wp\_ajax\_save\_wporg\_username()](wp_ajax_save_wporg_username) wp-admin/includes/ajax-actions.php | Ajax handler for saving the user’s WordPress.org username. |
| [WP\_User\_Meta\_Session\_Tokens::update\_sessions()](../classes/wp_user_meta_session_tokens/update_sessions) wp-includes/class-wp-user-meta-session-tokens.php | Updates the user’s sessions in the usermeta table. |
| [choose\_primary\_blog()](choose_primary_blog) wp-admin/includes/ms.php | Handles the display of choosing a user’s primary site. |
| [send\_confirmation\_on\_profile\_email()](send_confirmation_on_profile_email) wp-includes/user.php | Sends a confirmation request email when a change of user email address is attempted. |
| [set\_screen\_options()](set_screen_options) wp-admin/includes/misc.php | Saves option for number of rows when listing posts, pages, comments, etc. |
| [populate\_network()](populate_network) wp-admin/includes/schema.php | Populate network settings. |
| [wp\_install()](wp_install) wp-admin/includes/upgrade.php | Installs the site. |
| [wp\_install\_defaults()](wp_install_defaults) wp-admin/includes/upgrade.php | Creates the initial content for a newly-installed site. |
| [default\_password\_nag\_handler()](default_password_nag_handler) wp-admin/includes/user.php | |
| [default\_password\_nag\_edit\_user()](default_password_nag_edit_user) wp-admin/includes/user.php | |
| [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 | |
| [wp\_ajax\_save\_user\_color\_scheme()](wp_ajax_save_user_color_scheme) wp-admin/includes/ajax-actions.php | Ajax handler for auto-saving the selected color scheme for a user’s own profile. |
| [wp\_ajax\_dismiss\_wp\_pointer()](wp_ajax_dismiss_wp_pointer) wp-admin/includes/ajax-actions.php | Ajax handler for dismissing a WordPress pointer. |
| [wp\_ajax\_closed\_postboxes()](wp_ajax_closed_postboxes) wp-admin/includes/ajax-actions.php | Ajax handler for closed post boxes. |
| [wp\_ajax\_hidden\_columns()](wp_ajax_hidden_columns) wp-admin/includes/ajax-actions.php | Ajax handler for hidden columns. |
| [wp\_ajax\_update\_welcome\_panel()](wp_ajax_update_welcome_panel) wp-admin/includes/ajax-actions.php | Ajax handler for updating whether to display the welcome panel. |
| [wp\_ajax\_meta\_box\_order()](wp_ajax_meta_box_order) wp-admin/includes/ajax-actions.php | Ajax handler for saving the meta box order. |
| [wp\_nav\_menu\_setup()](wp_nav_menu_setup) wp-admin/includes/nav-menu.php | Register nav menu meta boxes and advanced menu items. |
| [wp\_initial\_nav\_menu\_meta\_boxes()](wp_initial_nav_menu_meta_boxes) wp-admin/includes/nav-menu.php | Limit the amount of meta boxes to pages, posts, links, and categories for first time users. |
| [WP\_User::update\_user\_level\_from\_caps()](../classes/wp_user/update_user_level_from_caps) wp-includes/class-wp-user.php | Updates the maximum user level for the user. |
| [WP\_User::add\_cap()](../classes/wp_user/add_cap) wp-includes/class-wp-user.php | Adds capability and grant or deny access to capability. |
| [WP\_User::remove\_cap()](../classes/wp_user/remove_cap) wp-includes/class-wp-user.php | Removes capability from user. |
| [WP\_User::add\_role()](../classes/wp_user/add_role) wp-includes/class-wp-user.php | Adds role to user. |
| [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. |
| [reset\_password()](reset_password) wp-includes/user.php | Handles resetting the user’s password. |
| [register\_new\_user()](register_new_user) wp-includes/user.php | Handles registering a new user. |
| [wp\_insert\_user()](wp_insert_user) wp-includes/user.php | Inserts a user into the database. |
| [update\_user\_option()](update_user_option) wp-includes/user.php | Updates user option with global blog capability. |
| [add\_new\_user\_to\_blog()](add_new_user_to_blog) wp-includes/ms-functions.php | Adds a newly created user to the appropriate blog |
| [get\_active\_blog\_for\_user()](get_active_blog_for_user) wp-includes/ms-functions.php | Gets one of a user’s active blogs. |
| [add\_user\_to\_blog()](add_user_to_blog) wp-includes/ms-functions.php | Adds a user to a blog, along with specifying the user’s role. |
| [remove\_user\_from\_blog()](remove_user_from_blog) wp-includes/ms-functions.php | Removes a user from a blog. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress get_author_feed_link( int $author_id, string $feed = '' ): string get\_author\_feed\_link( int $author\_id, string $feed = '' ): string
=====================================================================
Retrieves the feed link for a given author.
Returns a link to the feed for all posts by a given author. A specific feed can be requested or left blank to get the default feed.
`$author_id` int Required Author ID. `$feed` string Optional Feed type. Possible values include `'rss2'`, `'atom'`.
Default is the value of [get\_default\_feed()](get_default_feed) . Default: `''`
string Link to the feed for the author specified by $author\_id.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function get_author_feed_link( $author_id, $feed = '' ) {
$author_id = (int) $author_id;
$permalink_structure = get_option( 'permalink_structure' );
if ( empty( $feed ) ) {
$feed = get_default_feed();
}
if ( ! $permalink_structure ) {
$link = home_url( "?feed=$feed&author=" . $author_id );
} else {
$link = get_author_posts_url( $author_id );
if ( get_default_feed() == $feed ) {
$feed_link = 'feed';
} else {
$feed_link = "feed/$feed";
}
$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
}
/**
* Filters the feed link for a given author.
*
* @since 1.5.1
*
* @param string $link The author feed link.
* @param string $feed Feed type. Possible values include 'rss2', 'atom'.
*/
$link = apply_filters( 'author_feed_link', $link, $feed );
return $link;
}
```
[apply\_filters( 'author\_feed\_link', string $link, string $feed )](../hooks/author_feed_link)
Filters the feed link for a given author.
| Uses | Description |
| --- | --- |
| [user\_trailingslashit()](user_trailingslashit) wp-includes/link-template.php | Retrieves a trailing-slashed string if the site is set for adding trailing slashes. |
| [get\_default\_feed()](get_default_feed) wp-includes/feed.php | Retrieves the default feed. |
| [get\_author\_posts\_url()](get_author_posts_url) wp-includes/author-template.php | Retrieves the URL to the author page for the user with the ID provided. |
| [trailingslashit()](trailingslashit) wp-includes/formatting.php | Appends a trailing slash. |
| [home\_url()](home_url) wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Used By | Description |
| --- | --- |
| [wp\_list\_users()](wp_list_users) wp-includes/user.php | Lists all the users of the site, with several options available. |
| [feed\_links\_extra()](feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| [get\_author\_rss\_link()](get_author_rss_link) wp-includes/deprecated.php | Print/Return link to author RSS feed. |
| [wp\_list\_authors()](wp_list_authors) wp-includes/author-template.php | Lists all the authors of the site, with several options available. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress _post_format_request( array $qvs ): array \_post\_format\_request( array $qvs ): 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.
Filters the request to allow for the format prefix.
`$qvs` array Required array
File: `wp-includes/post-formats.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-formats.php/)
```
function _post_format_request( $qvs ) {
if ( ! isset( $qvs['post_format'] ) ) {
return $qvs;
}
$slugs = get_post_format_slugs();
if ( isset( $slugs[ $qvs['post_format'] ] ) ) {
$qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
}
$tax = get_taxonomy( 'post_format' );
if ( ! is_admin() ) {
$qvs['post_type'] = $tax->object_type;
}
return $qvs;
}
```
| Uses | Description |
| --- | --- |
| [get\_post\_format\_slugs()](get_post_format_slugs) wp-includes/post-formats.php | Retrieves the array of post format slugs. |
| [is\_admin()](is_admin) wp-includes/load.php | Determines whether the current request is for an administrative interface page. |
| [get\_taxonomy()](get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress _scalar_wp_die_handler( string $message = '', string $title = '', string|array $args = array() ) \_scalar\_wp\_die\_handler( string $message = '', string $title = '', string|array $args = 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.
Kills WordPress execution and displays an error message.
This is the handler for [wp\_die()](wp_die) when processing APP requests.
`$message` string Optional Response to print. Default: `''`
`$title` string Optional Error title (unused). Default: `''`
`$args` string|array Optional Arguments to control behavior. Default: `array()`
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) {
list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
if ( $parsed_args['exit'] ) {
if ( is_scalar( $message ) ) {
die( (string) $message );
}
die();
}
if ( is_scalar( $message ) ) {
echo (string) $message;
}
}
```
| Uses | Description |
| --- | --- |
| [\_wp\_die\_process\_input()](_wp_die_process_input) wp-includes/functions.php | Processes arguments passed to [wp\_die()](wp_die) consistently for its handlers. |
| Version | Description |
| --- | --- |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Added the $title and $args parameters. |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
wordpress user_can_create_post( int $user_id, int $blog_id = 1, int $category_id = 'None' ): bool user\_can\_create\_post( int $user\_id, int $blog\_id = 1, int $category\_id = 'None' ): bool
=============================================================================================
This function has been deprecated. Use [current\_user\_can()](current_user_can) instead.
Whether user can create a post.
* [current\_user\_can()](current_user_can)
`$user_id` int Required `$blog_id` int Optional Not Used Default: `1`
`$category_id` int Optional Not Used Default: `'None'`
bool
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') {
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
$author_data = get_userdata($user_id);
return ($author_data->user_level > 1);
}
```
| Uses | Description |
| --- | --- |
| [get\_userdata()](get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Used By | Description |
| --- | --- |
| [user\_can\_set\_post\_date()](user_can_set_post_date) wp-includes/deprecated.php | Whether user can set new posts’ dates. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Use [current\_user\_can()](current_user_can) |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress clean_object_term_cache( int|array $object_ids, array|string $object_type ) clean\_object\_term\_cache( int|array $object\_ids, array|string $object\_type )
================================================================================
Removes the taxonomy relationship to terms from the cache.
Will remove the entire taxonomy relationship containing term `$object_id`. The term IDs have to exist within the taxonomy `$object_type` for the deletion to take place.
* [get\_object\_taxonomies()](get_object_taxonomies) : for more on $object\_type.
`$object_ids` int|array Required Single or list of term object ID(s). `$object_type` array|string Required The taxonomy object type. File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
function clean_object_term_cache( $object_ids, $object_type ) {
global $_wp_suspend_cache_invalidation;
if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
return;
}
if ( ! is_array( $object_ids ) ) {
$object_ids = array( $object_ids );
}
$taxonomies = get_object_taxonomies( $object_type );
foreach ( $taxonomies as $taxonomy ) {
wp_cache_delete_multiple( $object_ids, "{$taxonomy}_relationships" );
}
wp_cache_delete( 'last_changed', 'terms' );
/**
* Fires after the object term cache has been cleaned.
*
* @since 2.5.0
*
* @param array $object_ids An array of object IDs.
* @param string $object_type Object type.
*/
do_action( 'clean_object_term_cache', $object_ids, $object_type );
}
```
[do\_action( 'clean\_object\_term\_cache', array $object\_ids, string $object\_type )](../hooks/clean_object_term_cache)
Fires after the object term cache has been cleaned.
| Uses | Description |
| --- | --- |
| [wp\_cache\_delete\_multiple()](wp_cache_delete_multiple) wp-includes/cache.php | Deletes multiple values from the cache in one call. |
| [wp\_cache\_delete()](wp_cache_delete) wp-includes/cache.php | Removes the cache contents matching key and group. |
| [get\_object\_taxonomies()](get_object_taxonomies) wp-includes/taxonomy.php | Returns the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Used By | Description |
| --- | --- |
| [wp\_delete\_term()](wp_delete_term) wp-includes/taxonomy.php | Removes a term from the database. |
| [clean\_post\_cache()](clean_post_cache) wp-includes/post.php | Will clean the post in the cache. |
| [clean\_attachment\_cache()](clean_attachment_cache) wp-includes/post.php | Will clean the attachment in the cache. |
| [clean\_bookmark\_cache()](clean_bookmark_cache) wp-includes/bookmark.php | Deletes the bookmark cache. |
| Version | Description |
| --- | --- |
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |
| programming_docs |
wordpress is_wp_version_compatible( string $required ): bool is\_wp\_version\_compatible( string $required ): bool
=====================================================
Checks compatibility with the current WordPress version.
`$required` string Required Minimum required WordPress version. bool True if required version is compatible or empty, false if not.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function is_wp_version_compatible( $required ) {
global $wp_version;
// Strip off any -alpha, -RC, -beta, -src suffixes.
list( $version ) = explode( '-', $wp_version );
return empty( $required ) || version_compare( $version, $required, '>=' );
}
```
| Used By | Description |
| --- | --- |
| [validate\_theme\_requirements()](validate_theme_requirements) wp-includes/theme.php | Validates the theme requirements for WordPress version and PHP version. |
| [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. |
| [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. |
| [validate\_plugin\_requirements()](validate_plugin_requirements) wp-admin/includes/plugin.php | Validates the plugin requirements for WordPress version and PHP version. |
| [WP\_Customize\_Manager::handle\_load\_themes\_request()](../classes/wp_customize_manager/handle_load_themes_request) wp-includes/class-wp-customize-manager.php | Loads themes into the theme browsing/installation UI. |
| [Plugin\_Upgrader::check\_package()](../classes/plugin_upgrader/check_package) wp-admin/includes/class-plugin-upgrader.php | Checks that the source package contains a valid plugin. |
| [Theme\_Upgrader::check\_package()](../classes/theme_upgrader/check_package) wp-admin/includes/class-theme-upgrader.php | Checks that the package source contains a valid theme. |
| [wp\_prepare\_themes\_for\_js()](wp_prepare_themes_for_js) wp-admin/includes/theme.php | Prepares themes for JavaScript. |
| [WP\_Plugins\_List\_Table::single\_row()](../classes/wp_plugins_list_table/single_row) wp-admin/includes/class-wp-plugins-list-table.php | |
| [wp\_theme\_update\_row()](wp_theme_update_row) wp-admin/includes/update.php | Displays update information for a theme. |
| [install\_plugin\_information()](install_plugin_information) wp-admin/includes/plugin-install.php | Displays plugin information in dialog box form. |
| [WP\_Plugin\_Install\_List\_Table::display\_rows()](../classes/wp_plugin_install_list_table/display_rows) wp-admin/includes/class-wp-plugin-install-list-table.php | |
| [wp\_ajax\_query\_themes()](wp_ajax_query_themes) wp-admin/includes/ajax-actions.php | Ajax handler for getting themes from [themes\_api()](themes_api) . |
| [list\_theme\_updates()](list_theme_updates) wp-admin/update-core.php | Display the upgrade themes form. |
| Version | Description |
| --- | --- |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress wp_timezone_choice( string $selected_zone, string $locale = null ): string wp\_timezone\_choice( string $selected\_zone, string $locale = null ): string
=============================================================================
Gives a nicely-formatted list of timezone strings.
`$selected_zone` string Required Selected timezone. `$locale` string Optional Locale to load the timezones in. Default current site locale. Default: `null`
string
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function wp_timezone_choice( $selected_zone, $locale = null ) {
static $mo_loaded = false, $locale_loaded = null;
$continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' );
// Load translations for continents and cities.
if ( ! $mo_loaded || $locale !== $locale_loaded ) {
$locale_loaded = $locale ? $locale : get_locale();
$mofile = WP_LANG_DIR . '/continents-cities-' . $locale_loaded . '.mo';
unload_textdomain( 'continents-cities' );
load_textdomain( 'continents-cities', $mofile );
$mo_loaded = true;
}
$tz_identifiers = timezone_identifiers_list();
$zonen = array();
foreach ( $tz_identifiers as $zone ) {
$zone = explode( '/', $zone );
if ( ! in_array( $zone[0], $continents, true ) ) {
continue;
}
// This determines what gets set and translated - we don't translate Etc/* strings here, they are done later.
$exists = array(
0 => ( isset( $zone[0] ) && $zone[0] ),
1 => ( isset( $zone[1] ) && $zone[1] ),
2 => ( isset( $zone[2] ) && $zone[2] ),
);
$exists[3] = ( $exists[0] && 'Etc' !== $zone[0] );
$exists[4] = ( $exists[1] && $exists[3] );
$exists[5] = ( $exists[2] && $exists[3] );
// phpcs:disable WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
$zonen[] = array(
'continent' => ( $exists[0] ? $zone[0] : '' ),
'city' => ( $exists[1] ? $zone[1] : '' ),
'subcity' => ( $exists[2] ? $zone[2] : '' ),
't_continent' => ( $exists[3] ? translate( str_replace( '_', ' ', $zone[0] ), 'continents-cities' ) : '' ),
't_city' => ( $exists[4] ? translate( str_replace( '_', ' ', $zone[1] ), 'continents-cities' ) : '' ),
't_subcity' => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' ),
);
// phpcs:enable
}
usort( $zonen, '_wp_timezone_choice_usort_callback' );
$structure = array();
if ( empty( $selected_zone ) ) {
$structure[] = '<option selected="selected" value="">' . __( 'Select a city' ) . '</option>';
}
// If this is a deprecated, but valid, timezone string, display it at the top of the list as-is.
if ( in_array( $selected_zone, $tz_identifiers, true ) === false
&& in_array( $selected_zone, timezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true )
) {
$structure[] = '<option selected="selected" value="' . esc_attr( $selected_zone ) . '">' . esc_html( $selected_zone ) . '</option>';
}
foreach ( $zonen as $key => $zone ) {
// Build value in an array to join later.
$value = array( $zone['continent'] );
if ( empty( $zone['city'] ) ) {
// It's at the continent level (generally won't happen).
$display = $zone['t_continent'];
} else {
// It's inside a continent group.
// Continent optgroup.
if ( ! isset( $zonen[ $key - 1 ] ) || $zonen[ $key - 1 ]['continent'] !== $zone['continent'] ) {
$label = $zone['t_continent'];
$structure[] = '<optgroup label="' . esc_attr( $label ) . '">';
}
// Add the city to the value.
$value[] = $zone['city'];
$display = $zone['t_city'];
if ( ! empty( $zone['subcity'] ) ) {
// Add the subcity to the value.
$value[] = $zone['subcity'];
$display .= ' - ' . $zone['t_subcity'];
}
}
// Build the value.
$value = implode( '/', $value );
$selected = '';
if ( $value === $selected_zone ) {
$selected = 'selected="selected" ';
}
$structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . '</option>';
// Close continent optgroup.
if ( ! empty( $zone['city'] ) && ( ! isset( $zonen[ $key + 1 ] ) || ( isset( $zonen[ $key + 1 ] ) && $zonen[ $key + 1 ]['continent'] !== $zone['continent'] ) ) ) {
$structure[] = '</optgroup>';
}
}
// Do UTC.
$structure[] = '<optgroup label="' . esc_attr__( 'UTC' ) . '">';
$selected = '';
if ( 'UTC' === $selected_zone ) {
$selected = 'selected="selected" ';
}
$structure[] = '<option ' . $selected . 'value="' . esc_attr( 'UTC' ) . '">' . __( 'UTC' ) . '</option>';
$structure[] = '</optgroup>';
// Do manual UTC offsets.
$structure[] = '<optgroup label="' . esc_attr__( 'Manual Offsets' ) . '">';
$offset_range = array(
-12,
-11.5,
-11,
-10.5,
-10,
-9.5,
-9,
-8.5,
-8,
-7.5,
-7,
-6.5,
-6,
-5.5,
-5,
-4.5,
-4,
-3.5,
-3,
-2.5,
-2,
-1.5,
-1,
-0.5,
0,
0.5,
1,
1.5,
2,
2.5,
3,
3.5,
4,
4.5,
5,
5.5,
5.75,
6,
6.5,
7,
7.5,
8,
8.5,
8.75,
9,
9.5,
10,
10.5,
11,
11.5,
12,
12.75,
13,
13.75,
14,
);
foreach ( $offset_range as $offset ) {
if ( 0 <= $offset ) {
$offset_name = '+' . $offset;
} else {
$offset_name = (string) $offset;
}
$offset_value = $offset_name;
$offset_name = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $offset_name );
$offset_name = 'UTC' . $offset_name;
$offset_value = 'UTC' . $offset_value;
$selected = '';
if ( $offset_value === $selected_zone ) {
$selected = 'selected="selected" ';
}
$structure[] = '<option ' . $selected . 'value="' . esc_attr( $offset_value ) . '">' . esc_html( $offset_name ) . '</option>';
}
$structure[] = '</optgroup>';
return implode( "\n", $structure );
}
```
| Uses | Description |
| --- | --- |
| [unload\_textdomain()](unload_textdomain) wp-includes/l10n.php | Unloads translations for a text domain. |
| [load\_textdomain()](load_textdomain) wp-includes/l10n.php | Loads a .mo file into the text domain $domain. |
| [translate()](translate) wp-includes/l10n.php | Retrieves the translation of $text. |
| [esc\_attr\_\_()](esc_attr__) wp-includes/l10n.php | Retrieves the translation of $text and escapes it for safe use in an attribute. |
| [get\_locale()](get_locale) wp-includes/l10n.php | Retrieves the current locale. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [esc\_html()](esc_html) wp-includes/formatting.php | Escaping for HTML blocks. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Added the `$locale` parameter. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress _wp_normalize_relative_css_links( string $css, string $stylesheet_url ): string \_wp\_normalize\_relative\_css\_links( string $css, string $stylesheet\_url ): 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.
Makes URLs relative to the WordPress installation.
`$css` string Required The CSS to make URLs relative to the WordPress installation. `$stylesheet_url` string Required The URL to the stylesheet. string The CSS with URLs made relative to the WordPress installation.
File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
function _wp_normalize_relative_css_links( $css, $stylesheet_url ) {
$has_src_results = preg_match_all( '#url\s*\(\s*[\'"]?\s*([^\'"\)]+)#', $css, $src_results );
if ( $has_src_results ) {
// Loop through the URLs to find relative ones.
foreach ( $src_results[1] as $src_index => $src_result ) {
// Skip if this is an absolute URL.
if ( 0 === strpos( $src_result, 'http' ) || 0 === strpos( $src_result, '//' ) ) {
continue;
}
// Skip if the URL is an HTML ID.
if ( str_starts_with( $src_result, '#' ) ) {
continue;
}
// Skip if the URL is a data URI.
if ( str_starts_with( $src_result, 'data:' ) ) {
continue;
}
// Build the absolute URL.
$absolute_url = dirname( $stylesheet_url ) . '/' . $src_result;
$absolute_url = str_replace( '/./', '/', $absolute_url );
// Convert to URL related to the site root.
$relative_url = wp_make_link_relative( $absolute_url );
// Replace the URL in the CSS.
$css = str_replace(
$src_results[0][ $src_index ],
str_replace( $src_result, $relative_url, $src_results[0][ $src_index ] ),
$css
);
}
}
return $css;
}
```
| Uses | Description |
| --- | --- |
| [wp\_make\_link\_relative()](wp_make_link_relative) wp-includes/formatting.php | Converts full URL paths to absolute paths. |
| Used By | Description |
| --- | --- |
| [wp\_maybe\_inline\_styles()](wp_maybe_inline_styles) wp-includes/script-loader.php | Allows small styles to be inlined. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress wp_set_post_lock( int|WP_Post $post ): array|false wp\_set\_post\_lock( int|WP\_Post $post ): array|false
======================================================
Marks the post as currently being edited by the current user.
`$post` int|[WP\_Post](../classes/wp_post) Required ID or object of the post being edited. array|false Array of the lock time and user ID. False if the post does not exist, or there is no current user.
* intThe current time as a Unix timestamp.
* `1`intThe ID of the current user.
File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
function wp_set_post_lock( $post ) {
$post = get_post( $post );
if ( ! $post ) {
return false;
}
$user_id = get_current_user_id();
if ( 0 == $user_id ) {
return false;
}
$now = time();
$lock = "$now:$user_id";
update_post_meta( $post->ID, '_edit_lock', $lock );
return array( $now, $user_id );
}
```
| Uses | Description |
| --- | --- |
| [update\_post\_meta()](update_post_meta) wp-includes/post.php | Updates a post meta field based on the given post ID. |
| [get\_current\_user\_id()](get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [wp\_refresh\_post\_lock()](wp_refresh_post_lock) wp-admin/includes/misc.php | Checks lock status on the New/Edit Post screen and refresh the lock. |
| [wp\_write\_post()](wp_write_post) wp-admin/includes/post.php | Creates a new post from the “Write Post” form using `$_POST` information. |
| [edit\_post()](edit_post) wp-admin/includes/post.php | Updates an existing post with values provided in `$_POST`. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress current_user_can_for_blog( int $blog_id, string $capability, mixed $args ): bool current\_user\_can\_for\_blog( int $blog\_id, string $capability, mixed $args ): bool
=====================================================================================
Returns whether the current user has the specified capability for a given site.
This function also accepts an ID of an object to check against if the capability is a meta capability. Meta capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.
Example usage:
```
current_user_can_for_blog( $blog_id, 'edit_posts' );
current_user_can_for_blog( $blog_id, 'edit_post', $post->ID );
current_user_can_for_blog( $blog_id, 'edit_post_meta', $post->ID, $meta_key );
```
`$blog_id` int Required Site ID. `$capability` string Required Capability name. `$args` mixed Optional further parameters, typically starting with an object ID. bool Whether the user has the given capability.
File: `wp-includes/capabilities.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
```
function current_user_can_for_blog( $blog_id, $capability, ...$args ) {
$switched = is_multisite() ? switch_to_blog( $blog_id ) : false;
$can = current_user_can( $capability, ...$args );
if ( $switched ) {
restore_current_blog();
}
return $can;
}
```
| Uses | Description |
| --- | --- |
| [switch\_to\_blog()](switch_to_blog) wp-includes/ms-blogs.php | Switch the current blog. |
| [restore\_current\_blog()](restore_current_blog) wp-includes/ms-blogs.php | Restore the current blog, after calling [switch\_to\_blog()](switch_to_blog) . |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [is\_multisite()](is_multisite) wp-includes/load.php | If Multisite is enabled. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Wraps [current\_user\_can()](current_user_can) after switching to blog. |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Formalized the existing and already documented `...$args` parameter by adding it to the function signature. |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress wp_readonly( mixed $readonly, mixed $current = true, bool $echo = true ): string wp\_readonly( mixed $readonly, mixed $current = true, bool $echo = true ): string
=================================================================================
Outputs the HTML readonly attribute.
Compares the first two arguments and if identical marks as readonly.
`$readonly` mixed Required One of the values to compare. `$current` mixed Optional The other value to compare if not just true.
Default: `true`
`$echo` bool Optional Whether to echo or just return the string.
Default: `true`
string HTML attribute or empty string.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
function wp_readonly( $readonly, $current = true, $echo = true ) {
return __checked_selected_helper( $readonly, $current, $echo, 'readonly' );
}
```
| Uses | Description |
| --- | --- |
| [\_\_checked\_selected\_helper()](__checked_selected_helper) wp-includes/general-template.php | Private helper function for checked, selected, disabled and readonly. |
| Used By | Description |
| --- | --- |
| [readonly()](readonly) wp-includes/php-compat/readonly.php | Outputs the HTML readonly attribute. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress wp_ajax_autocomplete_user() wp\_ajax\_autocomplete\_user()
==============================
Ajax handler for user autocomplete.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
function wp_ajax_autocomplete_user() {
if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) ) {
wp_die( -1 );
}
/** This filter is documented in wp-admin/user-new.php */
if ( ! current_user_can( 'manage_network_users' ) && ! apply_filters( 'autocomplete_users_for_site_admins', false ) ) {
wp_die( -1 );
}
$return = array();
// Check the type of request.
// Current allowed values are `add` and `search`.
if ( isset( $_REQUEST['autocomplete_type'] ) && 'search' === $_REQUEST['autocomplete_type'] ) {
$type = $_REQUEST['autocomplete_type'];
} else {
$type = 'add';
}
// Check the desired field for value.
// Current allowed values are `user_email` and `user_login`.
if ( isset( $_REQUEST['autocomplete_field'] ) && 'user_email' === $_REQUEST['autocomplete_field'] ) {
$field = $_REQUEST['autocomplete_field'];
} else {
$field = 'user_login';
}
// Exclude current users of this blog.
if ( isset( $_REQUEST['site_id'] ) ) {
$id = absint( $_REQUEST['site_id'] );
} else {
$id = get_current_blog_id();
}
$include_blog_users = ( 'search' === $type ? get_users(
array(
'blog_id' => $id,
'fields' => 'ID',
)
) : array() );
$exclude_blog_users = ( 'add' === $type ? get_users(
array(
'blog_id' => $id,
'fields' => 'ID',
)
) : array() );
$users = get_users(
array(
'blog_id' => false,
'search' => '*' . $_REQUEST['term'] . '*',
'include' => $include_blog_users,
'exclude' => $exclude_blog_users,
'search_columns' => array( 'user_login', 'user_nicename', 'user_email' ),
)
);
foreach ( $users as $user ) {
$return[] = array(
/* translators: 1: User login, 2: User email address. */
'label' => sprintf( _x( '%1$s (%2$s)', 'user autocomplete result' ), $user->user_login, $user->user_email ),
'value' => $user->$field,
);
}
wp_die( wp_json_encode( $return ) );
}
```
[apply\_filters( 'autocomplete\_users\_for\_site\_admins', bool $enable )](../hooks/autocomplete_users_for_site_admins)
Filters whether to enable user auto-complete for non-super admins in Multisite.
| Uses | Description |
| --- | --- |
| [get\_users()](get_users) wp-includes/user.php | Retrieves list of users matching criteria. |
| [wp\_is\_large\_network()](wp_is_large_network) wp-includes/ms-functions.php | Determines whether or not we have a large network. |
| [wp\_json\_encode()](wp_json_encode) wp-includes/functions.php | Encodes a variable into JSON, with some sanity checks. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [is\_multisite()](is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [get\_current\_blog\_id()](get_current_blog_id) wp-includes/load.php | Retrieve the current site ID. |
| [absint()](absint) wp-includes/functions.php | Converts a value to non-negative integer. |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
| programming_docs |
wordpress has_image_size( string $name ): bool has\_image\_size( string $name ): bool
======================================
Checks if an image size exists.
`$name` string Required The image size to check. bool True if the image size exists, false if not.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
function has_image_size( $name ) {
$sizes = wp_get_additional_image_sizes();
return isset( $sizes[ $name ] );
}
```
| Uses | Description |
| --- | --- |
| [wp\_get\_additional\_image\_sizes()](wp_get_additional_image_sizes) wp-includes/media.php | Retrieves additional image sizes. |
| Version | Description |
| --- | --- |
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |
wordpress wp_register_sitemap_provider( string $name, WP_Sitemaps_Provider $provider ): bool wp\_register\_sitemap\_provider( string $name, WP\_Sitemaps\_Provider $provider ): bool
=======================================================================================
Registers a new sitemap provider.
`$name` string Required Unique name for the sitemap provider. `$provider` [WP\_Sitemaps\_Provider](../classes/wp_sitemaps_provider) Required The `Sitemaps_Provider` instance implementing the sitemap. bool Whether the sitemap was added.
File: `wp-includes/sitemaps.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/sitemaps.php/)
```
function wp_register_sitemap_provider( $name, WP_Sitemaps_Provider $provider ) {
$sitemaps = wp_sitemaps_get_server();
return $sitemaps->registry->add_provider( $name, $provider );
}
```
| Uses | Description |
| --- | --- |
| [wp\_sitemaps\_get\_server()](wp_sitemaps_get_server) wp-includes/sitemaps.php | Retrieves the current Sitemaps server instance. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress get_the_author_meta( string $field = '', int|false $user_id = false ): string get\_the\_author\_meta( string $field = '', int|false $user\_id = false ): string
=================================================================================
Retrieves the requested data of the author of the current post.
Valid values for the `$field` parameter include:
* admin\_color
* aim
* comment\_shortcuts
* description
* display\_name
* first\_name
* ID
* jabber
* last\_name
* nickname
* plugins\_last\_view
* plugins\_per\_page
* rich\_editing
* syntax\_highlighting
* user\_activation\_key
* user\_description
* user\_email
* user\_firstname
* user\_lastname
* user\_level
* user\_login
* user\_nicename
* user\_pass
* user\_registered
* user\_status
* user\_url
* yim
`$field` string Optional The user field to retrieve. Default: `''`
`$user_id` int|false Optional User ID. Default: `false`
string The author's field from the current author's DB object, otherwise an empty string.
If used within [The Loop](https://codex.wordpress.org/The_Loop "The Loop"), the user ID need not be specified, it defaults to current post author. A user ID must be specified if used outside [The Loop](https://codex.wordpress.org/The_Loop "The Loop").
[get\_the\_author\_meta()](get_the_author_meta) returns the data for use programmatically in PHP. To just display it instead, use [the\_author\_meta()](the_author_meta)
If the specified meta field does not exist for this user, an empty string is returned.
Plugins may add additional fields to the user profile, which in turn adds new key/value pairs to the wp\_usermeta database table. This additional data can be retrieved by passing the field’s key to the function as the `$field` parameter.
File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
function get_the_author_meta( $field = '', $user_id = false ) {
$original_user_id = $user_id;
if ( ! $user_id ) {
global $authordata;
$user_id = isset( $authordata->ID ) ? $authordata->ID : 0;
} else {
$authordata = get_userdata( $user_id );
}
if ( in_array( $field, array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ), true ) ) {
$field = 'user_' . $field;
}
$value = isset( $authordata->$field ) ? $authordata->$field : '';
/**
* Filters the value of the requested user metadata.
*
* The filter name is dynamic and depends on the $field parameter of the function.
*
* @since 2.8.0
* @since 4.3.0 The `$original_user_id` parameter was added.
*
* @param string $value The value of the metadata.
* @param int $user_id The user ID for the value.
* @param int|false $original_user_id The original user ID, as passed to the function.
*/
return apply_filters( "get_the_author_{$field}", $value, $user_id, $original_user_id );
}
```
[apply\_filters( "get\_the\_author\_{$field}", string $value, int $user\_id, int|false $original\_user\_id )](../hooks/get_the_author_field)
Filters the value of the requested user metadata.
| Uses | Description |
| --- | --- |
| [get\_userdata()](get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Posts\_List\_Table::column\_author()](../classes/wp_posts_list_table/column_author) wp-admin/includes/class-wp-posts-list-table.php | Handles the post author column output. |
| [WP\_Media\_List\_Table::column\_author()](../classes/wp_media_list_table/column_author) wp-admin/includes/class-wp-media-list-table.php | Handles the author column output. |
| [get\_the\_archive\_description()](get_the_archive_description) wp-includes/general-template.php | Retrieves the description for an author, post type, or term archive. |
| [export\_wp()](export_wp) wp-admin/includes/export.php | Generates the WXR export file for download. |
| [wp\_prepare\_revisions\_for\_js()](wp_prepare_revisions_for_js) wp-admin/includes/revision.php | Prepare revisions for JavaScript. |
| [feed\_links\_extra()](feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| [get\_profile()](get_profile) wp-includes/deprecated.php | Retrieve user data based on field. |
| [get\_the\_author\_icq()](get_the_author_icq) wp-includes/deprecated.php | Retrieve the ICQ number of the author of the current post. |
| [get\_the\_author\_yim()](get_the_author_yim) wp-includes/deprecated.php | Retrieve the Yahoo! IM name of the author of the current post. |
| [get\_the\_author\_msn()](get_the_author_msn) wp-includes/deprecated.php | Retrieve the MSN address of the author of the current post. |
| [get\_the\_author\_aim()](get_the_author_aim) wp-includes/deprecated.php | Retrieve the AIM address of the author of the current post. |
| [get\_author\_name()](get_author_name) wp-includes/deprecated.php | Retrieve the specified author’s preferred display name. |
| [get\_the\_author\_url()](get_the_author_url) wp-includes/deprecated.php | Retrieve the URL to the home page of the author of the current post. |
| [get\_the\_author\_ID()](get_the_author_id) wp-includes/deprecated.php | Retrieve the ID of the author of the current post. |
| [get\_the\_author\_description()](get_the_author_description) wp-includes/deprecated.php | Retrieve the description of the author of the current post. |
| [get\_the\_author\_login()](get_the_author_login) wp-includes/deprecated.php | Retrieve the login name of the author of the current post. |
| [get\_the\_author\_firstname()](get_the_author_firstname) wp-includes/deprecated.php | Retrieve the first name of the author of the current post. |
| [get\_the\_author\_lastname()](get_the_author_lastname) wp-includes/deprecated.php | Retrieve the last name of the author of the current post. |
| [get\_the\_author\_nickname()](get_the_author_nickname) wp-includes/deprecated.php | Retrieve the nickname of the author of the current post. |
| [get\_the\_author\_email()](get_the_author_email) wp-includes/deprecated.php | Retrieve the email of the author of the current post. |
| [wp\_post\_revision\_title\_expanded()](wp_post_revision_title_expanded) wp-includes/post-template.php | Retrieves formatted date timestamp of a revision (linked to that revisions’s page). |
| [the\_author\_meta()](the_author_meta) wp-includes/author-template.php | Outputs the field from the user’s DB object. Defaults to current post’s author. |
| [get\_the\_author\_link()](get_the_author_link) wp-includes/author-template.php | Retrieves either author’s link or author’s name. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress __ngettext_noop( $args ) \_\_ngettext\_noop( $args )
===========================
This function has been deprecated. Use [\_n\_noop()](_n_noop) instead.
Register plural strings in POT file, but don’t translate them.
* [\_n\_noop()](_n_noop)
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function __ngettext_noop( ...$args ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
_deprecated_function( __FUNCTION__, '2.8.0', '_n_noop()' );
return _n_noop( ...$args );
}
```
| Uses | Description |
| --- | --- |
| [\_n\_noop()](_n_noop) wp-includes/l10n.php | Registers plural strings in POT file, but does not translate them. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Use [\_n\_noop()](_n_noop) |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress wp_register_comment_personal_data_eraser( array $erasers ): array wp\_register\_comment\_personal\_data\_eraser( array $erasers ): array
======================================================================
Registers the personal data eraser for comments.
`$erasers` array Required An array of personal data erasers. array An array of personal data erasers.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
function wp_register_comment_personal_data_eraser( $erasers ) {
$erasers['wordpress-comments'] = array(
'eraser_friendly_name' => __( 'WordPress Comments' ),
'callback' => 'wp_comments_personal_data_eraser',
);
return $erasers;
}
```
| Uses | Description |
| --- | --- |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress wp_reset_vars( array $vars ) wp\_reset\_vars( array $vars )
==============================
Resets global variables based on $\_GET and $\_POST.
This function resets global variables based on the names passed in the $vars array to the value of $\_POST[$var] or $\_GET[$var] or ” if neither is defined.
`$vars` array Required An array of globals to reset. File: `wp-admin/includes/misc.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/misc.php/)
```
function wp_reset_vars( $vars ) {
foreach ( $vars as $var ) {
if ( empty( $_POST[ $var ] ) ) {
if ( empty( $_GET[ $var ] ) ) {
$GLOBALS[ $var ] = '';
} else {
$GLOBALS[ $var ] = $_GET[ $var ];
}
} else {
$GLOBALS[ $var ] = $_POST[ $var ];
}
}
}
```
| Used By | Description |
| --- | --- |
| [WP\_Plugins\_List\_Table::prepare\_items()](../classes/wp_plugins_list_table/prepare_items) wp-admin/includes/class-wp-plugins-list-table.php | |
| [WP\_Links\_List\_Table::prepare\_items()](../classes/wp_links_list_table/prepare_items) wp-admin/includes/class-wp-links-list-table.php | |
| [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 | |
| [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 | |
| [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.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress create_initial_taxonomies() create\_initial\_taxonomies()
=============================
Creates the initial taxonomies.
This function fires twice: in wp-settings.php before plugins are loaded (for backward compatibility reasons), and again on the [‘init’](../hooks/init) action. We must avoid registering rewrite rules before the [‘init’](../hooks/init) action.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
function create_initial_taxonomies() {
global $wp_rewrite;
WP_Taxonomy::reset_default_labels();
if ( ! did_action( 'init' ) ) {
$rewrite = array(
'category' => false,
'post_tag' => false,
'post_format' => false,
);
} else {
/**
* Filters the post formats rewrite base.
*
* @since 3.1.0
*
* @param string $context Context of the rewrite base. Default 'type'.
*/
$post_format_base = apply_filters( 'post_format_rewrite_base', 'type' );
$rewrite = array(
'category' => array(
'hierarchical' => true,
'slug' => get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category',
'with_front' => ! get_option( 'category_base' ) || $wp_rewrite->using_index_permalinks(),
'ep_mask' => EP_CATEGORIES,
),
'post_tag' => array(
'hierarchical' => false,
'slug' => get_option( 'tag_base' ) ? get_option( 'tag_base' ) : 'tag',
'with_front' => ! get_option( 'tag_base' ) || $wp_rewrite->using_index_permalinks(),
'ep_mask' => EP_TAGS,
),
'post_format' => $post_format_base ? array( 'slug' => $post_format_base ) : false,
);
}
register_taxonomy(
'category',
'post',
array(
'hierarchical' => true,
'query_var' => 'category_name',
'rewrite' => $rewrite['category'],
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'_builtin' => true,
'capabilities' => array(
'manage_terms' => 'manage_categories',
'edit_terms' => 'edit_categories',
'delete_terms' => 'delete_categories',
'assign_terms' => 'assign_categories',
),
'show_in_rest' => true,
'rest_base' => 'categories',
'rest_controller_class' => 'WP_REST_Terms_Controller',
)
);
register_taxonomy(
'post_tag',
'post',
array(
'hierarchical' => false,
'query_var' => 'tag',
'rewrite' => $rewrite['post_tag'],
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'_builtin' => true,
'capabilities' => array(
'manage_terms' => 'manage_post_tags',
'edit_terms' => 'edit_post_tags',
'delete_terms' => 'delete_post_tags',
'assign_terms' => 'assign_post_tags',
),
'show_in_rest' => true,
'rest_base' => 'tags',
'rest_controller_class' => 'WP_REST_Terms_Controller',
)
);
register_taxonomy(
'nav_menu',
'nav_menu_item',
array(
'public' => false,
'hierarchical' => false,
'labels' => array(
'name' => __( 'Navigation Menus' ),
'singular_name' => __( 'Navigation Menu' ),
),
'query_var' => false,
'rewrite' => false,
'show_ui' => false,
'_builtin' => true,
'show_in_nav_menus' => false,
'capabilities' => array(
'manage_terms' => 'edit_theme_options',
'edit_terms' => 'edit_theme_options',
'delete_terms' => 'edit_theme_options',
'assign_terms' => 'edit_theme_options',
),
'show_in_rest' => true,
'rest_base' => 'menus',
'rest_controller_class' => 'WP_REST_Menus_Controller',
)
);
register_taxonomy(
'link_category',
'link',
array(
'hierarchical' => false,
'labels' => array(
'name' => __( 'Link Categories' ),
'singular_name' => __( 'Link Category' ),
'search_items' => __( 'Search Link Categories' ),
'popular_items' => null,
'all_items' => __( 'All Link Categories' ),
'edit_item' => __( 'Edit Link Category' ),
'update_item' => __( 'Update Link Category' ),
'add_new_item' => __( 'Add New Link Category' ),
'new_item_name' => __( 'New Link Category Name' ),
'separate_items_with_commas' => null,
'add_or_remove_items' => null,
'choose_from_most_used' => null,
'back_to_items' => __( '← Go to Link Categories' ),
),
'capabilities' => array(
'manage_terms' => 'manage_links',
'edit_terms' => 'manage_links',
'delete_terms' => 'manage_links',
'assign_terms' => 'manage_links',
),
'query_var' => false,
'rewrite' => false,
'public' => false,
'show_ui' => true,
'_builtin' => true,
)
);
register_taxonomy(
'post_format',
'post',
array(
'public' => true,
'hierarchical' => false,
'labels' => array(
'name' => _x( 'Formats', 'post format' ),
'singular_name' => _x( 'Format', 'post format' ),
),
'query_var' => true,
'rewrite' => $rewrite['post_format'],
'show_ui' => false,
'_builtin' => true,
'show_in_nav_menus' => current_theme_supports( 'post-formats' ),
)
);
register_taxonomy(
'wp_theme',
array( 'wp_template', 'wp_template_part', 'wp_global_styles' ),
array(
'public' => false,
'hierarchical' => false,
'labels' => array(
'name' => __( 'Themes' ),
'singular_name' => __( 'Theme' ),
),
'query_var' => false,
'rewrite' => false,
'show_ui' => false,
'_builtin' => true,
'show_in_nav_menus' => false,
'show_in_rest' => false,
)
);
register_taxonomy(
'wp_template_part_area',
array( 'wp_template_part' ),
array(
'public' => false,
'hierarchical' => false,
'labels' => array(
'name' => __( 'Template Part Areas' ),
'singular_name' => __( 'Template Part Area' ),
),
'query_var' => false,
'rewrite' => false,
'show_ui' => false,
'_builtin' => true,
'show_in_nav_menus' => false,
'show_in_rest' => false,
)
);
}
```
[apply\_filters( 'post\_format\_rewrite\_base', string $context )](../hooks/post_format_rewrite_base)
Filters the post formats rewrite base.
| Uses | Description |
| --- | --- |
| [WP\_Taxonomy::reset\_default\_labels()](../classes/wp_taxonomy/reset_default_labels) wp-includes/class-wp-taxonomy.php | Resets the cache for the default labels. |
| [register\_taxonomy()](register_taxonomy) wp-includes/taxonomy.php | Creates or modifies a taxonomy object. |
| [did\_action()](did_action) wp-includes/plugin.php | Retrieves the number of times an action has been fired during the current request. |
| [WP\_Rewrite::using\_index\_permalinks()](../classes/wp_rewrite/using_index_permalinks) wp-includes/class-wp-rewrite.php | Determines whether permalinks are being used and rewrite module is not enabled. |
| [current\_theme\_supports()](current_theme_supports) wp-includes/theme.php | Checks a theme’s support for a given feature. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Added `'wp_template_part_area'` taxonomy. |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
| programming_docs |
wordpress register_sidebar_widget( string|int $name, callable $output_callback, string $classname = '', mixed $params ) register\_sidebar\_widget( string|int $name, callable $output\_callback, string $classname = '', mixed $params )
================================================================================================================
This function has been deprecated. Use [wp\_register\_sidebar\_widget()](wp_register_sidebar_widget) instead.
Register widget for sidebar with backward compatibility.
Allows $name to be an array that accepts either three elements to grab the first element and the third for the name or just uses the first element of the array for the name.
Passes to [wp\_register\_sidebar\_widget()](wp_register_sidebar_widget) after argument list and backward compatibility is complete.
* [wp\_register\_sidebar\_widget()](wp_register_sidebar_widget)
`$name` string|int Required Widget ID. `$output_callback` callable Required Run when widget is called. `$classname` string Optional Classname widget option. Default: `''`
`$params` mixed Optional Widget parameters. File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function register_sidebar_widget($name, $output_callback, $classname = '', ...$params) {
_deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_sidebar_widget()' );
// Compat.
if ( is_array( $name ) ) {
if ( count( $name ) === 3 ) {
$name = sprintf( $name[0], $name[2] );
} else {
$name = $name[0];
}
}
$id = sanitize_title( $name );
$options = array();
if ( ! empty( $classname ) && is_string( $classname ) ) {
$options['classname'] = $classname;
}
wp_register_sidebar_widget( $id, $name, $output_callback, $options, ...$params );
}
```
| Uses | Description |
| --- | --- |
| [sanitize\_title()](sanitize_title) wp-includes/formatting.php | Sanitizes a string into a slug, which can be used in URLs or HTML attributes. |
| [wp\_register\_sidebar\_widget()](wp_register_sidebar_widget) wp-includes/widgets.php | Register an instance of a widget. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Use [wp\_register\_sidebar\_widget()](wp_register_sidebar_widget) |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress previous_posts_link( string $label = null ) previous\_posts\_link( string $label = null )
=============================================
Displays the previous posts page link.
`$label` string Optional Previous page link text. Default: `null`
If you need the values for use in PHP, use [get\_previous\_posts\_link()](get_previous_posts_link) .
Because post queries are usually sorted in reverse chronological order, [next\_posts\_link()](next_posts_link) usually points to older entries (toward the end of the set) and [previous\_posts\_link()](previous_posts_link) usually points to newer entries (toward the beginning of the set).
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function previous_posts_link( $label = null ) {
echo get_previous_posts_link( $label );
}
```
| Uses | Description |
| --- | --- |
| [get\_previous\_posts\_link()](get_previous_posts_link) wp-includes/link-template.php | Retrieves the previous posts page link. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress refresh_user_details( int $id ): int|false refresh\_user\_details( int $id ): int|false
============================================
Cleans the user cache for a specific user.
`$id` int Required The user ID. int|false The ID of the refreshed user or false if the user does not exist.
File: `wp-admin/includes/ms.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ms.php/)
```
function refresh_user_details( $id ) {
$id = (int) $id;
$user = get_userdata( $id );
if ( ! $user ) {
return false;
}
clean_user_cache( $user );
return $id;
}
```
| Uses | Description |
| --- | --- |
| [clean\_user\_cache()](clean_user_cache) wp-includes/user.php | Cleans all user caches. |
| [get\_userdata()](get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress wp_cache_add( int|string $key, mixed $data, string $group = '', int $expire ): bool wp\_cache\_add( int|string $key, mixed $data, string $group = '', int $expire ): bool
=====================================================================================
Adds data to the cache, if the cache key doesn’t already exist.
* [WP\_Object\_Cache::add()](../classes/wp_object_cache/add)
`$key` int|string Required The cache key to use for retrieval later. `$data` mixed Required The data to add to the cache. `$group` string Optional The group to add the cache to. Enables the same key to be used across groups. Default: `''`
`$expire` int Optional When the cache data should expire, in seconds.
Default 0 (no expiration). bool True on success, false if cache key and group already exist.
File: `wp-includes/cache.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/cache.php/)
```
function wp_cache_add( $key, $data, $group = '', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->add( $key, $data, $group, (int) $expire );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Object\_Cache::add()](../classes/wp_object_cache/add) wp-includes/class-wp-object-cache.php | Adds data to the cache if it doesn’t already exist. |
| 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. |
| [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. |
| [ms\_load\_current\_site\_and\_network()](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. |
| [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. |
| [WP\_Site::get\_instance()](../classes/wp_site/get_instance) wp-includes/class-wp-site.php | Retrieves a site from the database by its ID. |
| [WP\_Network::get\_instance()](../classes/wp_network/get_instance) wp-includes/class-wp-network.php | Retrieves a network from the database by its ID. |
| [WP\_Comment::get\_instance()](../classes/wp_comment/get_instance) wp-includes/class-wp-comment.php | Retrieves a [WP\_Comment](../classes/wp_comment) instance. |
| [WP\_Term::get\_instance()](../classes/wp_term/get_instance) wp-includes/class-wp-term.php | Retrieve [WP\_Term](../classes/wp_term) instance. |
| [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. |
| [get\_terms\_to\_edit()](get_terms_to_edit) wp-admin/includes/taxonomy.php | Gets comma-separated list of terms available to edit for the given post ID. |
| [get\_inline\_data()](get_inline_data) wp-admin/includes/template.php | Adds hidden fields with the data for use in the inline editor for posts and pages. |
| [get\_the\_terms()](get_the_terms) wp-includes/category-template.php | Retrieves the terms of the taxonomy that are attached to the post. |
| [WP\_Theme::cache\_add()](../classes/wp_theme/cache_add) wp-includes/class-wp-theme.php | Adds theme data to cache. |
| [WP\_Query::get\_posts()](../classes/wp_query/get_posts) wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| [wp\_load\_alloptions()](wp_load_alloptions) wp-includes/option.php | Loads and caches all autoloaded options, if available or all options. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [update\_user\_caches()](update_user_caches) wp-includes/user.php | Updates all user caches. |
| [WP\_Post::get\_instance()](../classes/wp_post/get_instance) wp-includes/class-wp-post.php | Retrieve [WP\_Post](../classes/wp_post) instance. |
| [wp\_mime\_type\_icon()](wp_mime_type_icon) wp-includes/post.php | Retrieves the icon for a MIME type or attachment. |
| [get\_all\_page\_ids()](get_all_page_ids) wp-includes/post.php | Gets a list of page IDs. |
| [get\_bookmark()](get_bookmark) wp-includes/bookmark.php | Retrieves bookmark data. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress rest_validate_string_value_from_schema( mixed $value, array $args, string $param ): true|WP_Error rest\_validate\_string\_value\_from\_schema( mixed $value, array $args, string $param ): true|WP\_Error
=======================================================================================================
Validates a string value based on a schema.
`$value` mixed Required The value to validate. `$args` array Required Schema array to use for validation. `$param` string Required The parameter name, used in error messages. true|[WP\_Error](../classes/wp_error)
File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
function rest_validate_string_value_from_schema( $value, $args, $param ) {
if ( ! is_string( $value ) ) {
return new WP_Error(
'rest_invalid_type',
/* translators: 1: Parameter, 2: Type name. */
sprintf( __( '%1$s is not of type %2$s.' ), $param, 'string' ),
array( 'param' => $param )
);
}
if ( isset( $args['minLength'] ) && mb_strlen( $value ) < $args['minLength'] ) {
return new WP_Error(
'rest_too_short',
sprintf(
/* translators: 1: Parameter, 2: Number of characters. */
_n(
'%1$s must be at least %2$s character long.',
'%1$s must be at least %2$s characters long.',
$args['minLength']
),
$param,
number_format_i18n( $args['minLength'] )
)
);
}
if ( isset( $args['maxLength'] ) && mb_strlen( $value ) > $args['maxLength'] ) {
return new WP_Error(
'rest_too_long',
sprintf(
/* translators: 1: Parameter, 2: Number of characters. */
_n(
'%1$s must be at most %2$s character long.',
'%1$s must be at most %2$s characters long.',
$args['maxLength']
),
$param,
number_format_i18n( $args['maxLength'] )
)
);
}
if ( isset( $args['pattern'] ) && ! rest_validate_json_schema_pattern( $args['pattern'], $value ) ) {
return new WP_Error(
'rest_invalid_pattern',
/* translators: 1: Parameter, 2: Pattern. */
sprintf( __( '%1$s does not match pattern %2$s.' ), $param, $args['pattern'] )
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [rest\_validate\_json\_schema\_pattern()](rest_validate_json_schema_pattern) wp-includes/rest-api.php | Validates if the JSON Schema pattern matches a value. |
| [\_n()](_n) wp-includes/l10n.php | Translates and retrieves the singular or plural form based on the supplied number. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [number\_format\_i18n()](number_format_i18n) wp-includes/functions.php | Converts float number to format based on the locale. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [rest\_validate\_value\_from\_schema()](rest_validate_value_from_schema) wp-includes/rest-api.php | Validate a value based on a schema. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress create_initial_rest_routes() create\_initial\_rest\_routes()
===============================
Registers default REST API routes.
File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
function create_initial_rest_routes() {
foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) {
$controller = $post_type->get_rest_controller();
if ( ! $controller ) {
continue;
}
$controller->register_routes();
if ( post_type_supports( $post_type->name, 'revisions' ) ) {
$revisions_controller = new WP_REST_Revisions_Controller( $post_type->name );
$revisions_controller->register_routes();
}
if ( 'attachment' !== $post_type->name ) {
$autosaves_controller = new WP_REST_Autosaves_Controller( $post_type->name );
$autosaves_controller->register_routes();
}
}
// Post types.
$controller = new WP_REST_Post_Types_Controller;
$controller->register_routes();
// Post statuses.
$controller = new WP_REST_Post_Statuses_Controller;
$controller->register_routes();
// Taxonomies.
$controller = new WP_REST_Taxonomies_Controller;
$controller->register_routes();
// Terms.
foreach ( get_taxonomies( array( 'show_in_rest' => true ), 'object' ) as $taxonomy ) {
$controller = $taxonomy->get_rest_controller();
if ( ! $controller ) {
continue;
}
$controller->register_routes();
}
// Users.
$controller = new WP_REST_Users_Controller;
$controller->register_routes();
// Application Passwords
$controller = new WP_REST_Application_Passwords_Controller();
$controller->register_routes();
// Comments.
$controller = new WP_REST_Comments_Controller;
$controller->register_routes();
$search_handlers = array(
new WP_REST_Post_Search_Handler(),
new WP_REST_Term_Search_Handler(),
new WP_REST_Post_Format_Search_Handler(),
);
/**
* Filters the search handlers to use in the REST search controller.
*
* @since 5.0.0
*
* @param array $search_handlers List of search handlers to use in the controller. Each search
* handler instance must extend the `WP_REST_Search_Handler` class.
* Default is only a handler for posts.
*/
$search_handlers = apply_filters( 'wp_rest_search_handlers', $search_handlers );
$controller = new WP_REST_Search_Controller( $search_handlers );
$controller->register_routes();
// Block Renderer.
$controller = new WP_REST_Block_Renderer_Controller();
$controller->register_routes();
// Block Types.
$controller = new WP_REST_Block_Types_Controller();
$controller->register_routes();
// Global Styles.
$controller = new WP_REST_Global_Styles_Controller;
$controller->register_routes();
// Settings.
$controller = new WP_REST_Settings_Controller;
$controller->register_routes();
// Themes.
$controller = new WP_REST_Themes_Controller;
$controller->register_routes();
// Plugins.
$controller = new WP_REST_Plugins_Controller();
$controller->register_routes();
// Sidebars.
$controller = new WP_REST_Sidebars_Controller();
$controller->register_routes();
// Widget Types.
$controller = new WP_REST_Widget_Types_Controller();
$controller->register_routes();
// Widgets.
$controller = new WP_REST_Widgets_Controller();
$controller->register_routes();
// Block Directory.
$controller = new WP_REST_Block_Directory_Controller();
$controller->register_routes();
// Pattern Directory.
$controller = new WP_REST_Pattern_Directory_Controller();
$controller->register_routes();
// Block Patterns.
$controller = new WP_REST_Block_Patterns_Controller();
$controller->register_routes();
// Block Pattern Categories.
$controller = new WP_REST_Block_Pattern_Categories_Controller();
$controller->register_routes();
// Site Health.
$site_health = WP_Site_Health::get_instance();
$controller = new WP_REST_Site_Health_Controller( $site_health );
$controller->register_routes();
// URL Details.
$controller = new WP_REST_URL_Details_Controller();
$controller->register_routes();
// Menu Locations.
$controller = new WP_REST_Menu_Locations_Controller();
$controller->register_routes();
// Site Editor Export.
$controller = new WP_REST_Edit_Site_Export_Controller();
$controller->register_routes();
}
```
[apply\_filters( 'wp\_rest\_search\_handlers', array $search\_handlers )](../hooks/wp_rest_search_handlers)
Filters the search handlers to use in the REST search controller.
| Uses | Description |
| --- | --- |
| [WP\_REST\_Block\_Patterns\_Controller::\_\_construct()](../classes/wp_rest_block_patterns_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php | Constructs the controller. |
| [WP\_REST\_Block\_Pattern\_Categories\_Controller::\_\_construct()](../classes/wp_rest_block_pattern_categories_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php | Constructs the controller. |
| [post\_type\_supports()](post_type_supports) wp-includes/post.php | Checks a post type’s support for a given feature. |
| [get\_taxonomies()](get_taxonomies) wp-includes/taxonomy.php | Retrieves a list of registered taxonomy names or objects. |
| [WP\_REST\_Comments\_Controller::\_\_construct()](../classes/wp_rest_comments_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Constructor. |
| [WP\_REST\_Post\_Types\_Controller::\_\_construct()](../classes/wp_rest_post_types_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php | Constructor. |
| [WP\_REST\_Taxonomies\_Controller::\_\_construct()](../classes/wp_rest_taxonomies_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php | Constructor. |
| [WP\_REST\_Settings\_Controller::\_\_construct()](../classes/wp_rest_settings_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php | Constructor. |
| [WP\_REST\_Post\_Statuses\_Controller::\_\_construct()](../classes/wp_rest_post_statuses_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php | Constructor. |
| [WP\_REST\_Revisions\_Controller::\_\_construct()](../classes/wp_rest_revisions_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Constructor. |
| [WP\_REST\_Users\_Controller::\_\_construct()](../classes/wp_rest_users_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Constructor. |
| [WP\_REST\_Post\_Search\_Handler::\_\_construct()](../classes/wp_rest_post_search_handler/__construct) wp-includes/rest-api/search/class-wp-rest-post-search-handler.php | Constructor. |
| [WP\_REST\_Block\_Renderer\_Controller::\_\_construct()](../classes/wp_rest_block_renderer_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php | Constructs the controller. |
| [WP\_REST\_Autosaves\_Controller::\_\_construct()](../classes/wp_rest_autosaves_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php | Constructor. |
| [WP\_REST\_Themes\_Controller::\_\_construct()](../classes/wp_rest_themes_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php | Constructor. |
| [WP\_REST\_Search\_Controller::\_\_construct()](../classes/wp_rest_search_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php | Constructor. |
| [WP\_Site\_Health::get\_instance()](../classes/wp_site_health/get_instance) wp-admin/includes/class-wp-site-health.php | Returns an instance of the [WP\_Site\_Health](../classes/wp_site_health) class, or create one if none exist yet. |
| [WP\_REST\_Block\_Types\_Controller::\_\_construct()](../classes/wp_rest_block_types_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php | Constructor. |
| [WP\_REST\_Sidebars\_Controller::\_\_construct()](../classes/wp_rest_sidebars_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Sidebars controller constructor. |
| [WP\_REST\_Global\_Styles\_Controller::\_\_construct()](../classes/wp_rest_global_styles_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php | Constructor. |
| [WP\_REST\_URL\_Details\_Controller::\_\_construct()](../classes/wp_rest_url_details_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php | Constructs the controller. |
| [WP\_REST\_Menu\_Locations\_Controller::\_\_construct()](../classes/wp_rest_menu_locations_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-menu-locations-controller.php | Menu Locations Constructor. |
| [WP\_REST\_Edit\_Site\_Export\_Controller::\_\_construct()](../classes/wp_rest_edit_site_export_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php | Constructor. |
| [WP\_REST\_Widgets\_Controller::\_\_construct()](../classes/wp_rest_widgets_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php | Widgets controller constructor. |
| [WP\_REST\_Pattern\_Directory\_Controller::\_\_construct()](../classes/wp_rest_pattern_directory_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php | Constructs the controller. |
| [WP\_REST\_Plugins\_Controller::\_\_construct()](../classes/wp_rest_plugins_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php | Plugins controller constructor. |
| [WP\_REST\_Widget\_Types\_Controller::\_\_construct()](../classes/wp_rest_widget_types_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php | Constructor. |
| [WP\_REST\_Site\_Health\_Controller::\_\_construct()](../classes/wp_rest_site_health_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php | Site Health controller constructor. |
| [WP\_REST\_Application\_Passwords\_Controller::\_\_construct()](../classes/wp_rest_application_passwords_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php | Application Passwords controller constructor. |
| [WP\_REST\_Term\_Search\_Handler::\_\_construct()](../classes/wp_rest_term_search_handler/__construct) wp-includes/rest-api/search/class-wp-rest-term-search-handler.php | Constructor. |
| [WP\_REST\_Post\_Format\_Search\_Handler::\_\_construct()](../classes/wp_rest_post_format_search_handler/__construct) wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php | Constructor. |
| [WP\_REST\_Block\_Directory\_Controller::\_\_construct()](../classes/wp_rest_block_directory_controller/__construct) wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php | Constructs the controller. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post\_types()](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 _redirect_to_about_wordpress( string $new_version ) \_redirect\_to\_about\_wordpress( string $new\_version )
========================================================
Redirect to the About WordPress page after a successful upgrade.
This function is only needed when the existing installation is older than 3.4.0.
`$new_version` string Required File: `wp-admin/includes/update-core.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update-core.php/)
```
function _redirect_to_about_wordpress( $new_version ) {
global $wp_version, $pagenow, $action;
if ( version_compare( $wp_version, '3.4-RC1', '>=' ) ) {
return;
}
// Ensure we only run this on the update-core.php page. The Core_Upgrader may be used in other contexts.
if ( 'update-core.php' !== $pagenow ) {
return;
}
if ( 'do-core-upgrade' !== $action && 'do-core-reinstall' !== $action ) {
return;
}
// Load the updated default text localization domain for new strings.
load_default_textdomain();
// See do_core_upgrade().
show_message( __( 'WordPress updated successfully.' ) );
// self_admin_url() won't exist when upgrading from <= 3.0, so relative URLs are intentional.
show_message(
'<span class="hide-if-no-js">' . sprintf(
/* translators: 1: WordPress version, 2: URL to About screen. */
__( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ),
$new_version,
'about.php?updated'
) . '</span>'
);
show_message(
'<span class="hide-if-js">' . sprintf(
/* translators: 1: WordPress version, 2: URL to About screen. */
__( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ),
$new_version,
'about.php?updated'
) . '</span>'
);
echo '</div>';
?>
<script type="text/javascript">
window.location = 'about.php?updated';
</script>
<?php
// Include admin-footer.php and exit.
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit;
}
```
| Uses | Description |
| --- | --- |
| [show\_message()](show_message) wp-admin/includes/misc.php | Displays the given administration message. |
| [load\_default\_textdomain()](load_default_textdomain) wp-includes/l10n.php | Loads default translated strings based on locale. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress filter_block_kses_value( string[]|string $value, array[]|string $allowed_html, string[] $allowed_protocols = array() ): string[]|string filter\_block\_kses\_value( string[]|string $value, array[]|string $allowed\_html, string[] $allowed\_protocols = array() ): string[]|string
============================================================================================================================================
Filters and sanitizes a parsed block attribute value to remove non-allowable HTML.
`$value` string[]|string Required The attribute value to filter. `$allowed_html` array[]|string Required An array of allowed HTML elements and attributes, or a context name such as `'post'`. See [wp\_kses\_allowed\_html()](wp_kses_allowed_html) for the list of accepted context names. `$allowed_protocols` string[] Optional Array of allowed URL protocols.
Defaults to the result of [wp\_allowed\_protocols()](wp_allowed_protocols) . Default: `array()`
string[]|string The filtered and sanitized result.
File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
function filter_block_kses_value( $value, $allowed_html, $allowed_protocols = array() ) {
if ( is_array( $value ) ) {
foreach ( $value as $key => $inner_value ) {
$filtered_key = filter_block_kses_value( $key, $allowed_html, $allowed_protocols );
$filtered_value = filter_block_kses_value( $inner_value, $allowed_html, $allowed_protocols );
if ( $filtered_key !== $key ) {
unset( $value[ $key ] );
}
$value[ $filtered_key ] = $filtered_value;
}
} elseif ( is_string( $value ) ) {
return wp_kses( $value, $allowed_html, $allowed_protocols );
}
return $value;
}
```
| Uses | Description |
| --- | --- |
| [filter\_block\_kses\_value()](filter_block_kses_value) wp-includes/blocks.php | Filters and sanitizes a parsed block attribute value to remove non-allowable HTML. |
| [wp\_kses()](wp_kses) wp-includes/kses.php | Filters text content and strips out disallowed HTML. |
| Used By | Description |
| --- | --- |
| [filter\_block\_kses()](filter_block_kses) wp-includes/blocks.php | Filters and sanitizes a parsed block to remove non-allowable HTML from block attribute values. |
| [filter\_block\_kses\_value()](filter_block_kses_value) wp-includes/blocks.php | Filters and sanitizes a parsed block attribute value to remove non-allowable HTML. |
| Version | Description |
| --- | --- |
| [5.3.1](https://developer.wordpress.org/reference/since/5.3.1/) | Introduced. |
wordpress wp_ajax_wp_fullscreen_save_post() wp\_ajax\_wp\_fullscreen\_save\_post()
======================================
This function has been deprecated.
Ajax handler for saving posts from the fullscreen editor.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
function wp_ajax_wp_fullscreen_save_post() {
$post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
$post = null;
if ( $post_id ) {
$post = get_post( $post_id );
}
check_ajax_referer( 'update-post_' . $post_id, '_wpnonce' );
$post_id = edit_post();
if ( is_wp_error( $post_id ) ) {
wp_send_json_error();
}
if ( $post ) {
$last_date = mysql2date( __( 'F j, Y' ), $post->post_modified );
$last_time = mysql2date( __( 'g:i a' ), $post->post_modified );
} else {
$last_date = date_i18n( __( 'F j, Y' ) );
$last_time = date_i18n( __( 'g:i a' ) );
}
$last_id = get_post_meta( $post_id, '_edit_last', true );
if ( $last_id ) {
$last_user = get_userdata( $last_id );
/* translators: 1: User's display name, 2: Date of last edit, 3: Time of last edit. */
$last_edited = sprintf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), $last_date, $last_time );
} else {
/* translators: 1: Date of last edit, 2: Time of last edit. */
$last_edited = sprintf( __( 'Last edited on %1$s at %2$s' ), $last_date, $last_time );
}
wp_send_json_success( array( 'last_edited' => $last_edited ) );
}
```
| Uses | Description |
| --- | --- |
| [edit\_post()](edit_post) wp-admin/includes/post.php | Updates an existing post with values provided in `$_POST`. |
| [date\_i18n()](date_i18n) wp-includes/functions.php | Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds. |
| [mysql2date()](mysql2date) wp-includes/functions.php | Converts given MySQL date string into a different format. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [esc\_html()](esc_html) wp-includes/formatting.php | Escaping for HTML blocks. |
| [check\_ajax\_referer()](check_ajax_referer) wp-includes/pluggable.php | Verifies the Ajax request to prevent processing requests external of the blog. |
| [get\_userdata()](get_userdata) wp-includes/pluggable.php | Retrieves user info by user ID. |
| [wp\_send\_json\_error()](wp_send_json_error) wp-includes/functions.php | Sends a JSON response back to an Ajax request, indicating failure. |
| [wp\_send\_json\_success()](wp_send_json_success) wp-includes/functions.php | Sends a JSON response back to an Ajax request, indicating success. |
| [get\_post\_meta()](get_post_meta) wp-includes/post.php | Retrieves a post meta field for the given post ID. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | This function has been deprecated. |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress wptexturize_primes( string $haystack, string $needle, string $prime, string $open_quote, string $close_quote ): string wptexturize\_primes( string $haystack, string $needle, string $prime, string $open\_quote, string $close\_quote ): string
=========================================================================================================================
Implements a logic tree to determine whether or not “7′.” represents seven feet, then converts the special char into either a prime char or a closing quote char.
`$haystack` string Required The plain text to be searched. `$needle` string Required The character to search for such as ' or ". `$prime` string Required The prime char to use for replacement. `$open_quote` string Required The opening quote char. Opening quote replacement must be accomplished already. `$close_quote` string Required The closing quote char to use for replacement. string The $haystack value after primes and quotes replacements.
File: `wp-includes/formatting.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
```
function wptexturize_primes( $haystack, $needle, $prime, $open_quote, $close_quote ) {
$spaces = wp_spaces_regexp();
$flag = '<!--wp-prime-or-quote-->';
$quote_pattern = "/$needle(?=\\Z|[.,:;!?)}\\-\\]]|>|" . $spaces . ')/';
$prime_pattern = "/(?<=\\d)$needle/";
$flag_after_digit = "/(?<=\\d)$flag/";
$flag_no_digit = "/(?<!\\d)$flag/";
$sentences = explode( $open_quote, $haystack );
foreach ( $sentences as $key => &$sentence ) {
if ( false === strpos( $sentence, $needle ) ) {
continue;
} elseif ( 0 !== $key && 0 === substr_count( $sentence, $close_quote ) ) {
$sentence = preg_replace( $quote_pattern, $flag, $sentence, -1, $count );
if ( $count > 1 ) {
// This sentence appears to have multiple closing quotes. Attempt Vulcan logic.
$sentence = preg_replace( $flag_no_digit, $close_quote, $sentence, -1, $count2 );
if ( 0 === $count2 ) {
// Try looking for a quote followed by a period.
$count2 = substr_count( $sentence, "$flag." );
if ( $count2 > 0 ) {
// Assume the rightmost quote-period match is the end of quotation.
$pos = strrpos( $sentence, "$flag." );
} else {
// When all else fails, make the rightmost candidate a closing quote.
// This is most likely to be problematic in the context of bug #18549.
$pos = strrpos( $sentence, $flag );
}
$sentence = substr_replace( $sentence, $close_quote, $pos, strlen( $flag ) );
}
// Use conventional replacement on any remaining primes and quotes.
$sentence = preg_replace( $prime_pattern, $prime, $sentence );
$sentence = preg_replace( $flag_after_digit, $prime, $sentence );
$sentence = str_replace( $flag, $close_quote, $sentence );
} elseif ( 1 == $count ) {
// Found only one closing quote candidate, so give it priority over primes.
$sentence = str_replace( $flag, $close_quote, $sentence );
$sentence = preg_replace( $prime_pattern, $prime, $sentence );
} else {
// No closing quotes found. Just run primes pattern.
$sentence = preg_replace( $prime_pattern, $prime, $sentence );
}
} else {
$sentence = preg_replace( $prime_pattern, $prime, $sentence );
$sentence = preg_replace( $quote_pattern, $close_quote, $sentence );
}
if ( '"' === $needle && false !== strpos( $sentence, '"' ) ) {
$sentence = str_replace( '"', $close_quote, $sentence );
}
}
return implode( $open_quote, $sentences );
}
```
| Uses | Description |
| --- | --- |
| [wp\_spaces\_regexp()](wp_spaces_regexp) wp-includes/formatting.php | Returns the regexp for common whitespace characters. |
| Used By | Description |
| --- | --- |
| [wptexturize()](wptexturize) wp-includes/formatting.php | Replaces common plain text characters with formatted entities. |
| Version | Description |
| --- | --- |
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |
wordpress wp_destroy_current_session() wp\_destroy\_current\_session()
===============================
Removes the current session token from the database.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
function wp_destroy_current_session() {
$token = wp_get_session_token();
if ( $token ) {
$manager = WP_Session_Tokens::get_instance( get_current_user_id() );
$manager->destroy( $token );
}
}
```
| Uses | Description |
| --- | --- |
| [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. |
| [wp\_get\_session\_token()](wp_get_session_token) wp-includes/user.php | Retrieves the current session token from the logged\_in cookie. |
| [get\_current\_user\_id()](get_current_user_id) wp-includes/user.php | Gets the current user’s ID. |
| Used By | Description |
| --- | --- |
| [wp\_logout()](wp_logout) wp-includes/pluggable.php | Logs the current user out. |
| Version | Description |
| --- | --- |
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |
wordpress get_shortcode_regex( array $tagnames = null ): string get\_shortcode\_regex( array $tagnames = null ): string
=======================================================
Retrieves the shortcode regular expression for searching.
The regular expression combines the shortcode tags in the regular expression in a regex class.
The regular expression contains 6 different sub matches to help with parsing.
1 – An extra [ to allow for escaping shortcodes with double [[]] 2 – The shortcode name 3 – The shortcode argument list 4 – The self closing / 5 – The content of a shortcode when it wraps some content.
6 – An extra ] to allow for escaping shortcodes with double [[]]
`$tagnames` array Optional List of shortcodes to find. Defaults to all registered shortcodes. Default: `null`
string The shortcode search regular expression
File: `wp-includes/shortcodes.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/shortcodes.php/)
```
function get_shortcode_regex( $tagnames = null ) {
global $shortcode_tags;
if ( empty( $tagnames ) ) {
$tagnames = array_keys( $shortcode_tags );
}
$tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) );
// WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag().
// Also, see shortcode_unautop() and shortcode.js.
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
return '\\[' // Opening bracket.
. '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]].
. "($tagregexp)" // 2: Shortcode name.
. '(?![\\w-])' // Not followed by word character or hyphen.
. '(' // 3: Unroll the loop: Inside the opening shortcode tag.
. '[^\\]\\/]*' // Not a closing bracket or forward slash.
. '(?:'
. '\\/(?!\\])' // A forward slash not followed by a closing bracket.
. '[^\\]\\/]*' // Not a closing bracket or forward slash.
. ')*?'
. ')'
. '(?:'
. '(\\/)' // 4: Self closing tag...
. '\\]' // ...and closing bracket.
. '|'
. '\\]' // Closing bracket.
. '(?:'
. '(' // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags.
. '[^\\[]*+' // Not an opening bracket.
. '(?:'
. '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag.
. '[^\\[]*+' // Not an opening bracket.
. ')*+'
. ')'
. '\\[\\/\\2\\]' // Closing shortcode tag.
. ')?'
. ')'
. '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]].
// phpcs:enable
}
```
| Used By | Description |
| --- | --- |
| [do\_shortcodes\_in\_html\_tags()](do_shortcodes_in_html_tags) wp-includes/shortcodes.php | Searches only inside HTML elements for shortcodes and process them. |
| [wp\_ajax\_parse\_embed()](wp_ajax_parse_embed) wp-admin/includes/ajax-actions.php | Apply [embed] Ajax handlers to a string. |
| [has\_shortcode()](has_shortcode) wp-includes/shortcodes.php | Determines whether the passed content contains the specified shortcode. |
| [do\_shortcode()](do_shortcode) wp-includes/shortcodes.php | Searches content for shortcodes and filter shortcodes through their hooks. |
| [strip\_shortcodes()](strip_shortcodes) wp-includes/shortcodes.php | Removes all shortcode tags from the given content. |
| [get\_post\_galleries()](get_post_galleries) wp-includes/media.php | Retrieves galleries from the passed post’s content. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `$tagnames` parameter. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress get_admin_page_title(): string get\_admin\_page\_title(): string
=================================
Gets the title of the current admin page.
string The title of the current admin page.
File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
function get_admin_page_title() {
global $title, $menu, $submenu, $pagenow, $typenow, $plugin_page;
if ( ! empty( $title ) ) {
return $title;
}
$hook = get_plugin_page_hook( $plugin_page, $pagenow );
$parent = get_admin_page_parent();
$parent1 = $parent;
if ( empty( $parent ) ) {
foreach ( (array) $menu as $menu_array ) {
if ( isset( $menu_array[3] ) ) {
if ( $menu_array[2] === $pagenow ) {
$title = $menu_array[3];
return $menu_array[3];
} elseif ( isset( $plugin_page ) && $plugin_page === $menu_array[2] && $hook === $menu_array[5] ) {
$title = $menu_array[3];
return $menu_array[3];
}
} else {
$title = $menu_array[0];
return $title;
}
}
} else {
foreach ( array_keys( $submenu ) as $parent ) {
foreach ( $submenu[ $parent ] as $submenu_array ) {
if ( isset( $plugin_page )
&& $plugin_page === $submenu_array[2]
&& ( $pagenow === $parent
|| $plugin_page === $parent
|| $plugin_page === $hook
|| 'admin.php' === $pagenow && $parent1 !== $submenu_array[2]
|| ! empty( $typenow ) && "$pagenow?post_type=$typenow" === $parent )
) {
$title = $submenu_array[3];
return $submenu_array[3];
}
if ( $submenu_array[2] !== $pagenow || isset( $_GET['page'] ) ) { // Not the current page.
continue;
}
if ( isset( $submenu_array[3] ) ) {
$title = $submenu_array[3];
return $submenu_array[3];
} else {
$title = $submenu_array[0];
return $title;
}
}
}
if ( empty( $title ) ) {
foreach ( $menu as $menu_array ) {
if ( isset( $plugin_page )
&& $plugin_page === $menu_array[2]
&& 'admin.php' === $pagenow
&& $parent1 === $menu_array[2]
) {
$title = $menu_array[3];
return $menu_array[3];
}
}
}
}
return $title;
}
```
| Uses | Description |
| --- | --- |
| [get\_plugin\_page\_hook()](get_plugin_page_hook) wp-admin/includes/plugin.php | Gets the hook attached to the administrative page of a plugin. |
| [get\_admin\_page\_parent()](get_admin_page_parent) wp-admin/includes/plugin.php | Gets the parent file of the current admin page. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress wp_die( string|WP_Error $message = '', string|int $title = '', string|array|int $args = array() ) wp\_die( string|WP\_Error $message = '', string|int $title = '', string|array|int $args = array() )
===================================================================================================
Kills WordPress execution and displays HTML page with an error message.
This function complements the `die()` PHP function. The difference is that HTML will be displayed to the user. It is recommended to use this function only when the execution should not continue any further. It is not recommended to call this function very often, and try to handle as many errors as possible silently or more gracefully.
As a shorthand, the desired HTTP response code may be passed as an integer to the `$title` parameter (the default title would apply) or the `$args` parameter.
`$message` string|[WP\_Error](../classes/wp_error) Optional Error message. If this is a [WP\_Error](../classes/wp_error) object, and not an Ajax or XML-RPC request, the error's messages are used.
Default: `''`
`$title` string|int Optional Error title. If `$message` is a `WP_Error` object, error data with the key `'title'` may be used to specify the title.
If `$title` is an integer, then it is treated as the response code. Default: `''`
`$args` string|array|int Optional Arguments to control behavior. If `$args` is an integer, then it is treated as the response code.
* `response`intThe HTTP response code. Default 200 for Ajax requests, 500 otherwise.
* `link_url`stringA URL to include a link to. Only works in combination with $link\_text.
Default empty string.
* `link_text`stringA label for the link to include. Only works in combination with $link\_url.
Default empty string.
* `back_link`boolWhether to include a link to go back. Default false.
* `text_direction`stringThe text direction. This is only useful internally, when WordPress is still loading and the site's locale is not set up yet. Accepts `'rtl'` and `'ltr'`.
Default is the value of [is\_rtl()](is_rtl) .
* `charset`stringCharacter set of the HTML output. Default `'utf-8'`.
* `code`stringError code to use. Default is `'wp_die'`, or the main error code if $message is a [WP\_Error](../classes/wp_error).
* `exit`boolWhether to exit the process after completion. Default true.
Default: `array()`
You can add a [WP\_Error](https://codex.wordpress.org/Class_Reference/WP_Error "Class Reference/WP Error") object. If you’ve done so, you can add $data['title'] to the error object and it will automatically be taken as (default/overwriteable) title for the die page
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function wp_die( $message = '', $title = '', $args = array() ) {
global $wp_query;
if ( is_int( $args ) ) {
$args = array( 'response' => $args );
} elseif ( is_int( $title ) ) {
$args = array( 'response' => $title );
$title = '';
}
if ( wp_doing_ajax() ) {
/**
* Filters the callback for killing WordPress execution for Ajax requests.
*
* @since 3.4.0
*
* @param callable $callback Callback function name.
*/
$callback = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' );
} elseif ( wp_is_json_request() ) {
/**
* Filters the callback for killing WordPress execution for JSON requests.
*
* @since 5.1.0
*
* @param callable $callback Callback function name.
*/
$callback = apply_filters( 'wp_die_json_handler', '_json_wp_die_handler' );
} elseif ( defined( 'REST_REQUEST' ) && REST_REQUEST && wp_is_jsonp_request() ) {
/**
* Filters the callback for killing WordPress execution for JSONP REST requests.
*
* @since 5.2.0
*
* @param callable $callback Callback function name.
*/
$callback = apply_filters( 'wp_die_jsonp_handler', '_jsonp_wp_die_handler' );
} elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
/**
* Filters the callback for killing WordPress execution for XML-RPC requests.
*
* @since 3.4.0
*
* @param callable $callback Callback function name.
*/
$callback = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
} elseif ( wp_is_xml_request()
|| isset( $wp_query ) &&
( function_exists( 'is_feed' ) && is_feed()
|| function_exists( 'is_comment_feed' ) && is_comment_feed()
|| function_exists( 'is_trackback' ) && is_trackback() ) ) {
/**
* Filters the callback for killing WordPress execution for XML requests.
*
* @since 5.2.0
*
* @param callable $callback Callback function name.
*/
$callback = apply_filters( 'wp_die_xml_handler', '_xml_wp_die_handler' );
} else {
/**
* Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
*
* @since 3.0.0
*
* @param callable $callback Callback function name.
*/
$callback = apply_filters( 'wp_die_handler', '_default_wp_die_handler' );
}
call_user_func( $callback, $message, $title, $args );
}
```
[apply\_filters( 'wp\_die\_ajax\_handler', callable $callback )](../hooks/wp_die_ajax_handler)
Filters the callback for killing WordPress execution for Ajax requests.
[apply\_filters( 'wp\_die\_handler', callable $callback )](../hooks/wp_die_handler)
Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests.
[apply\_filters( 'wp\_die\_jsonp\_handler', callable $callback )](../hooks/wp_die_jsonp_handler)
Filters the callback for killing WordPress execution for JSONP REST requests.
[apply\_filters( 'wp\_die\_json\_handler', callable $callback )](../hooks/wp_die_json_handler)
Filters the callback for killing WordPress execution for JSON requests.
[apply\_filters( 'wp\_die\_xmlrpc\_handler', callable $callback )](../hooks/wp_die_xmlrpc_handler)
Filters the callback for killing WordPress execution for XML-RPC requests.
[apply\_filters( 'wp\_die\_xml\_handler', callable $callback )](../hooks/wp_die_xml_handler)
Filters the callback for killing WordPress execution for XML requests.
| Uses | Description |
| --- | --- |
| [wp\_is\_jsonp\_request()](wp_is_jsonp_request) wp-includes/load.php | Checks whether current request is a JSONP request, or is expecting a JSONP response. |
| [wp\_is\_xml\_request()](wp_is_xml_request) wp-includes/load.php | Checks whether current request is an XML request, or is expecting an XML response. |
| [wp\_is\_json\_request()](wp_is_json_request) wp-includes/load.php | Checks whether current request is a JSON request, or is expecting a JSON response. |
| [wp\_doing\_ajax()](wp_doing_ajax) wp-includes/load.php | Determines whether the current request is a WordPress Ajax request. |
| [is\_trackback()](is_trackback) wp-includes/query.php | Determines whether the query is for a trackback endpoint call. |
| [is\_feed()](is_feed) wp-includes/query.php | Determines whether the query is for a feed. |
| [is\_comment\_feed()](is_comment_feed) wp-includes/query.php | Is the query for a comments feed? |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_Sitemaps\_Renderer::check\_for\_simple\_xml\_availability()](../classes/wp_sitemaps_renderer/check_for_simple_xml_availability) wp-includes/sitemaps/class-wp-sitemaps-renderer.php | Checks for the availability of the SimpleXML extension and errors if missing. |
| [WP\_Recovery\_Mode::handle\_exit\_recovery\_mode()](../classes/wp_recovery_mode/handle_exit_recovery_mode) wp-includes/class-wp-recovery-mode.php | Handles a request to exit Recovery Mode. |
| [WP\_Recovery\_Mode::handle\_cookie()](../classes/wp_recovery_mode/handle_cookie) wp-includes/class-wp-recovery-mode.php | Handles checking for the recovery mode cookie and validating it. |
| [WP\_Recovery\_Mode\_Link\_Service::handle\_begin\_link()](../classes/wp_recovery_mode_link_service/handle_begin_link) wp-includes/class-wp-recovery-mode-link-service.php | Enters recovery mode when the user hits wp-login.php with a valid recovery mode link. |
| [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. |
| [WP\_Customize\_Manager::handle\_load\_themes\_request()](../classes/wp_customize_manager/handle_load_themes_request) wp-includes/class-wp-customize-manager.php | Loads themes into the theme browsing/installation UI. |
| [wp\_load\_press\_this()](wp_load_press_this) wp-admin/press-this.php | |
| [wp\_check\_comment\_flood()](wp_check_comment_flood) wp-includes/comment.php | Checks whether comment flooding is occurring. |
| [wp\_ajax\_get\_post\_thumbnail\_html()](wp_ajax_get_post_thumbnail_html) wp-admin/includes/ajax-actions.php | Ajax handler for retrieving HTML for the featured image. |
| [wp\_ajax\_delete\_inactive\_widgets()](wp_ajax_delete_inactive_widgets) wp-admin/includes/ajax-actions.php | Ajax handler for removing inactive widgets. |
| [WP\_Customize\_Nav\_Menus::ajax\_load\_available\_items()](../classes/wp_customize_nav_menus/ajax_load_available_items) wp-includes/class-wp-customize-nav-menus.php | Ajax handler for loading available menu items. |
| [WP\_Customize\_Nav\_Menus::ajax\_search\_available\_items()](../classes/wp_customize_nav_menus/ajax_search_available_items) wp-includes/class-wp-customize-nav-menus.php | Ajax handler for searching available menu items. |
| [wp\_media\_attach\_action()](wp_media_attach_action) wp-admin/includes/media.php | Encapsulates the logic for Attach/Detach actions. |
| [File\_Upload\_Upgrader::\_\_construct()](../classes/file_upload_upgrader/__construct) wp-admin/includes/class-file-upload-upgrader.php | Construct the upgrader for a form. |
| [WP\_Screen::get()](../classes/wp_screen/get) wp-admin/includes/class-wp-screen.php | Fetches a screen object. |
| [install\_theme\_information()](install_theme_information) wp-admin/includes/theme-install.php | Displays theme information in dialog box form. |
| [\_access\_denied\_splash()](_access_denied_splash) wp-admin/includes/ms.php | Displays an access denied message when a user tries to view a site’s dashboard they do not have access to. |
| [check\_upload\_size()](check_upload_size) wp-admin/includes/ms.php | Determine if uploaded file exceeds space quota. |
| [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 | |
| [install\_plugin\_information()](install_plugin_information) wp-admin/includes/plugin-install.php | Displays plugin information in dialog box form. |
| [wp\_check\_mysql\_version()](wp_check_mysql_version) wp-admin/includes/upgrade.php | Checks the version of the installed MySQL binary. |
| [edit\_user()](edit_user) wp-admin/includes/user.php | Edit user settings based on contents of $\_POST |
| [post\_preview()](post_preview) wp-admin/includes/post.php | Saves a draft or manually autosaves for the purpose of showing a post preview. |
| [write\_post()](write_post) wp-admin/includes/post.php | Calls [wp\_write\_post()](wp_write_post) and handles the errors. |
| [edit\_post()](edit_post) wp-admin/includes/post.php | Updates an existing post with values provided in `$_POST`. |
| [bulk\_edit\_posts()](bulk_edit_posts) wp-admin/includes/post.php | Processes the post data for the bulk editing of posts. |
| [wp\_ajax\_save\_widget()](wp_ajax_save_widget) wp-admin/includes/ajax-actions.php | Ajax handler for saving a widget. |
| [wp\_ajax\_upload\_attachment()](wp_ajax_upload_attachment) wp-admin/includes/ajax-actions.php | Ajax handler for uploading attachments |
| [wp\_ajax\_image\_editor()](wp_ajax_image_editor) wp-admin/includes/ajax-actions.php | Ajax handler for image editing. |
| [wp\_ajax\_set\_post\_thumbnail()](wp_ajax_set_post_thumbnail) wp-admin/includes/ajax-actions.php | Ajax handler for setting the featured image. |
| [wp\_ajax\_date\_format()](wp_ajax_date_format) wp-admin/includes/ajax-actions.php | Ajax handler for date formatting. |
| [wp\_ajax\_time\_format()](wp_ajax_time_format) wp-admin/includes/ajax-actions.php | Ajax handler for time formatting. |
| [wp\_ajax\_wp\_remove\_post\_lock()](wp_ajax_wp_remove_post_lock) wp-admin/includes/ajax-actions.php | Ajax handler for removing a post lock. |
| [wp\_ajax\_dismiss\_wp\_pointer()](wp_ajax_dismiss_wp_pointer) wp-admin/includes/ajax-actions.php | Ajax handler for dismissing a WordPress pointer. |
| [wp\_ajax\_add\_menu\_item()](wp_ajax_add_menu_item) wp-admin/includes/ajax-actions.php | Ajax handler for adding a menu item. |
| [wp\_ajax\_add\_meta()](wp_ajax_add_meta) wp-admin/includes/ajax-actions.php | Ajax handler for adding meta. |
| [wp\_ajax\_add\_user()](wp_ajax_add_user) wp-admin/includes/ajax-actions.php | Ajax handler for adding a user. |
| [wp\_ajax\_closed\_postboxes()](wp_ajax_closed_postboxes) wp-admin/includes/ajax-actions.php | Ajax handler for closed post boxes. |
| [wp\_ajax\_hidden\_columns()](wp_ajax_hidden_columns) wp-admin/includes/ajax-actions.php | Ajax handler for hidden columns. |
| [wp\_ajax\_update\_welcome\_panel()](wp_ajax_update_welcome_panel) wp-admin/includes/ajax-actions.php | Ajax handler for updating whether to display the welcome panel. |
| [wp\_ajax\_menu\_get\_metabox()](wp_ajax_menu_get_metabox) wp-admin/includes/ajax-actions.php | Ajax handler for retrieving menu meta boxes. |
| [wp\_ajax\_wp\_link\_ajax()](wp_ajax_wp_link_ajax) wp-admin/includes/ajax-actions.php | Ajax handler for internal linking. |
| [wp\_ajax\_menu\_locations\_save()](wp_ajax_menu_locations_save) wp-admin/includes/ajax-actions.php | Ajax handler for menu locations save. |
| [wp\_ajax\_meta\_box\_order()](wp_ajax_meta_box_order) wp-admin/includes/ajax-actions.php | Ajax handler for saving the meta box order. |
| [wp\_ajax\_menu\_quick\_search()](wp_ajax_menu_quick_search) wp-admin/includes/ajax-actions.php | Ajax handler for menu quick searching. |
| [wp\_ajax\_get\_permalink()](wp_ajax_get_permalink) wp-admin/includes/ajax-actions.php | Ajax handler to retrieve a permalink. |
| [wp\_ajax\_sample\_permalink()](wp_ajax_sample_permalink) wp-admin/includes/ajax-actions.php | Ajax handler to retrieve a sample permalink. |
| [wp\_ajax\_inline\_save()](wp_ajax_inline_save) wp-admin/includes/ajax-actions.php | Ajax handler for Quick Edit saving a post from a list table. |
| [wp\_ajax\_inline\_save\_tax()](wp_ajax_inline_save_tax) wp-admin/includes/ajax-actions.php | Ajax handler for quick edit saving for a term. |
| [wp\_ajax\_widgets\_order()](wp_ajax_widgets_order) wp-admin/includes/ajax-actions.php | Ajax handler for saving the widgets order. |
| [wp\_ajax\_dashboard\_widgets()](wp_ajax_dashboard_widgets) wp-admin/includes/ajax-actions.php | Ajax handler for dashboard widgets. |
| [wp\_ajax\_logged\_in()](wp_ajax_logged_in) wp-admin/includes/ajax-actions.php | Ajax handler for Customizer preview logged-in status. |
| [\_wp\_ajax\_add\_hierarchical\_term()](_wp_ajax_add_hierarchical_term) wp-admin/includes/ajax-actions.php | Ajax handler for adding a hierarchical term. |
| [wp\_ajax\_delete\_comment()](wp_ajax_delete_comment) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a comment. |
| [wp\_ajax\_delete\_tag()](wp_ajax_delete_tag) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a tag. |
| [wp\_ajax\_delete\_link()](wp_ajax_delete_link) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a link. |
| [wp\_ajax\_delete\_meta()](wp_ajax_delete_meta) wp-admin/includes/ajax-actions.php | Ajax handler for deleting meta. |
| [wp\_ajax\_delete\_post()](wp_ajax_delete_post) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a post. |
| [wp\_ajax\_trash\_post()](wp_ajax_trash_post) wp-admin/includes/ajax-actions.php | Ajax handler for sending a post to the Trash. |
| [wp\_ajax\_delete\_page()](wp_ajax_delete_page) wp-admin/includes/ajax-actions.php | Ajax handler to delete a page. |
| [wp\_ajax\_dim\_comment()](wp_ajax_dim_comment) wp-admin/includes/ajax-actions.php | Ajax handler to dim a comment. |
| [wp\_ajax\_add\_link\_category()](wp_ajax_add_link_category) wp-admin/includes/ajax-actions.php | Ajax handler for adding a link category. |
| [wp\_ajax\_add\_tag()](wp_ajax_add_tag) wp-admin/includes/ajax-actions.php | Ajax handler to add a tag. |
| [wp\_ajax\_get\_tagcloud()](wp_ajax_get_tagcloud) wp-admin/includes/ajax-actions.php | Ajax handler for getting a tagcloud. |
| [wp\_ajax\_get\_comments()](wp_ajax_get_comments) wp-admin/includes/ajax-actions.php | Ajax handler for getting comments. |
| [wp\_ajax\_replyto\_comment()](wp_ajax_replyto_comment) wp-admin/includes/ajax-actions.php | Ajax handler for replying to a comment. |
| [wp\_ajax\_edit\_comment()](wp_ajax_edit_comment) wp-admin/includes/ajax-actions.php | Ajax handler for editing a comment. |
| [wp\_ajax\_fetch\_list()](wp_ajax_fetch_list) wp-admin/includes/ajax-actions.php | Ajax handler for fetching a list table. |
| [wp\_ajax\_ajax\_tag\_search()](wp_ajax_ajax_tag_search) wp-admin/includes/ajax-actions.php | Ajax handler for tag search. |
| [wp\_ajax\_wp\_compression\_test()](wp_ajax_wp_compression_test) wp-admin/includes/ajax-actions.php | Ajax handler for compression testing. |
| [wp\_ajax\_imgedit\_preview()](wp_ajax_imgedit_preview) wp-admin/includes/ajax-actions.php | Ajax handler for image editor previews. |
| [wp\_ajax\_oembed\_cache()](wp_ajax_oembed_cache) wp-admin/includes/ajax-actions.php | Ajax handler for oEmbed caching. |
| [wp\_ajax\_autocomplete\_user()](wp_ajax_autocomplete_user) wp-admin/includes/ajax-actions.php | Ajax handler for user autocomplete. |
| [wp\_link\_manager\_disabled\_message()](wp_link_manager_disabled_message) wp-admin/includes/bookmark.php | Outputs the ‘disabled’ message for the WordPress Link Manager. |
| [edit\_link()](edit_link) wp-admin/includes/bookmark.php | Updates or inserts a link using values provided in $\_POST. |
| [wpmu\_checkAvailableSpace()](wpmu_checkavailablespace) wp-admin/includes/ms-deprecated.php | Determines if the available space defined by the admin has been exceeded by the user. |
| [WP\_Terms\_List\_Table::\_\_construct()](../classes/wp_terms_list_table/__construct) wp-admin/includes/class-wp-terms-list-table.php | Constructor. |
| [validate\_file\_to\_edit()](validate_file_to_edit) wp-admin/includes/file.php | Makes sure that the file that was requested to be edited is allowed to be edited. |
| [edit\_comment()](edit_comment) wp-admin/includes/comment.php | Updates a comment with values provided in $\_POST. |
| [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\_2\_manage\_upload()](../classes/custom_image_header/step_2_manage_upload) wp-admin/includes/class-custom-image-header.php | Upload the file to be cropped in the second step. |
| [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\_Image\_Header::admin\_page()](../classes/custom_image_header/admin_page) wp-admin/includes/class-custom-image-header.php | Display the page based on the current step. |
| [confirm\_delete\_users()](confirm_delete_users) wp-admin/includes/ms.php | |
| [Custom\_Background::handle\_upload()](../classes/custom_background/handle_upload) wp-admin/includes/class-custom-background.php | Handles an Image upload for the background image. |
| [WP\_Customize\_Manager::wp\_die()](../classes/wp_customize_manager/wp_die) wp-includes/class-wp-customize-manager.php | Custom wp\_die wrapper. Returns either the standard message for UI or the Ajax message. |
| [WP\_Customize\_Manager::setup\_theme()](../classes/wp_customize_manager/setup_theme) wp-includes/class-wp-customize-manager.php | Starts preview and customize theme. |
| [switch\_theme()](switch_theme) wp-includes/theme.php | Switches the theme. |
| [wp\_redirect()](wp_redirect) wp-includes/pluggable.php | Redirects to another page. |
| [check\_ajax\_referer()](check_ajax_referer) wp-includes/pluggable.php | Verifies the Ajax request to prevent processing requests external of the blog. |
| [WP::parse\_request()](../classes/wp/parse_request) wp-includes/class-wp.php | Parses the request to find the correct WordPress query. |
| [wp\_check\_php\_mysql\_versions()](wp_check_php_mysql_versions) wp-includes/load.php | Check for the required PHP version, and the MySQL extension or a database drop-in. |
| [wp\_maintenance()](wp_maintenance) wp-includes/load.php | Die with a maintenance message when conditions are met. |
| [wp\_set\_wpdb\_vars()](wp_set_wpdb_vars) wp-includes/load.php | Set the database table prefix and the format specifiers for database table columns. |
| [wp\_not\_installed()](wp_not_installed) wp-includes/load.php | Redirect to the installer if WordPress is not installed. |
| [wp\_send\_json()](wp_send_json) wp-includes/functions.php | Sends a JSON response back to an Ajax request. |
| [dead\_db()](dead_db) wp-includes/functions.php | Loads custom DB error or display WordPress DB error. |
| [wp\_nonce\_ays()](wp_nonce_ays) wp-includes/functions.php | Displays “Are You Sure” message to confirm the action being taken. |
| [do\_feed()](do_feed) wp-includes/functions.php | Loads the feed template from the use of an action hook. |
| [WP\_Ajax\_Response::send()](../classes/wp_ajax_response/send) wp-includes/class-wp-ajax-response.php | Display XML formatted responses. |
| [wp\_protect\_special\_option()](wp_protect_special_option) wp-includes/option.php | Protects WordPress special option from being modified. |
| [\_show\_post\_preview()](_show_post_preview) wp-includes/revision.php | Filters the latest content for preview from the post autosave. |
| [maybe\_add\_existing\_user\_to\_blog()](maybe_add_existing_user_to_blog) wp-includes/ms-functions.php | Adds a new user to a blog by visiting /newbloguser/{key}/. |
| [ms\_not\_installed()](ms_not_installed) wp-includes/ms-load.php | Displays a failure message. |
| [wpmu\_admin\_do\_redirect()](wpmu_admin_do_redirect) wp-includes/ms-deprecated.php | Redirect a user based on $\_GET or $\_POST arguments. |
| [ms\_site\_check()](ms_site_check) wp-includes/ms-load.php | Checks status of current blog. |
| [wpdb::bail()](../classes/wpdb/bail) wp-includes/class-wpdb.php | Wraps errors in a nice header and footer and dies. |
| [wpdb::print\_error()](../classes/wpdb/print_error) wp-includes/class-wpdb.php | Prints SQL/DB error. |
| [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\_allow\_comment()](wp_allow_comment) wp-includes/comment.php | Validates whether this comment is allowed to be made. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | The `$text_direction` argument has a priority over [get\_language\_attributes()](get_language_attributes) in the default handler. |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | The `$charset` argument was added. |
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | The `$link_url`, `$link_text`, and `$exit` arguments were added. |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$title` and `$args` parameters were changed to optionally accept an integer to be used as the response code. |
| [2.0.4](https://developer.wordpress.org/reference/since/2.0.4/) | Introduced. |
| programming_docs |
wordpress update_user_status( int $id, string $pref, int $value, null $deprecated = null ): int update\_user\_status( int $id, string $pref, int $value, null $deprecated = null ): int
=======================================================================================
This function has been deprecated. Use [wp\_update\_user()](wp_update_user) instead.
Update the status of a user in the database.
Previously used in core to mark a user as spam or "ham" (not spam) in Multisite.
* [wp\_update\_user()](wp_update_user)
`$id` int Required The user ID. `$pref` string Required The column in the wp\_users table to update the user's status in (presumably user\_status, spam, or deleted). `$value` int Required The new status for the user. `$deprecated` null Optional Deprecated as of 3.0.2 and should not be used. Default: `null`
int The initially passed $value.
File: `wp-includes/ms-deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-deprecated.php/)
```
function update_user_status( $id, $pref, $value, $deprecated = null ) {
global $wpdb;
_deprecated_function( __FUNCTION__, '5.3.0', 'wp_update_user()' );
if ( null !== $deprecated ) {
_deprecated_argument( __FUNCTION__, '3.0.2' );
}
$wpdb->update( $wpdb->users, array( sanitize_key( $pref ) => $value ), array( 'ID' => $id ) );
$user = new WP_User( $id );
clean_user_cache( $user );
if ( 'spam' === $pref ) {
if ( $value == 1 ) {
/** This filter is documented in wp-includes/user.php */
do_action( 'make_spam_user', $id );
} else {
/** This filter is documented in wp-includes/user.php */
do_action( 'make_ham_user', $id );
}
}
return $value;
}
```
[do\_action( 'make\_ham\_user', int $user\_id )](../hooks/make_ham_user)
Fires after the user is marked as a HAM user. Opposite of SPAM.
[do\_action( 'make\_spam\_user', int $user\_id )](../hooks/make_spam_user)
Fires after the user is marked as a SPAM user.
| Uses | Description |
| --- | --- |
| [WP\_User::\_\_construct()](../classes/wp_user/__construct) wp-includes/class-wp-user.php | Constructor. |
| [clean\_user\_cache()](clean_user_cache) wp-includes/user.php | Cleans all user caches. |
| [wpdb::update()](../classes/wpdb/update) wp-includes/class-wpdb.php | Updates a row in the table. |
| [sanitize\_key()](sanitize_key) wp-includes/formatting.php | Sanitizes a string key. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| [\_deprecated\_argument()](_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Use [wp\_update\_user()](wp_update_user) |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress register_block_style( string $block_name, array $style_properties ): bool register\_block\_style( string $block\_name, array $style\_properties ): bool
=============================================================================
Registers a new block style.
`$block_name` string Required Block type name including namespace. `$style_properties` array Required Array containing the properties of the style name, label, style (name of the stylesheet to be enqueued), inline\_style (string containing the CSS to be added). bool True if the block style was registered with success and false otherwise.
File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
function register_block_style( $block_name, $style_properties ) {
return WP_Block_Styles_Registry::get_instance()->register( $block_name, $style_properties );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Block\_Styles\_Registry::get\_instance()](../classes/wp_block_styles_registry/get_instance) wp-includes/class-wp-block-styles-registry.php | Utility method to retrieve the main instance of the class. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress wp_default_packages( WP_Scripts $scripts ) wp\_default\_packages( WP\_Scripts $scripts )
=============================================
Registers all the WordPress packages scripts.
`$scripts` [WP\_Scripts](../classes/wp_scripts) Required [WP\_Scripts](../classes/wp_scripts) object. File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
function wp_default_packages( $scripts ) {
wp_default_packages_vendor( $scripts );
wp_register_development_scripts( $scripts );
wp_register_tinymce_scripts( $scripts );
wp_default_packages_scripts( $scripts );
if ( did_action( 'init' ) ) {
wp_default_packages_inline_scripts( $scripts );
}
}
```
| Uses | Description |
| --- | --- |
| [wp\_register\_development\_scripts()](wp_register_development_scripts) wp-includes/script-loader.php | Registers development scripts that integrate with `@wordpress/scripts`. |
| [wp\_default\_packages\_vendor()](wp_default_packages_vendor) wp-includes/script-loader.php | Registers all the WordPress vendor scripts that are in the standardized `js/dist/vendor/` location. |
| [wp\_register\_tinymce\_scripts()](wp_register_tinymce_scripts) wp-includes/script-loader.php | Registers TinyMCE scripts. |
| [wp\_default\_packages\_scripts()](wp_default_packages_scripts) wp-includes/script-loader.php | Registers all the WordPress packages scripts that are in the standardized `js/dist/` location. |
| [wp\_default\_packages\_inline\_scripts()](wp_default_packages_inline_scripts) wp-includes/script-loader.php | Adds inline scripts required for the WordPress JavaScript packages. |
| [did\_action()](did_action) wp-includes/plugin.php | Retrieves the number of times an action has been fired during the current request. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress check_upload_mimes( array $mimes ): array check\_upload\_mimes( array $mimes ): array
===========================================
Checks an array of MIME types against a list of allowed types.
WordPress ships with a set of allowed upload filetypes, which is defined in wp-includes/functions.php in [get\_allowed\_mime\_types()](get_allowed_mime_types) . This function is used to filter that list against the filetypes allowed provided by Multisite Super Admins at wp-admin/network/settings.php.
`$mimes` array Required array
File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
function check_upload_mimes( $mimes ) {
$site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) );
$site_mimes = array();
foreach ( $site_exts as $ext ) {
foreach ( $mimes as $ext_pattern => $mime ) {
if ( '' !== $ext && false !== strpos( $ext_pattern, $ext ) ) {
$site_mimes[ $ext_pattern ] = $mime;
}
}
}
return $site_mimes;
}
```
| Uses | Description |
| --- | --- |
| [get\_site\_option()](get_site_option) wp-includes/option.php | Retrieve an option value for the current network based on name of option. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress permalink_anchor( string $mode = 'id' ) permalink\_anchor( string $mode = 'id' )
========================================
Displays the permalink anchor for the current post.
The permalink mode title will use the post title for the ‘a’ element ‘id’ attribute. The id mode uses ‘post-‘ with the post ID for the ‘id’ attribute.
`$mode` string Optional Permalink mode. Accepts `'title'` or `'id'`. Default `'id'`. Default: `'id'`
##### Usage:
```
permalink_anchor( $type );
```
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function permalink_anchor( $mode = 'id' ) {
$post = get_post();
switch ( strtolower( $mode ) ) {
case 'title':
$title = sanitize_title( $post->post_title ) . '-' . $post->ID;
echo '<a id="' . $title . '"></a>';
break;
case 'id':
default:
echo '<a id="post-' . $post->ID . '"></a>';
break;
}
}
```
| Uses | Description |
| --- | --- |
| [sanitize\_title()](sanitize_title) wp-includes/formatting.php | Sanitizes a string into a slug, which can be used in URLs or HTML attributes. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress validate_plugin_requirements( string $plugin ): true|WP_Error validate\_plugin\_requirements( string $plugin ): true|WP\_Error
================================================================
Validates the plugin requirements for WordPress version and PHP version.
Uses the information from `Requires at least` and `Requires PHP` headers defined in the plugin’s main PHP file.
`$plugin` string Required Path to the plugin file relative to the plugins directory. true|[WP\_Error](../classes/wp_error) True if requirements are met, [WP\_Error](../classes/wp_error) on failure.
File: `wp-admin/includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
```
function validate_plugin_requirements( $plugin ) {
$plugin_headers = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
$requirements = array(
'requires' => ! empty( $plugin_headers['RequiresWP'] ) ? $plugin_headers['RequiresWP'] : '',
'requires_php' => ! empty( $plugin_headers['RequiresPHP'] ) ? $plugin_headers['RequiresPHP'] : '',
);
$compatible_wp = is_wp_version_compatible( $requirements['requires'] );
$compatible_php = is_php_version_compatible( $requirements['requires_php'] );
$php_update_message = '</p><p>' . sprintf(
/* translators: %s: URL to Update PHP page. */
__( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
$annotation = wp_get_update_php_annotation();
if ( $annotation ) {
$php_update_message .= '</p><p><em>' . $annotation . '</em>';
}
if ( ! $compatible_wp && ! $compatible_php ) {
return new WP_Error(
'plugin_wp_php_incompatible',
'<p>' . sprintf(
/* translators: 1: Current WordPress version, 2: Current PHP version, 3: Plugin name, 4: Required WordPress version, 5: Required PHP version. */
_x( '<strong>Error:</strong> Current versions of WordPress (%1$s) and PHP (%2$s) do not meet minimum requirements for %3$s. The plugin requires WordPress %4$s and PHP %5$s.', 'plugin' ),
get_bloginfo( 'version' ),
PHP_VERSION,
$plugin_headers['Name'],
$requirements['requires'],
$requirements['requires_php']
) . $php_update_message . '</p>'
);
} elseif ( ! $compatible_php ) {
return new WP_Error(
'plugin_php_incompatible',
'<p>' . sprintf(
/* translators: 1: Current PHP version, 2: Plugin name, 3: Required PHP version. */
_x( '<strong>Error:</strong> Current PHP version (%1$s) does not meet minimum requirements for %2$s. The plugin requires PHP %3$s.', 'plugin' ),
PHP_VERSION,
$plugin_headers['Name'],
$requirements['requires_php']
) . $php_update_message . '</p>'
);
} elseif ( ! $compatible_wp ) {
return new WP_Error(
'plugin_wp_incompatible',
'<p>' . sprintf(
/* translators: 1: Current WordPress version, 2: Plugin name, 3: Required WordPress version. */
_x( '<strong>Error:</strong> Current WordPress version (%1$s) does not meet minimum requirements for %2$s. The plugin requires WordPress %3$s.', 'plugin' ),
get_bloginfo( 'version' ),
$plugin_headers['Name'],
$requirements['requires']
) . '</p>'
);
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [is\_wp\_version\_compatible()](is_wp_version_compatible) wp-includes/functions.php | Checks compatibility with the current WordPress version. |
| [is\_php\_version\_compatible()](is_php_version_compatible) wp-includes/functions.php | Checks compatibility with the current PHP version. |
| [wp\_get\_update\_php\_annotation()](wp_get_update_php_annotation) wp-includes/functions.php | Returns the default annotation for the web hosting altering the “Update PHP” page URL. |
| [wp\_get\_update\_php\_url()](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. |
| [get\_plugin\_data()](get_plugin_data) wp-admin/includes/plugin.php | Parses the plugin contents to retrieve plugin’s metadata. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [get\_bloginfo()](get_bloginfo) wp-includes/general-template.php | Retrieves information about the current site. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [activate\_plugin()](activate_plugin) wp-admin/includes/plugin.php | Attempts activation of plugin in a “sandbox” and redirects on success. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Removed support for using `readme.txt` as a fallback. |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Added support for reading the headers from the plugin's main PHP file, with `readme.txt` as a fallback. |
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
wordpress delete_usermeta( int $user_id, string $meta_key, mixed $meta_value = '' ): bool delete\_usermeta( int $user\_id, string $meta\_key, mixed $meta\_value = '' ): bool
===================================================================================
This function has been deprecated. Use [delete\_user\_meta()](delete_user_meta) instead.
Remove user meta data.
* [delete\_user\_meta()](delete_user_meta)
`$user_id` int Required User ID. `$meta_key` string Required Metadata key. `$meta_value` mixed Optional Metadata value. Default: `''`
bool True deletion completed and false if user\_id is not a number.
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'delete_user_meta()' );
global $wpdb;
if ( !is_numeric( $user_id ) )
return false;
$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
if ( is_array($meta_value) || is_object($meta_value) )
$meta_value = serialize($meta_value);
$meta_value = trim( $meta_value );
$cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
if ( $cur && $cur->umeta_id )
do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
if ( ! empty($meta_value) )
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) );
else
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
clean_user_cache( $user_id );
wp_cache_delete( $user_id, 'user_meta' );
if ( $cur && $cur->umeta_id )
do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
return true;
}
```
| Uses | Description |
| --- | --- |
| [wp\_cache\_delete()](wp_cache_delete) wp-includes/cache.php | Removes the cache contents matching key and group. |
| [clean\_user\_cache()](clean_user_cache) wp-includes/user.php | Cleans all user caches. |
| [wpdb::get\_row()](../classes/wpdb/get_row) wp-includes/class-wpdb.php | Retrieves one row from the database. |
| [wpdb::query()](../classes/wpdb/query) wp-includes/class-wpdb.php | Performs a database query, using current database connection. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [wpdb::prepare()](../classes/wpdb/prepare) wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
| Used By | Description |
| --- | --- |
| [update\_usermeta()](update_usermeta) wp-includes/deprecated.php | Update metadata of user. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Use [delete\_user\_meta()](delete_user_meta) |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress _get_meta_table( string $type ): string|false \_get\_meta\_table( string $type ): string|false
================================================
Retrieves the name of the metadata table for the specified object type.
`$type` string Required Type of object metadata is for. Accepts `'post'`, `'comment'`, `'term'`, `'user'`, or any other object type with an associated meta table. string|false Metadata table name, or false if no metadata table exists
File: `wp-includes/meta.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/meta.php/)
```
function _get_meta_table( $type ) {
global $wpdb;
$table_name = $type . 'meta';
if ( empty( $wpdb->$table_name ) ) {
return false;
}
return $wpdb->$table_name;
}
```
| 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. |
| [delete\_metadata()](delete_metadata) wp-includes/meta.php | Deletes metadata for the specified object. |
| [get\_metadata\_by\_mid()](get_metadata_by_mid) wp-includes/meta.php | Retrieves metadata by meta ID. |
| [update\_metadata\_by\_mid()](update_metadata_by_mid) wp-includes/meta.php | Updates metadata by meta ID. |
| [delete\_metadata\_by\_mid()](delete_metadata_by_mid) wp-includes/meta.php | Deletes metadata by meta ID. |
| [update\_meta\_cache()](update_meta_cache) wp-includes/meta.php | Updates the metadata cache for the specified objects. |
| [add\_metadata()](add_metadata) wp-includes/meta.php | Adds metadata for the specified object. |
| [update\_metadata()](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 _wp_customize_include() \_wp\_customize\_include()
==========================
Includes and instantiates the [WP\_Customize\_Manager](../classes/wp_customize_manager) class.
Loads the Customizer at plugins\_loaded when accessing the customize.php admin page or when any request includes a wp\_customize=on param or a customize\_changeset param (a UUID). This param is a signal for whether to bootstrap the Customizer when WordPress is loading, especially in the Customizer preview or when making Customizer Ajax requests for widgets or menus.
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
function _wp_customize_include() {
$is_customize_admin_page = ( is_admin() && 'customize.php' === basename( $_SERVER['PHP_SELF'] ) );
$should_include = (
$is_customize_admin_page
||
( isset( $_REQUEST['wp_customize'] ) && 'on' === $_REQUEST['wp_customize'] )
||
( ! empty( $_GET['customize_changeset_uuid'] ) || ! empty( $_POST['customize_changeset_uuid'] ) )
);
if ( ! $should_include ) {
return;
}
/*
* Note that wp_unslash() is not being used on the input vars because it is
* called before wp_magic_quotes() gets called. Besides this fact, none of
* the values should contain any characters needing slashes anyway.
*/
$keys = array(
'changeset_uuid',
'customize_changeset_uuid',
'customize_theme',
'theme',
'customize_messenger_channel',
'customize_autosaved',
);
$input_vars = array_merge(
wp_array_slice_assoc( $_GET, $keys ),
wp_array_slice_assoc( $_POST, $keys )
);
$theme = null;
$autosaved = null;
$messenger_channel = null;
// Value false indicates UUID should be determined after_setup_theme
// to either re-use existing saved changeset or else generate a new UUID if none exists.
$changeset_uuid = false;
// Set initially fo false since defaults to true for back-compat;
// can be overridden via the customize_changeset_branching filter.
$branching = false;
if ( $is_customize_admin_page && isset( $input_vars['changeset_uuid'] ) ) {
$changeset_uuid = sanitize_key( $input_vars['changeset_uuid'] );
} elseif ( ! empty( $input_vars['customize_changeset_uuid'] ) ) {
$changeset_uuid = sanitize_key( $input_vars['customize_changeset_uuid'] );
}
// Note that theme will be sanitized via WP_Theme.
if ( $is_customize_admin_page && isset( $input_vars['theme'] ) ) {
$theme = $input_vars['theme'];
} elseif ( isset( $input_vars['customize_theme'] ) ) {
$theme = $input_vars['customize_theme'];
}
if ( ! empty( $input_vars['customize_autosaved'] ) ) {
$autosaved = true;
}
if ( isset( $input_vars['customize_messenger_channel'] ) ) {
$messenger_channel = sanitize_key( $input_vars['customize_messenger_channel'] );
}
/*
* Note that settings must be previewed even outside the customizer preview
* and also in the customizer pane itself. This is to enable loading an existing
* changeset into the customizer. Previewing the settings only has to be prevented
* here in the case of a customize_save action because this will cause WP to think
* there is nothing changed that needs to be saved.
*/
$is_customize_save_action = (
wp_doing_ajax()
&&
isset( $_REQUEST['action'] )
&&
'customize_save' === wp_unslash( $_REQUEST['action'] )
);
$settings_previewed = ! $is_customize_save_action;
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager(
compact(
'changeset_uuid',
'theme',
'messenger_channel',
'settings_previewed',
'autosaved',
'branching'
)
);
}
```
| Uses | Description |
| --- | --- |
| [wp\_doing\_ajax()](wp_doing_ajax) wp-includes/load.php | Determines whether the current request is a WordPress Ajax request. |
| [WP\_Customize\_Manager::\_\_construct()](../classes/wp_customize_manager/__construct) wp-includes/class-wp-customize-manager.php | Constructor. |
| [wp\_array\_slice\_assoc()](wp_array_slice_assoc) wp-includes/functions.php | Extracts a slice of an array, given a list of keys. |
| [wp\_unslash()](wp_unslash) wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| [sanitize\_key()](sanitize_key) wp-includes/formatting.php | Sanitizes a string key. |
| [is\_admin()](is_admin) wp-includes/load.php | Determines whether the current request is for an administrative interface page. |
| Version | Description |
| --- | --- |
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |
| programming_docs |
wordpress rest_are_values_equal( mixed $value1, mixed $value2 ): bool rest\_are\_values\_equal( mixed $value1, mixed $value2 ): bool
==============================================================
Checks the equality of two values, following JSON Schema semantics.
Property order is ignored for objects.
Values must have been previously sanitized/coerced to their native types.
`$value1` mixed Required The first value to check. `$value2` mixed Required The second value to check. bool True if the values are equal or false otherwise.
File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
function rest_are_values_equal( $value1, $value2 ) {
if ( is_array( $value1 ) && is_array( $value2 ) ) {
if ( count( $value1 ) !== count( $value2 ) ) {
return false;
}
foreach ( $value1 as $index => $value ) {
if ( ! array_key_exists( $index, $value2 ) || ! rest_are_values_equal( $value, $value2[ $index ] ) ) {
return false;
}
}
return true;
}
if ( is_int( $value1 ) && is_float( $value2 )
|| is_float( $value1 ) && is_int( $value2 )
) {
return (float) $value1 === (float) $value2;
}
return $value1 === $value2;
}
```
| Uses | Description |
| --- | --- |
| [rest\_are\_values\_equal()](rest_are_values_equal) wp-includes/rest-api.php | Checks the equality of two values, following JSON Schema semantics. |
| Used By | Description |
| --- | --- |
| [rest\_validate\_enum()](rest_validate_enum) wp-includes/rest-api.php | Validates that the given value is a member of the JSON Schema “enum”. |
| [rest\_are\_values\_equal()](rest_are_values_equal) wp-includes/rest-api.php | Checks the equality of two values, following JSON Schema semantics. |
| Version | Description |
| --- | --- |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Introduced. |
wordpress get_blog_count( int|null $network_id = null ): int get\_blog\_count( int|null $network\_id = null ): int
=====================================================
Gets the number of active sites on the installation.
The count is cached and updated twice daily. This is not a live count.
`$network_id` int|null Optional ID of the network. Default is the current network. Default: `null`
int Number of active sites on the network.
File: `wp-includes/ms-functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
```
function get_blog_count( $network_id = null ) {
return get_network_option( $network_id, 'blog_count' );
}
```
| Uses | Description |
| --- | --- |
| [get\_network\_option()](get_network_option) wp-includes/option.php | Retrieves a network’s option value based on the option name. |
| Used By | Description |
| --- | --- |
| [WP\_Debug\_Data::debug\_data()](../classes/wp_debug_data/debug_data) wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required. |
| [wp\_network\_dashboard\_right\_now()](wp_network_dashboard_right_now) wp-admin/includes/dashboard.php | |
| [wp\_version\_check()](wp_version_check) wp-includes/update.php | Checks WordPress version against the newest version. |
| [wp\_is\_large\_network()](wp_is_large_network) wp-includes/ms-functions.php | Determines whether or not we have a large network. |
| [get\_sitestats()](get_sitestats) wp-includes/ms-functions.php | Gets the network’s site and user counts. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | MU (3.0.0) |
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | The `$network_id` parameter is now being used. |
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |
wordpress __checked_selected_helper( mixed $helper, mixed $current, bool $echo, string $type ): string \_\_checked\_selected\_helper( mixed $helper, mixed $current, bool $echo, string $type ): 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.
Private helper function for checked, selected, disabled and readonly.
Compares the first two arguments and if identical marks as `$type`.
`$helper` mixed Required One of the values to compare. `$current` mixed Required The other value to compare if not just true. `$echo` bool Required Whether to echo or just return the string. `$type` string Required The type of `checked|selected|disabled|readonly` we are doing. string HTML attribute or empty string.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
function __checked_selected_helper( $helper, $current, $echo, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
if ( (string) $helper === (string) $current ) {
$result = " $type='$type'";
} else {
$result = '';
}
if ( $echo ) {
echo $result;
}
return $result;
}
```
| Used By | Description |
| --- | --- |
| [wp\_readonly()](wp_readonly) wp-includes/general-template.php | Outputs the HTML readonly attribute. |
| [checked()](checked) wp-includes/general-template.php | Outputs the HTML checked attribute. |
| [selected()](selected) wp-includes/general-template.php | Outputs the HTML selected attribute. |
| [disabled()](disabled) wp-includes/general-template.php | Outputs the HTML disabled attribute. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |
wordpress wp_enqueue_classic_theme_styles() wp\_enqueue\_classic\_theme\_styles()
=====================================
Loads classic theme styles on classic themes in the frontend.
This is needed for backwards compatibility for button blocks specifically.
File: `wp-includes/script-loader.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/script-loader.php/)
```
function wp_enqueue_classic_theme_styles() {
if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
$suffix = wp_scripts_get_suffix();
wp_register_style( 'classic-theme-styles', '/' . WPINC . "/css/classic-themes$suffix.css", array(), true );
wp_enqueue_style( 'classic-theme-styles' );
}
}
```
| Uses | Description |
| --- | --- |
| [WP\_Theme\_JSON\_Resolver::theme\_has\_support()](../classes/wp_theme_json_resolver/theme_has_support) wp-includes/class-wp-theme-json-resolver.php | Determines whether the active theme has a theme.json file. |
| [wp\_scripts\_get\_suffix()](wp_scripts_get_suffix) wp-includes/script-loader.php | Returns the suffix that can be used for the scripts. |
| [wp\_register\_style()](wp_register_style) wp-includes/functions.wp-styles.php | Register a CSS stylesheet. |
| [wp\_enqueue\_style()](wp_enqueue_style) wp-includes/functions.wp-styles.php | Enqueue a CSS stylesheet. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Introduced. |
wordpress rest_validate_array_contains_unique_items( array $array ): bool rest\_validate\_array\_contains\_unique\_items( array $array ): bool
====================================================================
Checks if an array is made up of unique items.
`$array` array Required The array to check. bool True if the array contains unique items, false otherwise.
File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
function rest_validate_array_contains_unique_items( $array ) {
$seen = array();
foreach ( $array as $item ) {
$stabilized = rest_stabilize_value( $item );
$key = serialize( $stabilized );
if ( ! isset( $seen[ $key ] ) ) {
$seen[ $key ] = true;
continue;
}
return false;
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [rest\_stabilize\_value()](rest_stabilize_value) wp-includes/rest-api.php | Stabilizes a value following JSON Schema semantics. |
| Used By | Description |
| --- | --- |
| [rest\_validate\_array\_value\_from\_schema()](rest_validate_array_value_from_schema) wp-includes/rest-api.php | Validates an array value based on a schema. |
| [rest\_sanitize\_value\_from\_schema()](rest_sanitize_value_from_schema) wp-includes/rest-api.php | Sanitize a value based on a schema. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
wordpress wp_update_custom_css_post( string $css, array $args = array() ): WP_Post|WP_Error wp\_update\_custom\_css\_post( string $css, array $args = array() ): WP\_Post|WP\_Error
=======================================================================================
Updates the `custom_css` post for a given theme.
Inserts a `custom_css` post when one doesn’t yet exist.
`$css` string Required CSS, stored in `post_content`. `$args` array Optional Args.
* `preprocessed`stringOptional. Pre-processed CSS, stored in `post_content_filtered`.
Normally empty string.
* `stylesheet`stringOptional. Stylesheet (child theme) to update.
Defaults to active theme/stylesheet.
Default: `array()`
[WP\_Post](../classes/wp_post)|[WP\_Error](../classes/wp_error) Post on success, error on failure.
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
function wp_update_custom_css_post( $css, $args = array() ) {
$args = wp_parse_args(
$args,
array(
'preprocessed' => '',
'stylesheet' => get_stylesheet(),
)
);
$data = array(
'css' => $css,
'preprocessed' => $args['preprocessed'],
);
/**
* 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:
*
* <code>
* 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 );
* </code>
*
* @since 4.7.0
* @param array $data {
* Custom CSS data.
*
* @type string $css CSS stored in `post_content`.
* @type string $preprocessed Pre-processed CSS stored in `post_content_filtered`.
* Normally empty string.
* }
* @param array $args {
* The args passed into `wp_update_custom_css_post()` merged with defaults.
*
* @type string $css The original CSS passed in to be updated.
* @type string $preprocessed The original preprocessed CSS passed in to be updated.
* @type string $stylesheet The stylesheet (theme) being updated.
* }
*/
$data = apply_filters( 'update_custom_css_data', $data, array_merge( $args, compact( 'css' ) ) );
$post_data = array(
'post_title' => $args['stylesheet'],
'post_name' => sanitize_title( $args['stylesheet'] ),
'post_type' => 'custom_css',
'post_status' => 'publish',
'post_content' => $data['css'],
'post_content_filtered' => $data['preprocessed'],
);
// Update post if it already exists, otherwise create a new one.
$post = wp_get_custom_css_post( $args['stylesheet'] );
if ( $post ) {
$post_data['ID'] = $post->ID;
$r = wp_update_post( wp_slash( $post_data ), true );
} else {
$r = wp_insert_post( wp_slash( $post_data ), true );
if ( ! is_wp_error( $r ) ) {
if ( get_stylesheet() === $args['stylesheet'] ) {
set_theme_mod( 'custom_css_post_id', $r );
}
// Trigger creation of a revision. This should be removed once #30854 is resolved.
$revisions = wp_get_latest_revision_id_and_total_count( $r );
if ( ! is_wp_error( $revisions ) && 0 === $revisions['count'] ) {
wp_save_post_revision( $r );
}
}
}
if ( is_wp_error( $r ) ) {
return $r;
}
return get_post( $r );
}
```
[apply\_filters( 'update\_custom\_css\_data', array $data, array $args )](../hooks/update_custom_css_data)
Filters the `css` (`post_content`) and `preprocessed` (`post_content_filtered`) args for a `custom_css` post being updated.
| Uses | Description |
| --- | --- |
| [wp\_get\_latest\_revision\_id\_and\_total\_count()](wp_get_latest_revision_id_and_total_count) wp-includes/revision.php | Returns the latest revision ID and count of revisions for a post. |
| [wp\_get\_custom\_css\_post()](wp_get_custom_css_post) wp-includes/theme.php | Fetches the `custom_css` post for a given theme. |
| [set\_theme\_mod()](set_theme_mod) wp-includes/theme.php | Updates theme modification value for the active theme. |
| [get\_stylesheet()](get_stylesheet) wp-includes/theme.php | Retrieves name of the current stylesheet. |
| [sanitize\_title()](sanitize_title) wp-includes/formatting.php | Sanitizes a string into a slug, which can be used in URLs or HTML attributes. |
| [wp\_update\_post()](wp_update_post) wp-includes/post.php | Updates a post with new post data. |
| [wp\_insert\_post()](wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| [wp\_save\_post\_revision()](wp_save_post_revision) wp-includes/revision.php | Creates a revision for the current version of a post. |
| [wp\_slash()](wp_slash) wp-includes/formatting.php | Adds slashes to a string or recursively adds slashes to strings within an array. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Custom\_CSS\_Setting::update()](../classes/wp_customize_custom_css_setting/update) wp-includes/customize/class-wp-customize-custom-css-setting.php | Store the CSS setting value in the custom\_css custom post type for the stylesheet. |
| Version | Description |
| --- | --- |
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |
wordpress wp_get_audio_extensions(): string[] wp\_get\_audio\_extensions(): string[]
======================================
Returns a filtered list of supported audio formats.
string[] Supported audio formats.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
function wp_get_audio_extensions() {
/**
* Filters the list of supported audio formats.
*
* @since 3.6.0
*
* @param string[] $extensions An array of supported audio formats. Defaults are
* 'mp3', 'ogg', 'flac', 'm4a', 'wav'.
*/
return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'flac', 'm4a', 'wav' ) );
}
```
[apply\_filters( 'wp\_audio\_extensions', string[] $extensions )](../hooks/wp_audio_extensions)
Filters the list of supported audio formats.
| Uses | Description |
| --- | --- |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [populate\_network\_meta()](populate_network_meta) wp-admin/includes/schema.php | Creates WordPress network meta and sets the default values. |
| [WP\_Widget\_Media\_Audio::get\_instance\_schema()](../classes/wp_widget_media_audio/get_instance_schema) wp-includes/widgets/class-wp-widget-media-audio.php | Get schema for properties of a widget instance (item). |
| [wp\_attachment\_is()](wp_attachment_is) wp-includes/post.php | Verifies an attachment is of a given type. |
| [wp\_enqueue\_media()](wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| [wp\_maybe\_load\_embeds()](wp_maybe_load_embeds) wp-includes/embed.php | Determines if default embed handlers should be loaded. |
| [wp\_audio\_shortcode()](wp_audio_shortcode) wp-includes/media.php | Builds the Audio shortcode output. |
| [wp\_underscore\_audio\_template()](wp_underscore_audio_template) wp-includes/media-template.php | Outputs the markup for a audio tag to be used in an Underscore template when data.model is passed. |
| [wp\_print\_media\_templates()](wp_print_media_templates) wp-includes/media-template.php | Prints the templates used in the media manager. |
| Version | Description |
| --- | --- |
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |
wordpress wp_delete_post( int $postid, bool $force_delete = false ): WP_Post|false|null wp\_delete\_post( int $postid, bool $force\_delete = false ): WP\_Post|false|null
=================================================================================
Trashes or deletes a post or page.
When the post and page is permanently deleted, everything that is tied to it is deleted also. This includes comments, post meta fields, and terms associated with the post.
The post or page is moved to Trash instead of permanently deleted unless Trash is disabled, item is already in the Trash, or $force\_delete is true.
* [wp\_delete\_attachment()](wp_delete_attachment)
* [wp\_trash\_post()](wp_trash_post)
`$postid` int Optional Post ID. Default 0. `$force_delete` bool Optional Whether to bypass Trash and force deletion.
Default: `false`
[WP\_Post](../classes/wp_post)|false|null Post data on success, false or null on failure.
[wp\_delete\_post()](wp_delete_post) automatically reverts to [[wp\_trash\_post()](wp_trash_post)](https://codex.wordpress.org/Function_Reference/wp_trash_post "Function Reference/wp trash post") if $force\_delete is *false*, the post\_type of $postid is *page* or *post*, $postid is not already in the trash **and** if [that trash feature](https://wordpress.org/support/article/editing-wp-config-php/ "Editing wp-config.php") enabled (which it it is by default).
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
function wp_delete_post( $postid = 0, $force_delete = false ) {
global $wpdb;
$post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $postid ) );
if ( ! $post ) {
return $post;
}
$post = get_post( $post );
if ( ! $force_delete && ( 'post' === $post->post_type || 'page' === $post->post_type ) && 'trash' !== get_post_status( $postid ) && EMPTY_TRASH_DAYS ) {
return wp_trash_post( $postid );
}
if ( 'attachment' === $post->post_type ) {
return wp_delete_attachment( $postid, $force_delete );
}
/**
* Filters whether a post deletion should take place.
*
* @since 4.4.0
*
* @param WP_Post|false|null $delete Whether to go forward with deletion.
* @param WP_Post $post Post object.
* @param bool $force_delete Whether to bypass the Trash.
*/
$check = apply_filters( 'pre_delete_post', null, $post, $force_delete );
if ( null !== $check ) {
return $check;
}
/**
* Fires before a post is deleted, at the start of wp_delete_post().
*
* @since 3.2.0
* @since 5.5.0 Added the `$post` parameter.
*
* @see wp_delete_post()
*
* @param int $postid Post ID.
* @param WP_Post $post Post object.
*/
do_action( 'before_delete_post', $postid, $post );
delete_post_meta( $postid, '_wp_trash_meta_status' );
delete_post_meta( $postid, '_wp_trash_meta_time' );
wp_delete_object_term_relationships( $postid, get_object_taxonomies( $post->post_type ) );
$parent_data = array( 'post_parent' => $post->post_parent );
$parent_where = array( 'post_parent' => $postid );
if ( is_post_type_hierarchical( $post->post_type ) ) {
// Point children of this page to its parent, also clean the cache of affected children.
$children_query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_parent = %d AND post_type = %s", $postid, $post->post_type );
$children = $wpdb->get_results( $children_query );
if ( $children ) {
$wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => $post->post_type ) );
}
}
// Do raw query. wp_get_post_revisions() is filtered.
$revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $postid ) );
// Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.
foreach ( $revision_ids as $revision_id ) {
wp_delete_post_revision( $revision_id );
}
// Point all attachments to this post up one level.
$wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) );
wp_defer_comment_counting( true );
$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_ID DESC", $postid ) );
foreach ( $comment_ids as $comment_id ) {
wp_delete_comment( $comment_id, true );
}
wp_defer_comment_counting( false );
$post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $postid ) );
foreach ( $post_meta_ids as $mid ) {
delete_metadata_by_mid( 'post', $mid );
}
/**
* Fires immediately before a post is deleted from the database.
*
* @since 1.2.0
* @since 5.5.0 Added the `$post` parameter.
*
* @param int $postid Post ID.
* @param WP_Post $post Post object.
*/
do_action( 'delete_post', $postid, $post );
$result = $wpdb->delete( $wpdb->posts, array( 'ID' => $postid ) );
if ( ! $result ) {
return false;
}
/**
* Fires immediately after a post is deleted from the database.
*
* @since 2.2.0
* @since 5.5.0 Added the `$post` parameter.
*
* @param int $postid Post ID.
* @param WP_Post $post Post object.
*/
do_action( 'deleted_post', $postid, $post );
clean_post_cache( $post );
if ( is_post_type_hierarchical( $post->post_type ) && $children ) {
foreach ( $children as $child ) {
clean_post_cache( $child );
}
}
wp_clear_scheduled_hook( 'publish_future_post', array( $postid ) );
/**
* Fires after a post is deleted, at the conclusion of wp_delete_post().
*
* @since 3.2.0
* @since 5.5.0 Added the `$post` parameter.
*
* @see wp_delete_post()
*
* @param int $postid Post ID.
* @param WP_Post $post Post object.
*/
do_action( 'after_delete_post', $postid, $post );
return $post;
}
```
[do\_action( 'after\_delete\_post', int $postid, WP\_Post $post )](../hooks/after_delete_post)
Fires after a post is deleted, at the conclusion of [wp\_delete\_post()](wp_delete_post) .
[do\_action( 'before\_delete\_post', int $postid, WP\_Post $post )](../hooks/before_delete_post)
Fires before a post is deleted, at the start of [wp\_delete\_post()](wp_delete_post) .
[do\_action( 'deleted\_post', int $postid, WP\_Post $post )](../hooks/deleted_post)
Fires immediately after a post is deleted from the database.
[do\_action( 'delete\_post', int $postid, WP\_Post $post )](../hooks/delete_post)
Fires immediately before a post is deleted from the database.
[apply\_filters( 'pre\_delete\_post', WP\_Post|false|null $delete, WP\_Post $post, bool $force\_delete )](../hooks/pre_delete_post)
Filters whether a post deletion should take place.
| Uses | Description |
| --- | --- |
| [wp\_clear\_scheduled\_hook()](wp_clear_scheduled_hook) wp-includes/cron.php | Unschedules all events attached to the hook with the specified arguments. |
| [wp\_delete\_object\_term\_relationships()](wp_delete_object_term_relationships) wp-includes/taxonomy.php | Unlinks the object from the taxonomy or taxonomies. |
| [wp\_delete\_comment()](wp_delete_comment) wp-includes/comment.php | Trashes or deletes a comment. |
| [wp\_defer\_comment\_counting()](wp_defer_comment_counting) wp-includes/comment.php | Determines whether to defer comment counting. |
| [wpdb::delete()](../classes/wpdb/delete) wp-includes/class-wpdb.php | Deletes a row in the table. |
| [wpdb::get\_col()](../classes/wpdb/get_col) wp-includes/class-wpdb.php | Retrieves one column from the database. |
| [wpdb::update()](../classes/wpdb/update) wp-includes/class-wpdb.php | Updates a row in the table. |
| [wpdb::get\_row()](../classes/wpdb/get_row) wp-includes/class-wpdb.php | Retrieves one row from the database. |
| [wp\_delete\_post\_revision()](wp_delete_post_revision) wp-includes/revision.php | Deletes a revision. |
| [is\_post\_type\_hierarchical()](is_post_type_hierarchical) wp-includes/post.php | Determines whether the post type is hierarchical. |
| [get\_post\_status()](get_post_status) wp-includes/post.php | Retrieves the post status based on the post ID. |
| [delete\_post\_meta()](delete_post_meta) wp-includes/post.php | Deletes a post meta field for the given post ID. |
| [wp\_trash\_post()](wp_trash_post) wp-includes/post.php | Moves a post or page to the Trash |
| [wp\_delete\_attachment()](wp_delete_attachment) wp-includes/post.php | Trashes or deletes an attachment. |
| [clean\_post\_cache()](clean_post_cache) wp-includes/post.php | Will clean the post in the cache. |
| [get\_object\_taxonomies()](get_object_taxonomies) wp-includes/taxonomy.php | Returns the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name. |
| [delete\_metadata\_by\_mid()](delete_metadata_by_mid) wp-includes/meta.php | Deletes metadata by meta ID. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [wpdb::get\_results()](../classes/wpdb/get_results) wp-includes/class-wpdb.php | Retrieves an entire SQL result set from the database (i.e., many rows). |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [wpdb::prepare()](../classes/wpdb/prepare) wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| 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. |
| [WP\_REST\_Templates\_Controller::update\_item()](../classes/wp_rest_templates_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Updates a single template. |
| [WP\_REST\_Templates\_Controller::delete\_item()](../classes/wp_rest_templates_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Deletes a single template. |
| [WP\_Privacy\_Requests\_Table::process\_bulk\_action()](../classes/wp_privacy_requests_table/process_bulk_action) wp-admin/includes/class-wp-privacy-requests-table.php | Process bulk actions. |
| [WP\_Customize\_Manager::handle\_dismiss\_autosave\_or\_lock\_request()](../classes/wp_customize_manager/handle_dismiss_autosave_or_lock_request) wp-includes/class-wp-customize-manager.php | Deletes a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock. |
| [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\_delete\_customize\_changeset\_dependent\_auto\_drafts()](_wp_delete_customize_changeset_dependent_auto_drafts) wp-includes/nav-menu.php | Deletes auto-draft posts associated with the supplied changeset. |
| [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. |
| [WP\_REST\_Revisions\_Controller::delete\_item()](../classes/wp_rest_revisions_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Deletes a single revision. |
| [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. |
| [WP\_Customize\_Nav\_Menu\_Item\_Setting::update()](../classes/wp_customize_nav_menu_item_setting/update) wp-includes/customize/class-wp-customize-nav-menu-item-setting.php | Creates/updates the nav\_menu\_item post for this setting. |
| [wpmu\_delete\_user()](wpmu_delete_user) wp-admin/includes/ms.php | Delete a user from the network and remove from all sites. |
| [wp\_delete\_user()](wp_delete_user) wp-admin/includes/user.php | Remove user and optionally reassign posts and links to another user. |
| [wp\_ajax\_save\_attachment()](wp_ajax_save_attachment) wp-admin/includes/ajax-actions.php | Ajax handler for updating attachment attributes. |
| [wp\_ajax\_delete\_post()](wp_ajax_delete_post) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a post. |
| [wp\_ajax\_delete\_page()](wp_ajax_delete_page) wp-admin/includes/ajax-actions.php | Ajax handler to delete a page. |
| [\_wp\_delete\_orphaned\_draft\_menu\_items()](_wp_delete_orphaned_draft_menu_items) wp-admin/includes/nav-menu.php | Deletes orphaned draft menu items |
| [wp\_nav\_menu\_update\_menu\_items()](wp_nav_menu_update_menu_items) wp-admin/includes/nav-menu.php | Saves nav menu items |
| [wp\_scheduled\_delete()](wp_scheduled_delete) wp-includes/functions.php | Permanently deletes comments or posts of any type that have held a status of ‘trash’ for the number of days defined in EMPTY\_TRASH\_DAYS. |
| [wp\_delete\_auto\_drafts()](wp_delete_auto_drafts) wp-includes/post.php | Deletes auto-drafts for new posts that are > 7 days old. |
| [wp\_trash\_post()](wp_trash_post) wp-includes/post.php | Moves a post or page to the Trash |
| [wp\_delete\_post\_revision()](wp_delete_post_revision) wp-includes/revision.php | Deletes a revision. |
| [\_wp\_delete\_post\_menu\_item()](_wp_delete_post_menu_item) wp-includes/nav-menu.php | Callback for handling a menu item when its original object is deleted. |
| [\_wp\_delete\_tax\_menu\_item()](_wp_delete_tax_menu_item) wp-includes/nav-menu.php | Serves as a callback for handling a menu item when its original object is deleted. |
| [wp\_delete\_nav\_menu()](wp_delete_nav_menu) wp-includes/nav-menu.php | Deletes a navigation menu. |
| [wp\_xmlrpc\_server::blogger\_deletePost()](../classes/wp_xmlrpc_server/blogger_deletepost) wp-includes/class-wp-xmlrpc-server.php | Remove a post. |
| [wp\_xmlrpc\_server::wp\_deletePage()](../classes/wp_xmlrpc_server/wp_deletepage) wp-includes/class-wp-xmlrpc-server.php | Delete page. |
| [wp\_xmlrpc\_server::wp\_deletePost()](../classes/wp_xmlrpc_server/wp_deletepost) wp-includes/class-wp-xmlrpc-server.php | Delete a post for any registered post type. |
| Version | Description |
| --- | --- |
| [1.0.0](https://developer.wordpress.org/reference/since/1.0.0/) | Introduced. |
| programming_docs |
wordpress get_locale(): string get\_locale(): string
=====================
Retrieves the current locale.
If the locale is set, then it will filter the locale in the [‘locale’](../hooks/locale) filter hook and return the value.
If the locale is not set already, then the WPLANG constant is used if it is defined. Then it is filtered through the [‘locale’](../hooks/locale) filter hook and the value for the locale global set and the locale is returned.
The process to get the locale should only be done once, but the locale will always be filtered using the [‘locale’](../hooks/locale) hook.
string The locale of the blog or from the ['locale'](../hooks/locale) hook.
File: `wp-includes/l10n.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
```
function get_locale() {
global $locale, $wp_local_package;
if ( isset( $locale ) ) {
/** This filter is documented in wp-includes/l10n.php */
return apply_filters( 'locale', $locale );
}
if ( isset( $wp_local_package ) ) {
$locale = $wp_local_package;
}
// WPLANG was defined in wp-config.
if ( defined( 'WPLANG' ) ) {
$locale = WPLANG;
}
// If multisite, check options.
if ( is_multisite() ) {
// Don't check blog option when installing.
if ( wp_installing() ) {
$ms_locale = get_site_option( 'WPLANG' );
} else {
$ms_locale = get_option( 'WPLANG' );
if ( false === $ms_locale ) {
$ms_locale = get_site_option( 'WPLANG' );
}
}
if ( false !== $ms_locale ) {
$locale = $ms_locale;
}
} else {
$db_locale = get_option( 'WPLANG' );
if ( false !== $db_locale ) {
$locale = $db_locale;
}
}
if ( empty( $locale ) ) {
$locale = 'en_US';
}
/**
* Filters the locale ID of the WordPress installation.
*
* @since 1.5.0
*
* @param string $locale The locale ID.
*/
return apply_filters( 'locale', $locale );
}
```
[apply\_filters( 'locale', string $locale )](../hooks/locale)
Filters the locale ID of the WordPress installation.
| Uses | Description |
| --- | --- |
| [wp\_installing()](wp_installing) wp-includes/load.php | Check or set whether WordPress is in “installation” mode. |
| [is\_multisite()](is_multisite) wp-includes/load.php | If Multisite is enabled. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_site\_option()](get_site_option) wp-includes/option.php | Retrieve an option value for the current network based on name of option. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Used By | Description |
| --- | --- |
| [wpmu\_new\_site\_admin\_notification()](wpmu_new_site_admin_notification) wp-includes/ms-functions.php | Notifies the Multisite network administrator that a new site was created. |
| [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. |
| [WP\_Debug\_Data::debug\_data()](../classes/wp_debug_data/debug_data) wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required. |
| [populate\_network\_meta()](populate_network_meta) wp-admin/includes/schema.php | Creates WordPress network meta and sets the default values. |
| [determine\_locale()](determine_locale) wp-includes/l10n.php | Determines the current locale desired for the request. |
| [\_wp\_privacy\_send\_erasure\_fulfillment\_notification()](_wp_privacy_send_erasure_fulfillment_notification) wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
| [wp\_send\_user\_request()](wp_send_user_request) wp-includes/user.php | Send a confirmation request email to confirm an action. |
| [wp\_privacy\_send\_personal\_data\_export\_email()](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 |
| [get\_user\_locale()](get_user_locale) wp-includes/l10n.php | Retrieves the locale of a user. |
| [wp\_maybe\_decline\_date()](wp_maybe_decline_date) wp-includes/functions.php | Determines if the date should be declined. |
| [translations\_api()](translations_api) wp-admin/includes/translation-install.php | Retrieve translations from WordPress Translation API. |
| [login\_header()](login_header) wp-login.php | Output the login page header. |
| [insert\_with\_markers()](insert_with_markers) wp-admin/includes/misc.php | Inserts an array of strings into a file (.htaccess), placing it between BEGIN and END markers. |
| [list\_core\_update()](list_core_update) wp-admin/update-core.php | Lists available core updates. |
| [list\_translation\_updates()](list_translation_updates) wp-admin/update-core.php | Display the update translations form. |
| [get\_locale\_stylesheet\_uri()](get_locale_stylesheet_uri) wp-includes/theme.php | Retrieves the localized stylesheet URI. |
| [remove\_accents()](remove_accents) wp-includes/formatting.php | Converts all accent characters to ASCII characters. |
| [wp\_new\_user\_notification()](wp_new_user_notification) wp-includes/pluggable.php | Emails login credentials to a newly-registered user. |
| [wp\_notify\_postauthor()](wp_notify_postauthor) wp-includes/pluggable.php | Notifies an author (and/or others) of a comment/trackback/pingback on a post. |
| [wp\_notify\_moderator()](wp_notify_moderator) wp-includes/pluggable.php | Notifies the moderator of the site about a new comment that is awaiting approval. |
| [wp\_timezone\_choice()](wp_timezone_choice) wp-includes/functions.php | Gives a nicely-formatted list of timezone strings. |
| [wp\_version\_check()](wp_version_check) wp-includes/update.php | Checks WordPress version against the newest version. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress _get_plugin_from_callback( callable $callback ): array|null \_get\_plugin\_from\_callback( callable $callback ): array|null
===============================================================
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.
Internal helper function to find the plugin from a meta box callback.
`$callback` callable Required The callback function to check. array|null The plugin that the callback belongs to, or null if it doesn't belong to a plugin.
File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
function _get_plugin_from_callback( $callback ) {
try {
if ( is_array( $callback ) ) {
$reflection = new ReflectionMethod( $callback[0], $callback[1] );
} elseif ( is_string( $callback ) && false !== strpos( $callback, '::' ) ) {
$reflection = new ReflectionMethod( $callback );
} else {
$reflection = new ReflectionFunction( $callback );
}
} catch ( ReflectionException $exception ) {
// We could not properly reflect on the callable, so we abort here.
return null;
}
// Don't show an error if it's an internal PHP function.
if ( ! $reflection->isInternal() ) {
// Only show errors if the meta box was registered by a plugin.
$filename = wp_normalize_path( $reflection->getFileName() );
$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
if ( strpos( $filename, $plugin_dir ) === 0 ) {
$filename = str_replace( $plugin_dir, '', $filename );
$filename = preg_replace( '|^/([^/]*/).*$|', '\\1', $filename );
$plugins = get_plugins();
foreach ( $plugins as $name => $plugin ) {
if ( strpos( $name, $filename ) === 0 ) {
return $plugin;
}
}
}
}
return null;
}
```
| Uses | Description |
| --- | --- |
| [get\_plugins()](get_plugins) wp-admin/includes/plugin.php | Checks the plugins directory and retrieve all plugin files with plugin data. |
| [wp\_normalize\_path()](wp_normalize_path) wp-includes/functions.php | Normalizes a filesystem path. |
| Used By | Description |
| --- | --- |
| [do\_block\_editor\_incompatible\_meta\_box()](do_block_editor_incompatible_meta_box) wp-admin/includes/template.php | Renders a “fake” meta box with an information message, shown on the block editor, when an incompatible meta box is found. |
| [do\_meta\_boxes()](do_meta_boxes) wp-admin/includes/template.php | Meta-Box template function. |
| Version | Description |
| --- | --- |
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |
wordpress wp_untrash_comment( int|WP_Comment $comment_id ): bool wp\_untrash\_comment( int|WP\_Comment $comment\_id ): bool
==========================================================
Removes a comment from the Trash
`$comment_id` int|[WP\_Comment](../classes/wp_comment) Required Comment ID or [WP\_Comment](../classes/wp_comment) object. bool True on success, false on failure.
File: `wp-includes/comment.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
```
function wp_untrash_comment( $comment_id ) {
$comment = get_comment( $comment_id );
if ( ! $comment ) {
return false;
}
/**
* Fires immediately before a comment is restored from the Trash.
*
* @since 2.9.0
* @since 4.9.0 Added the `$comment` parameter.
*
* @param string $comment_id The comment ID as a numeric string.
* @param WP_Comment $comment The comment to be untrashed.
*/
do_action( 'untrash_comment', $comment->comment_ID, $comment );
$status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );
if ( empty( $status ) ) {
$status = '0';
}
if ( wp_set_comment_status( $comment, $status ) ) {
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
/**
* Fires immediately after a comment is restored from the Trash.
*
* @since 2.9.0
* @since 4.9.0 Added the `$comment` parameter.
*
* @param string $comment_id The comment ID as a numeric string.
* @param WP_Comment $comment The untrashed comment.
*/
do_action( 'untrashed_comment', $comment->comment_ID, $comment );
return true;
}
return false;
}
```
[do\_action( 'untrashed\_comment', string $comment\_id, WP\_Comment $comment )](../hooks/untrashed_comment)
Fires immediately after a comment is restored from the Trash.
[do\_action( 'untrash\_comment', string $comment\_id, WP\_Comment $comment )](../hooks/untrash_comment)
Fires immediately before a comment is restored from the Trash.
| Uses | Description |
| --- | --- |
| [get\_comment\_meta()](get_comment_meta) wp-includes/comment.php | Retrieves comment meta field for a comment. |
| [wp\_set\_comment\_status()](wp_set_comment_status) wp-includes/comment.php | Sets the status of a comment. |
| [delete\_comment\_meta()](delete_comment_meta) wp-includes/comment.php | Removes metadata matching criteria from a comment. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [get\_comment()](get_comment) wp-includes/comment.php | Retrieves comment data given a comment ID or comment object. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Comments\_Controller::handle\_status\_param()](../classes/wp_rest_comments_controller/handle_status_param) wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Sets the comment\_status of a given comment object when creating or updating a comment. |
| [wp\_ajax\_delete\_comment()](wp_ajax_delete_comment) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a comment. |
| Version | Description |
| --- | --- |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress get_block_template( string $id, string $template_type = 'wp_template' ): WP_Block_Template|null get\_block\_template( string $id, string $template\_type = 'wp\_template' ): WP\_Block\_Template|null
=====================================================================================================
Retrieves a single unified template object using its id.
`$id` string Required Template unique identifier (example: theme\_slug//template\_slug). `$template_type` string Optional Template type: `'wp_template'` or '`wp_template_part'`.
Default `'wp_template'`. Default: `'wp_template'`
[WP\_Block\_Template](../classes/wp_block_template)|null Template.
File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
function get_block_template( $id, $template_type = 'wp_template' ) {
/**
* Filters the block template object before the query takes place.
*
* Return a non-null value to bypass the WordPress queries.
*
* @since 5.9.0
*
* @param WP_Block_Template|null $block_template Return block template object to short-circuit the default query,
* or null to allow WP to run its normal queries.
* @param string $id Template unique identifier (example: theme_slug//template_slug).
* @param string $template_type Template type: `'wp_template'` or '`wp_template_part'`.
*/
$block_template = apply_filters( 'pre_get_block_template', null, $id, $template_type );
if ( ! is_null( $block_template ) ) {
return $block_template;
}
$parts = explode( '//', $id, 2 );
if ( count( $parts ) < 2 ) {
return null;
}
list( $theme, $slug ) = $parts;
$wp_query_args = array(
'post_name__in' => array( $slug ),
'post_type' => $template_type,
'post_status' => array( 'auto-draft', 'draft', 'publish', 'trash' ),
'posts_per_page' => 1,
'no_found_rows' => true,
'tax_query' => array(
array(
'taxonomy' => 'wp_theme',
'field' => 'name',
'terms' => $theme,
),
),
);
$template_query = new WP_Query( $wp_query_args );
$posts = $template_query->posts;
if ( count( $posts ) > 0 ) {
$template = _build_block_template_result_from_post( $posts[0] );
if ( ! is_wp_error( $template ) ) {
return $template;
}
}
$block_template = get_block_file_template( $id, $template_type );
/**
* Filters the queried block template object after it's been fetched.
*
* @since 5.9.0
*
* @param WP_Block_Template|null $block_template The found block template, or null if there isn't one.
* @param string $id Template unique identifier (example: theme_slug//template_slug).
* @param array $template_type Template type: `'wp_template'` or '`wp_template_part'`.
*/
return apply_filters( 'get_block_template', $block_template, $id, $template_type );
}
```
[apply\_filters( 'get\_block\_template', WP\_Block\_Template|null $block\_template, string $id, array $template\_type )](../hooks/get_block_template)
Filters the queried block template object after it’s been fetched.
[apply\_filters( 'pre\_get\_block\_template', WP\_Block\_Template|null $block\_template, string $id, string $template\_type )](../hooks/pre_get_block_template)
Filters the block template object before the query takes place.
| Uses | Description |
| --- | --- |
| [get\_block\_file\_template()](get_block_file_template) wp-includes/block-template-utils.php | Retrieves a unified template object based on a theme file. |
| [\_build\_block\_template\_result\_from\_post()](_build_block_template_result_from_post) wp-includes/block-template-utils.php | Builds a unified template object based a post Object. |
| [WP\_Query::\_\_construct()](../classes/wp_query/__construct) wp-includes/class-wp-query.php | Constructor. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Used By | Description |
| --- | --- |
| [block\_template\_part()](block_template_part) wp-includes/block-template-utils.php | Prints a block template part. |
| [WP\_REST\_Templates\_Controller::get\_item()](../classes/wp_rest_templates_controller/get_item) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Returns the given template |
| [WP\_REST\_Templates\_Controller::update\_item()](../classes/wp_rest_templates_controller/update_item) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Updates a single template. |
| [WP\_REST\_Templates\_Controller::create\_item()](../classes/wp_rest_templates_controller/create_item) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Creates a single template. |
| [WP\_REST\_Templates\_Controller::delete\_item()](../classes/wp_rest_templates_controller/delete_item) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Deletes a single template. |
| [WP\_REST\_Templates\_Controller::prepare\_item\_for\_database()](../classes/wp_rest_templates_controller/prepare_item_for_database) wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Prepares a single template for create or update. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress the_category( string $separator = '', string $parents = '', int $post_id = false ) the\_category( string $separator = '', string $parents = '', int $post\_id = false )
====================================================================================
Displays category list for a post in either HTML list or custom format.
`$separator` string Optional Separator between the categories. By default, the links are placed in an unordered list. An empty string will result in the default behavior. Default: `''`
`$parents` string Optional How to display the parents. Accepts `'multiple'`, `'single'`, or empty.
Default: `''`
`$post_id` int Optional ID of the post to retrieve categories for. Defaults to the current post. Default: `false`
File: `wp-includes/category-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
```
function the_category( $separator = '', $parents = '', $post_id = false ) {
echo get_the_category_list( $separator, $parents, $post_id );
}
```
| Uses | Description |
| --- | --- |
| [get\_the\_category\_list()](get_the_category_list) wp-includes/category-template.php | Retrieves category list for a post in either HTML list or custom format. |
| Version | Description |
| --- | --- |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress wp_ajax_get_tagcloud() wp\_ajax\_get\_tagcloud()
=========================
Ajax handler for getting a tagcloud.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
function wp_ajax_get_tagcloud() {
if ( ! isset( $_POST['tax'] ) ) {
wp_die( 0 );
}
$taxonomy = sanitize_key( $_POST['tax'] );
$taxonomy_object = get_taxonomy( $taxonomy );
if ( ! $taxonomy_object ) {
wp_die( 0 );
}
if ( ! current_user_can( $taxonomy_object->cap->assign_terms ) ) {
wp_die( -1 );
}
$tags = get_terms(
array(
'taxonomy' => $taxonomy,
'number' => 45,
'orderby' => 'count',
'order' => 'DESC',
)
);
if ( empty( $tags ) ) {
wp_die( $taxonomy_object->labels->not_found );
}
if ( is_wp_error( $tags ) ) {
wp_die( $tags->get_error_message() );
}
foreach ( $tags as $key => $tag ) {
$tags[ $key ]->link = '#';
$tags[ $key ]->id = $tag->term_id;
}
// We need raw tag names here, so don't filter the output.
$return = wp_generate_tag_cloud(
$tags,
array(
'filter' => 0,
'format' => 'list',
)
);
if ( empty( $return ) ) {
wp_die( 0 );
}
echo $return;
wp_die();
}
```
| Uses | Description |
| --- | --- |
| [wp\_generate\_tag\_cloud()](wp_generate_tag_cloud) wp-includes/category-template.php | Generates a tag cloud (heatmap) from provided data. |
| [get\_terms()](get_terms) wp-includes/taxonomy.php | Retrieves the terms in a given taxonomy or list of taxonomies. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [sanitize\_key()](sanitize_key) wp-includes/formatting.php | Sanitizes a string key. |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| [get\_taxonomy()](get_taxonomy) wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
| programming_docs |
wordpress wp_insert_category( array $catarr, bool $wp_error = false ): int|WP_Error wp\_insert\_category( array $catarr, bool $wp\_error = false ): int|WP\_Error
=============================================================================
Updates an existing Category or creates a new Category.
`$catarr` array Required Array of arguments for inserting a new category.
* `cat_ID`intCategory ID. A non-zero value updates an existing category.
Default 0.
* `taxonomy`stringTaxonomy slug. Default `'category'`.
* `cat_name`stringCategory name. Default empty.
* `category_description`stringCategory description. Default empty.
* `category_nicename`stringCategory nice (display) name. Default empty.
* `category_parent`int|stringCategory parent ID. Default empty.
`$wp_error` bool Optional Default: `false`
int|[WP\_Error](../classes/wp_error) The ID number of the new or updated Category on success. Zero or a [WP\_Error](../classes/wp_error) on failure, depending on param `$wp_error`.
Not all possible members of the $catarr array are listed here.
The value of category\_nicename will set the slug. (In WordPress terminology, a “nice” name is one that is sanitized for use in places like URLs. It is not meant for displaying to humans, as you might assume.)
See [wp\_create\_category()](wp_create_category) for a simpler version which takes just a string instead of an array
File: `wp-admin/includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/taxonomy.php/)
```
function wp_insert_category( $catarr, $wp_error = false ) {
$cat_defaults = array(
'cat_ID' => 0,
'taxonomy' => 'category',
'cat_name' => '',
'category_description' => '',
'category_nicename' => '',
'category_parent' => '',
);
$catarr = wp_parse_args( $catarr, $cat_defaults );
if ( '' === trim( $catarr['cat_name'] ) ) {
if ( ! $wp_error ) {
return 0;
} else {
return new WP_Error( 'cat_name', __( 'You did not enter a category name.' ) );
}
}
$catarr['cat_ID'] = (int) $catarr['cat_ID'];
// Are we updating or creating?
$update = ! empty( $catarr['cat_ID'] );
$name = $catarr['cat_name'];
$description = $catarr['category_description'];
$slug = $catarr['category_nicename'];
$parent = (int) $catarr['category_parent'];
if ( $parent < 0 ) {
$parent = 0;
}
if ( empty( $parent )
|| ! term_exists( $parent, $catarr['taxonomy'] )
|| ( $catarr['cat_ID'] && term_is_ancestor_of( $catarr['cat_ID'], $parent, $catarr['taxonomy'] ) ) ) {
$parent = 0;
}
$args = compact( 'name', 'slug', 'parent', 'description' );
if ( $update ) {
$catarr['cat_ID'] = wp_update_term( $catarr['cat_ID'], $catarr['taxonomy'], $args );
} else {
$catarr['cat_ID'] = wp_insert_term( $catarr['cat_name'], $catarr['taxonomy'], $args );
}
if ( is_wp_error( $catarr['cat_ID'] ) ) {
if ( $wp_error ) {
return $catarr['cat_ID'];
} else {
return 0;
}
}
return $catarr['cat_ID']['term_id'];
}
```
| Uses | Description |
| --- | --- |
| [wp\_update\_term()](wp_update_term) wp-includes/taxonomy.php | Updates term based on arguments provided. |
| [wp\_insert\_term()](wp_insert_term) wp-includes/taxonomy.php | Adds a new term to the database. |
| [term\_exists()](term_exists) wp-includes/taxonomy.php | Determines whether a taxonomy term exists. |
| [term\_is\_ancestor\_of()](term_is_ancestor_of) wp-includes/taxonomy.php | Checks if a term is an ancestor of another term. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [wp\_create\_category()](wp_create_category) wp-admin/includes/taxonomy.php | Adds a new category to the database if it does not already exist. |
| [wp\_update\_category()](wp_update_category) wp-admin/includes/taxonomy.php | Aliases [wp\_insert\_category()](wp_insert_category) with minimal args. |
| [wp\_xmlrpc\_server::wp\_newCategory()](../classes/wp_xmlrpc_server/wp_newcategory) wp-includes/class-wp-xmlrpc-server.php | Create new category. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | The `'taxonomy'` argument was added. |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | $wp\_error parameter was added. |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress get_the_author( string $deprecated = '' ): string|null get\_the\_author( string $deprecated = '' ): string|null
========================================================
Retrieves the author of the current post.
`$deprecated` string Optional Deprecated. Default: `''`
string|null The author's display name.
File: `wp-includes/author-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/author-template.php/)
```
function get_the_author( $deprecated = '' ) {
global $authordata;
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '2.1.0' );
}
/**
* Filters the display name of the current post's author.
*
* @since 2.9.0
*
* @param string|null $display_name The author's display name.
*/
return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );
}
```
[apply\_filters( 'the\_author', string|null $display\_name )](../hooks/the_author)
Filters the display name of the current post’s author.
| Uses | Description |
| --- | --- |
| [\_deprecated\_argument()](_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [get\_the\_author\_posts\_link()](get_the_author_posts_link) wp-includes/author-template.php | Retrieves an HTML link to the author page of the current post’s author. |
| [WP\_Posts\_List\_Table::column\_author()](../classes/wp_posts_list_table/column_author) wp-admin/includes/class-wp-posts-list-table.php | Handles the post author column output. |
| [WP\_Media\_List\_Table::column\_author()](../classes/wp_media_list_table/column_author) wp-admin/includes/class-wp-media-list-table.php | Handles the author column output. |
| [get\_the\_archive\_title()](get_the_archive_title) wp-includes/general-template.php | Retrieves the archive title based on the queried object. |
| [get\_the\_author\_link()](get_the_author_link) wp-includes/author-template.php | Retrieves either author’s link or author’s name. |
| [the\_author()](the_author) wp-includes/author-template.php | Displays the name of the author of the current post. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress signup_blog( string $user_name = '', string $user_email = '', string $blogname = '', string $blog_title = '', WP_Error|string $errors = '' ) signup\_blog( string $user\_name = '', string $user\_email = '', string $blogname = '', string $blog\_title = '', WP\_Error|string $errors = '' )
=================================================================================================================================================
Shows a form for a user or visitor to sign up for a new site.
`$user_name` string Optional The username. Default: `''`
`$user_email` string Optional The user's email address. Default: `''`
`$blogname` string Optional The site name. Default: `''`
`$blog_title` string Optional The site title. Default: `''`
`$errors` [WP\_Error](../classes/wp_error)|string Optional A [WP\_Error](../classes/wp_error) object containing existing errors. Defaults to empty string. Default: `''`
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
function signup_blog( $user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '' ) {
if ( ! is_wp_error( $errors ) ) {
$errors = new WP_Error();
}
$signup_blog_defaults = array(
'user_name' => $user_name,
'user_email' => $user_email,
'blogname' => $blogname,
'blog_title' => $blog_title,
'errors' => $errors,
);
/**
* Filters the default site creation variables for the site sign-up form.
*
* @since 3.0.0
*
* @param array $signup_blog_defaults {
* An array of default site creation variables.
*
* @type string $user_name The user username.
* @type string $user_email The user email address.
* @type string $blogname The blogname.
* @type string $blog_title The title of the site.
* @type WP_Error $errors A WP_Error object with possible errors relevant to new site creation variables.
* }
*/
$filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults );
$user_name = $filtered_results['user_name'];
$user_email = $filtered_results['user_email'];
$blogname = $filtered_results['blogname'];
$blog_title = $filtered_results['blog_title'];
$errors = $filtered_results['errors'];
if ( empty( $blogname ) ) {
$blogname = $user_name;
}
?>
<form id="setupform" method="post" action="wp-signup.php">
<input type="hidden" name="stage" value="validate-blog-signup" />
<input type="hidden" name="user_name" value="<?php echo esc_attr( $user_name ); ?>" />
<input type="hidden" name="user_email" value="<?php echo esc_attr( $user_email ); ?>" />
<?php
/** This action is documented in wp-signup.php */
do_action( 'signup_hidden_fields', 'validate-site' );
?>
<?php show_blog_form( $blogname, $blog_title, $errors ); ?>
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Sign up' ); ?>" /></p>
</form>
<?php
}
```
[apply\_filters( 'signup\_blog\_init', array $signup\_blog\_defaults )](../hooks/signup_blog_init)
Filters the default site creation variables for the site sign-up form.
[do\_action( 'signup\_hidden\_fields', string $context )](../hooks/signup_hidden_fields)
Hidden sign-up form fields output when creating another site or user.
| Uses | Description |
| --- | --- |
| [show\_blog\_form()](show_blog_form) wp-signup.php | Generates and displays the Sign-up and Create Site forms. |
| [esc\_attr\_e()](esc_attr_e) wp-includes/l10n.php | Displays translated text that has been escaped for safe use in an attribute. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [validate\_user\_signup()](validate_user_signup) wp-signup.php | Validates the new user sign-up. |
| [validate\_blog\_signup()](validate_blog_signup) wp-signup.php | Validates new site signup. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress is_home(): bool is\_home(): bool
================
Determines whether the query is for the blog homepage.
The blog homepage is the page that shows the time-based blog content of the site.
[is\_home()](is_home) is dependent on the site’s "Front page displays" Reading Settings ‘show\_on\_front’ and ‘page\_for\_posts’.
If a static page is set for the front page of the site, this function will return true only on the page you set as the "Posts page".
For more information on this and similar theme functions, check out the [Conditional Tags](https://developer.wordpress.org/themes/basics/conditional-tags/) article in the Theme Developer Handbook.
* [is\_front\_page()](is_front_page)
bool Whether the query is for the blog homepage.
Since WordPress 2.1, when the static front page functionality was introduced, the blog posts index and site front page have been treated as two different query contexts, with [is\_home()](is_home) applying to the blog posts index, and [is\_front\_page()](is_front_page) applying to the site front page.
Be careful not to confuse the two query conditionals:
* On the site front page, [is\_front\_page()](is_front_page) will always return `true`, regardless of whether the site front page displays the blog posts index or a static page.
* On the blog posts index, [is\_home()](is_home) will always return `true`, regardless of whether the blog posts index is displayed on the site front page or a separate page.
Whether [is\_home()](is_home) or [is\_front\_page()](is_front_page) return `true` or `false` depends on the values of certain option values:
* `get_option( 'show_on_front' )`: returns either `'posts'` or `'page'`
* `get_option( 'page_on_front' )`: returns the `ID` of the static page assigned to the front page
* `get_option( 'page_for_posts' )`: returns the `ID` of the static page assigned to the blog posts index (posts page)
When using these query conditionals:
* If `'posts' == get_option( 'show_on_front' )`:
+ On the site front page:
- `is_front_page()` will return `true`
- `is_home()` will return `true`
+ If assigned, WordPress ignores the pages assigned to display the site front page or the blog posts index
* If `'page' == get_option( 'show_on_front' )`:
+ On the page assigned to display the site front page:
- `is_front_page()` will return `true`
- `is_home()` will return `false`
+ On the page assigned to display the blog posts index:
- `is_front_page()` will return `false`
- `is_home()` will return `true`
[is\_home()](is_home) uses the global `$wp_query` [WP\_Query](../classes/wp_query) object. [is\_home()](is_home) isn’t usable before the [‘parse\_query’](../hooks/parse_query) action.
File: `wp-includes/query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/query.php/)
```
function is_home() {
global $wp_query;
if ( ! isset( $wp_query ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
return false;
}
return $wp_query->is_home();
}
```
| Uses | Description |
| --- | --- |
| [WP\_Query::is\_home()](../classes/wp_query/is_home) wp-includes/class-wp-query.php | Is the query for the blog homepage? |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| Used By | Description |
| --- | --- |
| [wp\_get\_document\_title()](wp_get_document_title) wp-includes/general-template.php | Returns document title for the current page. |
| [wp\_title()](wp_title) wp-includes/general-template.php | Displays or retrieves page title for all areas of blog. |
| [WP::handle\_404()](../classes/wp/handle_404) wp-includes/class-wp.php | Set the Headers for 404, if nothing is found for requested URL. |
| [get\_post\_class()](get_post_class) wp-includes/post-template.php | Retrieves an array of the class names for the post container element. |
| [get\_body\_class()](get_body_class) wp-includes/post-template.php | Retrieves an array of the class names for the body element. |
| [redirect\_canonical()](redirect_canonical) wp-includes/canonical.php | Redirects incoming links to the proper URL based on the site url. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress force_ssl_admin( string|bool $force = null ): bool force\_ssl\_admin( string|bool $force = null ): bool
====================================================
Determines whether to force SSL used for the Administration Screens.
`$force` string|bool Optional Whether to force SSL in admin screens. Default: `null`
bool True if forced, false if not forced.
Determine whether the administration panel should be viewed over SSL. This function relies on the [FORCE\_SSL\_ADMIN](https://wordpress.org/support/article/administration-over-ssl/ "Administration Over SSL") constant that is set in the [wp-config.php file](https://wordpress.org/support/article/editing-wp-config-php/ "Editing wp-config.php") if you’re using your site [over SSL](https://wordpress.org/support/article/administration-over-ssl/ "Administration Over SSL").
The [force](https://codex.wordpress.org/Function_Reference/force_ssl_admin#Parameters) parameter will change the [return value](https://codex.wordpress.org/Function_Reference/force_ssl_admin#Returns) of this function until it is reset.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function force_ssl_admin( $force = null ) {
static $forced = false;
if ( ! is_null( $force ) ) {
$old_forced = $forced;
$forced = $force;
return $old_forced;
}
return $forced;
}
```
| Used By | Description |
| --- | --- |
| [get\_rest\_url()](get_rest_url) wp-includes/rest-api.php | Retrieves the URL to a REST endpoint on a site. |
| [auth\_redirect()](auth_redirect) wp-includes/pluggable.php | Checks if a user is logged in, if not it redirects them to the login page. |
| [force\_ssl\_login()](force_ssl_login) wp-includes/deprecated.php | Whether SSL login should be forced. |
| [wp\_ssl\_constants()](wp_ssl_constants) wp-includes/default-constants.php | Defines SSL-related WordPress constants. |
| [set\_url\_scheme()](set_url_scheme) wp-includes/link-template.php | Sets the scheme for a URL. |
| Version | Description |
| --- | --- |
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |
wordpress wp_kses_allowed_html( string|array $context = '' ): array wp\_kses\_allowed\_html( string|array $context = '' ): array
============================================================
Returns an array of allowed HTML tags and attributes for a given context.
`$context` string|array Optional The context for which to retrieve tags. Allowed values are `'post'`, `'strip'`, `'data'`, `'entities'`, or the name of a field filter such as `'pre_user_description'`, or an array of allowed HTML elements and attributes. Default: `''`
array Array of allowed HTML tags and their allowed attributes.
The Return value is a multidimensional array with the tag name as the key and an array of attributes as the value.
File: `wp-includes/kses.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/kses.php/)
```
function wp_kses_allowed_html( $context = '' ) {
global $allowedposttags, $allowedtags, $allowedentitynames;
if ( is_array( $context ) ) {
// When `$context` is an array it's actually an array of allowed HTML elements and attributes.
$html = $context;
$context = 'explicit';
/**
* 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.
*
* @since 3.5.0
*
* @param array[] $html Allowed HTML tags.
* @param string $context Context name.
*/
return apply_filters( 'wp_kses_allowed_html', $html, $context );
}
switch ( $context ) {
case 'post':
/** This filter is documented in wp-includes/kses.php */
$tags = apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context );
// 5.0.1 removed the `<form>` tag, allow it if a filter is allowing it's sub-elements `<input>` or `<select>`.
if ( ! CUSTOM_TAGS && ! isset( $tags['form'] ) && ( isset( $tags['input'] ) || isset( $tags['select'] ) ) ) {
$tags = $allowedposttags;
$tags['form'] = array(
'action' => true,
'accept' => true,
'accept-charset' => true,
'enctype' => true,
'method' => true,
'name' => true,
'target' => true,
);
/** This filter is documented in wp-includes/kses.php */
$tags = apply_filters( 'wp_kses_allowed_html', $tags, $context );
}
return $tags;
case 'user_description':
case 'pre_user_description':
$tags = $allowedtags;
$tags['a']['rel'] = true;
/** This filter is documented in wp-includes/kses.php */
return apply_filters( 'wp_kses_allowed_html', $tags, $context );
case 'strip':
/** This filter is documented in wp-includes/kses.php */
return apply_filters( 'wp_kses_allowed_html', array(), $context );
case 'entities':
/** This filter is documented in wp-includes/kses.php */
return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context );
case 'data':
default:
/** This filter is documented in wp-includes/kses.php */
return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context );
}
}
```
[apply\_filters( 'wp\_kses\_allowed\_html', array[] $html, string $context )](../hooks/wp_kses_allowed_html)
Filters the HTML tags that are allowed for a given context.
| Uses | Description |
| --- | --- |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [wp\_get\_code\_editor\_settings()](wp_get_code_editor_settings) wp-includes/general-template.php | Generates and returns code editor settings. |
| [WP\_Widget\_Custom\_HTML::render\_control\_template\_scripts()](../classes/wp_widget_custom_html/render_control_template_scripts) wp-includes/widgets/class-wp-widget-custom-html.php | Render form template scripts. |
| [wp\_kses\_one\_attr()](wp_kses_one_attr) wp-includes/kses.php | Filters one HTML attribute and ensures its value is allowed. |
| [wp\_kses\_attr()](wp_kses_attr) wp-includes/kses.php | Removes all attributes, if none are allowed for this element. |
| [gallery\_shortcode()](gallery_shortcode) wp-includes/media.php | Builds the Gallery shortcode output. |
| Version | Description |
| --- | --- |
| [5.0.1](https://developer.wordpress.org/reference/since/5.0.1/) | `form` removed as allowable HTML tag. |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
| programming_docs |
wordpress wp_footer() wp\_footer()
============
Fires the wp\_footer action.
See [‘wp\_footer’](../hooks/wp_footer).
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
function wp_footer() {
/**
* Prints scripts or data before the closing body tag on the front end.
*
* @since 1.5.1
*/
do_action( 'wp_footer' );
}
```
[do\_action( 'wp\_footer' )](../hooks/wp_footer)
Prints scripts or data before the closing body tag on the front end.
| Uses | Description |
| --- | --- |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Widget\_Types\_Controller::render\_legacy\_widget\_preview\_iframe()](../classes/wp_rest_widget_types_controller/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 |
| --- | --- |
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |
wordpress can_edit_network( int $network_id ): bool can\_edit\_network( int $network\_id ): bool
============================================
Whether or not we can edit this network from this page.
By default editing of network is restricted to the Network Admin for that `$network_id`.
This function allows for this to be overridden.
`$network_id` int Required The network ID to check. bool True if network can be edited, otherwise false.
File: `wp-admin/includes/ms.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ms.php/)
```
function can_edit_network( $network_id ) {
if ( get_current_network_id() === (int) $network_id ) {
$result = true;
} else {
$result = false;
}
/**
* Filters whether this network can be edited from this page.
*
* @since 3.1.0
*
* @param bool $result Whether the network can be edited from this page.
* @param int $network_id The network ID to check.
*/
return apply_filters( 'can_edit_network', $result, $network_id );
}
```
[apply\_filters( 'can\_edit\_network', bool $result, int $network\_id )](../hooks/can_edit_network)
Filters whether this network can be edited from this page.
| Uses | Description |
| --- | --- |
| [get\_current\_network\_id()](get_current_network_id) wp-includes/load.php | Retrieves the current network ID. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [WP\_MS\_Users\_List\_Table::column\_blogs()](../classes/wp_ms_users_list_table/column_blogs) wp-admin/includes/class-wp-ms-users-list-table.php | Handles the sites column output. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress wp_trash_post_comments( int|WP_Post|null $post = null ): mixed|void wp\_trash\_post\_comments( int|WP\_Post|null $post = null ): mixed|void
=======================================================================
Moves comments for a post to the Trash.
`$post` int|[WP\_Post](../classes/wp_post)|null Optional Post ID or post object. Defaults to global $post. Default: `null`
mixed|void False on failure.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
function wp_trash_post_comments( $post = null ) {
global $wpdb;
$post = get_post( $post );
if ( ! $post ) {
return;
}
$post_id = $post->ID;
/**
* Fires before comments are sent to the Trash.
*
* @since 2.9.0
*
* @param int $post_id Post ID.
*/
do_action( 'trash_post_comments', $post_id );
$comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) );
if ( ! $comments ) {
return;
}
// Cache current status for each comment.
$statuses = array();
foreach ( $comments as $comment ) {
$statuses[ $comment->comment_ID ] = $comment->comment_approved;
}
add_post_meta( $post_id, '_wp_trash_meta_comments_status', $statuses );
// Set status for all comments to post-trashed.
$result = $wpdb->update( $wpdb->comments, array( 'comment_approved' => 'post-trashed' ), array( 'comment_post_ID' => $post_id ) );
clean_comment_cache( array_keys( $statuses ) );
/**
* Fires after comments are sent to the Trash.
*
* @since 2.9.0
*
* @param int $post_id Post ID.
* @param array $statuses Array of comment statuses.
*/
do_action( 'trashed_post_comments', $post_id, $statuses );
return $result;
}
```
[do\_action( 'trashed\_post\_comments', int $post\_id, array $statuses )](../hooks/trashed_post_comments)
Fires after comments are sent to the Trash.
[do\_action( 'trash\_post\_comments', int $post\_id )](../hooks/trash_post_comments)
Fires before comments are sent to the Trash.
| Uses | Description |
| --- | --- |
| [add\_post\_meta()](add_post_meta) wp-includes/post.php | Adds a meta field to the given post. |
| [wpdb::update()](../classes/wpdb/update) wp-includes/class-wpdb.php | Updates a row in the table. |
| [clean\_comment\_cache()](clean_comment_cache) wp-includes/comment.php | Removes a comment from the object cache. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| [wpdb::get\_results()](../classes/wpdb/get_results) wp-includes/class-wpdb.php | Retrieves an entire SQL result set from the database (i.e., many rows). |
| [wpdb::prepare()](../classes/wpdb/prepare) wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
| 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()](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 _wp_remove_unregistered_widgets( array $sidebars_widgets, array $allowed_widget_ids = array() ): array \_wp\_remove\_unregistered\_widgets( array $sidebars\_widgets, array $allowed\_widget\_ids = array() ): array
=============================================================================================================
Compares a list of sidebars with their widgets against an allowed list.
`$sidebars_widgets` array Required List of sidebars and their widget instance IDs. `$allowed_widget_ids` array Optional List of widget IDs to compare against. Default: Registered widgets. Default: `array()`
array Sidebars with allowed widgets.
File: `wp-includes/widgets.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
```
function _wp_remove_unregistered_widgets( $sidebars_widgets, $allowed_widget_ids = array() ) {
if ( empty( $allowed_widget_ids ) ) {
$allowed_widget_ids = array_keys( $GLOBALS['wp_registered_widgets'] );
}
foreach ( $sidebars_widgets as $sidebar => $widgets ) {
if ( is_array( $widgets ) ) {
$sidebars_widgets[ $sidebar ] = array_intersect( $widgets, $allowed_widget_ids );
}
}
return $sidebars_widgets;
}
```
| Used By | Description |
| --- | --- |
| [wp\_map\_sidebars\_widgets()](wp_map_sidebars_widgets) wp-includes/widgets.php | Compares a list of sidebars with their widgets against an allowed list. |
| [retrieve\_widgets()](retrieve_widgets) wp-includes/widgets.php | Validates and remaps any “orphaned” widgets to wp\_inactive\_widgets sidebar, and saves the widget settings. This has to run at least on each theme change. |
| Version | Description |
| --- | --- |
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |
wordpress wp_update_category( array $catarr ): int|false wp\_update\_category( array $catarr ): int|false
================================================
Aliases [wp\_insert\_category()](wp_insert_category) with minimal args.
If you want to update only some fields of an existing category, call this function with only the new values set inside $catarr.
`$catarr` array Required The `'cat_ID'` value is required. All other keys are optional. int|false The ID number of the new or updated Category on success. Zero or FALSE on failure.
File: `wp-admin/includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/taxonomy.php/)
```
function wp_update_category( $catarr ) {
$cat_ID = (int) $catarr['cat_ID'];
if ( isset( $catarr['category_parent'] ) && ( $cat_ID == $catarr['category_parent'] ) ) {
return false;
}
// First, get all of the original fields.
$category = get_term( $cat_ID, 'category', ARRAY_A );
_make_cat_compat( $category );
// Escape data pulled from DB.
$category = wp_slash( $category );
// Merge old and new fields with new fields overwriting old ones.
$catarr = array_merge( $category, $catarr );
return wp_insert_category( $catarr );
}
```
| Uses | Description |
| --- | --- |
| [wp\_insert\_category()](wp_insert_category) wp-admin/includes/taxonomy.php | Updates an existing Category or creates a new Category. |
| [\_make\_cat\_compat()](_make_cat_compat) wp-includes/category.php | Updates category structure to old pre-2.3 from new taxonomy structure. |
| [wp\_slash()](wp_slash) wp-includes/formatting.php | Adds slashes to a string or recursively adds slashes to strings within an array. |
| [get\_term()](get_term) wp-includes/taxonomy.php | Gets all term data from database by term ID. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress _get_block_templates_files( string $template_type ): array \_get\_block\_templates\_files( string $template\_type ): 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.
Retrieves the template files from the theme.
`$template_type` string Required `'wp_template'` or `'wp_template_part'`. array Template.
File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
function _get_block_templates_files( $template_type ) {
if ( 'wp_template' !== $template_type && 'wp_template_part' !== $template_type ) {
return null;
}
$themes = array(
get_stylesheet() => get_stylesheet_directory(),
get_template() => get_template_directory(),
);
$template_files = array();
foreach ( $themes as $theme_slug => $theme_dir ) {
$template_base_paths = get_block_theme_folders( $theme_slug );
$theme_template_files = _get_block_templates_paths( $theme_dir . '/' . $template_base_paths[ $template_type ] );
foreach ( $theme_template_files as $template_file ) {
$template_base_path = $template_base_paths[ $template_type ];
$template_slug = substr(
$template_file,
// Starting position of slug.
strpos( $template_file, $template_base_path . DIRECTORY_SEPARATOR ) + 1 + strlen( $template_base_path ),
// Subtract ending '.html'.
-5
);
$new_template_item = array(
'slug' => $template_slug,
'path' => $template_file,
'theme' => $theme_slug,
'type' => $template_type,
);
if ( 'wp_template_part' === $template_type ) {
$template_files[] = _add_block_template_part_area_info( $new_template_item );
}
if ( 'wp_template' === $template_type ) {
$template_files[] = _add_block_template_info( $new_template_item );
}
}
}
return $template_files;
}
```
| Uses | Description |
| --- | --- |
| [\_get\_block\_templates\_paths()](_get_block_templates_paths) wp-includes/block-template-utils.php | Finds all nested template part file paths in a theme’s directory. |
| [\_add\_block\_template\_part\_area\_info()](_add_block_template_part_area_info) wp-includes/block-template-utils.php | Attempts to add the template part’s area information to the input template. |
| [\_add\_block\_template\_info()](_add_block_template_info) wp-includes/block-template-utils.php | Attempts to add custom template information to the template item. |
| [get\_block\_theme\_folders()](get_block_theme_folders) wp-includes/block-template-utils.php | For backward compatibility reasons, block themes might be using block-templates or block-template-parts, this function ensures we fallback to these folders properly. |
| [get\_stylesheet\_directory()](get_stylesheet_directory) wp-includes/theme.php | Retrieves stylesheet directory path for the active theme. |
| [get\_template()](get_template) wp-includes/theme.php | Retrieves name of the active theme. |
| [get\_template\_directory()](get_template_directory) wp-includes/theme.php | Retrieves template directory path for the active theme. |
| [get\_stylesheet()](get_stylesheet) wp-includes/theme.php | Retrieves name of the current stylesheet. |
| Used By | Description |
| --- | --- |
| [get\_block\_templates()](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 wp_admin_bar_add_secondary_groups( WP_Admin_Bar $wp_admin_bar ) wp\_admin\_bar\_add\_secondary\_groups( WP\_Admin\_Bar $wp\_admin\_bar )
========================================================================
Adds secondary menus.
`$wp_admin_bar` [WP\_Admin\_Bar](../classes/wp_admin_bar) Required The [WP\_Admin\_Bar](../classes/wp_admin_bar) instance. File: `wp-includes/admin-bar.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
```
function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {
$wp_admin_bar->add_group(
array(
'id' => 'top-secondary',
'meta' => array(
'class' => 'ab-top-secondary',
),
)
);
$wp_admin_bar->add_group(
array(
'parent' => 'wp-logo',
'id' => 'wp-logo-external',
'meta' => array(
'class' => 'ab-sub-secondary',
),
)
);
}
```
| Uses | Description |
| --- | --- |
| [WP\_Admin\_Bar::add\_group()](../classes/wp_admin_bar/add_group) wp-includes/class-wp-admin-bar.php | Adds a group to a toolbar menu node. |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |
wordpress get_the_post_navigation( array $args = array() ): string get\_the\_post\_navigation( array $args = array() ): string
===========================================================
Retrieves the navigation to next/previous post, when applicable.
`$args` array Optional Default post navigation arguments.
* `prev_text`stringAnchor text to display in the previous post link. Default `'%title'`.
* `next_text`stringAnchor text to display in the next post link. Default `'%title'`.
* `in_same_term`boolWhether link should be in a same taxonomy term. Default false.
* `excluded_terms`int[]|stringArray or comma-separated list of excluded term IDs.
* `taxonomy`stringTaxonomy, if `$in_same_term` is true. Default `'category'`.
* `screen_reader_text`stringScreen reader text for the nav element. Default 'Post navigation'.
* `aria_label`stringARIA label text for the nav element. Default `'Posts'`.
* `class`stringCustom class for the nav element. Default `'post-navigation'`.
Default: `array()`
string Markup for post links.
File: `wp-includes/link-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
```
function get_the_post_navigation( $args = array() ) {
// Make sure the nav element has an aria-label attribute: fallback to the screen reader text.
if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) {
$args['aria_label'] = $args['screen_reader_text'];
}
$args = wp_parse_args(
$args,
array(
'prev_text' => '%title',
'next_text' => '%title',
'in_same_term' => false,
'excluded_terms' => '',
'taxonomy' => 'category',
'screen_reader_text' => __( 'Post navigation' ),
'aria_label' => __( 'Posts' ),
'class' => 'post-navigation',
)
);
$navigation = '';
$previous = get_previous_post_link(
'<div class="nav-previous">%link</div>',
$args['prev_text'],
$args['in_same_term'],
$args['excluded_terms'],
$args['taxonomy']
);
$next = get_next_post_link(
'<div class="nav-next">%link</div>',
$args['next_text'],
$args['in_same_term'],
$args['excluded_terms'],
$args['taxonomy']
);
// Only add markup if there's somewhere to navigate to.
if ( $previous || $next ) {
$navigation = _navigation_markup( $previous . $next, $args['class'], $args['screen_reader_text'], $args['aria_label'] );
}
return $navigation;
}
```
| Uses | Description |
| --- | --- |
| [\_navigation\_markup()](_navigation_markup) wp-includes/link-template.php | Wraps passed links in navigational markup. |
| [get\_previous\_post\_link()](get_previous_post_link) wp-includes/link-template.php | Retrieves the previous post link that is adjacent to the current post. |
| [get\_next\_post\_link()](get_next_post_link) wp-includes/link-template.php | Retrieves the next post link that is adjacent to the current post. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [wp\_parse\_args()](wp_parse_args) wp-includes/functions.php | Merges user defined arguments into defaults array. |
| Used By | Description |
| --- | --- |
| [the\_post\_navigation()](the_post_navigation) wp-includes/link-template.php | Displays the navigation to next/previous post, when applicable. |
| Version | Description |
| --- | --- |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `class` parameter. |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Added the `aria_label` parameter. |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced the `in_same_term`, `excluded_terms`, and `taxonomy` arguments. |
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |
wordpress do_feed_rss2( bool $for_comments ) do\_feed\_rss2( bool $for\_comments )
=====================================
Loads either the RSS2 comment feed or the RSS2 posts feed.
* [load\_template()](load_template)
`$for_comments` bool Required True for the comment feed, false for normal feed. File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function do_feed_rss2( $for_comments ) {
if ( $for_comments ) {
load_template( ABSPATH . WPINC . '/feed-rss2-comments.php' );
} else {
load_template( ABSPATH . WPINC . '/feed-rss2.php' );
}
}
```
| Uses | Description |
| --- | --- |
| [load\_template()](load_template) wp-includes/template.php | Requires the template file with WordPress environment. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |
| programming_docs |
wordpress wp_date( string $format, int $timestamp = null, DateTimeZone $timezone = null ): string|false wp\_date( string $format, int $timestamp = null, DateTimeZone $timezone = null ): string|false
==============================================================================================
Retrieves the date, in localized format.
This is a newer function, intended to replace `date_i18n()` without legacy quirks in it.
Note that, unlike `date_i18n()`, this function accepts a true Unix timestamp, not summed with timezone offset.
`$format` string Required PHP date format. `$timestamp` int Optional Unix timestamp. Defaults to current time. Default: `null`
`$timezone` DateTimeZone Optional Timezone to output result in. Defaults to timezone from site settings. Default: `null`
string|false The date, translated if locale specifies it. False on invalid timestamp input.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function wp_date( $format, $timestamp = null, $timezone = null ) {
global $wp_locale;
if ( null === $timestamp ) {
$timestamp = time();
} elseif ( ! is_numeric( $timestamp ) ) {
return false;
}
if ( ! $timezone ) {
$timezone = wp_timezone();
}
$datetime = date_create( '@' . $timestamp );
$datetime->setTimezone( $timezone );
if ( empty( $wp_locale->month ) || empty( $wp_locale->weekday ) ) {
$date = $datetime->format( $format );
} else {
// We need to unpack shorthand `r` format because it has parts that might be localized.
$format = preg_replace( '/(?<!\\\\)r/', DATE_RFC2822, $format );
$new_format = '';
$format_length = strlen( $format );
$month = $wp_locale->get_month( $datetime->format( 'm' ) );
$weekday = $wp_locale->get_weekday( $datetime->format( 'w' ) );
for ( $i = 0; $i < $format_length; $i ++ ) {
switch ( $format[ $i ] ) {
case 'D':
$new_format .= addcslashes( $wp_locale->get_weekday_abbrev( $weekday ), '\\A..Za..z' );
break;
case 'F':
$new_format .= addcslashes( $month, '\\A..Za..z' );
break;
case 'l':
$new_format .= addcslashes( $weekday, '\\A..Za..z' );
break;
case 'M':
$new_format .= addcslashes( $wp_locale->get_month_abbrev( $month ), '\\A..Za..z' );
break;
case 'a':
$new_format .= addcslashes( $wp_locale->get_meridiem( $datetime->format( 'a' ) ), '\\A..Za..z' );
break;
case 'A':
$new_format .= addcslashes( $wp_locale->get_meridiem( $datetime->format( 'A' ) ), '\\A..Za..z' );
break;
case '\\':
$new_format .= $format[ $i ];
// If character follows a slash, we add it without translating.
if ( $i < $format_length ) {
$new_format .= $format[ ++$i ];
}
break;
default:
$new_format .= $format[ $i ];
break;
}
}
$date = $datetime->format( $new_format );
$date = wp_maybe_decline_date( $date, $format );
}
/**
* Filters the date formatted based on the locale.
*
* @since 5.3.0
*
* @param string $date Formatted date string.
* @param string $format Format to display the date.
* @param int $timestamp Unix timestamp.
* @param DateTimeZone $timezone Timezone.
*/
$date = apply_filters( 'wp_date', $date, $format, $timestamp, $timezone );
return $date;
}
```
[apply\_filters( 'wp\_date', string $date, string $format, int $timestamp, DateTimeZone $timezone )](../hooks/wp_date)
Filters the date formatted based on the locale.
| Uses | Description |
| --- | --- |
| [wp\_timezone()](wp_timezone) wp-includes/functions.php | Retrieves the timezone of the site as a `DateTimeZone` object. |
| [wp\_maybe\_decline\_date()](wp_maybe_decline_date) wp-includes/functions.php | Determines if the date should be declined. |
| [WP\_Locale::get\_month()](../classes/wp_locale/get_month) wp-includes/class-wp-locale.php | Retrieves the full translated month by month number. |
| [WP\_Locale::get\_month\_abbrev()](../classes/wp_locale/get_month_abbrev) wp-includes/class-wp-locale.php | Retrieves translated version of month abbreviation string. |
| [WP\_Locale::get\_meridiem()](../classes/wp_locale/get_meridiem) wp-includes/class-wp-locale.php | Retrieves translated version of meridiem string. |
| [WP\_Locale::get\_weekday()](../classes/wp_locale/get_weekday) wp-includes/class-wp-locale.php | Retrieves the full translated weekday word. |
| [WP\_Locale::get\_weekday\_abbrev()](../classes/wp_locale/get_weekday_abbrev) wp-includes/class-wp-locale.php | Retrieves the translated weekday abbreviation. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [get\_post\_time()](get_post_time) wp-includes/general-template.php | Retrieves the time at which the post was written. |
| [get\_post\_modified\_time()](get_post_modified_time) wp-includes/general-template.php | Retrieves the time at which the post was last modified. |
| [date\_i18n()](date_i18n) wp-includes/functions.php | Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds. |
| [mysql2date()](mysql2date) wp-includes/functions.php | Converts given MySQL date string into a different format. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress get_the_modified_date( string $format = '', int|WP_Post $post = null ): string|int|false get\_the\_modified\_date( string $format = '', int|WP\_Post $post = null ): string|int|false
============================================================================================
Retrieves the date on which the post was last modified.
`$format` string Optional PHP date format. Defaults to the `'date_format'` option. Default: `''`
`$post` int|[WP\_Post](../classes/wp_post) Optional Post ID or [WP\_Post](../classes/wp_post) object. Default current post. Default: `null`
string|int|false Date the current post was modified. False on failure.
File: `wp-includes/general-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
```
function get_the_modified_date( $format = '', $post = null ) {
$post = get_post( $post );
if ( ! $post ) {
// For backward compatibility, failures go through the filter below.
$the_time = false;
} else {
$_format = ! empty( $format ) ? $format : get_option( 'date_format' );
$the_time = get_post_modified_time( $_format, false, $post, true );
}
/**
* Filters the date a post was last modified.
*
* @since 2.1.0
* @since 4.6.0 Added the `$post` parameter.
*
* @param string|int|false $the_time The formatted date or false if no post is found.
* @param string $format PHP date format.
* @param WP_Post|null $post WP_Post object or null if no post is found.
*/
return apply_filters( 'get_the_modified_date', $the_time, $format, $post );
}
```
[apply\_filters( 'get\_the\_modified\_date', string|int|false $the\_time, string $format, WP\_Post|null $post )](../hooks/get_the_modified_date)
Filters the date a post was last modified.
| Uses | Description |
| --- | --- |
| [get\_post\_modified\_time()](get_post_modified_time) wp-includes/general-template.php | Retrieves the time at which the post was last modified. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [the\_modified\_date()](the_modified_date) wp-includes/general-template.php | Displays 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 get_post_meta( int $post_id, string $key = '', bool $single = false ): mixed get\_post\_meta( int $post\_id, string $key = '', bool $single = false ): mixed
===============================================================================
Retrieves a post meta field for the given post ID.
`$post_id` int Required Post ID. `$key` string Optional The meta key to retrieve. By default, returns data for all keys. Default: `''`
`$single` bool Optional Whether to return a single value.
This parameter has no effect if `$key` is not specified.
Default: `false`
mixed An array of values if `$single` is false.
The value of the meta field if `$single` is true.
False for an invalid `$post_id` (non-numeric, zero, or negative value).
An empty string if a valid but non-existing post ID is passed.
* Please note that if a db collation is case insensitive (has with suffix \_ci) then update\_post\_meta and delete\_post\_meta and [get\_posts()](get_posts) will update/delete/query the meta records with keys that are upper or lower case. However get\_post\_meta will apparently be case sensitive due to WordPress caching. See <https://core.trac.wordpress.org/ticket/18210> for more info. Be careful not to mix upper and lowercase.
* Uses: [get\_metadata()](get_metadata) to retrieve the metadata.
File: `wp-includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
```
function get_post_meta( $post_id, $key = '', $single = false ) {
return get_metadata( 'post', $post_id, $key, $single );
}
```
| Uses | Description |
| --- | --- |
| [get\_metadata()](get_metadata) wp-includes/meta.php | Retrieves the value of a metadata field for the specified object type and ID. |
| Used By | Description |
| --- | --- |
| [update\_menu\_item\_cache()](update_menu_item_cache) wp-includes/nav-menu.php | Updates post and term caches for all linked objects for a list of menu items. |
| [\_build\_block\_template\_result\_from\_post()](_build_block_template_result_from_post) wp-includes/block-template-utils.php | Builds a unified template object based a post Object. |
| [get\_media\_states()](get_media_states) wp-admin/includes/template.php | Retrieves an array of media states from an attachment. |
| [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. |
| [get\_post\_states()](get_post_states) wp-admin/includes/template.php | Retrieves an array of post states from a post. |
| [WP\_User\_Request::\_\_construct()](../classes/wp_user_request/__construct) wp-includes/class-wp-user-request.php | Constructor. |
| [\_wp\_privacy\_send\_request\_confirmation\_notification()](_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()](_wp_privacy_send_erasure_fulfillment_notification) wp-includes/user.php | Notifies the user when their erasure request is fulfilled. |
| [wp\_check\_for\_changed\_dates()](wp_check_for_changed_dates) wp-includes/post.php | Checks for changed dates for published post objects and save the old date. |
| [WP\_Privacy\_Policy\_Content::get\_suggested\_policy\_text()](../classes/wp_privacy_policy_content/get_suggested_policy_text) wp-admin/includes/class-wp-privacy-policy-content.php | Check for updated, added or removed privacy policy information from plugins. |
| [WP\_Privacy\_Policy\_Content::text\_change\_check()](../classes/wp_privacy_policy_content/text_change_check) wp-admin/includes/class-wp-privacy-policy-content.php | Quick check if any privacy info has changed. |
| [WP\_Privacy\_Policy\_Content::\_policy\_page\_updated()](../classes/wp_privacy_policy_content/_policy_page_updated) wp-admin/includes/class-wp-privacy-policy-content.php | Update the cached policy info when the policy page is updated. |
| [wp\_privacy\_process\_personal\_data\_export\_page()](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\_privacy\_generate\_personal\_data\_export\_file()](wp_privacy_generate_personal_data_export_file) wp-admin/includes/privacy-tools.php | Generate the personal data export file. |
| [wp\_privacy\_send\_personal\_data\_export\_email()](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 |
| [WP\_Customize\_Manager::set\_changeset\_lock()](../classes/wp_customize_manager/set_changeset_lock) wp-includes/class-wp-customize-manager.php | Marks the changeset post as being currently edited by the current user. |
| [WP\_Customize\_Manager::refresh\_changeset\_lock()](../classes/wp_customize_manager/refresh_changeset_lock) wp-includes/class-wp-customize-manager.php | Refreshes changeset lock with the current time if current user edited the changeset before. |
| [WP\_Customize\_Manager::import\_theme\_starter\_content()](../classes/wp_customize_manager/import_theme_starter_content) wp-includes/class-wp-customize-manager.php | Imports theme starter content into the customized state. |
| [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\_Customize\_Nav\_Menus::save\_nav\_menus\_created\_posts()](../classes/wp_customize_nav_menus/save_nav_menus_created_posts) wp-includes/class-wp-customize-nav-menus.php | Publishes the auto-draft posts that were created for nav menu items. |
| [get\_custom\_logo()](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. |
| [get\_header\_image\_tag()](get_header_image_tag) wp-includes/theme.php | Creates image tag markup for a custom header image. |
| [wp\_ajax\_crop\_image()](wp_ajax_crop_image) wp-admin/includes/ajax-actions.php | Ajax handler for cropping an image. |
| [wp\_restore\_image()](wp_restore_image) wp-admin/includes/image-edit.php | Restores the metadata for a given attachment. |
| [wp\_save\_image()](wp_save_image) wp-admin/includes/image-edit.php | Saves image to post, along with enqueued changes in `$_REQUEST['history']`. |
| [wp\_image\_editor()](wp_image_editor) wp-admin/includes/image-edit.php | Loads the WP image-editing interface. |
| [edit\_form\_image\_editor()](edit_form_image_editor) wp-admin/includes/media.php | Displays the image and editor in the post editor |
| [get\_attachment\_fields\_to\_edit()](get_attachment_fields_to_edit) wp-admin/includes/media.php | Retrieves the attachment fields to edit form fields. |
| [media\_upload\_form\_handler()](media_upload_form_handler) wp-admin/includes/media.php | Handles form submissions for the legacy media uploader. |
| [wp\_check\_post\_lock()](wp_check_post_lock) wp-admin/includes/post.php | Determines whether the post is currently being edited by another user. |
| [edit\_post()](edit_post) wp-admin/includes/post.php | Updates an existing post with values provided in `$_POST`. |
| [wp\_ajax\_wp\_fullscreen\_save\_post()](wp_ajax_wp_fullscreen_save_post) wp-admin/includes/ajax-actions.php | Ajax handler for saving posts from the fullscreen editor. |
| [wp\_ajax\_save\_attachment()](wp_ajax_save_attachment) wp-admin/includes/ajax-actions.php | Ajax handler for updating attachment attributes. |
| [post\_thumbnail\_meta\_box()](post_thumbnail_meta_box) wp-admin/includes/meta-boxes.php | Displays post thumbnail meta box. |
| [post\_submit\_meta\_box()](post_submit_meta_box) wp-admin/includes/meta-boxes.php | Displays post submit form fields. |
| [Custom\_Image\_Header::get\_uploaded\_header\_images()](../classes/custom_image_header/get_uploaded_header_images) wp-admin/includes/class-custom-image-header.php | Gets the previously uploaded header images. |
| [map\_meta\_cap()](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. |
| [get\_uploaded\_header\_images()](get_uploaded_header_images) wp-includes/theme.php | Gets the header images uploaded for the active theme. |
| [WP\_Embed::shortcode()](../classes/wp_embed/shortcode) wp-includes/class-wp-embed.php | The [do\_shortcode()](do_shortcode) callback function. |
| [get\_post\_thumbnail\_id()](get_post_thumbnail_id) wp-includes/post-thumbnail-template.php | Retrieves the post thumbnail ID. |
| [\_wp\_menu\_item\_classes\_by\_context()](_wp_menu_item_classes_by_context) wp-includes/nav-menu-template.php | Adds the class property classes for the current context, if applicable. |
| [get\_page\_template\_slug()](get_page_template_slug) wp-includes/post-template.php | Gets the specific template filename for a given post. |
| [wp\_maybe\_generate\_attachment\_metadata()](wp_maybe_generate_attachment_metadata) wp-includes/media.php | Maybe attempts to generate attachment metadata, if missing. |
| [wp\_prepare\_attachment\_for\_js()](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. |
| [wp\_enqueue\_media()](wp_enqueue_media) wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| [wp\_get\_attachment\_image()](wp_get_attachment_image) wp-includes/media.php | Gets an HTML img element representing an image attachment. |
| [WP\_Post::\_\_get()](../classes/wp_post/__get) wp-includes/class-wp-post.php | Getter. |
| [wp\_check\_for\_changed\_slugs()](wp_check_for_changed_slugs) wp-includes/post.php | Checks for changed slugs for published post objects and save the old slug. |
| [wp\_delete\_attachment()](wp_delete_attachment) wp-includes/post.php | Trashes or deletes an attachment. |
| [wp\_get\_attachment\_metadata()](wp_get_attachment_metadata) wp-includes/post.php | Retrieves attachment metadata for attachment ID. |
| [wp\_get\_attachment\_url()](wp_get_attachment_url) wp-includes/post.php | Retrieves the URL for an attachment. |
| [wp\_untrash\_post\_comments()](wp_untrash_post_comments) wp-includes/post.php | Restores comments for a post from the Trash. |
| [wp\_insert\_post()](wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| [wp\_untrash\_post()](wp_untrash_post) wp-includes/post.php | Restores a post from the Trash. |
| [get\_post\_custom()](get_post_custom) wp-includes/post.php | Retrieves post meta fields, based on post ID. |
| [get\_post\_status()](get_post_status) wp-includes/post.php | Retrieves the post status based on the post ID. |
| [get\_attached\_file()](get_attached_file) wp-includes/post.php | Retrieves attached file path based on attachment ID. |
| [get\_the\_modified\_author()](get_the_modified_author) wp-includes/author-template.php | Retrieves the author who last edited the current post. |
| [wp\_get\_associated\_nav\_menu\_items()](wp_get_associated_nav_menu_items) wp-includes/nav-menu.php | Returns the menu items associated with a particular object. |
| [wp\_setup\_nav\_menu\_item()](wp_setup_nav_menu_item) wp-includes/nav-menu.php | Decorates a menu item object with the shared navigation menu item properties. |
| [wp\_update\_nav\_menu\_item()](wp_update_nav_menu_item) wp-includes/nav-menu.php | Saves the properties of a menu item or create a new one. |
| [wp\_xmlrpc\_server::add\_enclosure\_if\_new()](../classes/wp_xmlrpc_server/add_enclosure_if_new) wp-includes/class-wp-xmlrpc-server.php | Adds an enclosure to a post if it’s new. |
| [wp\_xmlrpc\_server::\_prepare\_post()](../classes/wp_xmlrpc_server/_prepare_post) wp-includes/class-wp-xmlrpc-server.php | Prepares post data for return in an XML-RPC object. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress get_links( int $category = -1, string $before = '', string $after = '<br />', string $between = ' ', bool $show_images = true, string $orderby = 'name', bool $show_description = true, bool $show_rating = false, int $limit = -1, int $show_updated = 1, bool $display = true ): null|string get\_links( int $category = -1, string $before = '', string $after = '<br />', string $between = ' ', bool $show\_images = true, string $orderby = 'name', bool $show\_description = true, bool $show\_rating = false, int $limit = -1, int $show\_updated = 1, bool $display = true ): null|string
===================================================================================================================================================================================================================================================================================================
This function has been deprecated. Use [get\_bookmarks()](get_bookmarks) instead.
Gets the links associated with category by ID.
* [get\_bookmarks()](get_bookmarks)
`$category` int Optional The category to use. If no category supplied uses all.
Default 0. Default: `-1`
`$before` string Optional The HTML to output before the link. Default: `''`
`$after` string Optional The HTML to output after the link. Default `<br />`. Default: `'<br />'`
`$between` string Optional The HTML to output between the link/image and its description.
Not used if no image or $show\_images is true. Default: `' '`
`$show_images` bool Optional Whether to show images (if defined). Default: `true`
`$orderby` string Optional The order to output the links. E.g. `'id'`, `'name'`, `'url'`, `'description'`, `'rating'`, or `'owner'`. Default `'name'`.
If you start the name with an underscore, the order will be reversed.
Specifying `'rand'` as the order will return links in a random order. Default: `'name'`
`$show_description` bool Optional Whether to show the description if show\_images=false/not defined.
Default: `true`
`$show_rating` bool Optional Show rating stars/chars. Default: `false`
`$limit` int Optional Limit to X entries. If not specified, all entries are shown.
Default: `-1`
`$show_updated` int Optional Whether to show last updated timestamp. Default: `1`
`$display` bool Optional Whether to display the results, or return them instead. Default: `true`
null|string
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
$show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $display = true) {
_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
$order = 'ASC';
if ( substr($orderby, 0, 1) == '_' ) {
$order = 'DESC';
$orderby = substr($orderby, 1);
}
if ( $category == -1 ) // get_bookmarks() uses '' to signify all categories.
$category = '';
$results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit));
if ( !$results )
return;
$output = '';
foreach ( (array) $results as $row ) {
if ( !isset($row->recently_updated) )
$row->recently_updated = false;
$output .= $before;
if ( $show_updated && $row->recently_updated )
$output .= get_option('links_recently_updated_prepend');
$the_link = '#';
if ( !empty($row->link_url) )
$the_link = esc_url($row->link_url);
$rel = $row->link_rel;
if ( '' != $rel )
$rel = ' rel="' . $rel . '"';
$desc = esc_attr(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display'));
$name = esc_attr(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display'));
$title = $desc;
if ( $show_updated )
if (substr($row->link_updated_f, 0, 2) != '00')
$title .= ' ('.__('Last updated') . ' ' . gmdate(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)) . ')';
if ( '' != $title )
$title = ' title="' . $title . '"';
$alt = ' alt="' . $name . '"';
$target = $row->link_target;
if ( '' != $target )
$target = ' target="' . $target . '"';
$output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
if ( $row->link_image != null && $show_images ) {
if ( strpos($row->link_image, 'http') !== false )
$output .= "<img src=\"$row->link_image\" $alt $title />";
else // If it's a relative path.
$output .= "<img src=\"" . get_option('siteurl') . "$row->link_image\" $alt $title />";
} else {
$output .= $name;
}
$output .= '</a>';
if ( $show_updated && $row->recently_updated )
$output .= get_option('links_recently_updated_append');
if ( $show_description && '' != $desc )
$output .= $between . $desc;
if ($show_rating) {
$output .= $between . get_linkrating($row);
}
$output .= "$after\n";
} // End while.
if ( !$display )
return $output;
echo $output;
}
```
| Uses | Description |
| --- | --- |
| [sanitize\_bookmark\_field()](sanitize_bookmark_field) wp-includes/bookmark.php | Sanitizes a bookmark field. |
| [get\_linkrating()](get_linkrating) wp-includes/deprecated.php | Legacy function that retrieved the value of a link’s link\_rating field. |
| [get\_bookmarks()](get_bookmarks) wp-includes/bookmark.php | Retrieves the list of bookmarks. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Used By | Description |
| --- | --- |
| [get\_links\_list()](get_links_list) wp-includes/deprecated.php | Output entire list of links by category. |
| [get\_linksbyname()](get_linksbyname) wp-includes/deprecated.php | Gets the links associated with category $cat\_name. |
| [get\_links\_withrating()](get_links_withrating) wp-includes/deprecated.php | Gets the links associated with category n and display rating stars/chars. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Use [get\_bookmarks()](get_bookmarks) |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress wp_clean_themes_cache( bool $clear_update_cache = true ) wp\_clean\_themes\_cache( bool $clear\_update\_cache = true )
=============================================================
Clears the cache held by [get\_theme\_roots()](get_theme_roots) and [WP\_Theme](../classes/wp_theme).
`$clear_update_cache` bool Optional Whether to clear the theme updates cache. Default: `true`
File: `wp-includes/theme.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
```
function wp_clean_themes_cache( $clear_update_cache = true ) {
if ( $clear_update_cache ) {
delete_site_transient( 'update_themes' );
}
search_theme_directories( true );
foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme ) {
$theme->cache_delete();
}
}
```
| Uses | Description |
| --- | --- |
| [search\_theme\_directories()](search_theme_directories) wp-includes/theme.php | Searches all registered theme directories for complete and valid themes. |
| [wp\_get\_themes()](wp_get_themes) wp-includes/theme.php | Returns an array of [WP\_Theme](../classes/wp_theme) objects based on the arguments. |
| [delete\_site\_transient()](delete_site_transient) wp-includes/option.php | Deletes a site transient. |
| Used By | Description |
| --- | --- |
| [wp\_clean\_update\_cache()](wp_clean_update_cache) wp-includes/update.php | Clears existing update caches for plugins, themes, and core. |
| [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. |
| [Theme\_Upgrader::current\_after()](../classes/theme_upgrader/current_after) wp-admin/includes/class-theme-upgrader.php | Turn off maintenance mode after upgrading the active theme. |
| [Theme\_Upgrader::install()](../classes/theme_upgrader/install) wp-admin/includes/class-theme-upgrader.php | Install a theme package. |
| [Theme\_Upgrader::upgrade()](../classes/theme_upgrader/upgrade) wp-admin/includes/class-theme-upgrader.php | Upgrade a theme. |
| [Theme\_Upgrader::bulk\_upgrade()](../classes/theme_upgrader/bulk_upgrade) wp-admin/includes/class-theme-upgrader.php | Upgrade several themes at once. |
| Version | Description |
| --- | --- |
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |
wordpress register_block_type_from_metadata( string $file_or_folder, array $args = array() ): WP_Block_Type|false register\_block\_type\_from\_metadata( string $file\_or\_folder, array $args = array() ): WP\_Block\_Type|false
===============================================================================================================
Registers a block type from the metadata stored in the `block.json` file.
`$file_or_folder` string Required Path to the JSON file with metadata definition for the block or path to the folder where the `block.json` file is located.
If providing the path to a JSON file, the filename must end with `block.json`. `$args` array Optional Array of block type arguments. Accepts any public property of `WP_Block_Type`. See [WP\_Block\_Type::\_\_construct()](../classes/wp_block_type/__construct) for information on accepted arguments. More Arguments from WP\_Block\_Type::\_\_construct( ... $args ) Array or string of arguments for registering a block type. Any arguments may be defined, however the ones described below are supported by default.
* `api_version`stringBlock API version.
* `title`stringHuman-readable block type label.
* `category`string|nullBlock type category classification, used in search interfaces to arrange block types by category.
* `parent`string[]|nullSetting parent lets a block require that it is only available when nested within the specified blocks.
* `ancestor`string[]|nullSetting ancestor makes a block available only inside the specified block types at any position of the ancestor's block subtree.
* `icon`string|nullBlock type icon.
* `description`stringA detailed block type description.
* `keywords`string[]Additional keywords to produce block type as result in search interfaces.
* `textdomain`string|nullThe translation textdomain.
* `styles`array[]Alternative block styles.
* `variations`array[]Block variations.
* `supports`array|nullSupported features.
* `example`array|nullStructured data for the block preview.
* `render_callback`callable|nullBlock type render callback.
* `attributes`array|nullBlock type attributes property schemas.
* `uses_context`string[]Context values inherited by blocks of this type.
* `provides_context`string[]|nullContext provided by blocks of this type.
* `editor_script_handles`string[]Block type editor only script handles.
* `script_handles`string[]Block type front end and editor script handles.
* `view_script_handles`string[]Block type front end only script handles.
* `editor_style_handles`string[]Block type editor only style handles.
* `style_handles`string[]Block type front end and editor style handles.
Default: `array()`
[WP\_Block\_Type](../classes/wp_block_type)|false The registered block type on success, or false on failure.
File: `wp-includes/blocks.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
```
function register_block_type_from_metadata( $file_or_folder, $args = array() ) {
/*
* Get an array of metadata from a PHP file.
* This improves performance for core blocks as it's only necessary to read a single PHP file
* instead of reading a JSON file per-block, and then decoding from JSON to PHP.
* Using a static variable ensures that the metadata is only read once per request.
*/
static $core_blocks_meta;
if ( ! $core_blocks_meta ) {
$core_blocks_meta = include_once ABSPATH . WPINC . '/blocks/blocks-json.php';
}
$metadata_file = ( ! str_ends_with( $file_or_folder, 'block.json' ) ) ?
trailingslashit( $file_or_folder ) . 'block.json' :
$file_or_folder;
if ( ! file_exists( $metadata_file ) ) {
return false;
}
// Try to get metadata from the static cache for core blocks.
$metadata = false;
if ( str_starts_with( $file_or_folder, ABSPATH . WPINC ) ) {
$core_block_name = str_replace( ABSPATH . WPINC . '/blocks/', '', $file_or_folder );
if ( ! empty( $core_blocks_meta[ $core_block_name ] ) ) {
$metadata = $core_blocks_meta[ $core_block_name ];
}
}
// If metadata is not found in the static cache, read it from the file.
if ( ! $metadata ) {
$metadata = wp_json_file_decode( $metadata_file, array( 'associative' => true ) );
}
if ( ! is_array( $metadata ) || empty( $metadata['name'] ) ) {
return false;
}
$metadata['file'] = wp_normalize_path( realpath( $metadata_file ) );
/**
* Filters the metadata provided for registering a block type.
*
* @since 5.7.0
*
* @param array $metadata Metadata for registering a block type.
*/
$metadata = apply_filters( 'block_type_metadata', $metadata );
// Add `style` and `editor_style` for core blocks if missing.
if ( ! empty( $metadata['name'] ) && 0 === strpos( $metadata['name'], 'core/' ) ) {
$block_name = str_replace( 'core/', '', $metadata['name'] );
if ( ! isset( $metadata['style'] ) ) {
$metadata['style'] = "wp-block-$block_name";
}
if ( ! isset( $metadata['editorStyle'] ) ) {
$metadata['editorStyle'] = "wp-block-{$block_name}-editor";
}
}
$settings = array();
$property_mappings = array(
'apiVersion' => 'api_version',
'title' => 'title',
'category' => 'category',
'parent' => 'parent',
'ancestor' => 'ancestor',
'icon' => 'icon',
'description' => 'description',
'keywords' => 'keywords',
'attributes' => 'attributes',
'providesContext' => 'provides_context',
'usesContext' => 'uses_context',
'supports' => 'supports',
'styles' => 'styles',
'variations' => 'variations',
'example' => 'example',
);
$textdomain = ! empty( $metadata['textdomain'] ) ? $metadata['textdomain'] : null;
$i18n_schema = get_block_metadata_i18n_schema();
foreach ( $property_mappings as $key => $mapped_key ) {
if ( isset( $metadata[ $key ] ) ) {
$settings[ $mapped_key ] = $metadata[ $key ];
if ( $textdomain && isset( $i18n_schema->$key ) ) {
$settings[ $mapped_key ] = translate_settings_using_i18n_schema( $i18n_schema->$key, $settings[ $key ], $textdomain );
}
}
}
$script_fields = array(
'editorScript' => 'editor_script_handles',
'script' => 'script_handles',
'viewScript' => 'view_script_handles',
);
foreach ( $script_fields as $metadata_field_name => $settings_field_name ) {
if ( ! empty( $metadata[ $metadata_field_name ] ) ) {
$scripts = $metadata[ $metadata_field_name ];
$processed_scripts = array();
if ( is_array( $scripts ) ) {
for ( $index = 0; $index < count( $scripts ); $index++ ) {
$result = register_block_script_handle(
$metadata,
$metadata_field_name,
$index
);
if ( $result ) {
$processed_scripts[] = $result;
}
}
} else {
$result = register_block_script_handle(
$metadata,
$metadata_field_name
);
if ( $result ) {
$processed_scripts[] = $result;
}
}
$settings[ $settings_field_name ] = $processed_scripts;
}
}
$style_fields = array(
'editorStyle' => 'editor_style_handles',
'style' => 'style_handles',
);
foreach ( $style_fields as $metadata_field_name => $settings_field_name ) {
if ( ! empty( $metadata[ $metadata_field_name ] ) ) {
$styles = $metadata[ $metadata_field_name ];
$processed_styles = array();
if ( is_array( $styles ) ) {
for ( $index = 0; $index < count( $styles ); $index++ ) {
$result = register_block_style_handle(
$metadata,
$metadata_field_name,
$index
);
if ( $result ) {
$processed_styles[] = $result;
}
}
} else {
$result = register_block_style_handle(
$metadata,
$metadata_field_name
);
if ( $result ) {
$processed_styles[] = $result;
}
}
$settings[ $settings_field_name ] = $processed_styles;
}
}
if ( ! empty( $metadata['render'] ) ) {
$template_path = wp_normalize_path(
realpath(
dirname( $metadata['file'] ) . '/' .
remove_block_asset_path_prefix( $metadata['render'] )
)
);
if ( $template_path ) {
/**
* Renders the block on the server.
*
* @since 6.1.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
*
* @return string Returns the block content.
*/
$settings['render_callback'] = function( $attributes, $content, $block ) use ( $template_path ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
ob_start();
require $template_path;
return ob_get_clean();
};
}
}
/**
* Filters the settings determined from the block type metadata.
*
* @since 5.7.0
*
* @param array $settings Array of determined settings for registering a block type.
* @param array $metadata Metadata provided for registering a block type.
*/
$settings = apply_filters(
'block_type_metadata_settings',
array_merge(
$settings,
$args
),
$metadata
);
return WP_Block_Type_Registry::get_instance()->register(
$metadata['name'],
$settings
);
}
```
[apply\_filters( 'block\_type\_metadata', array $metadata )](../hooks/block_type_metadata)
Filters the metadata provided for registering a block type.
[apply\_filters( 'block\_type\_metadata\_settings', array $settings, array $metadata )](../hooks/block_type_metadata_settings)
Filters the settings determined from the block type metadata.
| Uses | Description |
| --- | --- |
| [translate\_settings\_using\_i18n\_schema()](translate_settings_using_i18n_schema) wp-includes/l10n.php | Translates the provided settings value using its i18n schema. |
| [wp\_json\_file\_decode()](wp_json_file_decode) wp-includes/functions.php | Reads and decodes a JSON file. |
| [get\_block\_metadata\_i18n\_schema()](get_block_metadata_i18n_schema) wp-includes/blocks.php | Gets i18n schema for block’s metadata read from `block.json` file. |
| [register\_block\_script\_handle()](register_block_script_handle) wp-includes/blocks.php | Finds a script handle for the selected block metadata field. It detects when a path to file was provided and finds a corresponding asset file with details necessary to register the script under automatically generated handle name. It returns unprocessed script handle otherwise. |
| [register\_block\_style\_handle()](register_block_style_handle) wp-includes/blocks.php | Finds a style handle for the block metadata field. It detects when a path to file was provided and registers the style under automatically generated handle name. It returns unprocessed style handle otherwise. |
| [remove\_block\_asset\_path\_prefix()](remove_block_asset_path_prefix) wp-includes/blocks.php | Removes the block asset’s path prefix if provided. |
| [WP\_Block\_Type\_Registry::get\_instance()](../classes/wp_block_type_registry/get_instance) wp-includes/class-wp-block-type-registry.php | Utility method to retrieve the main instance of the class. |
| [wp\_normalize\_path()](wp_normalize_path) wp-includes/functions.php | Normalizes a filesystem path. |
| [trailingslashit()](trailingslashit) wp-includes/formatting.php | Appends a trailing slash. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [register\_block\_type()](register_block_type) wp-includes/blocks.php | Registers a block type. The recommended way is to register a block type using the metadata stored in the `block.json` file. |
| Version | Description |
| --- | --- |
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Added support for `render` field. |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Added support for `variations` and `viewScript` fields. |
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Added support for `textdomain` field and i18n handling for all translatable fields. |
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |
| programming_docs |
wordpress show_user_form( string $user_name = '', string $user_email = '', WP_Error|string $errors = '' ) show\_user\_form( string $user\_name = '', string $user\_email = '', WP\_Error|string $errors = '' )
====================================================================================================
Displays the fields for the new user account registration form.
`$user_name` string Optional The entered username. Default: `''`
`$user_email` string Optional The entered email address. Default: `''`
`$errors` [WP\_Error](../classes/wp_error)|string Optional A [WP\_Error](../classes/wp_error) object containing existing errors. Defaults to empty string. Default: `''`
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
function show_user_form( $user_name = '', $user_email = '', $errors = '' ) {
if ( ! is_wp_error( $errors ) ) {
$errors = new WP_Error();
}
// Username.
echo '<label for="user_name">' . __( 'Username:' ) . '</label>';
$errmsg_username = $errors->get_error_message( 'user_name' );
$errmsg_username_aria = '';
if ( $errmsg_username ) {
$errmsg_username_aria = 'wp-signup-username-error ';
echo '<p class="error" id="wp-signup-username-error">' . $errmsg_username . '</p>';
}
?>
<input name="user_name" type="text" id="user_name" value="<?php echo esc_attr( $user_name ); ?>" autocapitalize="none" autocorrect="off" maxlength="60" autocomplete="username" required="required" aria-describedby="<?php echo $errmsg_username_aria; ?>wp-signup-username-description" />
<p id="wp-signup-username-description"><?php _e( '(Must be at least 4 characters, lowercase letters and numbers only.)' ); ?></p>
<?php
// Email address.
echo '<label for="user_email">' . __( 'Email Address:' ) . '</label>';
$errmsg_email = $errors->get_error_message( 'user_email' );
$errmsg_email_aria = '';
if ( $errmsg_email ) {
$errmsg_email_aria = 'wp-signup-email-error ';
echo '<p class="error" id="wp-signup-email-error">' . $errmsg_email . '</p>';
}
?>
<input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" autocomplete="email" required="required" aria-describedby="<?php echo $errmsg_email_aria; ?>wp-signup-email-description" />
<p id="wp-signup-email-description"><?php _e( 'Your registration email is sent to this address. (Double-check your email address before continuing.)' ); ?></p>
<?php
// Extra fields.
$errmsg_generic = $errors->get_error_message( 'generic' );
if ( $errmsg_generic ) {
echo '<p class="error" id="wp-signup-generic-error">' . $errmsg_generic . '</p>';
}
/**
* Fires at the end of the new user account registration form.
*
* @since 3.0.0
*
* @param WP_Error $errors A WP_Error object containing 'user_name' or 'user_email' errors.
*/
do_action( 'signup_extra_fields', $errors );
}
```
[do\_action( 'signup\_extra\_fields', WP\_Error $errors )](../hooks/signup_extra_fields)
Fires at the end of the new user account registration form.
| Uses | Description |
| --- | --- |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_e()](_e) wp-includes/l10n.php | Displays translated text. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [do\_action()](do_action) wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [signup\_user()](signup_user) wp-signup.php | Shows a form for a visitor to sign up for a new user account. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress get_linksbyname_withrating( string $cat_name = "noname", string $before = '', string $after = '<br />', string $between = " ", bool $show_images = true, string $orderby = 'id', bool $show_description = true, int $limit = -1, int $show_updated ) get\_linksbyname\_withrating( string $cat\_name = "noname", string $before = '', string $after = '<br />', string $between = " ", bool $show\_images = true, string $orderby = 'id', bool $show\_description = true, int $limit = -1, int $show\_updated )
==========================================================================================================================================================================================================================================================
This function has been deprecated. Use [get\_bookmarks()](get_bookmarks) instead.
Gets the links associated with category ‘cat\_name’ and display rating stars/chars.
* [get\_bookmarks()](get_bookmarks)
`$cat_name` string Optional The category name to use. If no match is found, uses all.
Default `'noname'`. Default: `"noname"`
`$before` string Optional The HTML to output before the link. Default: `''`
`$after` string Optional The HTML to output after the link. Default `<br />`. Default: `'<br />'`
`$between` string Optional The HTML to output between the link/image and its description.
Not used if no image or $show\_images is true. Default ' '. Default: `" "`
`$show_images` bool Optional Whether to show images (if defined). Default: `true`
`$orderby` string Optional The order to output the links. E.g. `'id'`, `'name'`, `'url'`, `'description'`, `'rating'`, or `'owner'`. Default `'id'`.
If you start the name with an underscore, the order will be reversed.
Specifying `'rand'` as the order will return links in a random order. Default: `'id'`
`$show_description` bool Optional Whether to show the description if show\_images=false/not defined.
Default: `true`
`$limit` int Optional Limit to X entries. If not specified, all entries are shown.
Default: `-1`
`$show_updated` int Optional Whether to show last updated timestamp. Default 0. File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ",
$show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
}
```
| Uses | Description |
| --- | --- |
| [get\_linksbyname()](get_linksbyname) wp-includes/deprecated.php | Gets the links associated with category $cat\_name. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Use [get\_bookmarks()](get_bookmarks) |
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |
wordpress update_category_cache(): bool update\_category\_cache(): bool
===============================
This function has been deprecated.
Update the categories cache.
This function does not appear to be used anymore or does not appear to be needed. It might be a legacy function left over from when there was a need for updating the category cache.
bool Always return True
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function update_category_cache() {
_deprecated_function( __FUNCTION__, '3.1.0' );
return true;
}
```
| Uses | Description |
| --- | --- |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | This function has been deprecated. |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress get_home_template(): string get\_home\_template(): string
=============================
Retrieves path of home template in current or parent template.
The template hierarchy and template path are filterable via the [‘$type\_template\_hierarchy’](../hooks/type_template_hierarchy) and [‘$type\_template’](../hooks/type_template) dynamic hooks, where `$type` is ‘home’.
* [get\_query\_template()](get_query_template)
string Full path to home template file.
File: `wp-includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/template.php/)
```
function get_home_template() {
$templates = array( 'home.php', 'index.php' );
return get_query_template( 'home', $templates );
}
```
| Uses | Description |
| --- | --- |
| [get\_query\_template()](get_query_template) wp-includes/template.php | Retrieves path to a template. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress wp_privacy_anonymize_data( string $type, string $data = '' ): string wp\_privacy\_anonymize\_data( string $type, string $data = '' ): string
=======================================================================
Returns uniform “anonymous” data by type.
`$type` string Required The type of data to be anonymized. `$data` string Optional The data to be anonymized. Default: `''`
string The anonymous data for the requested type.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function wp_privacy_anonymize_data( $type, $data = '' ) {
switch ( $type ) {
case 'email':
$anonymous = '[email protected]';
break;
case 'url':
$anonymous = 'https://site.invalid';
break;
case 'ip':
$anonymous = wp_privacy_anonymize_ip( $data );
break;
case 'date':
$anonymous = '0000-00-00 00:00:00';
break;
case 'text':
/* translators: Deleted text. */
$anonymous = __( '[deleted]' );
break;
case 'longtext':
/* translators: Deleted long text. */
$anonymous = __( 'This content was deleted by the author.' );
break;
default:
$anonymous = '';
break;
}
/**
* Filters the anonymous data for each type.
*
* @since 4.9.6
*
* @param string $anonymous Anonymized data.
* @param string $type Type of the data.
* @param string $data Original data.
*/
return apply_filters( 'wp_privacy_anonymize_data', $anonymous, $type, $data );
}
```
[apply\_filters( 'wp\_privacy\_anonymize\_data', string $anonymous, string $type, string $data )](../hooks/wp_privacy_anonymize_data)
Filters the anonymous data for each type.
| Uses | Description |
| --- | --- |
| [wp\_privacy\_anonymize\_ip()](wp_privacy_anonymize_ip) wp-includes/functions.php | Returns an anonymized IPv4 or IPv6 address. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [wp\_comments\_personal\_data\_eraser()](wp_comments_personal_data_eraser) wp-includes/comment.php | Erases personal data associated with an email address from the comments table. |
| Version | Description |
| --- | --- |
| [4.9.6](https://developer.wordpress.org/reference/since/4.9.6/) | Introduced. |
wordpress validate_blog_form(): array validate\_blog\_form(): array
=============================
Validates the new site sign-up.
array Contains the new site data and error messages.
See [wpmu\_validate\_blog\_signup()](wpmu_validate_blog_signup) for details.
File: `wp-signup.php`. [View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
```
function validate_blog_form() {
$user = '';
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
}
return wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'], $user );
}
```
| Uses | Description |
| --- | --- |
| [wpmu\_validate\_blog\_signup()](wpmu_validate_blog_signup) wp-includes/ms-functions.php | Processes new site registrations. |
| [wp\_get\_current\_user()](wp_get_current_user) wp-includes/pluggable.php | Retrieves the current user object. |
| [is\_user\_logged\_in()](is_user_logged_in) wp-includes/pluggable.php | Determines whether the current visitor is a logged in user. |
| Used By | Description |
| --- | --- |
| [validate\_another\_blog\_signup()](validate_another_blog_signup) wp-signup.php | Validates a new site sign-up for an existing user. |
| Version | Description |
| --- | --- |
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |
wordpress _get_block_templates_paths( string $base_directory ): array \_get\_block\_templates\_paths( string $base\_directory ): 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.
Finds all nested template part file paths in a theme’s directory.
`$base_directory` string Required The theme's file path. array A list of paths to all template part files.
File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
function _get_block_templates_paths( $base_directory ) {
$path_list = array();
if ( file_exists( $base_directory ) ) {
$nested_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $base_directory ) );
$nested_html_files = new RegexIterator( $nested_files, '/^.+\.html$/i', RecursiveRegexIterator::GET_MATCH );
foreach ( $nested_html_files as $path => $file ) {
$path_list[] = $path;
}
}
return $path_list;
}
```
| Used By | Description |
| --- | --- |
| [\_get\_block\_templates\_files()](_get_block_templates_files) wp-includes/block-template-utils.php | Retrieves the template files from the theme. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress _find_post_by_old_slug( string $post_type ): int \_find\_post\_by\_old\_slug( string $post\_type ): int
======================================================
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. Use [wp\_old\_slug\_redirect()](wp_old_slug_redirect) instead.
Find the post ID for redirecting an old slug.
* [wp\_old\_slug\_redirect()](wp_old_slug_redirect)
`$post_type` string Required The current post type based on the query vars. int The Post ID.
File: `wp-includes/query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/query.php/)
```
function _find_post_by_old_slug( $post_type ) {
global $wpdb;
$query = $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, get_query_var( 'name' ) );
// If year, monthnum, or day have been specified, make our query more precise
// just in case there are multiple identical _wp_old_slug values.
if ( get_query_var( 'year' ) ) {
$query .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) );
}
if ( get_query_var( 'monthnum' ) ) {
$query .= $wpdb->prepare( ' AND MONTH(post_date) = %d', get_query_var( 'monthnum' ) );
}
if ( get_query_var( 'day' ) ) {
$query .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) );
}
$key = md5( $query );
$last_changed = wp_cache_get_last_changed( 'posts' );
$cache_key = "find_post_by_old_slug:$key:$last_changed";
$cache = wp_cache_get( $cache_key, 'posts' );
if ( false !== $cache ) {
$id = $cache;
} else {
$id = (int) $wpdb->get_var( $query );
wp_cache_set( $cache_key, $id, 'posts' );
}
return $id;
}
```
| Uses | Description |
| --- | --- |
| [wp\_cache\_get\_last\_changed()](wp_cache_get_last_changed) wp-includes/functions.php | Gets last changed date for the specified cache group. |
| [wp\_cache\_set()](wp_cache_set) wp-includes/cache.php | Saves the data to the cache. |
| [get\_query\_var()](get_query_var) wp-includes/query.php | Retrieves the value of a query variable in the [WP\_Query](../classes/wp_query) class. |
| [wp\_cache\_get()](wp_cache_get) wp-includes/cache.php | Retrieves the cache contents from the cache by key and group. |
| [wpdb::get\_var()](../classes/wpdb/get_var) wp-includes/class-wpdb.php | Retrieves one variable from the database. |
| [wpdb::prepare()](../classes/wpdb/prepare) wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
| Used By | Description |
| --- | --- |
| [wp\_old\_slug\_redirect()](wp_old_slug_redirect) wp-includes/query.php | Redirect old slugs to the correct permalink. |
| Version | Description |
| --- | --- |
| [4.9.3](https://developer.wordpress.org/reference/since/4.9.3/) | Introduced. |
wordpress get_link_to_edit( int|stdClass $link ): object get\_link\_to\_edit( int|stdClass $link ): object
=================================================
Retrieves link data based on its ID.
`$link` int|stdClass Required Link ID or object to retrieve. object Link object for editing.
File: `wp-admin/includes/bookmark.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/bookmark.php/)
```
function get_link_to_edit( $link ) {
return get_bookmark( $link, OBJECT, 'edit' );
}
```
| Uses | Description |
| --- | --- |
| [get\_bookmark()](get_bookmark) wp-includes/bookmark.php | Retrieves bookmark data. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
wordpress is_preview(): bool is\_preview(): bool
===================
Determines whether the query is for a post or page preview.
For more information on this and similar theme functions, check out the [Conditional Tags](https://developer.wordpress.org/themes/basics/conditional-tags/) article in the Theme Developer Handbook.
bool Whether the query is for a post or page preview.
File: `wp-includes/query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/query.php/)
```
function is_preview() {
global $wp_query;
if ( ! isset( $wp_query ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
return false;
}
return $wp_query->is_preview();
}
```
| Uses | Description |
| --- | --- |
| [WP\_Query::is\_preview()](../classes/wp_query/is_preview) wp-includes/class-wp-query.php | Is the query for a post or page preview? |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| Used By | Description |
| --- | --- |
| [wp\_post\_preview\_js()](wp_post_preview_js) wp-includes/functions.php | Outputs a small JS snippet on preview tabs/windows to remove `window.name` on unload. |
| [\_wp\_link\_page()](_wp_link_page) wp-includes/post-template.php | Helper function for [wp\_link\_pages()](wp_link_pages) . |
| [redirect\_canonical()](redirect_canonical) wp-includes/canonical.php | Redirects incoming links to the proper URL based on the site url. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
| programming_docs |
wordpress rest_api_register_rewrites() rest\_api\_register\_rewrites()
===============================
Adds REST rewrite rules.
* [add\_rewrite\_rule()](add_rewrite_rule)
File: `wp-includes/rest-api.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
```
function rest_api_register_rewrites() {
global $wp_rewrite;
add_rewrite_rule( '^' . rest_get_url_prefix() . '/?$', 'index.php?rest_route=/', 'top' );
add_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?', 'index.php?rest_route=/$matches[1]', 'top' );
add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/?$', 'index.php?rest_route=/', 'top' );
add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/(.*)?', 'index.php?rest_route=/$matches[1]', 'top' );
}
```
| Uses | Description |
| --- | --- |
| [rest\_get\_url\_prefix()](rest_get_url_prefix) wp-includes/rest-api.php | Retrieves the URL prefix for any API resource. |
| [add\_rewrite\_rule()](add_rewrite_rule) wp-includes/rewrite.php | Adds a rewrite rule that transforms a URL structure to a set of query vars. |
| Used By | Description |
| --- | --- |
| [rest\_api\_init()](rest_api_init) wp-includes/rest-api.php | Registers rewrite rules for the REST API. |
| Version | Description |
| --- | --- |
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |
wordpress _remove_theme_attribute_in_block_template_content( string $template_content ): string \_remove\_theme\_attribute\_in\_block\_template\_content( string $template\_content ): 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.
Parses a block template and removes the theme attribute from each template part.
`$template_content` string Required Serialized block template content. string Updated block template content.
File: `wp-includes/block-template-utils.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/block-template-utils.php/)
```
function _remove_theme_attribute_in_block_template_content( $template_content ) {
$has_updated_content = false;
$new_content = '';
$template_blocks = parse_blocks( $template_content );
$blocks = _flatten_blocks( $template_blocks );
foreach ( $blocks as $key => $block ) {
if ( 'core/template-part' === $block['blockName'] && isset( $block['attrs']['theme'] ) ) {
unset( $blocks[ $key ]['attrs']['theme'] );
$has_updated_content = true;
}
}
if ( ! $has_updated_content ) {
return $template_content;
}
foreach ( $template_blocks as $block ) {
$new_content .= serialize_block( $block );
}
return $new_content;
}
```
| Uses | Description |
| --- | --- |
| [\_flatten\_blocks()](_flatten_blocks) wp-includes/block-template-utils.php | Returns an array containing the references of the passed blocks and their inner blocks. |
| [serialize\_block()](serialize_block) wp-includes/blocks.php | Returns the content of a block, including comment delimiters, serializing all attributes from the given parsed block. |
| [parse\_blocks()](parse_blocks) wp-includes/blocks.php | Parses blocks out of a content string. |
| Used By | Description |
| --- | --- |
| [wp\_generate\_block\_templates\_export\_file()](wp_generate_block_templates_export_file) wp-includes/block-template-utils.php | Creates an export of the current templates and template parts from the site editor at the specified path in a ZIP file. |
| Version | Description |
| --- | --- |
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |
wordpress get_adjacent_image_link( bool $prev = true, string|int[] $size = 'thumbnail', bool $text = false ): string get\_adjacent\_image\_link( bool $prev = true, string|int[] $size = 'thumbnail', bool $text = false ): string
=============================================================================================================
Gets the next or previous image link that has the same post parent.
Retrieves the current attachment object from the $post global.
`$prev` bool Optional Whether to display the next (false) or previous (true) link. Default: `true`
`$size` string|int[] Optional Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). Default `'thumbnail'`. Default: `'thumbnail'`
`$text` bool Optional Link text. Default: `false`
string Markup for image link.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
function get_adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
$post = get_post();
$attachments = array_values(
get_children(
array(
'post_parent' => $post->post_parent,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID',
)
)
);
foreach ( $attachments as $k => $attachment ) {
if ( (int) $attachment->ID === (int) $post->ID ) {
break;
}
}
$output = '';
$attachment_id = 0;
if ( $attachments ) {
$k = $prev ? $k - 1 : $k + 1;
if ( isset( $attachments[ $k ] ) ) {
$attachment_id = $attachments[ $k ]->ID;
$attr = array( 'alt' => get_the_title( $attachment_id ) );
$output = wp_get_attachment_link( $attachment_id, $size, true, false, $text, $attr );
}
}
$adjacent = $prev ? 'previous' : 'next';
/**
* 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`
*
* @since 3.5.0
*
* @param string $output Adjacent image HTML markup.
* @param int $attachment_id Attachment ID
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @param string $text Link text.
*/
return apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );
}
```
[apply\_filters( "{$adjacent}\_image\_link", string $output, int $attachment\_id, string|int[] $size, string $text )](../hooks/adjacent_image_link)
Filters the adjacent image link.
| Uses | Description |
| --- | --- |
| [get\_children()](get_children) wp-includes/post.php | Retrieves all children of the post parent ID. |
| [wp\_get\_attachment\_link()](wp_get_attachment_link) wp-includes/post-template.php | Retrieves an attachment page link using an image or icon, if possible. |
| [get\_the\_title()](get_the_title) wp-includes/post-template.php | Retrieves the post title. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [get\_next\_image\_link()](get_next_image_link) wp-includes/media.php | Gets the next image link that has the same post parent. |
| [get\_previous\_image\_link()](get_previous_image_link) wp-includes/media.php | Gets the previous image link that has the same post parent. |
| [adjacent\_image\_link()](adjacent_image_link) wp-includes/media.php | Displays next or previous image link that has the same post parent. |
| Version | Description |
| --- | --- |
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |
wordpress _wp_filter_build_unique_id( string $hook_name, callable|string|array $callback, int $priority ): string \_wp\_filter\_build\_unique\_id( string $hook\_name, callable|string|array $callback, int $priority ): 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.
Builds Unique ID for storage and retrieval.
The old way to serialize the callback caused issues and this function is the solution. It works by checking for objects and creating a new property in the class to keep track of the object and new objects of the same class that need to be added.
It also allows for the removal of actions and filters for objects after they change class properties. It is possible to include the property $wp\_filter\_id in your class and set it to "null" or a number to bypass the workaround.
However this will prevent you from adding new classes and any new classes will overwrite the previous hook by the same class.
Functions and static method callbacks are just returned as strings and shouldn’t have any speed penalty.
`$hook_name` string Required Unused. The name of the filter to build ID for. `$callback` callable|string|array Required The callback to generate ID for. The callback may or may not exist. `$priority` int Required Unused. The order in which the functions associated with a particular action are executed. string Unique function ID for usage as array key.
File: `wp-includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/plugin.php/)
```
function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
if ( is_string( $callback ) ) {
return $callback;
}
if ( is_object( $callback ) ) {
// Closures are currently implemented as objects.
$callback = array( $callback, '' );
} else {
$callback = (array) $callback;
}
if ( is_object( $callback[0] ) ) {
// Object class calling.
return spl_object_hash( $callback[0] ) . $callback[1];
} elseif ( is_string( $callback[0] ) ) {
// Static calling.
return $callback[0] . '::' . $callback[1];
}
}
```
| Used By | Description |
| --- | --- |
| [WP\_Hook::add\_filter()](../classes/wp_hook/add_filter) wp-includes/class-wp-hook.php | Adds a callback function to a filter hook. |
| [WP\_Hook::remove\_filter()](../classes/wp_hook/remove_filter) wp-includes/class-wp-hook.php | Removes a callback function from a filter hook. |
| [WP\_Hook::has\_filter()](../classes/wp_hook/has_filter) wp-includes/class-wp-hook.php | Checks if a specific callback has been registered for this hook. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Removed workarounds for spl\_object\_hash(). `$hook_name` and `$priority` are no longer used, and the function always returns a string. |
| [2.2.3](https://developer.wordpress.org/reference/since/2.2.3/) | Introduced. |
wordpress copy_dir( string $from, string $to, string[] $skip_list = array() ): true|WP_Error copy\_dir( string $from, string $to, string[] $skip\_list = array() ): true|WP\_Error
=====================================================================================
Copies a directory from one location to another via the WordPress Filesystem Abstraction.
Assumes that [WP\_Filesystem()](wp_filesystem) has already been called and setup.
`$from` string Required Source directory. `$to` string Required Destination directory. `$skip_list` string[] Optional An array of files/folders to skip copying. Default: `array()`
true|[WP\_Error](../classes/wp_error) True on success, [WP\_Error](../classes/wp_error) on failure.
File: `wp-admin/includes/file.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
```
function copy_dir( $from, $to, $skip_list = array() ) {
global $wp_filesystem;
$dirlist = $wp_filesystem->dirlist( $from );
if ( false === $dirlist ) {
return new WP_Error( 'dirlist_failed_copy_dir', __( 'Directory listing failed.' ), basename( $to ) );
}
$from = trailingslashit( $from );
$to = trailingslashit( $to );
foreach ( (array) $dirlist as $filename => $fileinfo ) {
if ( in_array( $filename, $skip_list, true ) ) {
continue;
}
if ( 'f' === $fileinfo['type'] ) {
if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {
// If copy failed, chmod file to 0644 and try again.
$wp_filesystem->chmod( $to . $filename, FS_CHMOD_FILE );
if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {
return new WP_Error( 'copy_failed_copy_dir', __( 'Could not copy file.' ), $to . $filename );
}
}
wp_opcache_invalidate( $to . $filename );
} elseif ( 'd' === $fileinfo['type'] ) {
if ( ! $wp_filesystem->is_dir( $to . $filename ) ) {
if ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) {
return new WP_Error( 'mkdir_failed_copy_dir', __( 'Could not create directory.' ), $to . $filename );
}
}
// Generate the $sub_skip_list for the subdirectory as a sub-set of the existing $skip_list.
$sub_skip_list = array();
foreach ( $skip_list as $skip_item ) {
if ( 0 === strpos( $skip_item, $filename . '/' ) ) {
$sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename, '!' ) . '/!i', '', $skip_item );
}
}
$result = copy_dir( $from . $filename, $to . $filename, $sub_skip_list );
if ( is_wp_error( $result ) ) {
return $result;
}
}
}
return true;
}
```
| Uses | Description |
| --- | --- |
| [wp\_opcache\_invalidate()](wp_opcache_invalidate) wp-admin/includes/file.php | Attempts to clear the opcode cache for an individual PHP file. |
| [copy\_dir()](copy_dir) wp-admin/includes/file.php | Copies a directory from one location to another via the WordPress Filesystem Abstraction. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [trailingslashit()](trailingslashit) wp-includes/formatting.php | Appends a trailing slash. |
| [is\_wp\_error()](is_wp_error) wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
| [WP\_Error::\_\_construct()](../classes/wp_error/__construct) wp-includes/class-wp-error.php | Initializes the error. |
| Used By | Description |
| --- | --- |
| [WP\_Upgrader::install\_package()](../classes/wp_upgrader/install_package) wp-admin/includes/class-wp-upgrader.php | Install a package. |
| [update\_core()](update_core) wp-admin/includes/update-core.php | Upgrades the core of WordPress. |
| [copy\_dir()](copy_dir) wp-admin/includes/file.php | Copies a directory from one location to another via the WordPress Filesystem Abstraction. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress get_post_states( WP_Post $post ): string[] get\_post\_states( WP\_Post $post ): string[]
=============================================
Retrieves an array of post states from a post.
`$post` [WP\_Post](../classes/wp_post) Required The post to retrieve states for. string[] Array of post state labels keyed by their state.
File: `wp-admin/includes/template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
```
function get_post_states( $post ) {
$post_states = array();
if ( isset( $_REQUEST['post_status'] ) ) {
$post_status = $_REQUEST['post_status'];
} else {
$post_status = '';
}
if ( ! empty( $post->post_password ) ) {
$post_states['protected'] = _x( 'Password protected', 'post status' );
}
if ( 'private' === $post->post_status && 'private' !== $post_status ) {
$post_states['private'] = _x( 'Private', 'post status' );
}
if ( 'draft' === $post->post_status ) {
if ( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
$post_states[] = __( 'Customization Draft' );
} elseif ( 'draft' !== $post_status ) {
$post_states['draft'] = _x( 'Draft', 'post status' );
}
} elseif ( 'trash' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
$post_states[] = _x( 'Customization Draft', 'post status' );
}
if ( 'pending' === $post->post_status && 'pending' !== $post_status ) {
$post_states['pending'] = _x( 'Pending', 'post status' );
}
if ( is_sticky( $post->ID ) ) {
$post_states['sticky'] = _x( 'Sticky', 'post status' );
}
if ( 'future' === $post->post_status ) {
$post_states['scheduled'] = _x( 'Scheduled', 'post status' );
}
if ( 'page' === get_option( 'show_on_front' ) ) {
if ( (int) get_option( 'page_on_front' ) === $post->ID ) {
$post_states['page_on_front'] = _x( 'Front Page', 'page label' );
}
if ( (int) get_option( 'page_for_posts' ) === $post->ID ) {
$post_states['page_for_posts'] = _x( 'Posts Page', 'page label' );
}
}
if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
$post_states['page_for_privacy_policy'] = _x( 'Privacy Policy Page', 'page label' );
}
/**
* Filters the default post display states used in the posts list table.
*
* @since 2.8.0
* @since 3.6.0 Added the `$post` parameter.
* @since 5.5.0 Also applied in the Customizer context. If any admin functions
* are used within the filter, their existence should be checked
* with `function_exists()` before being used.
*
* @param string[] $post_states An array of post display states.
* @param WP_Post $post The current post object.
*/
return apply_filters( 'display_post_states', $post_states, $post );
}
```
[apply\_filters( 'display\_post\_states', string[] $post\_states, WP\_Post $post )](../hooks/display_post_states)
Filters the default post display states used in the posts list table.
| Uses | Description |
| --- | --- |
| [is\_sticky()](is_sticky) wp-includes/post.php | Determines whether a post is sticky. |
| [\_x()](_x) wp-includes/l10n.php | Retrieves translated string with gettext context. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [get\_post\_meta()](get_post_meta) wp-includes/post.php | Retrieves a post meta field for the given post ID. |
| Used By | Description |
| --- | --- |
| [WP\_Customize\_Nav\_Menus::search\_available\_items\_query()](../classes/wp_customize_nav_menus/search_available_items_query) wp-includes/class-wp-customize-nav-menus.php | Performs post queries for available-item searching. |
| [WP\_Customize\_Nav\_Menus::load\_available\_items\_query()](../classes/wp_customize_nav_menus/load_available_items_query) wp-includes/class-wp-customize-nav-menus.php | Performs the post\_type and taxonomy queries for loading available menu items. |
| [\_post\_states()](_post_states) wp-admin/includes/template.php | Echoes or returns the post states as HTML. |
| [wp\_setup\_nav\_menu\_item()](wp_setup_nav_menu_item) wp-includes/nav-menu.php | Decorates a menu item object with the shared navigation menu item properties. |
| Version | Description |
| --- | --- |
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |
wordpress screen_meta( $screen ) screen\_meta( $screen )
=======================
This function has been deprecated. Use [WP\_Screen::render\_screen\_meta()](../classes/wp_screen/render_screen_meta) instead.
Renders the screen’s help.
* [WP\_Screen::render\_screen\_meta()](../classes/wp_screen/render_screen_meta)
File: `wp-admin/includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/deprecated.php/)
```
function screen_meta( $screen ) {
$current_screen = get_current_screen();
$current_screen->render_screen_meta();
}
```
| Uses | Description |
| --- | --- |
| [get\_current\_screen()](get_current_screen) wp-admin/includes/screen.php | Get the current screen object |
| Version | Description |
| --- | --- |
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Use [WP\_Screen::render\_screen\_meta()](../classes/wp_screen/render_screen_meta) |
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |
| programming_docs |
wordpress is_category( int|string|int[]|string[] $category = '' ): bool is\_category( int|string|int[]|string[] $category = '' ): bool
==============================================================
Determines whether the query is for an existing category archive page.
If the $category parameter is specified, this function will additionally check if the query is for one of the categories specified.
For more information on this and similar theme functions, check out the [Conditional Tags](https://developer.wordpress.org/themes/basics/conditional-tags/) article in the Theme Developer Handbook.
`$category` int|string|int[]|string[] Optional Category ID, name, slug, or array of such to check against. Default: `''`
bool Whether the query is for an existing category archive page.
* See also [is\_archive()](is_archive) and [Category Templates](https://codex.wordpress.org/Category_Templates "Category Templates").
* For [Custom Taxonomies](https://codex.wordpress.org/Taxonomies#Custom_Taxonomies "Taxonomies") use [is\_tax()](is_tax)
File: `wp-includes/query.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/query.php/)
```
function is_category( $category = '' ) {
global $wp_query;
if ( ! isset( $wp_query ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
return false;
}
return $wp_query->is_category( $category );
}
```
| Uses | Description |
| --- | --- |
| [WP\_Query::is\_category()](../classes/wp_query/is_category) wp-includes/class-wp-query.php | Is the query for an existing category archive page? |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| Used By | Description |
| --- | --- |
| [rest\_get\_queried\_resource\_route()](rest_get_queried_resource_route) wp-includes/rest-api.php | Gets the REST route for the currently queried object. |
| [wp\_get\_document\_title()](wp_get_document_title) wp-includes/general-template.php | Returns document title for the current page. |
| [get\_the\_archive\_title()](get_the_archive_title) wp-includes/general-template.php | Retrieves the archive title based on the queried object. |
| [term\_description()](term_description) wp-includes/category-template.php | Retrieves term description. |
| [wp\_dropdown\_categories()](wp_dropdown_categories) wp-includes/category-template.php | Displays or retrieves the HTML dropdown list of categories. |
| [wp\_list\_categories()](wp_list_categories) wp-includes/category-template.php | Displays or retrieves the HTML list of categories. |
| [feed\_links\_extra()](feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| [wp\_title()](wp_title) wp-includes/general-template.php | Displays or retrieves page title for all areas of blog. |
| [single\_term\_title()](single_term_title) wp-includes/general-template.php | Displays or retrieves page title for taxonomy term archive. |
| [WP::handle\_404()](../classes/wp/handle_404) wp-includes/class-wp.php | Set the Headers for 404, if nothing is found for requested URL. |
| [get\_body\_class()](get_body_class) wp-includes/post-template.php | Retrieves an array of the class names for the body element. |
| [redirect\_canonical()](redirect_canonical) wp-includes/canonical.php | Redirects incoming links to the proper URL based on the site url. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress is_object_in_taxonomy( string $object_type, string $taxonomy ): bool is\_object\_in\_taxonomy( string $object\_type, string $taxonomy ): bool
========================================================================
Determines if the given object type is associated with the given taxonomy.
`$object_type` string Required Object type string. `$taxonomy` string Required Single taxonomy name. bool True if object is associated with the taxonomy, otherwise false.
File: `wp-includes/taxonomy.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
```
function is_object_in_taxonomy( $object_type, $taxonomy ) {
$taxonomies = get_object_taxonomies( $object_type );
if ( empty( $taxonomies ) ) {
return false;
}
return in_array( $taxonomy, $taxonomies, true );
}
```
| Uses | Description |
| --- | --- |
| [get\_object\_taxonomies()](get_object_taxonomies) wp-includes/taxonomy.php | Returns the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Terms\_Controller::check\_read\_terms\_permission\_for\_post()](../classes/wp_rest_terms_controller/check_read_terms_permission_for_post) wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Checks if the terms for a post can be read. |
| [WP\_Posts\_List\_Table::formats\_dropdown()](../classes/wp_posts_list_table/formats_dropdown) wp-admin/includes/class-wp-posts-list-table.php | Displays a formats drop-down for filtering items. |
| [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. |
| [WP\_Screen::get()](../classes/wp_screen/get) wp-admin/includes/class-wp-screen.php | Fetches a screen object. |
| [get\_the\_category\_list()](get_the_category_list) wp-includes/category-template.php | Retrieves category list for a post in either HTML list or custom format. |
| [get\_adjacent\_post()](get_adjacent_post) wp-includes/link-template.php | Retrieves the adjacent post. |
| [get\_post\_class()](get_post_class) wp-includes/post-template.php | Retrieves an array of the class names for the post container element. |
| [WP\_Post::\_\_get()](../classes/wp_post/__get) wp-includes/class-wp-post.php | Getter. |
| [wp\_set\_post\_categories()](wp_set_post_categories) wp-includes/post.php | Sets categories for a post. |
| [wp\_insert\_post()](wp_insert_post) wp-includes/post.php | Inserts or update a post. |
| [wp\_update\_post()](wp_update_post) wp-includes/post.php | Updates a post with new post data. |
| [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.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress is_gd_image( resource|GdImage|false $image ): bool is\_gd\_image( resource|GdImage|false $image ): bool
====================================================
Determines whether the value is an acceptable type for GD image functions.
In PHP 8.0, the GD extension uses GdImage objects for its data structures.
This function checks if the passed value is either a resource of type `gd` or a GdImage object instance. Any other type will return false.
`$image` resource|GdImage|false Required A value to check the type for. bool True if $image is either a GD image resource or GdImage instance, false otherwise.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
function is_gd_image( $image ) {
if ( is_resource( $image ) && 'gd' === get_resource_type( $image )
|| is_object( $image ) && $image instanceof GdImage
) {
return true;
}
return false;
}
```
| Used By | Description |
| --- | --- |
| [image\_edit\_apply\_changes()](image_edit_apply_changes) wp-admin/includes/image-edit.php | Performs group of changes on Editor specified. |
| [load\_image\_to\_edit()](load_image_to_edit) wp-admin/includes/image.php | Loads an image resource for editing. |
| [wp\_load\_image()](wp_load_image) wp-includes/deprecated.php | Load an image from a string, if PHP supports it. |
| [WP\_Image\_Editor\_GD::load()](../classes/wp_image_editor_gd/load) wp-includes/class-wp-image-editor-gd.php | Loads image from $this->file into new GD Resource. |
| [WP\_Image\_Editor\_GD::resize()](../classes/wp_image_editor_gd/resize) wp-includes/class-wp-image-editor-gd.php | Resizes current image. |
| [WP\_Image\_Editor\_GD::\_resize()](../classes/wp_image_editor_gd/_resize) wp-includes/class-wp-image-editor-gd.php | |
| [WP\_Image\_Editor\_GD::crop()](../classes/wp_image_editor_gd/crop) wp-includes/class-wp-image-editor-gd.php | Crops Image. |
| [WP\_Image\_Editor\_GD::rotate()](../classes/wp_image_editor_gd/rotate) wp-includes/class-wp-image-editor-gd.php | Rotates current image counter-clockwise by $angle. |
| [WP\_Image\_Editor\_GD::flip()](../classes/wp_image_editor_gd/flip) wp-includes/class-wp-image-editor-gd.php | Flips current image. |
| [wp\_imagecreatetruecolor()](wp_imagecreatetruecolor) wp-includes/media.php | Creates new GD image resource with transparency support. |
| Version | Description |
| --- | --- |
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |
wordpress get_the_author_lastname(): string get\_the\_author\_lastname(): string
====================================
This function has been deprecated. Use [get\_the\_author\_meta()](get_the_author_meta) instead.
Retrieve the last name of the author of the current post.
* [get\_the\_author\_meta()](get_the_author_meta)
string The author's last name.
File: `wp-includes/deprecated.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
```
function get_the_author_lastname() {
_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'last_name\')' );
return get_the_author_meta('last_name');
}
```
| Uses | Description |
| --- | --- |
| [get\_the\_author\_meta()](get_the_author_meta) wp-includes/author-template.php | Retrieves the requested data of the author of the current post. |
| [\_deprecated\_function()](_deprecated_function) wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| Version | Description |
| --- | --- |
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Use [get\_the\_author\_meta()](get_the_author_meta) |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress wp_save_image_file( string $filename, WP_Image_Editor $image, string $mime_type, int $post_id ): array|WP_Error|bool wp\_save\_image\_file( string $filename, WP\_Image\_Editor $image, string $mime\_type, int $post\_id ): array|WP\_Error|bool
============================================================================================================================
Saves image to file.
`$filename` string Required Name of the file to be saved. `$image` [WP\_Image\_Editor](../classes/wp_image_editor) Required The image editor instance. `$mime_type` string Required The mime type of the image. `$post_id` int Required Attachment post ID. array|[WP\_Error](../classes/wp_error)|bool Array on success or [WP\_Error](../classes/wp_error) if the file failed to save.
When called with a deprecated value for the `$image` parameter, i.e. a non-`WP_Image_Editor` image resource or `GdImage` instance, the function will return true on success, false on failure.
* `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-admin/includes/image-edit.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/image-edit.php/)
```
function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
if ( $image instanceof WP_Image_Editor ) {
/** This filter is documented in wp-admin/includes/image-edit.php */
$image = apply_filters( 'image_editor_save_pre', $image, $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.
*
* @since 3.5.0
*
* @param bool|null $override Value to return instead of saving. Default null.
* @param string $filename Name of the file to be saved.
* @param WP_Image_Editor $image The image editor instance.
* @param string $mime_type The mime type of the image.
* @param int $post_id Attachment post ID.
*/
$saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id );
if ( null !== $saved ) {
return $saved;
}
return $image->save( $filename, $mime_type );
} else {
/* translators: 1: $image, 2: WP_Image_Editor */
_deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) );
/** This filter is documented in wp-admin/includes/image-edit.php */
$image = apply_filters_deprecated( 'image_save_pre', array( $image, $post_id ), '3.5.0', 'image_editor_save_pre' );
/**
* Filters whether to skip saving the image file.
*
* Returning a non-null value will short-circuit the save method,
* returning that value instead.
*
* @since 2.9.0
* @deprecated 3.5.0 Use {@see 'wp_save_image_editor_file'} instead.
*
* @param bool|null $override Value to return instead of saving. Default null.
* @param string $filename Name of the file to be saved.
* @param resource|GdImage $image Image resource or GdImage instance.
* @param string $mime_type The mime type of the image.
* @param int $post_id Attachment post ID.
*/
$saved = apply_filters_deprecated(
'wp_save_image_file',
array( null, $filename, $image, $mime_type, $post_id ),
'3.5.0',
'wp_save_image_editor_file'
);
if ( null !== $saved ) {
return $saved;
}
switch ( $mime_type ) {
case 'image/jpeg':
/** This filter is documented in wp-includes/class-wp-image-editor.php */
return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) );
case 'image/png':
return imagepng( $image, $filename );
case 'image/gif':
return imagegif( $image, $filename );
case 'image/webp':
if ( function_exists( 'imagewebp' ) ) {
return imagewebp( $image, $filename );
}
return false;
default:
return false;
}
}
}
```
[apply\_filters( 'image\_editor\_save\_pre', WP\_Image\_Editor $image, int $attachment\_id )](../hooks/image_editor_save_pre)
Filters the [WP\_Image\_Editor](../classes/wp_image_editor) instance for the image to be streamed to the browser.
[apply\_filters\_deprecated( 'image\_save\_pre', resource|GdImage $image, int $attachment\_id )](../hooks/image_save_pre)
Filters the GD image resource to be streamed to the browser.
[apply\_filters( 'jpeg\_quality', int $quality, string $context )](../hooks/jpeg_quality)
Filters the JPEG compression quality for backward-compatibility.
[apply\_filters( 'wp\_save\_image\_editor\_file', bool|null $override, string $filename, WP\_Image\_Editor $image, string $mime\_type, int $post\_id )](../hooks/wp_save_image_editor_file)
Filters whether to skip saving the image file.
[apply\_filters\_deprecated( 'wp\_save\_image\_file', bool|null $override, string $filename, resource|GdImage $image, string $mime\_type, int $post\_id )](../hooks/wp_save_image_file)
Filters whether to skip saving the image file.
| Uses | Description |
| --- | --- |
| [apply\_filters\_deprecated()](apply_filters_deprecated) wp-includes/plugin.php | Fires functions attached to a deprecated filter hook. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_deprecated\_argument()](_deprecated_argument) wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [wp\_save\_image()](wp_save_image) wp-admin/includes/image-edit.php | Saves image to post, along with enqueued changes in `$_REQUEST['history']`. |
| 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/) | The `$image` parameter expects a `WP_Image_Editor` instance. |
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |
wordpress prepend_attachment( string $content ): string prepend\_attachment( string $content ): string
==============================================
Wraps attachment in paragraph tag before content.
`$content` string Required string
File: `wp-includes/post-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
```
function prepend_attachment( $content ) {
$post = get_post();
if ( empty( $post->post_type ) || 'attachment' !== $post->post_type ) {
return $content;
}
if ( wp_attachment_is( 'video', $post ) ) {
$meta = wp_get_attachment_metadata( get_the_ID() );
$atts = array( 'src' => wp_get_attachment_url() );
if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) {
$atts['width'] = (int) $meta['width'];
$atts['height'] = (int) $meta['height'];
}
if ( has_post_thumbnail() ) {
$atts['poster'] = wp_get_attachment_url( get_post_thumbnail_id() );
}
$p = wp_video_shortcode( $atts );
} elseif ( wp_attachment_is( 'audio', $post ) ) {
$p = wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) );
} else {
$p = '<p class="attachment">';
// Show the medium sized image representation of the attachment if available, and link to the raw file.
$p .= wp_get_attachment_link( 0, 'medium', false );
$p .= '</p>';
}
/**
* Filters the attachment markup to be prepended to the post content.
*
* @since 2.0.0
*
* @see prepend_attachment()
*
* @param string $p The attachment HTML output.
*/
$p = apply_filters( 'prepend_attachment', $p );
return "$p\n$content";
}
```
[apply\_filters( 'prepend\_attachment', string $p )](../hooks/prepend_attachment)
Filters the attachment markup to be prepended to the post content.
| Uses | Description |
| --- | --- |
| [wp\_attachment\_is()](wp_attachment_is) wp-includes/post.php | Verifies an attachment is of a given type. |
| [has\_post\_thumbnail()](has_post_thumbnail) wp-includes/post-thumbnail-template.php | Determines whether a post has an image attached. |
| [get\_post\_thumbnail\_id()](get_post_thumbnail_id) wp-includes/post-thumbnail-template.php | Retrieves the post thumbnail ID. |
| [wp\_get\_attachment\_link()](wp_get_attachment_link) wp-includes/post-template.php | Retrieves an attachment page link using an image or icon, if possible. |
| [get\_the\_ID()](get_the_id) wp-includes/post-template.php | Retrieves the ID of the current item in the WordPress Loop. |
| [wp\_video\_shortcode()](wp_video_shortcode) wp-includes/media.php | Builds the Video shortcode output. |
| [wp\_audio\_shortcode()](wp_audio_shortcode) wp-includes/media.php | Builds the Audio shortcode output. |
| [wp\_get\_attachment\_metadata()](wp_get_attachment_metadata) wp-includes/post.php | Retrieves attachment metadata for attachment ID. |
| [wp\_get\_attachment\_url()](wp_get_attachment_url) wp-includes/post.php | Retrieves the URL for an attachment. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [wp\_embed\_excerpt\_attachment()](wp_embed_excerpt_attachment) wp-includes/embed.php | Filters the post excerpt for the embed template. |
| Version | Description |
| --- | --- |
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |
| programming_docs |
wordpress wp_ajax_oembed_cache() wp\_ajax\_oembed\_cache()
=========================
Ajax handler for oEmbed caching.
File: `wp-admin/includes/ajax-actions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/ajax-actions.php/)
```
function wp_ajax_oembed_cache() {
$GLOBALS['wp_embed']->cache_oembed( $_GET['post'] );
wp_die( 0 );
}
```
| Uses | Description |
| --- | --- |
| [wp\_die()](wp_die) wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| Version | Description |
| --- | --- |
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |
wordpress plugin_basename( string $file ): string plugin\_basename( string $file ): string
========================================
Gets the basename of a plugin.
This method extracts the name of a plugin from its filename.
`$file` string Required The filename of plugin. string The name of a plugin.
This function gets the path to a plugin file or directory, relative to the plugins directory, without the leading and trailing slashes.
Uses both the WP\_PLUGIN\_DIR and WPMU\_PLUGIN\_DIR constants internally, to test for and strip the plugins directory path from the $file path. Note that the direct usage of WordPress internal constants [is not recommended](https://codex.wordpress.org/Determining_Plugin_and_Content_Directories "Determining Plugin and Content Directories").
File: `wp-includes/plugin.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/plugin.php/)
```
function plugin_basename( $file ) {
global $wp_plugin_paths;
// $wp_plugin_paths contains normalized paths.
$file = wp_normalize_path( $file );
arsort( $wp_plugin_paths );
foreach ( $wp_plugin_paths as $dir => $realdir ) {
if ( strpos( $file, $realdir ) === 0 ) {
$file = $dir . substr( $file, strlen( $realdir ) );
}
}
$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );
// Get relative path from plugins directory.
$file = preg_replace( '#^' . preg_quote( $plugin_dir, '#' ) . '/|^' . preg_quote( $mu_plugin_dir, '#' ) . '/#', '', $file );
$file = trim( $file, '/' );
return $file;
}
```
| Uses | Description |
| --- | --- |
| [wp\_normalize\_path()](wp_normalize_path) wp-includes/functions.php | Normalizes a filesystem path. |
| Used By | Description |
| --- | --- |
| [WP\_REST\_Plugins\_Controller::validate\_plugin\_param()](../classes/wp_rest_plugins_controller/validate_plugin_param) wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php | Checks that the “plugin” parameter is a valid path. |
| [WP\_REST\_Plugins\_Controller::sanitize\_plugin\_param()](../classes/wp_rest_plugins_controller/sanitize_plugin_param) wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php | Sanitizes the “plugin” parameter to be a proper plugin file with “.php” appended. |
| [wp\_skip\_paused\_plugins()](wp_skip_paused_plugins) wp-includes/load.php | Filters a given list of plugins, removing any paused plugins from it. |
| [wp\_ajax\_delete\_plugin()](wp_ajax_delete_plugin) wp-admin/includes/ajax-actions.php | Ajax handler for deleting a plugin. |
| [wp\_ajax\_update\_plugin()](wp_ajax_update_plugin) wp-admin/includes/ajax-actions.php | Ajax handler for updating a plugin. |
| [is\_uninstallable\_plugin()](is_uninstallable_plugin) wp-admin/includes/plugin.php | Determines whether the plugin can be uninstalled. |
| [uninstall\_plugin()](uninstall_plugin) wp-admin/includes/plugin.php | Uninstalls a single plugin. |
| [add\_menu\_page()](add_menu_page) wp-admin/includes/plugin.php | Adds a top-level menu page. |
| [add\_submenu\_page()](add_submenu_page) wp-admin/includes/plugin.php | Adds a submenu page. |
| [deactivate\_plugins()](deactivate_plugins) wp-admin/includes/plugin.php | Deactivates a single plugin or multiple plugins. |
| [activate\_plugin()](activate_plugin) wp-admin/includes/plugin.php | Attempts activation of plugin in a “sandbox” and redirects on success. |
| [get\_plugin\_data()](get_plugin_data) wp-admin/includes/plugin.php | Parses the plugin contents to retrieve plugin’s metadata. |
| [\_get\_plugin\_data\_markup\_translate()](_get_plugin_data_markup_translate) wp-admin/includes/plugin.php | Sanitizes plugin data, optionally adds markup, optionally translates. |
| [get\_plugin\_files()](get_plugin_files) wp-admin/includes/plugin.php | Gets a list of a plugin’s files. |
| [get\_plugins()](get_plugins) wp-admin/includes/plugin.php | Checks the plugins directory and retrieve all plugin files with plugin data. |
| [plugins\_url()](plugins_url) wp-includes/link-template.php | Retrieves a URL within the plugins or mu-plugins directory. |
| [register\_activation\_hook()](register_activation_hook) wp-includes/plugin.php | Set the activation hook for a plugin. |
| [register\_deactivation\_hook()](register_deactivation_hook) wp-includes/plugin.php | Sets the deactivation hook for a plugin. |
| [register\_uninstall\_hook()](register_uninstall_hook) wp-includes/plugin.php | Sets the uninstallation hook for a plugin. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress smilies_init() smilies\_init()
===============
Converts smiley code to the icon graphic file equivalent.
You can turn off smilies, by going to the write setting screen and unchecking the box, or by setting ‘use\_smilies’ option to false or removing the option.
Plugins may override the default smiley list by setting the $wpsmiliestrans to an array, with the key the code the blogger types in and the value the image file.
The $wp\_smiliessearch global is for the regular expression and is set each time the function is called.
The full list of smilies can be found in the function and won’t be listed in the description. Probably should create a Codex page for it, so that it is available.
File: `wp-includes/functions.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
```
function smilies_init() {
global $wpsmiliestrans, $wp_smiliessearch;
// Don't bother setting up smilies if they are disabled.
if ( ! get_option( 'use_smilies' ) ) {
return;
}
if ( ! isset( $wpsmiliestrans ) ) {
$wpsmiliestrans = array(
':mrgreen:' => 'mrgreen.png',
':neutral:' => "\xf0\x9f\x98\x90",
':twisted:' => "\xf0\x9f\x98\x88",
':arrow:' => "\xe2\x9e\xa1",
':shock:' => "\xf0\x9f\x98\xaf",
':smile:' => "\xf0\x9f\x99\x82",
':???:' => "\xf0\x9f\x98\x95",
':cool:' => "\xf0\x9f\x98\x8e",
':evil:' => "\xf0\x9f\x91\xbf",
':grin:' => "\xf0\x9f\x98\x80",
':idea:' => "\xf0\x9f\x92\xa1",
':oops:' => "\xf0\x9f\x98\xb3",
':razz:' => "\xf0\x9f\x98\x9b",
':roll:' => "\xf0\x9f\x99\x84",
':wink:' => "\xf0\x9f\x98\x89",
':cry:' => "\xf0\x9f\x98\xa5",
':eek:' => "\xf0\x9f\x98\xae",
':lol:' => "\xf0\x9f\x98\x86",
':mad:' => "\xf0\x9f\x98\xa1",
':sad:' => "\xf0\x9f\x99\x81",
'8-)' => "\xf0\x9f\x98\x8e",
'8-O' => "\xf0\x9f\x98\xaf",
':-(' => "\xf0\x9f\x99\x81",
':-)' => "\xf0\x9f\x99\x82",
':-?' => "\xf0\x9f\x98\x95",
':-D' => "\xf0\x9f\x98\x80",
':-P' => "\xf0\x9f\x98\x9b",
':-o' => "\xf0\x9f\x98\xae",
':-x' => "\xf0\x9f\x98\xa1",
':-|' => "\xf0\x9f\x98\x90",
';-)' => "\xf0\x9f\x98\x89",
// This one transformation breaks regular text with frequency.
// '8)' => "\xf0\x9f\x98\x8e",
'8O' => "\xf0\x9f\x98\xaf",
':(' => "\xf0\x9f\x99\x81",
':)' => "\xf0\x9f\x99\x82",
':?' => "\xf0\x9f\x98\x95",
':D' => "\xf0\x9f\x98\x80",
':P' => "\xf0\x9f\x98\x9b",
':o' => "\xf0\x9f\x98\xae",
':x' => "\xf0\x9f\x98\xa1",
':|' => "\xf0\x9f\x98\x90",
';)' => "\xf0\x9f\x98\x89",
':!:' => "\xe2\x9d\x97",
':?:' => "\xe2\x9d\x93",
);
}
/**
* Filters all the smilies.
*
* This filter must be added before `smilies_init` is run, as
* it is normally only run once to setup the smilies regex.
*
* @since 4.7.0
*
* @param string[] $wpsmiliestrans List of the smilies' hexadecimal representations, keyed by their smily code.
*/
$wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans );
if ( count( $wpsmiliestrans ) == 0 ) {
return;
}
/*
* NOTE: we sort the smilies in reverse key order. This is to make sure
* we match the longest possible smilie (:???: vs :?) as the regular
* expression used below is first-match
*/
krsort( $wpsmiliestrans );
$spaces = wp_spaces_regexp();
// Begin first "subpattern".
$wp_smiliessearch = '/(?<=' . $spaces . '|^)';
$subchar = '';
foreach ( (array) $wpsmiliestrans as $smiley => $img ) {
$firstchar = substr( $smiley, 0, 1 );
$rest = substr( $smiley, 1 );
// New subpattern?
if ( $firstchar != $subchar ) {
if ( '' !== $subchar ) {
$wp_smiliessearch .= ')(?=' . $spaces . '|$)'; // End previous "subpattern".
$wp_smiliessearch .= '|(?<=' . $spaces . '|^)'; // Begin another "subpattern".
}
$subchar = $firstchar;
$wp_smiliessearch .= preg_quote( $firstchar, '/' ) . '(?:';
} else {
$wp_smiliessearch .= '|';
}
$wp_smiliessearch .= preg_quote( $rest, '/' );
}
$wp_smiliessearch .= ')(?=' . $spaces . '|$)/m';
}
```
[apply\_filters( 'smilies', string[] $wpsmiliestrans )](../hooks/smilies)
Filters all the smilies.
| Uses | Description |
| --- | --- |
| [wp\_spaces\_regexp()](wp_spaces_regexp) wp-includes/formatting.php | Returns the regexp for common whitespace characters. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Version | Description |
| --- | --- |
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |
wordpress get_clean_basedomain(): string get\_clean\_basedomain(): string
================================
Get base domain of network.
string Base domain.
File: `wp-admin/includes/network.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/network.php/)
```
function get_clean_basedomain() {
$existing_domain = network_domain_check();
if ( $existing_domain ) {
return $existing_domain;
}
$domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
$slash = strpos( $domain, '/' );
if ( $slash ) {
$domain = substr( $domain, 0, $slash );
}
return $domain;
}
```
| Uses | Description |
| --- | --- |
| [network\_domain\_check()](network_domain_check) wp-admin/includes/network.php | Check for an existing network. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| Used By | Description |
| --- | --- |
| [network\_step1()](network_step1) wp-admin/includes/network.php | Prints step 1 for Network installation process. |
| [network\_step2()](network_step2) wp-admin/includes/network.php | Prints step 2 for Network installation process. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |
wordpress get_image_send_to_editor( int $id, string $caption, string $title, string $align, string $url = '', bool|string $rel = false, string|int[] $size = 'medium', string $alt = '' ): string get\_image\_send\_to\_editor( int $id, string $caption, string $title, string $align, string $url = '', bool|string $rel = false, string|int[] $size = 'medium', string $alt = '' ): string
===========================================================================================================================================================================================
Retrieves the image HTML to send to the editor.
`$id` int Required Image attachment ID. `$caption` string Required Image caption. `$title` string Required Image title attribute. `$align` string Required Image CSS alignment property. `$url` string Optional Image src URL. Default: `''`
`$rel` bool|string Optional Value for rel attribute or whether to add a default value. Default: `false`
`$size` string|int[] Optional Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). Default `'medium'`. Default: `'medium'`
`$alt` string Optional Image alt attribute. Default: `''`
string The HTML output to insert into the editor.
File: `wp-admin/includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
```
function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $rel = false, $size = 'medium', $alt = '' ) {
$html = get_image_tag( $id, $alt, '', $align, $size );
if ( $rel ) {
if ( is_string( $rel ) ) {
$rel = ' rel="' . esc_attr( $rel ) . '"';
} else {
$rel = ' rel="attachment wp-att-' . (int) $id . '"';
}
} else {
$rel = '';
}
if ( $url ) {
$html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
}
/**
* Filters the image HTML markup to send to the editor when inserting an image.
*
* @since 2.5.0
* @since 5.6.0 The `$rel` parameter was added.
*
* @param string $html The image HTML markup to send.
* @param int $id The attachment ID.
* @param string $caption The image caption.
* @param string $title The image title.
* @param string $align The image alignment.
* @param string $url The image source URL.
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @param string $alt The image alternative, or alt, text.
* @param string $rel The image rel attribute.
*/
$html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt, $rel );
return $html;
}
```
[apply\_filters( 'image\_send\_to\_editor', string $html, int $id, string $caption, string $title, string $align, string $url, string|int[] $size, string $alt, string $rel )](../hooks/image_send_to_editor)
Filters the image HTML markup to send to the editor when inserting an image.
| Uses | Description |
| --- | --- |
| [get\_image\_tag()](get_image_tag) wp-includes/media.php | Gets an img tag for an image attachment, scaling it down if requested. |
| [esc\_attr()](esc_attr) wp-includes/formatting.php | Escaping for HTML attributes. |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| Used By | Description |
| --- | --- |
| [image\_media\_send\_to\_editor()](image_media_send_to_editor) wp-admin/includes/media.php | Retrieves the media element HTML to send to the editor. |
| [wp\_ajax\_send\_attachment\_to\_editor()](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 pings_open( int|WP_Post $post = null ): bool pings\_open( int|WP\_Post $post = null ): bool
==============================================
Determines whether the current post is open for pings.
For more information on this and similar theme functions, check out the [Conditional Tags](https://developer.wordpress.org/themes/basics/conditional-tags/) article in the Theme Developer Handbook.
`$post` int|[WP\_Post](../classes/wp_post) Optional Post ID or [WP\_Post](../classes/wp_post) object. Default current post. Default: `null`
bool True if pings are accepted
File: `wp-includes/comment-template.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
```
function pings_open( $post = null ) {
$_post = get_post( $post );
$post_id = $_post ? $_post->ID : 0;
$open = ( $_post && ( 'open' === $_post->ping_status ) );
/**
* Filters whether the current post is open for pings.
*
* @since 2.5.0
*
* @param bool $open Whether the current post is open for pings.
* @param int $post_id The post ID.
*/
return apply_filters( 'pings_open', $open, $post_id );
}
```
[apply\_filters( 'pings\_open', bool $open, int $post\_id )](../hooks/pings_open)
Filters whether the current post is open for pings.
| Uses | Description |
| --- | --- |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [register\_and\_do\_post\_meta\_boxes()](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. |
| [feed\_links\_extra()](feed_links_extra) wp-includes/general-template.php | Displays the links to the extra feeds such as category feeds. |
| [WP::send\_headers()](../classes/wp/send_headers) wp-includes/class-wp.php | Sends additional HTTP headers for caching, content type, etc. |
| [wp\_xmlrpc\_server::pingback\_ping()](../classes/wp_xmlrpc_server/pingback_ping) wp-includes/class-wp-xmlrpc-server.php | Retrieves a pingback and registers it. |
| [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. |
| [comments\_popup\_link()](comments_popup_link) wp-includes/comment-template.php | Displays the link to the comments for the current post ID. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
wordpress _response_to_rss( array $resp ): MagpieRSS|bool \_response\_to\_rss( array $resp ): MagpieRSS|bool
==================================================
Retrieve
`$resp` array Required [MagpieRSS](../classes/magpierss)|bool
File: `wp-includes/rss.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/rss.php/)
```
function _response_to_rss ($resp) {
$rss = new MagpieRSS( $resp->results );
// if RSS parsed successfully
if ( $rss && (!isset($rss->ERROR) || !$rss->ERROR) ) {
// find Etag, and Last-Modified
foreach ( (array) $resp->headers as $h) {
// 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1"
if (strpos($h, ": ")) {
list($field, $val) = explode(": ", $h, 2);
}
else {
$field = $h;
$val = "";
}
if ( $field == 'etag' ) {
$rss->etag = $val;
}
if ( $field == 'last-modified' ) {
$rss->last_modified = $val;
}
}
return $rss;
} // else construct error message
else {
$errormsg = "Failed to parse RSS file.";
if ($rss) {
$errormsg .= " (" . $rss->ERROR . ")";
}
// error($errormsg);
return false;
} // end if ($rss and !$rss->error)
}
```
| Uses | Description |
| --- | --- |
| [MagpieRSS::\_\_construct()](../classes/magpierss/__construct) wp-includes/rss.php | PHP5 constructor. |
| Used By | Description |
| --- | --- |
| [fetch\_rss()](fetch_rss) wp-includes/rss.php | Build Magpie object based on RSS from URL. |
| Version | Description |
| --- | --- |
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |
| programming_docs |
wordpress wp_add_inline_script( string $handle, string $data, string $position = 'after' ): bool wp\_add\_inline\_script( string $handle, string $data, string $position = 'after' ): bool
=========================================================================================
Adds extra code to a registered script.
Code will only be added if the script is already in the queue.
Accepts a string $data containing the Code. If two or more code blocks are added to the same script $handle, they will be printed in the order they were added, i.e. the latter added code can redeclare the previous.
* [WP\_Scripts::add\_inline\_script()](../classes/wp_scripts/add_inline_script)
`$handle` string Required Name of the script to add the inline script to. `$data` string Required String containing the JavaScript to be added. `$position` string Optional Whether to add the inline script before the handle or after. Default `'after'`. Default: `'after'`
bool True on success, false on failure.
File: `wp-includes/functions.wp-scripts.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/functions-wp-scripts.php/)
```
function wp_add_inline_script( $handle, $data, $position = 'after' ) {
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
if ( false !== stripos( $data, '</script>' ) ) {
_doing_it_wrong(
__FUNCTION__,
sprintf(
/* translators: 1: <script>, 2: wp_add_inline_script() */
__( 'Do not pass %1$s tags to %2$s.' ),
'<code><script></code>',
'<code>wp_add_inline_script()</code>'
),
'4.5.0'
);
$data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) );
}
return wp_scripts()->add_inline_script( $handle, $data, $position );
}
```
| Uses | Description |
| --- | --- |
| [stripos()](stripos) wp-includes/class-pop3.php | |
| [WP\_Scripts::add\_inline\_script()](../classes/wp_scripts/add_inline_script) wp-includes/class-wp-scripts.php | Adds extra code to a registered script. |
| [wp\_scripts()](wp_scripts) wp-includes/functions.wp-scripts.php | Initialize $wp\_scripts if it has not been set. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [\_doing\_it\_wrong()](_doing_it_wrong) wp-includes/functions.php | Marks something as being incorrectly called. |
| Used By | Description |
| --- | --- |
| [block\_editor\_rest\_api\_preload()](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. |
| [enqueue\_editor\_block\_styles\_assets()](enqueue_editor_block_styles_assets) wp-includes/script-loader.php | Function responsible for enqueuing the assets required for block styles functionality on the editor. |
| [the\_block\_editor\_meta\_boxes()](the_block_editor_meta_boxes) wp-admin/includes/post.php | Renders the meta boxes forms. |
| [WP\_Privacy\_Policy\_Content::notice()](../classes/wp_privacy_policy_content/notice) wp-admin/includes/class-wp-privacy-policy-content.php | Add a notice with a link to the guide when editing the privacy policy page. |
| [wp\_enqueue\_code\_editor()](wp_enqueue_code_editor) wp-includes/general-template.php | Enqueues assets needed by the code editor for the given settings. |
| [WP\_Widget\_Text::\_register\_one()](../classes/wp_widget_text/_register_one) wp-includes/widgets/class-wp-widget-text.php | Add hooks for enqueueing assets when registering all widget instances of this widget class. |
| [WP\_Widget\_Media\_Gallery::enqueue\_admin\_scripts()](../classes/wp_widget_media_gallery/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. |
| [WP\_Widget\_Custom\_HTML::\_register\_one()](../classes/wp_widget_custom_html/_register_one) wp-includes/widgets/class-wp-widget-custom-html.php | Add hooks for enqueueing assets when registering all widget instances of this widget class. |
| [WP\_Widget\_Custom\_HTML::enqueue\_admin\_scripts()](../classes/wp_widget_custom_html/enqueue_admin_scripts) wp-includes/widgets/class-wp-widget-custom-html.php | Loads the required scripts and styles for the widget control. |
| [WP\_Widget\_Text::enqueue\_admin\_scripts()](../classes/wp_widget_text/enqueue_admin_scripts) wp-includes/widgets/class-wp-widget-text.php | Loads the required scripts and styles for the widget control. |
| [WP\_Widget\_Media\_Audio::enqueue\_admin\_scripts()](../classes/wp_widget_media_audio/enqueue_admin_scripts) wp-includes/widgets/class-wp-widget-media-audio.php | Loads the required media files for the media manager and scripts for media widgets. |
| [WP\_Widget\_Media\_Video::enqueue\_admin\_scripts()](../classes/wp_widget_media_video/enqueue_admin_scripts) wp-includes/widgets/class-wp-widget-media-video.php | Loads the required scripts and styles for the widget control. |
| [WP\_Widget\_Media\_Image::enqueue\_admin\_scripts()](../classes/wp_widget_media_image/enqueue_admin_scripts) wp-includes/widgets/class-wp-widget-media-image.php | Loads the required media files for the media manager and scripts for media widgets. |
| [wp\_localize\_jquery\_ui\_datepicker()](wp_localize_jquery_ui_datepicker) wp-includes/script-loader.php | Localizes the jQuery UI datepicker. |
| [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 |
| --- | --- |
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |
wordpress get_sample_permalink_html( int|WP_Post $post, string|null $new_title = null, string|null $new_slug = null ): string get\_sample\_permalink\_html( int|WP\_Post $post, string|null $new\_title = null, string|null $new\_slug = null ): string
=========================================================================================================================
Returns the HTML of the sample permalink slug editor.
`$post` int|[WP\_Post](../classes/wp_post) Required Post ID or post object. `$new_title` string|null Optional New title. Default: `null`
`$new_slug` string|null Optional New slug. Default: `null`
string The HTML of the sample permalink slug editor.
File: `wp-admin/includes/post.php`. [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
```
function get_sample_permalink_html( $post, $new_title = null, $new_slug = null ) {
$post = get_post( $post );
if ( ! $post ) {
return '';
}
list($permalink, $post_name) = get_sample_permalink( $post->ID, $new_title, $new_slug );
$view_link = false;
$preview_target = '';
if ( current_user_can( 'read_post', $post->ID ) ) {
if ( 'draft' === $post->post_status || empty( $post->post_name ) ) {
$view_link = get_preview_post_link( $post );
$preview_target = " target='wp-preview-{$post->ID}'";
} else {
if ( 'publish' === $post->post_status || 'attachment' === $post->post_type ) {
$view_link = get_permalink( $post );
} else {
// Allow non-published (private, future) to be viewed at a pretty permalink, in case $post->post_name is set.
$view_link = str_replace( array( '%pagename%', '%postname%' ), $post->post_name, $permalink );
}
}
}
// Permalinks without a post/page name placeholder don't have anything to edit.
if ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) {
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
if ( false !== $view_link ) {
$display_link = urldecode( $view_link );
$return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . esc_html( $display_link ) . "</a>\n";
} else {
$return .= '<span id="sample-permalink">' . $permalink . "</span>\n";
}
// Encourage a pretty permalink setting.
if ( ! get_option( 'permalink_structure' ) && current_user_can( 'manage_options' )
&& ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID )
) {
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small">' . __( 'Change Permalink Structure' ) . "</a></span>\n";
}
} else {
if ( mb_strlen( $post_name ) > 34 ) {
$post_name_abridged = mb_substr( $post_name, 0, 16 ) . '…' . mb_substr( $post_name, -16 );
} else {
$post_name_abridged = $post_name;
}
$post_name_html = '<span id="editable-post-name">' . esc_html( $post_name_abridged ) . '</span>';
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
$return .= '<span id="sample-permalink"><a href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a></span>\n";
$return .= '‎'; // Fix bi-directional text display defect in RTL languages.
$return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js" aria-label="' . __( 'Edit permalink' ) . '">' . __( 'Edit' ) . "</button></span>\n";
$return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
}
/**
* Filters the sample permalink HTML markup.
*
* @since 2.9.0
* @since 4.4.0 Added `$post` parameter.
*
* @param string $return Sample permalink HTML markup.
* @param int $post_id Post ID.
* @param string $new_title New sample permalink title.
* @param string $new_slug New sample permalink slug.
* @param WP_Post $post Post object.
*/
$return = apply_filters( 'get_sample_permalink_html', $return, $post->ID, $new_title, $new_slug, $post );
return $return;
}
```
[apply\_filters( 'get\_sample\_permalink\_html', string $return, int $post\_id, string $new\_title, string $new\_slug, WP\_Post $post )](../hooks/get_sample_permalink_html)
Filters the sample permalink HTML markup.
| Uses | Description |
| --- | --- |
| [get\_preview\_post\_link()](get_preview_post_link) wp-includes/link-template.php | Retrieves the URL used for the post preview. |
| [get\_sample\_permalink()](get_sample_permalink) wp-admin/includes/post.php | Returns a sample permalink based on the post name. |
| [current\_user\_can()](current_user_can) wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| [\_\_()](__) wp-includes/l10n.php | Retrieves the translation of $text. |
| [esc\_url()](esc_url) wp-includes/formatting.php | Checks and cleans a URL. |
| [esc\_html()](esc_html) wp-includes/formatting.php | Escaping for HTML blocks. |
| [get\_permalink()](get_permalink) wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| [get\_option()](get_option) wp-includes/option.php | Retrieves an option value based on an option name. |
| [get\_post()](get_post) wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Used By | Description |
| --- | --- |
| [wp\_ajax\_sample\_permalink()](wp_ajax_sample_permalink) wp-admin/includes/ajax-actions.php | Ajax handler to retrieve a sample permalink. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress wp_get_attachment_image_src( int $attachment_id, string|int[] $size = 'thumbnail', bool $icon = false ): array|false wp\_get\_attachment\_image\_src( int $attachment\_id, string|int[] $size = 'thumbnail', bool $icon = false ): array|false
=========================================================================================================================
Retrieves an image to represent an attachment.
`$attachment_id` int Required Image attachment ID. `$size` string|int[] Optional Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). Default `'thumbnail'`. Default: `'thumbnail'`
`$icon` bool Optional Whether the image should fall back to a mime type icon. Default: `false`
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.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon = false ) {
// Get a thumbnail or intermediate image if there is one.
$image = image_downsize( $attachment_id, $size );
if ( ! $image ) {
$src = false;
if ( $icon ) {
$src = wp_mime_type_icon( $attachment_id );
if ( $src ) {
/** This filter is documented in wp-includes/post.php */
$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );
$src_file = $icon_dir . '/' . wp_basename( $src );
list( $width, $height ) = wp_getimagesize( $src_file );
}
}
if ( $src && $width && $height ) {
$image = array( $src, $width, $height, false );
}
}
/**
* Filters the attachment image source result.
*
* @since 4.3.0
*
* @param array|false $image {
* Array of image data, or boolean false if no image is available.
*
* @type string $0 Image source URL.
* @type int $1 Image width in pixels.
* @type int $2 Image height in pixels.
* @type bool $3 Whether the image is a resized image.
* }
* @param int $attachment_id Image attachment ID.
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @param bool $icon Whether the image should be treated as an icon.
*/
return apply_filters( 'wp_get_attachment_image_src', $image, $attachment_id, $size, $icon );
}
```
[apply\_filters( 'icon\_dir', string $path )](../hooks/icon_dir)
Filters the icon directory path.
[apply\_filters( 'wp\_get\_attachment\_image\_src', array|false $image, int $attachment\_id, string|int[] $size, bool $icon )](../hooks/wp_get_attachment_image_src)
Filters the attachment image source result.
| Uses | Description |
| --- | --- |
| [wp\_getimagesize()](wp_getimagesize) wp-includes/media.php | Allows PHP’s getimagesize() to be debuggable when necessary. |
| [image\_downsize()](image_downsize) wp-includes/media.php | Scales an image to fit a particular size (such as ‘thumb’ or ‘medium’). |
| [wp\_mime\_type\_icon()](wp_mime_type_icon) wp-includes/post.php | Retrieves the icon for a MIME type or attachment. |
| [wp\_basename()](wp_basename) wp-includes/formatting.php | i18n-friendly version of basename(). |
| [apply\_filters()](apply_filters) wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| 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. |
| [get\_oembed\_response\_data\_rich()](get_oembed_response_data_rich) wp-includes/embed.php | Filters the oEmbed response data to return an iframe embed code. |
| [wp\_get\_attachment\_image\_srcset()](wp_get_attachment_image_srcset) wp-includes/media.php | Retrieves the value for an image attachment’s ‘srcset’ attribute. |
| [wp\_get\_attachment\_image\_sizes()](wp_get_attachment_image_sizes) wp-includes/media.php | Retrieves the value for an image attachment’s ‘sizes’ attribute. |
| [wp\_get\_attachment\_image\_url()](wp_get_attachment_image_url) wp-includes/media.php | Gets the URL of an image attachment. |
| [wp\_save\_image()](wp_save_image) wp-admin/includes/image-edit.php | Saves image to post, along with enqueued changes in `$_REQUEST['history']`. |
| [edit\_form\_image\_editor()](edit_form_image_editor) wp-admin/includes/media.php | Displays the image and editor in the post editor |
| [get\_media\_item()](get_media_item) wp-admin/includes/media.php | Retrieves HTML form for modifying the image attachment. |
| [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\_Background::wp\_set\_background\_image()](../classes/custom_background/wp_set_background_image) wp-admin/includes/class-custom-background.php | |
| [Custom\_Background::handle\_upload()](../classes/custom_background/handle_upload) wp-admin/includes/class-custom-background.php | Handles an Image upload for the background image. |
| [wp\_prepare\_attachment\_for\_js()](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. |
| [wp\_playlist\_shortcode()](wp_playlist_shortcode) wp-includes/media.php | Builds the Playlist shortcode output. |
| [wp\_get\_attachment\_image()](wp_get_attachment_image) wp-includes/media.php | Gets an HTML img element representing an image attachment. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress previous_image_link( string|int[] $size = 'thumbnail', string|false $text = false ) previous\_image\_link( string|int[] $size = 'thumbnail', string|false $text = false )
=====================================================================================
Displays previous image link that has the same post parent.
`$size` string|int[] Optional Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). Default `'thumbnail'`. Default: `'thumbnail'`
`$text` string|false Optional Link text. Default: `false`
##### Usage:
Typically uses in `attachment.php`. In the WordPress default theme Twenty Eleven and Twenty Twelve, it is used in `image.php`.
```
previous_image_link( $size, $text );
```
##### Notes:
This creates a link to the previous image attached to the current post. Whenever a series of images are linked to the attachment page, it will put a ‘previous image link’ with the images when viewed in the attachment page.
File: `wp-includes/media.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
```
function previous_image_link( $size = 'thumbnail', $text = false ) {
echo get_previous_image_link( $size, $text );
}
```
| Uses | Description |
| --- | --- |
| [get\_previous\_image\_link()](get_previous_image_link) wp-includes/media.php | Gets the previous image link that has the same post parent. |
| Version | Description |
| --- | --- |
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |
wordpress count_many_users_posts( int[] $users, string|string[] $post_type = 'post', bool $public_only = false ): string[] count\_many\_users\_posts( int[] $users, string|string[] $post\_type = 'post', bool $public\_only = false ): string[]
=====================================================================================================================
Gets the number of posts written by a list of users.
`$users` int[] Required Array of user IDs. `$post_type` string|string[] Optional Single post type or array of post types to check. Defaults to `'post'`. Default: `'post'`
`$public_only` bool Optional Only return counts for public posts. Defaults to false. Default: `false`
string[] Amount of posts each user has written, as strings, keyed by user ID.
File: `wp-includes/user.php`. [View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
```
function count_many_users_posts( $users, $post_type = 'post', $public_only = false ) {
global $wpdb;
$count = array();
if ( empty( $users ) || ! is_array( $users ) ) {
return $count;
}
$userlist = implode( ',', array_map( 'absint', $users ) );
$where = get_posts_by_author_sql( $post_type, true, null, $public_only );
$result = $wpdb->get_results( "SELECT post_author, COUNT(*) FROM $wpdb->posts $where AND post_author IN ($userlist) GROUP BY post_author", ARRAY_N );
foreach ( $result as $row ) {
$count[ $row[0] ] = $row[1];
}
foreach ( $users as $id ) {
if ( ! isset( $count[ $id ] ) ) {
$count[ $id ] = 0;
}
}
return $count;
}
```
| Uses | Description |
| --- | --- |
| [get\_posts\_by\_author\_sql()](get_posts_by_author_sql) wp-includes/post.php | Retrieves the post SQL based on capability, author, and type. |
| [wpdb::get\_results()](../classes/wpdb/get_results) wp-includes/class-wpdb.php | Retrieves an entire SQL result set from the database (i.e., many rows). |
| Used By | Description |
| --- | --- |
| [WP\_Users\_List\_Table::display\_rows()](../classes/wp_users_list_table/display_rows) wp-admin/includes/class-wp-users-list-table.php | Generate the list table rows. |
| Version | Description |
| --- | --- |
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | 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.