Skip to content

Blocks: remove gutenberg refs in PHP files - #51978

Merged
ramonjd merged 3 commits into
trunkfrom
update/gutenberg-refs-in-block-library-php
Jun 27, 2023
Merged

ramonjd merged 3 commits into
trunkfrom
update/gutenberg-refs-in-block-library-php

Conversation

@ramonjd

@ramonjd ramonjd commented Jun 27, 2023

Copy link
Copy Markdown
Member

What?

Removes references to execution code referencing gutenberg where possible.

Why?

To avoid conflicts with Core

How?

Keyboard!

Testing Instructions

Tests should pass.
Editor should load.

@ramonjd ramonjd self-assigned this Jun 27, 2023
@ramonjd ramonjd added Backwards Compatibility Issues or PRs that impact backwards compatability [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. and removed Backwards Compatibility Issues or PRs that impact backwards compatability labels Jun 27, 2023
$fallback_blocks = $registry->is_registered( 'core/page-list' ) ? $page_list_fallback : array();

$navigation_post = Gutenberg_Navigation_Fallback::get_fallback();
if ( class_exists( 'WP_Navigation_Fallback' ) ) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I this should be

if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {

Same effect, just convention?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd go with the class_exists check, since the compat layer changes over time (and is thus not directly equivalent to the presence of the plugin).

@ramonjd
ramonjd enabled auto-merge (squash) June 27, 2023 13:48

@tellthemachines tellthemachines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM! Testing locally everything is working well.

@ramonjd
ramonjd merged commit 458ed04 into trunk Jun 27, 2023
@ramonjd
ramonjd deleted the update/gutenberg-refs-in-block-library-php branch June 27, 2023 14:39
@github-actions github-actions Bot added this to the Gutenberg 16.2 milestone Jun 27, 2023
ockham pushed a commit that referenced this pull request Jun 27, 2023
* Removes references to execution code referencing gutenberg where possible to avoid conflicts with Core.

* Added deprecated notices

* Removed `gutenberg_` for `IS_GUTENBERG_PLUGIN` only method
@ockham

ockham commented Jun 27, 2023

Copy link
Copy Markdown
Contributor

Cherry-picked to the wp/6.3 branch in 59b5abe.

@ockham

ockham commented Jun 28, 2023

Copy link
Copy Markdown
Contributor

@ramonjd @tellthemachines Should this also go into GB 16.1?

@ramonjd

ramonjd commented Jun 28, 2023

Copy link
Copy Markdown
Member Author

Should this also go into GB 16.1?

It probably should have I think. I can't see it the changes in the branch or in the commit history.

@ramonjd

ramonjd commented Jun 28, 2023

Copy link
Copy Markdown
Member Author

I think it's also missing 40aa280

sethrubenstein pushed a commit to pewresearch/gutenberg that referenced this pull request Jul 13, 2023
* Removes references to execution code referencing gutenberg where possible to avoid conflicts with Core.

* Added deprecated notices

* Removed `gutenberg_` for `IS_GUTENBERG_PLUGIN` only method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants