diff --git a/CHANGELOG.md b/CHANGELOG.md index e8c1037..7c4178c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,42 @@ This document is automatically generated from the hooks extracted from WordPress and lists new actions, new filters, and parameter changes by version. +## WordPress 7.1 + +### New Actions + +- [`wp_ability_invoked`](https://developer.wordpress.org/reference/hooks/wp_ability_invoked/) - Fires when an ability is invoked, before any processing takes place. + +### New Filters + +- [`is_user_member_of_blog`](https://developer.wordpress.org/reference/hooks/is_user_member_of_blog/) - Filters whether the user is a member of a given blog. +- [`login_remember_me_help_text`](https://developer.wordpress.org/reference/hooks/login_remember_me_help_text/) - Filters the help text shown in the "Remember Me" tooltip on the login form. +- [`rest_abilities_collection_params`](https://developer.wordpress.org/reference/hooks/rest_abilities_collection_params/) - Filters REST API collection parameters for the abilities controller. +- [`wp_ability_execute_result`](https://developer.wordpress.org/reference/hooks/wp_ability_execute_result/) - Filters the result returned by an ability's execute callback. +- [`wp_ability_normalize_input`](https://developer.wordpress.org/reference/hooks/wp_ability_normalize_input/) - Filters the normalized input for an ability. +- [`wp_ability_permission_result`](https://developer.wordpress.org/reference/hooks/wp_ability_permission_result/) - Filters the result of an ability's permission check. +- [`wp_ability_validate_input`](https://developer.wordpress.org/reference/hooks/wp_ability_validate_input/) - Filters the input validation result for an ability. +- [`wp_ability_validate_output`](https://developer.wordpress.org/reference/hooks/wp_ability_validate_output/) - Filters the output validation result for an ability. +- [`wp_ai_client_cache_group`](https://developer.wordpress.org/reference/hooks/wp_ai_client_cache_group/) - Filters the cache group used by the WP AI Client cache adapter. +- [`wp_auto_approve_ping`](https://developer.wordpress.org/reference/hooks/wp_auto_approve_ping/) - Filters whether a pingback is approved without being held for moderation. +- [`wp_client_side_media_processing_enabled`](https://developer.wordpress.org/reference/hooks/wp_client_side_media_processing_enabled/) - Filters whether client-side media processing is enabled. +- [`wp_get_abilities_item_include`](https://developer.wordpress.org/reference/hooks/wp_get_abilities_item_include/) - Filters whether an individual ability should be included in the result set. +- [`wp_get_abilities_result`](https://developer.wordpress.org/reference/hooks/wp_get_abilities_result/) - Filters the full list of matched abilities after all per-item filtering is complete. +- [`wp_get_entity_view_config_hook_name($kind, $name)`](https://developer.wordpress.org/reference/hooks/wp_get_entity_view_config_hook_name(kind, name)/) - Filters the view configuration for a given entity. +- [`wp_json_schema_allowed_keywords`](https://developer.wordpress.org/reference/hooks/wp_json_schema_allowed_keywords/) - Filters the JSON Schema keywords allowed for a given schema profile. +- [`wp_pre_execute_ability`](https://developer.wordpress.org/reference/hooks/wp_pre_execute_ability/) - Filters whether to short-circuit ability execution. +- [`wp_should_disable_pings_for_environment`](https://developer.wordpress.org/reference/hooks/wp_should_disable_pings_for_environment/) - Filters whether pings should be disabled for the current environment. + +### Changes + +- [`media_library_infinite_scrolling`](https://developer.wordpress.org/reference/hooks/media_library_infinite_scrolling/) - Changed default to true and introduced per-user opt-out of infinite scrolling. +- [`notify_post_author`](https://developer.wordpress.org/reference/hooks/notify_post_author/) - Comment approval status is checked before this filter, and the filter no longer fires for invalid comment IDs. +- [`pre_wp_filesize`](https://developer.wordpress.org/reference/hooks/pre_wp_filesize/) - Negative values are now ignored, being treated the same as null. Numeric values are cast to integers. +- [`safe_style_css`](https://developer.wordpress.org/reference/hooks/safe_style_css/) - Added support for SVG presentation attributes. +- [`wp_after_execute_ability`](https://developer.wordpress.org/reference/hooks/wp_after_execute_ability/) - Added the $ability parameter. +- [`wp_before_execute_ability`](https://developer.wordpress.org/reference/hooks/wp_before_execute_ability/) - Added the $ability parameter. +- [`wp_filesize`](https://developer.wordpress.org/reference/hooks/wp_filesize/) - The return value is now always zero or greater. Numeric values are cast to integers. + ## WordPress 7.0 ### New Actions @@ -27,6 +63,7 @@ This document is automatically generated from the hooks extracted from WordPress ### Changes +- [`gallery_style`](https://developer.wordpress.org/reference/hooks/gallery_style/) - Removed the type attribute for any theme. - [`load_script_textdomain_relative_path`](https://developer.wordpress.org/reference/hooks/load_script_textdomain_relative_path/) - The $is_module parameter was added. - [`option_page_capability_{$option_page}`](https://developer.wordpress.org/reference/hooks/option_page_capability_option_page/) - Applied when wp-admin/options.php is accessed directly. - [`the_author_posts_link`](https://developer.wordpress.org/reference/hooks/the_author_posts_link/) - Added $author and $title parameters. @@ -477,7 +514,7 @@ _No new actions in this version._ - [`enable_loading_object_cache_dropin`](https://developer.wordpress.org/reference/hooks/enable_loading_object_cache_dropin/) - Filters whether to enable loading of the object-cache.php drop-in. - [`excerpt_allowed_wrapper_blocks`](https://developer.wordpress.org/reference/hooks/excerpt_allowed_wrapper_blocks/) - Filters the list of blocks that can be used as wrapper blocks, allowing excerpts to be generated from the `innerBlocks` of these wrappers. - [`image_editor_output_format`](https://developer.wordpress.org/reference/hooks/image_editor_output_format/) - Filters the image editor output format mapping. -- [`media_library_infinite_scrolling`](https://developer.wordpress.org/reference/hooks/media_library_infinite_scrolling/) - Filters whether the Media Library grid has infinite scrolling. Default `false`. +- [`media_library_infinite_scrolling`](https://developer.wordpress.org/reference/hooks/media_library_infinite_scrolling/) - Filters whether the Media Library grid has infinite scrolling. Default `true`. - [`rest_pattern_directory_collection_params`](https://developer.wordpress.org/reference/hooks/rest_pattern_directory_collection_params/) - Filter collection parameters for the block pattern directory controller. - [`rest_prepare_block_pattern`](https://developer.wordpress.org/reference/hooks/rest_prepare_block_pattern/) - Filters the REST API response for a block pattern. - [`rest_prepare_sidebar`](https://developer.wordpress.org/reference/hooks/rest_prepare_sidebar/) - Filters the REST API response for a sidebar. @@ -824,6 +861,7 @@ _No new actions in this version._ ### Changes +- [`gallery_style`](https://developer.wordpress.org/reference/hooks/gallery_style/) - Removed the type attribute for style tags when the theme supports HTML5 style, and changed the quotes from single to double for other themes. - [`intermediate_image_sizes_advanced`](https://developer.wordpress.org/reference/hooks/intermediate_image_sizes_advanced/) - Added the $attachment_id argument. - [`mce_external_languages`](https://developer.wordpress.org/reference/hooks/mce_external_languages/) - The $editor_id parameter was added. - [`mce_external_plugins`](https://developer.wordpress.org/reference/hooks/mce_external_plugins/) - The $editor_id parameter was added. @@ -856,7 +894,7 @@ _No new actions in this version._ - [`oembed_iframe_title_attribute`](https://developer.wordpress.org/reference/hooks/oembed_iframe_title_attribute/) - Filters the title attribute of the given oEmbed HTML iframe. - [`populate_site_meta`](https://developer.wordpress.org/reference/hooks/populate_site_meta/) - Filters meta for a site on creation. - [`post_column_taxonomy_links`](https://developer.wordpress.org/reference/hooks/post_column_taxonomy_links/) - Filters the links in `$taxonomy` column of edit.php. -- [`recovery_email_support_info`](https://developer.wordpress.org/reference/hooks/recovery_email_support_info/) - Filters the support message sent with the the fatal error protection email. +- [`recovery_email_support_info`](https://developer.wordpress.org/reference/hooks/recovery_email_support_info/) - Filters the support message sent with the fatal error protection email. - [`recovery_mode_begin_url`](https://developer.wordpress.org/reference/hooks/recovery_mode_begin_url/) - Filters the URL to begin recovery mode. - [`recovery_mode_cookie_length`](https://developer.wordpress.org/reference/hooks/recovery_mode_cookie_length/) - Filters the length of time a Recovery Mode cookie is valid for. - [`recovery_mode_email`](https://developer.wordpress.org/reference/hooks/recovery_mode_email/) - Filters the contents of the Recovery Mode email. @@ -1484,7 +1522,7 @@ _No new actions in this version._ - [`nav_menu_item_title`](https://developer.wordpress.org/reference/hooks/nav_menu_item_title/) - Filters a menu item's title. - [`navigation_markup_template`](https://developer.wordpress.org/reference/hooks/navigation_markup_template/) - Filters the navigation markup template. - [`notify_moderator`](https://developer.wordpress.org/reference/hooks/notify_moderator/) - Filters whether to send the site moderator email notifications, overriding the site setting. -- [`notify_post_author`](https://developer.wordpress.org/reference/hooks/notify_post_author/) - Filters whether to send the post author new comment notification emails, overriding the site setting. +- [`notify_post_author`](https://developer.wordpress.org/reference/hooks/notify_post_author/) - Filters whether to send the post author new comment and note notification emails, overriding the site settings and defaults. By default, notifications are sent for all notes and for approved comments. - [`oembed_default_width`](https://developer.wordpress.org/reference/hooks/oembed_default_width/) - Filters the maxwidth oEmbed parameter. - [`oembed_discovery_links`](https://developer.wordpress.org/reference/hooks/oembed_discovery_links/) - Filters the oEmbed discovery links HTML. - [`oembed_endpoint_url`](https://developer.wordpress.org/reference/hooks/oembed_endpoint_url/) - Filters the oEmbed endpoint URL. @@ -1823,7 +1861,7 @@ _No new actions in this version._ ### Changes -_No changes in this version._ +- [`use_default_gallery_style`](https://developer.wordpress.org/reference/hooks/use_default_gallery_style/) - Set the default to false when the theme supports HTML5 galleries. ## WordPress 3.8 @@ -2314,6 +2352,7 @@ _No changes in this version._ ### Changes +- [`gallery_style`](https://developer.wordpress.org/reference/hooks/gallery_style/) - Added classes for number of columns and size to opening div. - [`upload_post_params`](https://developer.wordpress.org/reference/hooks/upload_post_params/) - As 'swfupload_post_params' ## WordPress 3.0 @@ -2987,7 +3026,7 @@ _No changes in this version._ - [`editor_max_image_size`](https://developer.wordpress.org/reference/hooks/editor_max_image_size/) - Filters the maximum image size dimensions for the editor. - [`ext2type`](https://developer.wordpress.org/reference/hooks/ext2type/) - Filters file type based on the extension name. - [`file_is_displayable_image`](https://developer.wordpress.org/reference/hooks/file_is_displayable_image/) - Filters whether the current image is displayable in the browser. -- [`gallery_style`](https://developer.wordpress.org/reference/hooks/gallery_style/) - Filters the default gallery shortcode CSS styles. +- [`gallery_style`](https://developer.wordpress.org/reference/hooks/gallery_style/) - Filters the gallery shortcode's default CSS styles and opening HTML div container. - [`get_avatar`](https://developer.wordpress.org/reference/hooks/get_avatar/) - Filters the HTML for a user's avatar. - [`get_pagenum_link`](https://developer.wordpress.org/reference/hooks/get_pagenum_link/) - Filters the page number link for the current request. - [`get_the_generator_{$type}`](https://developer.wordpress.org/reference/hooks/get_the_generator_type/) - Filters the HTML for the retrieved generator type. diff --git a/ISSUES.md b/ISSUES.md index d882229..35b0a28 100644 --- a/ISSUES.md +++ b/ISSUES.md @@ -8,7 +8,7 @@ This document lists known data quality issues in the hooks JSON files. ## Duplicate Filters -- `rest_block_hooks_post_types` +_No duplicate filters._ ## Missing @since Tags diff --git a/composer.json b/composer.json index 018ea85..f21ae32 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "wp-hooks/generator": "1.0.0", "oomphinc/composer-installers-extender": "^2", "roots/wordpress-core-installer": "^1.0.0", - "roots/wordpress-full": "7.0" + "roots/wordpress-full": "7.1" }, "extra": { "wordpress-install-dir": "vendor/wordpress/wordpress", diff --git a/hooks/actions.json b/hooks/actions.json index 03fceeb..7161d44 100644 --- a/hooks/actions.json +++ b/hooks/actions.json @@ -18056,6 +18056,47 @@ }, "args": 1 }, + { + "name": "wp_ability_invoked", + "file": "wp-includes/abilities-api/class-wp-ability.php", + "type": "action", + "doc": { + "description": "Fires when an ability is invoked, before any processing takes place.", + "long_description": "This action fires for every call regardless of outcome (validation failure, permission denial, short-circuit, or successful execution), and before input normalization so the raw input is captured as-is.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The name of the ability.", + "types": [ + "string" + ], + "variable": "$ability_name" + }, + { + "name": "param", + "content": "The raw input data for the ability, before normalization.", + "types": [ + "mixed" + ], + "variable": "$input" + }, + { + "name": "param", + "content": "The ability instance.", + "types": [ + "\\WP_Ability" + ], + "variable": "$ability" + } + ], + "long_description_html": "

