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

Reusable Blocks: wp_block custom post type needs full set of labels #11272

Closed
1 task
benlk opened this issue Oct 30, 2018 · 2 comments · Fixed by #11278
Closed
1 task

Reusable Blocks: wp_block custom post type needs full set of labels #11272

benlk opened this issue Oct 30, 2018 · 2 comments · Fixed by #11278
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended

Comments

@benlk
Copy link
Contributor

benlk commented Oct 30, 2018

Describe the bug
When viewing the list of reusable blocks at /wp-admin/edit.php?post_type=wp_block with no reusable blocks saved, the text displayed is "No posts found."

Screenshots

WordPress 4.9.8:
screen shot 2018-10-30 at 6 11 20 pm

WordPress 5.0-beta2-43845:
screen shot 2018-10-30 at 6 14 55 pm

To Reproduce
Steps to reproduce the behavior:

  1. Prepare an install of WordPress with no blocks saved as reusable blocks.
  2. Navigate to /wp-admin/edit.php?post_type=wp_block
  3. Observe the message showing a lack of posts in the custom post type.

Expected behavior
It should say "No reusable blocks found" or something of that sort.

  • make sure that the 'labels array is fully populated in lib/register.php:

gutenberg/lib/register.php

Lines 446 to 450 in 3600c88

'labels' => array(
'name' => __( 'Blocks', 'gutenberg' ),
'singular_name' => __( 'Block', 'gutenberg' ),
'search_items' => __( 'Search Blocks', 'gutenberg' ),
),

A reasonably-current list of labels is at https://developer.wordpress.org/reference/functions/get_post_type_labels/

Additional context
This happens in:

  • Gutenberg 4.1.1 in WordPress 4.9.8
  • WordPress 5.0-beta2-43845
@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone Oct 30, 2018
@danielbachhuber danielbachhuber added [Type] Bug An existing feature does not function as intended [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) labels Oct 30, 2018
@danielbachhuber
Copy link
Member

Thanks for the report, @benlk!

Want to submit a pull request for this? We'll also need to fix this in core; you can include a patch on https://core.trac.wordpress.org/ticket/45098 too if you'd like.

@benlk
Copy link
Contributor Author

benlk commented Oct 31, 2018

@danielbachhuber It looks like @TimothyBJacobs has a PR already in #11278

danielbachhuber pushed a commit that referenced this issue Oct 31, 2018
* Add complete post type labels for Resuable Blocks

Fixes #11272.

* Clean up PHPCS issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants