Make WordPress Core

Opened 7 weeks ago

Closed 6 weeks ago

#65390 closed defect (bug) (fixed)

Docs: Fix malformed and missing @since tags in WP_Theme_JSON for responsive block nodes

Reported by: khokansardar Owned by: SergeyBiryukov
Priority: normal Milestone: 7.1
Component: Editor Version: trunk
Severity: trivial Keywords: has-patch
Cc: Focuses: docs

Description (last modified by sabernhardt)

When responsive global styles for blocks were added in [62444], two @since documentation issues were introduced in src/wp-includes/class-wp-theme-json.php:

  1. WP_Theme_JSON::get_block_name_from_metadata_path() has @since 7.1 — missing the patch version. WordPress coding standards require three-part version strings. Should be @since 7.1.0.
  2. WP_Theme_JSON::get_block_nodes() was extended to generate responsive block nodes for breakpoint-based styles, but no @since 7.1.0 changelog entry was added to its docblock. The existing @since chain ends at 6.7.0.

Change History (5)

This ticket was mentioned in PR #12052 on WordPress/wordpress-develop by @khokansardar.


7 weeks ago
#1

  • Keywords has-patch added

## Summary

Fixes two @since documentation issues introduced in [5bc40a6] when responsive global styles for blocks were added.

  • WP_Theme_JSON::get_block_name_from_metadata_path() had @since 7.1 (missing patch version). WordPress always uses three-part version strings (major.minor.patch). Corrected to @since 7.1.0.
  • WP_Theme_JSON::get_block_nodes() was significantly extended to generate responsive block nodes for breakpoint-based styles, but the docblock was not updated with a new @since 7.1.0 changelog entry. Added the missing entry.


No functional changes.

#2 @sabernhardt
7 weeks ago

  • Component Bundled ThemeEditor
  • Description modified (diff)
  • Milestone Awaiting Review7.1

#3 @manhar
7 weeks ago

Reviewed the patch on src/wp-includes/class-wp-theme-json.php.

Both documentation fixes are correct — @since 7.1 updated to @since 7.1.0 on get_block_name_from_metadata_path(), and the missing @since 7.1.0 changelog entry added to get_block_nodes(). Changes follow WordPress coding standards for version strings.

@isabel_brison commented on PR #12052:


6 weeks ago
#4

Thanks for the PR! Documentation of changes to WP_Theme_JSON functions has been very ad-hoc with some changes being noted in the tags and others not. https://github.com/WordPress/wordpress-develop/commit/5bc40a6263c24649e6e97b2883fd9f16239f14de also made significant updates to sanitize, get_styles_for_block and remove_insecure_properties; perhaps these should also be tagged.

#5 @SergeyBiryukov
6 weeks ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 62493:

Docs: Correct @since tags in WP_Theme_JSON for responsive block nodes.

Follow-up to [62444].

Props khokansardar, huzaifaalmesbah, isabel_brison, sabernhardt, manhar, SergeyBiryukov.
Fixes #65390.

Note: See TracTickets for help on using tickets.