This action fires for every call regardless of outcome (validation failure, permission denial, short-circuit, or successful execution), and before input normalization so the raw input is captured as-is.

" + }, + "args": 3 + }, { "name": "wp_add_nav_menu_item", "file": "wp-includes/nav-menu.php", @@ -18164,6 +18205,11 @@ "name": "since", "content": "6.9.0" }, + { + "name": "since", + "content": "7.1.0", + "description": "Added the $ability parameter." + }, { "name": "param", "content": "The name of the ability.", @@ -18187,11 +18233,19 @@ "mixed" ], "variable": "$result" + }, + { + "name": "param", + "content": "The ability instance.", + "types": [ + "\\WP_Ability" + ], + "variable": "$ability" } ], "long_description_html": "" }, - "args": 3 + "args": 4 }, { "name": "wp_after_insert_post", @@ -18619,6 +18673,11 @@ "name": "since", "content": "6.9.0" }, + { + "name": "since", + "content": "7.1.0", + "description": "Added the $ability parameter." + }, { "name": "param", "content": "The name of the ability.", @@ -18634,11 +18693,19 @@ "mixed" ], "variable": "$input" + }, + { + "name": "param", + "content": "The ability instance.", + "types": [ + "\\WP_Ability" + ], + "variable": "$ability" } ], "long_description_html": "" }, - "args": 2 + "args": 3 }, { "name": "wp_before_include_template", diff --git a/hooks/filters.json b/hooks/filters.json index f41fc92..4266ef9 100644 --- a/hooks/filters.json +++ b/hooks/filters.json @@ -12338,13 +12338,28 @@ "file": "wp-includes/media.php", "type": "filter", "doc": { - "description": "Filters the default gallery shortcode CSS styles.", - "long_description": "", + "description": "Filters the gallery shortcode's default CSS styles and opening HTML div container.", + "long_description": "To remove the CSS entirely, use the `use_default_gallery_style` filter instead:\n add_filter( 'use_default_gallery_style', '__return_false' );", "tags": [ { "name": "since", "content": "2.5.0" }, + { + "name": "since", + "content": "3.1.0", + "description": "Added classes for number of columns and size to opening div." + }, + { + "name": "since", + "content": "5.3.0", + "description": "Removed the type attribute for style tags when the theme supports HTML5 style, and changed the quotes from single to double for other themes." + }, + { + "name": "since", + "content": "7.0.0", + "description": "Removed the type attribute for any theme." + }, { "name": "param", "content": "Default CSS styles and opening HTML div container for the gallery shortcode output.", @@ -12354,7 +12369,7 @@ "variable": "$gallery_style" } ], - "long_description_html": "" + "long_description_html": "

To remove the CSS entirely, use the use_default_gallery_style filter instead:

add_filter( 'use_default_gallery_style', '__return_false' );

" }, "args": 1 }, @@ -19165,9 +19180,9 @@ }, { "name": "param", - "content": "{ An array of mime type mappings. Maps a source mime type to a new destination mime type. By default maps HEIC/HEIF input to JPEG output. @type string ...$0 The new mime type. }", + "content": "An array of mime type mappings. Maps a source mime type to a new destination mime type. By default maps HEIC/HEIF input to JPEG output.", "types": [ - "string[]" + "array" ], "variable": "$output_format" }, @@ -20953,6 +20968,47 @@ }, "args": 2 }, + { + "name": "is_user_member_of_blog", + "file": "wp-includes/user.php", + "type": "filter", + "doc": { + "description": "Filters whether the user is a member of a given blog.", + "long_description": "This filter only runs when the user and blog have both been resolved to valid records on a multisite installation; it is not invoked for logged-out requests, unknown users, or archived/spammed/deleted sites.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "Whether the user is a member of the blog.", + "types": [ + "bool" + ], + "variable": "$is_member" + }, + { + "name": "param", + "content": "The user ID being checked.", + "types": [ + "int" + ], + "variable": "$user_id" + }, + { + "name": "param", + "content": "The blog ID being checked.", + "types": [ + "int" + ], + "variable": "$blog_id" + } + ], + "long_description_html": "

This filter only runs when the user and blog have both been resolved to valid records on a multisite installation; it is not invoked for logged-out requests, unknown users, or archived/spammed/deleted sites.

" + }, + "args": 3 + }, { "name": "is_wide_widget_in_customizer", "file": "wp-includes/class-wp-customize-widgets.php", @@ -22344,6 +22400,31 @@ }, "args": 3 }, + { + "name": "login_remember_me_help_text", + "file": "wp-login.php", + "type": "filter", + "doc": { + "description": "Filters the help text shown in the \"Remember Me\" tooltip on the login form.", + "long_description": "Returning an empty string removes the tooltip toggle from the form.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The tooltip help text.", + "types": [ + "string" + ], + "variable": "$rememberme_help_text" + } + ], + "long_description_html": "

Returning an empty string removes the tooltip toggle from the form.

" + }, + "args": 1 + }, { "name": "login_site_html_link", "file": "wp-login.php", @@ -23545,23 +23626,28 @@ "file": "wp-includes/media.php", "type": "filter", "doc": { - "description": "Filters whether the Media Library grid has infinite scrolling. Default `false`.", - "long_description": "", + "description": "Filters whether the Media Library grid has infinite scrolling. Default `true`.", + "long_description": "This setting respects the current user's \"Infinite Scrolling\" personal option, but a filter callback takes precedence over that preference.", "tags": [ { "name": "since", "content": "5.8.0" }, + { + "name": "since", + "content": "7.1.0", + "description": "Changed default to true and introduced per-user opt-out of infinite scrolling." + }, { "name": "param", "content": "Whether the Media Library grid has infinite scrolling.", "types": [ "bool" ], - "variable": "$infinite" + "variable": "$infinite_scrolling" } ], - "long_description_html": "" + "long_description_html": "

This setting respects the current user's \"Infinite Scrolling\" personal option, but a filter callback takes precedence over that preference.

" }, "args": 1 }, @@ -26444,13 +26530,18 @@ "file": "wp-includes/comment.php", "type": "filter", "doc": { - "description": "Filters whether to send the post author new comment notification emails, overriding the site setting.", + "description": "Filters whether to send the post author new comment and note notification emails, overriding the site settings and defaults. By default, notifications are sent for all notes and for approved comments.", "long_description": "", "tags": [ { "name": "since", "content": "4.4.0" }, + { + "name": "since", + "content": "7.1.0", + "description": "Comment approval status is checked before this filter, and the filter no longer fires for invalid comment IDs." + }, { "name": "param", "content": "Whether to notify the post author about the new comment.", @@ -26815,9 +26906,9 @@ }, { "name": "param", - "content": "An array of arrays containing data about popular oEmbed providers.", + "content": "An associative array mapping URL patterns to provider data. Each value must be an array with a provider endpoint URL string at index 0 and an optional boolean regex flag at index 1.", "types": [ - "array[]" + "array" ], "variable": "$providers" } @@ -34350,9 +34441,14 @@ "name": "since", "content": "6.0.0" }, + { + "name": "since", + "content": "7.1.0", + "description": "Negative values are now ignored, being treated the same as null. Numeric values are cast to integers." + }, { "name": "param", - "content": "The unfiltered value. Returning an int from the callback bypasses the filesize call.", + "content": "The unfiltered value. Returning a non-negative number from the callback bypasses the filesize call.", "types": [ "null", "int" @@ -35833,7 +35929,7 @@ "file": "wp-includes/class-wp-recovery-mode-email-service.php", "type": "filter", "doc": { - "description": "Filters the support message sent with the the fatal error protection email.", + "description": "Filters the support message sent with the fatal error protection email.", "long_description": "", "tags": [ { @@ -37030,6 +37126,31 @@ }, "args": 2 }, + { + "name": "rest_abilities_collection_params", + "file": "wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php", + "type": "filter", + "doc": { + "description": "Filters REST API collection parameters for the abilities controller.", + "long_description": "Use this to declare the schema type of a custom meta key. A declared type lets REST coerce a query-string value, for example \"true\" to a boolean, before the meta filter matches it.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "JSON Schema-formatted collection parameters.", + "types": [ + "array" + ], + "variable": "$query_params" + } + ], + "long_description_html": "

Use this to declare the schema type of a custom meta key. A declared type lets REST coerce a query-string value, for example \"true\" to a boolean, before the meta filter matches it.

" + }, + "args": 1 + }, { "name": "rest_allow_anonymous_comments", "file": "wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php", @@ -37194,7 +37315,7 @@ "name": "param", "content": "Array of post type names that support Block Hooks.", "types": [ - "array" + "string[]" ], "variable": "$content_like_post_types" }, @@ -37210,50 +37331,10 @@ "name": "param", "content": "The prepared post object.", "types": [ - "object" - ], - "variable": "$prepared_post" - } - ], - "long_description_html": "

Allows themes and plugins to add or remove post types that should have Block Hooks functionality enabled in the REST API.

" - }, - "args": 3 - }, - { - "name": "rest_block_hooks_post_types", - "file": "wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php", - "type": "filter", - "doc": { - "description": "Filters which post types should have Block Hooks applied.", - "long_description": "Allows themes and plugins to add or remove post types that should have Block Hooks functionality enabled in the REST API.", - "tags": [ - { - "name": "since", - "content": "7.0.0" - }, - { - "name": "param", - "content": "Array of post type names that support Block Hooks.", - "types": [ - "array" - ], - "variable": "$content_like_post_types" - }, - { - "name": "param", - "content": "The current post type being processed.", - "types": [ - "string" - ], - "variable": "$post_type" - }, - { - "name": "param", - "content": "The post object.", - "types": [ + "\\stdClass", "\\WP_Post" ], - "variable": "$post" + "variable": "$prepared_post" } ], "long_description_html": "

