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

Set default values for missing labels attributes in bw_default_labels() #183

Closed
1 task done
bobbingwide opened this issue Oct 8, 2021 · 1 comment
Closed
1 task done

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Oct 8, 2021

Since WordPress 5.8, a variation of the core/navigation-link block is registered in the server for each Custom Post Type and Taxonomy where the show_in_nav_menus attribute is true.

For CPTs registered using bw_register_post_type(), many of these variations were indistiguishable in the block editor. In blocks.wp-a2z.org I had 16 variations of "Post Link".

This is because the strings being used to generate the variation name and description were not defined in the post type's / taxonomy's labels array.

For more information, and a screenshot, see bobbingwide/oik-blocks#49

Requirement

  • Add missing strings to help the user to identify the link type.

Solution

  • Change bw_default_labels() to add item_link and item_link_description.

Notes:

  • bw_default_labels() is used to create labels for both post types and taxonomies.
  • There are other labels which oik doesn't (yet) set.
  • The defaults that WordPress core use for these are not a problem.
'filter_items_list'        => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ),
'filter_by_date'           => array( __( 'Filter by date' ), __( 'Filter by date' ) ),
'items_list_navigation'    => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ),
'items_list'               => array( __( 'Posts list' ), __( 'Pages list' ) ),
'item_published'           => array( __( 'Post published.' ), __( 'Page published.' ) ),
'item_published_privately' => array( __( 'Post published privately.' ), __( 'Page published privately.' ) ),
'item_reverted_to_draft'   => array( __( 'Post reverted to draft.' ), __( 'Page reverted to draft.' ) ),
'item_scheduled'           => array( __( 'Post scheduled.' ), __( 'Page scheduled.' ) ),
'item_updated'             => array( __( 'Post updated.' ), __( 'Page updated.' ) ),
@bobbingwide
Copy link
Owner Author

oik v4.4.1 was made available on WordPress.org on 21st October. No Support requests since. Closing therefore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant