You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding Category Links to a Nav Menu: Rename Custom Category Link #69749
While writing a tutorial about adding categories to Block Theme menus, I came across 2 kinds of Category Links, one of which had me confused. I've attached a screengrab to help describe what I'm talking about.
The Category Link with a square shape comprised of 4 dots is the one that will work as expected. Using that, an existing category can be added to the menu.
The Category Link with the asterisk above 2 lines doesn't work as expected. This link is for a custom taxonomy, but I didn't know that until I posted the question in Slack. After a brief discussion, @pbiron came up with an answer in this thread: https://app.slack.com/client/T024MFP4J
What is your proposed solution?
I think the labels should be different. Maybe something like "Custom Category Link", to help the average user realize what it is.
@Rishit30G Are there any custom taxonomies registered (e.g. in a plugin) on the site you're testing with? If not, then you won't see the other "variation" of the Category Link block.
@pbiron I thought you saw it on a vanilla site?
I am not aware of any custom taxonomies on my site.
My configuration = child theme of 2024 theme. I disabled several plugins and could still see the 2nd Category Link. Here are all of the plugins installed on my test site:
Bingo! Good find @pbiron.
A secondary issue with this Custom Category Link is figuring out how to use it. It's not intuitive. I'll have to play around and experiment to see how it works.
WP: 6.7.2
Theme: TT4
Plugins: only the test-69749 plugin
Steps to test:
install/active the test plugin.
add a few terms to each of the 2 custom taxonomies the plugin registers (the taxes are applied to post_type post)
add a few terms to the core/built-in Category taxonomy
edit a post and add a navigation block
select that block (and the Block tab in the sidebar)
click the "+" icon to add a navigation-item block
in the "Search" box, enter "Category Link". You'll notice that 3 blocks appear in the inserter, one of which has the "4 boxes" icon, the other 2 have the "* with 2 lines below" icon
select the block with the "4 boxes" icon and choose one of the Category terms you added
click the "+" icon to add a navigation-item block
in the "Search" box, enter "Category Link" and choose one of the blocks with the "* with 2 lines below" icon and select one of the custom terms you added to that custom tax
click the "+" icon to add a navigation-item block
in the "Search" box, enter "Category Link" and choose the other blocks with the "* with 2 lines below" icon and select one of the custom terms you added to that custom tax
See attached screengrab of the relevant steps above
As you can see in the screengrab, it's impossible to tell which custom taxonomy is associated with each block with the "* with 2 lines below" icon in the insert until you select one ;-(
Wow! Thanx Aki! I had no idea those lables existed!
@askdesign Based on what @t-hamano says, this doesn't seem to be a problem with GB. Rather, it's a problem those plugins (or themes) that register custom taxes not suppling their own name for the block variation. So, you probably will want to open an issue with the devs of Responsive Lightbox & Gallery and ask them to add those lables ;-)
@t-hamano Do you think it would be worthwhile opening another issue and to propose that in the absence of a link_item label, that the block variation name be singular_name + ' Link'?
Activity
pbiron commentedon Mar 29, 2025
@Rishit30G Are there any custom taxonomies registered (e.g. in a plugin) on the site you're testing with? If not, then you won't see the other "variation" of the
Category Linkblock.askdesign commentedon Mar 29, 2025
@pbiron I thought you saw it on a vanilla site?
I am not aware of any custom taxonomies on my site.
My configuration = child theme of 2024 theme. I disabled several plugins and could still see the 2nd Category Link. Here are all of the plugins installed on my test site:
pbiron commentedon Mar 29, 2025
sorry, "vanilla" + a simple plugin that just registers a few custom taxonomies just to surface the issue.
pbiron commentedon Mar 29, 2025
@askdesign Responsive Lightbox & Gallery regsiters a taxonomy named
rl_category. `askdesign commentedon Mar 29, 2025
Bingo! Good find @pbiron.
A secondary issue with this Custom Category Link is figuring out how to use it. It's not intuitive. I'll have to play around and experiment to see how it works.
pbiron commentedon Mar 29, 2025
Attached is a simple plugin to demonstrate the problem.
test-69749.zip
WP: 6.7.2
Theme: TT4
Plugins: only the test-69749 plugin
Steps to test:
post)CategorytaxonomynavigationblockBlocktab in the sidebar)navigation-itemblockCategoryterms you addednavigation-itemblocknavigation-itemblockSee attached screengrab of the relevant steps above
As you can see in the screengrab, it's impossible to tell which custom taxonomy is associated with each block with the "* with 2 lines below" icon in the insert until you select one ;-(
t-hamano commentedon Mar 31, 2025
You can change the block name and description by using the
item_linkanditem_link_descriptionfields of thelabelsproperty. Example:pbiron commentedon Mar 31, 2025
Wow! Thanx Aki! I had no idea those lables existed!
@askdesign Based on what @t-hamano says, this doesn't seem to be a problem with GB. Rather, it's a problem those plugins (or themes) that register custom taxes not suppling their own name for the block variation. So, you probably will want to open an issue with the devs of
Responsive Lightbox & Galleryand ask them to add those lables ;-)t-hamano commentedon Mar 31, 2025
As the reported issue is not a bug and I don't think there is anything we can do about it, I would like to close it.
pbiron commentedon Mar 31, 2025
@t-hamano Do you think it would be worthwhile opening another issue and to propose that in the absence of a
link_itemlabel, that the block variation name besingular_name+ ' Link'?t-hamano commentedon Mar 31, 2025
This format may not be ideal for localization. See #29095 (comment)
pbiron commentedon Mar 31, 2025
yup, I was wondering that myself, but thought I'd ask. thanx
askdesign commentedon Mar 31, 2025
Thank you all! I've reported the issue to the plugin devs.