Allows themes and plugins to add or remove post types that should have Block Hooks functionality enabled in the REST API.

" @@ -40857,6 +40938,11 @@ "name": "since", "content": "2.8.1" }, + { + "name": "since", + "content": "7.1.0", + "description": "Added support for SVG presentation attributes." + }, { "name": "param", "content": "Array of allowed CSS attributes.", @@ -41747,7 +41833,7 @@ "type": "filter", "doc": { "description": "Filters data associated with a given Script Module.", - "long_description": "Script Modules may require data that is required for initialization or is essential to have immediately available on page load. These are suitable use cases for this data.\n The dynamic portion of the hook name, `$module_id`, refers to the Script Module ID that the data is associated with.\n This is best suited to pass essential data that must be available to the module for initialization or immediately on page load. It does not replace the REST API or fetching data from the client.\n Example:\n add_filter( 'script_module_data_MyScriptModuleID', function ( array $data ): array { $data['dataForClient'] = 'ok'; return $data; } );\n If the filter returns no data (an empty array), nothing will be embedded in the page.\n The data for a given Script Module, if provided, will be JSON serialized in a script tag with an ID of the form `wp-script-module-data-{$module_id}`.\n The data can be read on the client with a pattern like this:\n Example:\n const dataContainer = document.getElementById( 'wp-script-module-data-MyScriptModuleID' ); let data = }; if ( dataContainer ) { try { data = JSON.parse( dataContainer.textContent ); } catch } } // data.dataForClient === 'ok'; initMyScriptModuleWithData( data );", + "long_description": "Script Modules may require data that is required for initialization or is essential to have immediately available on page load. These are suitable use cases for this data.\n The dynamic portion of the hook name, `$module_id`, refers to the Script Module ID that the data is associated with.\n This is best suited to pass essential data that must be available to the module for initialization or immediately on page load. It does not replace the REST API or fetching data from the client.\n Example:\n add_filter( 'script_module_data_MyScriptModuleID', function ( array $data ): array { $data['dataForClient'] = 'ok'; return $data; } );\n If the filter returns no data (an empty array), nothing will be embedded in the page.\n The data for a given Script Module, if provided, will be JSON serialized in a script tag with an ID of the form `wp-script-module-data-{$module_id}`.\n The data can be read on the client with a pattern like the following; you are encouraged to use this pattern _verbatim_ to avoid common pitfalls or vulnerabilities:\n Example:\n const dataContainer = document.querySelector( 'script[id=\"wp-script-module-data-MyScriptModuleID\"]' ); let data = }; if ( dataContainer instanceof HTMLScriptElement ) { try { data = JSON.parse( dataContainer.text ); } catch } } // data.dataForClient === 'ok'; initMyScriptModuleWithData( data );", "tags": [ { "name": "since", @@ -41762,7 +41848,7 @@ "variable": "$data" } ], - "long_description_html": "

Script Modules may require data that is required for initialization or is essential to have immediately available on page load. These are suitable use cases for this data.

The dynamic portion of the hook name, $module_id, refers to the Script Module ID that the data is associated with.

This is best suited to pass essential data that must be available to the module for initialization or immediately on page load. It does not replace the REST API or fetching data from the client.

Example:

add_filter(     'script_module_data_MyScriptModuleID',     function ( array $data ): array {         $data['dataForClient'] = 'ok';         return $data;     } );

If the filter returns no data (an empty array), nothing will be embedded in the page.

The data for a given Script Module, if provided, will be JSON serialized in a script tag with an ID of the form wp-script-module-data-{$module_id}.

The data can be read on the client with a pattern like this:

Example:

const dataContainer = document.getElementById( 'wp-script-module-data-MyScriptModuleID' ); let data = }; if ( dataContainer ) {     try {         data = JSON.parse( dataContainer.textContent );     } catch } } // data.dataForClient === 'ok'; initMyScriptModuleWithData( data );
" + "long_description_html": "

Script Modules may require data that is required for initialization or is essential to have immediately available on page load. These are suitable use cases for this data.

The dynamic portion of the hook name, $module_id, refers to the Script Module ID that the data is associated with.

This is best suited to pass essential data that must be available to the module for initialization or immediately on page load. It does not replace the REST API or fetching data from the client.

Example:

add_filter(     'script_module_data_MyScriptModuleID',     function ( array $data ): array {         $data['dataForClient'] = 'ok';         return $data;     } );

If the filter returns no data (an empty array), nothing will be embedded in the page.

The data for a given Script Module, if provided, will be JSON serialized in a script tag with an ID of the form wp-script-module-data-{$module_id}.

The data can be read on the client with a pattern like the following; you are encouraged to use this pattern verbatim to avoid common pitfalls or vulnerabilities:

Example:

const dataContainer = document.querySelector( 'script[id=\"wp-script-module-data-MyScriptModuleID\"]' ); let data = }; if ( dataContainer instanceof HTMLScriptElement ) {     try {         data = JSON.parse( dataContainer.text );     } catch } } // data.dataForClient === 'ok'; initMyScriptModuleWithData( data );
" }, "args": 1 }, @@ -50140,6 +50226,11 @@ "name": "since", "content": "3.1.0" }, + { + "name": "since", + "content": "3.9.0", + "description": "Set the default to false when the theme supports HTML5 galleries." + }, { "name": "param", "content": "Whether to print default gallery styles. Defaults to false if the theme supports HTML5 galleries. Otherwise, defaults to true.", @@ -52573,6 +52664,230 @@ }, "args": 2 }, + { + "name": "wp_ability_execute_result", + "file": "wp-includes/abilities-api/class-wp-ability.php", + "type": "filter", + "doc": { + "description": "Filters the result returned by an ability's execute callback.", + "long_description": "Fires after the registered execute callback runs. Plugins can use this to transform the result \u2014 response formatting, stripping internal metadata, content safety filtering, response enrichment, or recovering from a failure by returning a successful value.\n The filter receives whatever the registered callback produced, including a `WP_Error` if execution failed. Filters may pass the `WP_Error` through unchanged, override it with a recovered result, or convert a successful result into a `WP_Error`.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The result returned by the registered execute_callback, or a WP_Error if execution failed.", + "types": [ + "mixed" + ], + "variable": "$result" + }, + { + "name": "param", + "content": "The name of the ability.", + "types": [ + "string" + ], + "variable": "$ability_name" + }, + { + "name": "param", + "content": "The normalized input data.", + "types": [ + "mixed" + ], + "variable": "$input" + }, + { + "name": "param", + "content": "The ability instance.", + "types": [ + "\\WP_Ability" + ], + "variable": "$ability" + } + ], + "long_description_html": "

Fires after the registered execute callback runs. Plugins can use this to transform the result \u2014 response formatting, stripping internal metadata, content safety filtering, response enrichment, or recovering from a failure by returning a successful value.

The filter receives whatever the registered callback produced, including a WP_Error if execution failed. Filters may pass the WP_Error through unchanged, override it with a recovered result, or convert a successful result into a WP_Error.

" + }, + "args": 4 + }, + { + "name": "wp_ability_normalize_input", + "file": "wp-includes/abilities-api/class-wp-ability.php", + "type": "filter", + "doc": { + "description": "Filters the normalized input for an ability.", + "long_description": "Fires after `normalize_input()` has applied any default value declared in the input schema, giving plugins a chance to adjust the input before it is consumed downstream. Common uses include defaulting beyond what JSON Schema can express, prompt enrichment, and injecting caller metadata.\n Returning a `WP_Error` causes callers that propagate it (such as `execute()`) to halt before validation, permission checks, and the registered execute callback.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The normalized input data.", + "types": [ + "mixed" + ], + "variable": "$input" + }, + { + "name": "param", + "content": "The name of the ability.", + "types": [ + "string" + ], + "variable": "$ability_name" + }, + { + "name": "param", + "content": "The ability instance.", + "types": [ + "\\WP_Ability" + ], + "variable": "$ability" + } + ], + "long_description_html": "

Fires after normalize_input() has applied any default value declared in the input schema, giving plugins a chance to adjust the input before it is consumed downstream. Common uses include defaulting beyond what JSON Schema can express, prompt enrichment, and injecting caller metadata.

Returning a WP_Error causes callers that propagate it (such as execute()) to halt before validation, permission checks, and the registered execute callback.

" + }, + "args": 3 + }, + { + "name": "wp_ability_permission_result", + "file": "wp-includes/abilities-api/class-wp-ability.php", + "type": "filter", + "doc": { + "description": "Filters the result of an ability's permission check.", + "long_description": "Fires after the registered `permission_callback` returns. Plugins can use this to layer additional authorization rules on top of the ability's own permission logic \u2014 for example, multi-factor authorization gates or temporary permission elevation for trusted contexts.\n Filters can return `true` to grant, `false` to deny, or a `WP_Error` to deny with a specific error code and message. The filter receives whatever the `permission_callback` produced. Any other return value is coerced to `false`.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The permission result returned by permission_callback.", + "types": [ + "bool", + "\\WP_Error" + ], + "variable": "$permission" + }, + { + "name": "param", + "content": "The name of the ability.", + "types": [ + "string" + ], + "variable": "$ability_name" + }, + { + "name": "param", + "content": "The input data for the permission check.", + "types": [ + "mixed" + ], + "variable": "$input" + }, + { + "name": "param", + "content": "The ability instance.", + "types": [ + "\\WP_Ability" + ], + "variable": "$ability" + } + ], + "long_description_html": "

Fires after the registered permission_callback returns. Plugins can use this to layer additional authorization rules on top of the ability's own permission logic \u2014 for example, multi-factor authorization gates or temporary permission elevation for trusted contexts.

Filters can return true to grant, false to deny, or a WP_Error to deny with a specific error code and message. The filter receives whatever the permission_callback produced. Any other return value is coerced to false.

" + }, + "args": 4 + }, + { + "name": "wp_ability_validate_input", + "file": "wp-includes/abilities-api/class-wp-ability.php", + "type": "filter", + "doc": { + "description": "Filters the input validation result for an ability.", + "long_description": "Allows developers to add custom validation logic on top of the default JSON Schema validation. If default validation already failed, the filter receives the WP_Error object and can add additional error information or override it. If default validation passed, the filter can add additional validation checks and return a WP_Error if those checks fail.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The validation result from default validation.", + "types": [ + "true", + "\\WP_Error" + ], + "variable": "$is_valid" + }, + { + "name": "param", + "content": "The input data being validated.", + "types": [ + "mixed" + ], + "variable": "$input" + }, + { + "name": "param", + "content": "The name of the ability.", + "types": [ + "string" + ], + "variable": "$ability_name" + } + ], + "long_description_html": "

Allows developers to add custom validation logic on top of the default JSON Schema validation. If default validation already failed, the filter receives the WP_Error object and can add additional error information or override it. If default validation passed, the filter can add additional validation checks and return a WP_Error if those checks fail.

" + }, + "args": 3 + }, + { + "name": "wp_ability_validate_output", + "file": "wp-includes/abilities-api/class-wp-ability.php", + "type": "filter", + "doc": { + "description": "Filters the output validation result for an ability.", + "long_description": "Allows developers to add custom validation logic on top of the default JSON Schema validation. If default validation already failed, the filter receives the WP_Error object and can add additional error information or override it. If default validation passed, the filter can add additional validation checks and return a WP_Error if those checks fail.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The validation result from default validation.", + "types": [ + "true", + "\\WP_Error" + ], + "variable": "$is_valid" + }, + { + "name": "param", + "content": "The output data being validated.", + "types": [ + "mixed" + ], + "variable": "$output" + }, + { + "name": "param", + "content": "The name of the ability.", + "types": [ + "string" + ], + "variable": "$ability_name" + } + ], + "long_description_html": "

