From 7431d9e4828729ed9ba0cd67b915b79dbc8e328c Mon Sep 17 00:00:00 2001 From: som3669 Date: Fri, 18 Sep 2026 00:44:07 +0545 Subject: [PATCH] Docs: Add missing `@since` tags to eleven functions and methods. The inline documentation standards require an `@since` tag on every function and method. These eleven have complete `@param`/`@return` documentation but no `@since` at all, so the handbook reference pages for them show no version. Three are public HTML API methods: `WP_HTML_Tag_Processor::release_bookmark()` has been undocumented since it shipped in 6.2.0. Each version was determined from the commit that introduced the function, cross-checked against the previous release branch to confirm the function was not present there: * `WP_REST_Block_Directory_Controller::register_routes()` 5.5.0 * `WP_Sitemaps_Stylesheet::render_stylesheet()` 5.5.0 * `WP_HTML_Tag_Processor::release_bookmark()` 6.2.0 * `WP_REST_Font_Families_Controller::prepare_font_face_links()` 6.5.0 * `WP_Token_Map::to_array()` 6.6.0 * `WP_HTML_Tag_Processor::get_doctype_info()` 6.7.0 * `WP_HTML_Processor::get_namespace()` 6.7.0 * `WP_Block_Processor::is_block_type()` 6.9.0 * `WP_REST_Comments_Controller::check_post_type_supports_notes()` 6.9.0 * `WP_Theme_JSON::process_pseudo_selectors()` 7.0.0 * `wp_register_custom_css_support()` 7.0.0 See #65860. --- src/wp-includes/block-supports/custom-css.php | 2 ++ src/wp-includes/class-wp-block-processor.php | 2 ++ src/wp-includes/class-wp-theme-json.php | 2 ++ src/wp-includes/class-wp-token-map.php | 2 ++ src/wp-includes/html-api/class-wp-html-processor.php | 2 ++ src/wp-includes/html-api/class-wp-html-tag-processor.php | 4 ++++ .../endpoints/class-wp-rest-block-directory-controller.php | 2 ++ .../rest-api/endpoints/class-wp-rest-comments-controller.php | 2 ++ .../endpoints/class-wp-rest-font-families-controller.php | 2 ++ src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | 2 ++ 10 files changed, 22 insertions(+) diff --git a/src/wp-includes/block-supports/custom-css.php b/src/wp-includes/block-supports/custom-css.php index 50d21d406378f..66fd9469dd2b9 100644 --- a/src/wp-includes/block-supports/custom-css.php +++ b/src/wp-includes/block-supports/custom-css.php @@ -157,6 +157,8 @@ function wp_render_custom_css_class_name( $block_content, $block ) { /** * Registers the style block attribute for block types that support it. * + * @since 7.0.0 + * * @param WP_Block_Type $block_type Block Type. */ function wp_register_custom_css_support( $block_type ) { diff --git a/src/wp-includes/class-wp-block-processor.php b/src/wp-includes/class-wp-block-processor.php index 7c22dc1ea87cd..24aa2b56d4001 100644 --- a/src/wp-includes/class-wp-block-processor.php +++ b/src/wp-includes/class-wp-block-processor.php @@ -1442,6 +1442,8 @@ public function has_closing_flag(): bool { * $is_core_paragraph = $processor->is_block_type( 'core/paragraph' ); * $is_formula = $processor->is_block_type( 'math-block/formula' ); * + * @since 6.9.0 + * * @param string $block_type Block type name for the desired block. * E.g. "paragraph", "core/paragraph", "math-blocks/formula". * @return bool Whether this delimiter represents a block of the given type. diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index 087c215e568d7..d61e8e2a91a7f 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -954,6 +954,8 @@ protected static function schema_in_root_and_per_origin( $schema ) { /** * Processes pseudo-selectors for any node (block or variation). * + * @since 7.0.0 + * * @param array $node The node data (block or variation). * @param string $base_selector The base selector. * @param array $settings The theme settings. diff --git a/src/wp-includes/class-wp-token-map.php b/src/wp-includes/class-wp-token-map.php index 317a9830cba85..fd51e9f8546a5 100644 --- a/src/wp-includes/class-wp-token-map.php +++ b/src/wp-includes/class-wp-token-map.php @@ -643,6 +643,8 @@ private function read_small_token( string $text, int $offset = 0, &$matched_toke * ':?' => '😕', * ); * + * @since 6.6.0 + * * @return array The lookup key/substitution values as an associate array. */ public function to_array(): array { diff --git a/src/wp-includes/html-api/class-wp-html-processor.php b/src/wp-includes/html-api/class-wp-html-processor.php index 25cc062a35b52..1270fc0ece7e6 100644 --- a/src/wp-includes/html-api/class-wp-html-processor.php +++ b/src/wp-includes/html-api/class-wp-html-processor.php @@ -5133,6 +5133,8 @@ private function bookmark_token() { /** * Indicates the namespace of the current token, or "html" if there is none. * + * @since 6.7.0 + * * @return string One of "html", "math", or "svg". */ public function get_namespace(): string { diff --git a/src/wp-includes/html-api/class-wp-html-tag-processor.php b/src/wp-includes/html-api/class-wp-html-tag-processor.php index 0ad4c293a3e9f..0c40b4d4508f5 100644 --- a/src/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/src/wp-includes/html-api/class-wp-html-tag-processor.php @@ -1381,6 +1381,8 @@ public function set_bookmark( $name ): bool { * Releasing a bookmark frees up the small * performance overhead it requires. * + * @since 6.2.0 + * * @param string $name Name of the bookmark to remove. * @return bool Whether the bookmark already existed before removal. */ @@ -5086,6 +5088,8 @@ private function matches(): bool { * This method can be called to perform a full parse of the DOCTYPE token and retrieve * its information. * + * @since 6.7.0 + * * @return WP_HTML_Doctype_Info|null The DOCTYPE declaration information or `null` if not * currently at a DOCTYPE node. */ diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php index 31267f9600671..88ae59a2fa781 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php @@ -26,6 +26,8 @@ public function __construct() { /** * Registers the necessary REST API routes. + * + * @since 5.5.0 */ public function register_routes() { register_rest_route( diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 8846f72788fce..c7a3ffe327030 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -2167,6 +2167,8 @@ protected function check_target_post_permission( int $post_id, WP_REST_Request $ /** * Check if post type supports notes. * + * @since 6.9.0 + * * @param string $post_type Post type name. * @return bool True if post type supports notes, false otherwise. */ diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php index a99a885d3945c..a83f64c816003 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php @@ -496,6 +496,8 @@ protected function prepare_links( $post ) { /** * Prepares child font face links for the request. * + * @since 6.5.0 + * * @param int $font_family_id Font family post ID. * @return array Links for the child font face posts. */ diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 25319b0a0b7d4..b07fe5d4cfe84 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -19,6 +19,8 @@ class WP_Sitemaps_Stylesheet { /** * Renders the XSL stylesheet depending on whether it's the sitemap index or not. * + * @since 5.5.0 + * * @param string $type Stylesheet type. Either 'sitemap' or 'index'. * @return never */