Gutenberg: Remove gutenberg references from block-library PHP files

Created on 20 Nov 2018  Â·  8Comments  Â·  Source: WordPress/gutenberg

The PHP files in block-library are copied to Core and committed there, but they're going to be maintained in this repo for now.

To fit in properly with core, there are a couple of changes to make:

  • @package gutenberg should become @package WordPress.
  • All gutenberg_ function prefixes should be removed.

10788 is related, for removing the 'gutenberg' textdomain from these files.

[Package] Block library [Status] In Progress [Type] Task

Most helpful comment

Has there been any discussion about prefixing the names of the new global functions with wp_?

All 8 comments

Are there plans to deprecate those functions or will they be removed completely? Lots of juggling of “what’s active” (plugin version vs core version) already, and removing these functions only makes things more difficult for plugins and themes built against the Gutenberg plugin over the last year.

@spencerfinnell: Do you have a use case for when you're relying on these particular functions?

I don’t have a specific use case but completely removing (renaming) functions a week before release doesn’t fit with the deprecation schedule that has been used for JavaScript functions/APIs.

Has there been any discussion about prefixing the names of the new global functions with wp_?

Nope just this ticket 6 days before 33% of the web changes.

There are just two functions inside of one file block-library/latest-comments/index.php

Looking at the code, one of the functions was copied out of core because it could not be used included during rendering. The other function is used to render the latest comments block.

Both seem pretty unlikely they'd be called outside of latest-comments block

We now have both render_block_core_latest_posts() and gutenberg_render_block_core_latest_comments() in core. At least the latter should definitely get renamed before 5.0.

There's also gutenberg_draft_or_post_title()...

When I grep gutenberg_ in the WordPress 5.0 branch I only see gutenberg_draft_or_post_title() which was removed in https://github.com/WordPress/gutenberg/pull/12326 and will be included in core when the @wordpress/blocks dependency is updated.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cr101 picture cr101  Â·  3Comments

jasmussen picture jasmussen  Â·  3Comments

aduth picture aduth  Â·  3Comments

mhenrylucero picture mhenrylucero  Â·  3Comments

maddisondesigns picture maddisondesigns  Â·  3Comments