Allows developers to add custom validation logic on top of the default JSON Schema validation. If default validation already failed, the filter receives the WP_Error object and can add additional error information or override it. If default validation passed, the filter can add additional validation checks and return a WP_Error if those checks fail.

" + }, + "args": 3 + }, { "name": "wp_admin_bar_class", "file": "wp-includes/admin-bar.php", @@ -52788,6 +53103,31 @@ }, "args": 3 }, + { + "name": "wp_ai_client_cache_group", + "file": "wp-includes/ai-client/adapters/class-wp-ai-client-cache.php", + "type": "filter", + "doc": { + "description": "Filters the cache group used by the WP AI Client cache adapter.", + "long_description": "Allows integrators to change the object cache group under which AI client items are stored. This is useful for avoiding key collisions, creating environment-specific caches, or adapting to backend constraints.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The cache group.", + "types": [ + "string" + ], + "variable": "$group" + } + ], + "long_description_html": "

Allows integrators to change the object cache group under which AI client items are stored. This is useful for avoiding key collisions, creating environment-specific caches, or adapting to backend constraints.

" + }, + "args": 1 + }, { "name": "wp_ai_client_default_request_timeout", "file": "wp-includes/ai-client/class-wp-ai-client-prompt-builder.php", @@ -53370,6 +53710,47 @@ }, "args": 2 }, + { + "name": "wp_auto_approve_ping", + "file": "wp-includes/comment.php", + "type": "filter", + "doc": { + "description": "Filters whether a pingback is approved without being held for moderation.", + "long_description": "Defaults to true for pingbacks originating from a published post on the same site, and false for every other pingback. Trackbacks are never considered, as they cannot be verified.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "Whether to auto-approve the pingback.", + "types": [ + "bool" + ], + "variable": "$approve_pingback" + }, + { + "name": "param", + "content": "ID of the post on this site the pingback originated from, or 0 if it came from elsewhere.", + "types": [ + "int" + ], + "variable": "$source_id" + }, + { + "name": "param", + "content": "The URL the pingback was sent from.", + "types": [ + "string" + ], + "variable": "$url" + } + ], + "long_description_html": "

Defaults to true for pingbacks originating from a published post on the same site, and false for every other pingback. Trackbacks are never considered, as they cannot be verified.

" + }, + "args": 3 + }, { "name": "wp_autoload_values_to_autoload", "file": "wp-includes/option.php", @@ -53716,6 +54097,31 @@ }, "args": 2 }, + { + "name": "wp_client_side_media_processing_enabled", + "file": "wp-includes/media.php", + "type": "filter", + "doc": { + "description": "Filters whether client-side media processing is enabled.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "Whether client-side media processing is enabled. Default true if the page is served in a secure context.", + "types": [ + "bool" + ], + "variable": "$enabled" + } + ], + "long_description_html": "" + }, + "args": 1 + }, { "name": "wp_code_editor_settings", "file": "wp-includes/general-template.php", @@ -55006,6 +55412,11 @@ "name": "since", "content": "6.0.0" }, + { + "name": "since", + "content": "7.1.0", + "description": "The return value is now always zero or greater. Numeric values are cast to integers." + }, { "name": "param", "content": "The result of PHP filesize on the file.", @@ -55170,6 +55581,80 @@ }, "args": 1 }, + { + "name": "wp_get_abilities_item_include", + "file": "wp-includes/abilities-api.php", + "type": "filter", + "doc": { + "description": "Filters whether an individual ability should be included in the result set.", + "long_description": "Fires after the declarative filters and the caller-scoped item_include_callback. Plugins can use this to enforce universal inclusion rules regardless of what the caller passed in $args.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "Whether to include the ability. Default true (after declarative filters pass).", + "types": [ + "bool" + ], + "variable": "$include" + }, + { + "name": "param", + "content": "The ability instance being evaluated.", + "types": [ + "\\WP_Ability" + ], + "variable": "$ability" + }, + { + "name": "param", + "content": "The full $args array passed to wp_get_abilities().", + "types": [ + "array" + ], + "variable": "$args" + } + ], + "long_description_html": "

Fires after the declarative filters and the caller-scoped item_include_callback. Plugins can use this to enforce universal inclusion rules regardless of what the caller passed in $args.

" + }, + "args": 3 + }, + { + "name": "wp_get_abilities_result", + "file": "wp-includes/abilities-api.php", + "type": "filter", + "doc": { + "description": "Filters the full list of matched abilities after all per-item filtering is complete.", + "long_description": "Fires after the caller-scoped result_callback. Plugins can use this to sort, paginate, or reshape the final result set universally.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The matched abilities after all filtering.", + "types": [ + "\\WP_Ability[]" + ], + "variable": "$matched" + }, + { + "name": "param", + "content": "The full $args array passed to wp_get_abilities().", + "types": [ + "array" + ], + "variable": "$args" + } + ], + "long_description_html": "

Fires after the caller-scoped result_callback. Plugins can use this to sort, paginate, or reshape the final result set universally.

" + }, + "args": 2 + }, { "name": "wp_get_archives_args", "file": "wp-includes/general-template.php", @@ -57753,6 +58238,39 @@ }, "args": 2 }, + { + "name": "wp_json_schema_allowed_keywords", + "file": "wp-includes/json-schema.php", + "type": "filter", + "doc": { + "description": "Filters the JSON Schema keywords allowed for a given schema profile.", + "long_description": "Use this to decide which keywords may be exposed to clients for a profile. It does not make WordPress validate or sanitize values against the keyword.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "Allowed JSON Schema keywords.", + "types": [ + "string[]" + ], + "variable": "$allowed_keywords" + }, + { + "name": "param", + "content": "The schema profile the keywords are for.", + "types": [ + "string" + ], + "variable": "$schema_profile" + } + ], + "long_description_html": "

Use this to decide which keywords may be exposed to clients for a profile. It does not make WordPress validate or sanitize values against the keyword.

" + }, + "args": 2 + }, { "name": "wp_kses_allowed_html", "file": "wp-includes/kses.php", @@ -59506,6 +60024,55 @@ }, "args": 3 }, + { + "name": "wp_pre_execute_ability", + "file": "wp-includes/abilities-api/class-wp-ability.php", + "type": "filter", + "doc": { + "description": "Filters whether to short-circuit ability execution.", + "long_description": "Returning a value other than the received default bypasses the rest of `execute()` \u2014 input normalization, input validation, permission checks, the registered execute callback, output validation, and the surrounding actions \u2014 and the value is returned to the caller as-is. Useful for cached responses, rate limiting, maintenance mode, and test mocking.\n To continue with normal execution, return `$pre` unchanged. This preserves any value (including `null`, `false`, or arbitrary objects) as a valid short-circuit result.\n Because validation is bypassed, callers that short-circuit are responsible for the integrity of any value they consume from `$input`.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "The pre-computed result. Return this value unchanged to continue execution. Default WP_Filter_Sentinel instance unique to this invocation.", + "types": [ + "mixed" + ], + "variable": "$pre" + }, + { + "name": "param", + "content": "The name of the ability.", + "types": [ + "string" + ], + "variable": "$ability_name" + }, + { + "name": "param", + "content": "The raw input passed to execute().", + "types": [ + "mixed" + ], + "variable": "$input" + }, + { + "name": "param", + "content": "The ability instance.", + "types": [ + "\\WP_Ability" + ], + "variable": "$ability" + } + ], + "long_description_html": "

Returning a value other than the received default bypasses the rest of execute() \u2014 input normalization, input validation, permission checks, the registered execute callback, output validation, and the surrounding actions \u2014 and the value is returned to the caller as-is. Useful for cached responses, rate limiting, maintenance mode, and test mocking.

To continue with normal execution, return $pre unchanged. This preserves any value (including null, false, or arbitrary objects) as a valid short-circuit result.

Because validation is bypassed, callers that short-circuit are responsible for the integrity of any value they consume from $input.

" + }, + "args": 4 + }, { "name": "wp_pre_insert_user_data", "file": "wp-includes/user.php", @@ -60634,7 +61201,7 @@ }, { "name": "param", - "content": "{ An associative array of arguments for the ability. @type string $label The human-readable label for the ability. @type string $description A detailed description of what the ability does. @type string $category The ability category slug this ability belongs to. @type callable $execute_callback A callback function to execute when the ability is invoked. Receives optional mixed input and returns mixed result or WP_Error. @type callable $permission_callback A callback function to check permissions before execution. Receives optional mixed input and returns bool or WP_Error. @type array<string, mixed> $input_schema Optional. JSON Schema definition for the ability's input. @type array<string, mixed> $output_schema Optional. JSON Schema definition for the ability's output. @type array<string, mixed> $meta { Optional. Additional metadata for the ability. @type array<string, bool|string> $annotations Optional. Annotation metadata for the ability. @type bool $show_in_rest Optional. Whether to expose this ability in the REST API. Default false. } @type string $ability_class Optional. Custom class to instantiate instead of WP_Ability. }", + "content": "{ An associative array of arguments for the ability. @type string $label The human-readable label for the ability. @type string $description A detailed description of what the ability does. @type string $category The ability category slug this ability belongs to. @type callable $execute_callback A callback function to execute when the ability is invoked. Receives optional mixed input and returns mixed result or WP_Error. @type callable $permission_callback A callback function to check permissions before execution. Receives optional mixed input and returns bool or WP_Error. @type array<string, mixed> $input_schema Optional. JSON Schema definition for the ability's input. @type array<string, mixed> $output_schema Optional. JSON Schema definition for the ability's output. @type array<string, mixed> $meta { Optional. Additional metadata for the ability. @type array<string, bool|string> $annotations Optional. Annotation metadata for the ability. @type bool $public Optional. Whether the ability is meant to be available to clients such as the REST API, MCP, or AI agents. Seeds the default for per-channel flags like $show_in_rest. Defaults to false. @type bool $show_in_rest Optional. Whether to expose this ability in the REST API. Default is the value of $public when set, false otherwise. } @type string $ability_class Optional. Custom class to instantiate instead of WP_Ability. }", "types": [ "array" ], @@ -61229,6 +61796,39 @@ }, "args": 1 }, + { + "name": "wp_should_disable_pings_for_environment", + "file": "wp-includes/comment.php", + "type": "filter", + "doc": { + "description": "Filters whether pings should be disabled for the current environment.", + "long_description": "Returning false re-enables pings in non-production environments. Returning true disables pings even in production.", + "tags": [ + { + "name": "since", + "content": "7.1.0" + }, + { + "name": "param", + "content": "Whether pings should be disabled. Default true for non-production environments, false for production.", + "types": [ + "bool" + ], + "variable": "$should_disable" + }, + { + "name": "param", + "content": "The current environment type as returned by wp_get_environment_type().", + "types": [ + "string" + ], + "variable": "$environment_type" + } + ], + "long_description_html": "

Returning false re-enables pings in non-production environments. Returning true disables pings even in production.

" + }, + "args": 2 + }, { "name": "wp_should_handle_php_error", "file": "wp-includes/class-wp-fatal-error-handler.php", @@ -66032,7 +66632,7 @@ }, { "name": "param", - "content": "Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'. Default 'display'.", + "content": "Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'. The 'sample' value is used for permalink previewing. Default 'display'.", "types": [ "string" ], diff --git a/readme.md b/readme.md index 7faf302..9544e07 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ All the actions and filters from WordPress core in machine-readable JSON format. -Last updated for WordPress 7.0. +Last updated for WordPress 7.1. ## Installation