Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocks: remove gutenberg refs in PHP files #51978

Merged
merged 3 commits into from Jun 27, 2023

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Jun 27, 2023

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
@@ -341,7 +341,11 @@ function block_core_navigation_get_fallback_blocks() {
// If `core/page-list` is not registered then return empty blocks.
$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
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
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 added the Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jun 27, 2023
@ramonjd ramonjd enabled auto-merge (squash) June 27, 2023 13:48
Copy link
Contributor

@tellthemachines tellthemachines left a comment

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
50 checks passed
@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
Copy link
Contributor

ockham commented Jun 27, 2023

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

@tellthemachines tellthemachines removed the Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jun 28, 2023
@ockham
Copy link
Contributor

ockham commented Jun 28, 2023

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

@ramonjd
Copy link
Member Author

ramonjd commented Jun 28, 2023

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
Copy link
Member Author

ramonjd commented Jun 28, 2023

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.

None yet

4 participants