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.
https://github.com/bobbingwide/oik/issues/183 addresses the problem for post types registered using bw_register_post_type(), but doesn't cater for CPTs and taxonomies that have been created / updated using oik-types.
Requirement
Ensure core/navigation-link variations for CPTs and taxonomies are identifiable.
Support oik-types definitions created prior to WordPress 5.8
Solution
[x] For CPTs which are modified by oik-types merge the labels produced by bw_register_post_type() with those that have been saved in the bw_types option.
[x] For CPTs created by oik-types unset the saved $args['labels'] and use the values produced by bw_register_post_type().
At this point in time it doesn't seem necessary to remove the old labels from the bw_types option.
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 theshow_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".For more information, and a screenshot, see https://github.com/bobbingwide/oik-blocks/issues/49
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.
https://github.com/bobbingwide/oik/issues/183 addresses the problem for post types registered using
bw_register_post_type()
, but doesn't cater for CPTs and taxonomies that have been created / updated using oik-types.Requirement
core/navigation-link
variations for CPTs and taxonomies are identifiable.Solution
bw_register_post_type()
with those that have been saved in thebw_types
option.$args['labels']
and use the values produced bybw_register_post_type()
.At this point in time it doesn't seem necessary to remove the old
labels
from thebw_types
option.