WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 5 months ago

#53576 closed defect (bug) (fixed)

Remove unnecessary compatibility shim added in 5.8

Reported by: desrosj Owned by: desrosj
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.8
Component: Themes Keywords: has-patch commit dev-reviewed fixed-major
Focuses: Cc:

Description

It looks like a compatibility shim from the Gutenberg plugin has accidentally made its way into Core.

The inline documentation indicates that the code block allows the plugin to work with older versions of WordPress until 5.8 is made the minimum required version. This doesn't matter in the context of WordPress because this code is being added in 5.8.

Attachments (1)

53576.diff (883 bytes) - added by desrosj 5 months ago.

Download all attachments as: .zip

Change History (9)

@desrosj
5 months ago

#1 @jorbin
5 months ago

  • Keywords commit added

This looks good to be committed and backported

This ticket was mentioned in Slack in #core-editor by desrosj. View the logs.


5 months ago

#3 @desrosj
5 months ago

  • Keywords commit removed

Going to hold off committing to allow for additional context. See this thread in Slack.

#4 @oandregal
5 months ago

Hey, sorry about the late response. This code needs to remain, although the comment could be removed as it's a leftover.

This is what I've tested:

  • Theme without theme.json support: the spacing panel is shown when the theme adds add_theme_support( 'custom-spacing' );, otherwise is not.
  • Theme with theme.json and settings.spacing.customPadding equals true: the spacing panel is shown, whether or not the theme has custom-spacing theme support.
  • Theme with theme.json and settings.spacing.customPadding equals false: the spacing panel is not shown, whether or not the theme has custom-spacing theme support.

I've also tested that it can be enabled per block (disable the top-level settings.spacing.customPadding but enable it for the core/cover block, for example).

#5 @desrosj
5 months ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 51352:

Themes: Remove inline comment that is not relevant in WordPress Core.

This removes an inline comment block that was added when importing the WP_Theme_JSON class in [50959]. The comment is relevant to the code only when viewed within the context of the Gutenberg plugin.

Props nosolosw, jorbin.
Fixes #53576.

#6 @desrosj
5 months ago

  • Keywords commit dev-feedback fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Thanks @nosolosw!

I've verified your testing steps and I'm seeing the same thing.

Conclusion: the inline comment is specific to the Gutenberg plugin, but only because the code following the notice will not be in WordPress Core until 5.8.

I've removed the inline comment in [51352] and marking for backport.

#7 @SergeyBiryukov
5 months ago

  • Keywords dev-reviewed added; dev-feedback removed

Looks good to backport.

#8 @desrosj
5 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51364:

Themes: Remove inline comment that is not relevant in WordPress Core.

This removes an inline comment block that was added when importing the WP_Theme_JSON class in [50959]. The comment is relevant to the code only when viewed within the context of the Gutenberg plugin.

Props nosolosw, jorbin, SergeyBiryukov.
Merges [51352] to the 5.8 branch.
Fixes #53576.

Note: See TracTickets for help on using tickets.