Using apostrophes in labels
-
Hi, when we use an apostrophe in a label, it shows in the submenu (i.e. ‘All What’s On’ as ‘All What's On’, even though it’s correct in the label when editing the CPT. Any idea why or how to fix?
Thank you
-
Not quite following what the issue is, based on the text in the original thread topic, possibly because the .org forum is rendering things instead of encoding them?
Hi Michael, you’re right. Looking back at the original post it’s rendering the same. The issue is the submenu label is appearing as
All What&.#39;s On
instead of All What’s On (period added in my reply after the ampersand to break it).Thanks
-
This reply was modified 2 years ago by
theotherdavid.
Can you provide your CPTUI post type settings, from
/wp-admin/admin.php?page=cptui_tools
and paste them here? I am not managing to recreate the issue at the moment.Hi Michael,
Please see below:
{“whatson”:{“name”:”whatson”,”label”:”What’s On”,”singular_label”:”What’s On”,”description”:””,”public”:”true”,”publicly_queryable”:”true”,”show_ui”:”true”,”show_in_nav_menus”:”true”,”delete_with_user”:”false”,”show_in_rest”:”true”,”rest_base”:””,”rest_controller_class”:””,”rest_namespace”:””,”has_archive”:”false”,”has_archive_string”:””,”exclude_from_search”:”false”,”capability_type”:”post”,”hierarchical”:”false”,”can_export”:”false”,”rewrite”:”true”,”rewrite_slug”:””,”rewrite_withfront”:”true”,”query_var”:”true”,”query_var_slug”:””,”menu_position”:””,”show_in_menu”:”true”,”show_in_menu_string”:””,”menu_icon”:”dashicons-tickets-alt”,”register_meta_box_cb”:null,”supports”:[“title”,”editor”,”thumbnail”,”excerpt”,”revisions”,”author”],”taxonomies”:[],”labels”:{“menu_name”:”What’s On”,”all_items”:”All What’s On”,”add_new”:”Add new”,”add_new_item”:”Add new What’s On”,”edit_item”:”Edit What’s On”,”new_item”:”New What’s On”,”view_item”:”View What’s On”,”view_items”:”View What’s On”,”search_items”:”Search What’s On”,”not_found”:”No What’s On found”,”not_found_in_trash”:”No What’s On found in trash”,”parent”:”Parent What’s On:”,”featured_image”:”Featured image for this What’s On”,”set_featured_image”:”Set featured image for this What’s On”,”remove_featured_image”:”Remove featured image for this What’s On”,”use_featured_image”:”Use as featured image for this What’s On”,”archives”:”What’s On archives”,”insert_into_item”:”Insert into What’s On”,”uploaded_to_this_item”:”Upload to this What’s On”,”filter_items_list”:”Filter What’s On list”,”items_list_navigation”:”What’s On list navigation”,”items_list”:”What’s On list”,”attributes”:”What’s On attributes”,”name_admin_bar”:”What’s On”,”item_published”:”What’s On published”,”item_published_privately”:”What’s On published privately.”,”item_reverted_to_draft”:”What’s On reverted to draft.”,”item_scheduled”:”What’s On scheduled”,”item_updated”:”What’s On updated.”,”parent_item_colon”:”Parent What’s On:”},”custom_supports”:””,”enter_title_here”:”Add What’s On”},”dining”:{“name”:”dining”,”label”:”Dining”,”singular_label”:”Dining”,”description”:””,”public”:”true”,”publicly_queryable”:”true”,”show_ui”:”true”,”show_in_nav_menus”:”true”,”delete_with_user”:”false”,”show_in_rest”:”true”,”rest_base”:””,”rest_controller_class”:””,”rest_namespace”:””,”has_archive”:”false”,”has_archive_string”:””,”exclude_from_search”:”false”,”capability_type”:”post”,”hierarchical”:”false”,”can_export”:”false”,”rewrite”:”true”,”rewrite_slug”:””,”rewrite_withfront”:”true”,”query_var”:”true”,”query_var_slug”:””,”menu_position”:””,”show_in_menu”:”true”,”show_in_menu_string”:””,”menu_icon”:”dashicons-drumstick”,”register_meta_box_cb”:null,”supports”:[“title”,”editor”,”thumbnail”,”excerpt”,”revisions”,”author”],”taxonomies”:[],”labels”:{“menu_name”:”Dining”,”all_items”:”All Dining”,”add_new”:”Add new”,”add_new_item”:”Add new Dining”,”edit_item”:”Edit Dining”,”new_item”:”New Dining”,”view_item”:”View Dining”,”view_items”:”View Dining”,”search_items”:”Search Dining”,”not_found”:”No Dining found”,”not_found_in_trash”:”No Dining found in trash”,”parent”:”Parent Dining:”,”featured_image”:”Featured image for this Dining”,”set_featured_image”:”Set featured image for this Dining”,”remove_featured_image”:”Remove featured image for this Dining”,”use_featured_image”:”Use as featured image for this Dining”,”archives”:”Dining archives”,”insert_into_item”:”Insert into Dining”,”uploaded_to_this_item”:”Upload to this Dining”,”filter_items_list”:”Filter Dining list”,”items_list_navigation”:”Din list navigation”,”items_list”:”Dining list”,”attributes”:”Dining attributes”,”name_admin_bar”:”Dining”,”item_published”:”Dining published”,”item_published_privately”:”Dining published privately.”,”item_reverted_to_draft”:”Dining reverted to draft.”,”item_scheduled”:”Dining scheduled”,”item_updated”:”Dining updated.”,”parent_item_colon”:”Parent Dining:”},”custom_supports”:””,”enter_title_here”:”Add Dining”},”store”:{“name”:”store”,”label”:”Stores”,”singular_label”:”Store”,”description”:””,”public”:”true”,”publicly_queryable”:”true”,”show_ui”:”true”,”show_in_nav_menus”:”true”,”delete_with_user”:”false”,”show_in_rest”:”true”,”rest_base”:””,”rest_controller_class”:””,”rest_namespace”:””,”has_archive”:”false”,”has_archive_string”:””,”exclude_from_search”:”false”,”capability_type”:”post”,”hierarchical”:”false”,”can_export”:”false”,”rewrite”:”true”,”rewrite_slug”:””,”rewrite_withfront”:”true”,”query_var”:”true”,”query_var_slug”:””,”menu_position”:””,”show_in_menu”:”true”,”show_in_menu_string”:””,”menu_icon”:”dashicons-store”,”register_meta_box_cb”:null,”supports”:[“title”,”editor”,”thumbnail”,”excerpt”,”revisions”,”author”],”taxonomies”:[],”labels”:{“menu_name”:”Stores”,”all_items”:”All Stores”,”add_new”:”Add new”,”add_new_item”:”Add new Store”,”edit_item”:”Edit Store”,”new_item”:”New Store”,”view_item”:”View Store”,”view_items”:”View Stores”,”search_items”:”Search Stores”,”not_found”:”No Stores found”,”not_found_in_trash”:”No Stores found in trash”,”parent”:”Parent Store:”,”featured_image”:”Featured image for this Store”,”set_featured_image”:”Set featured image for this Store”,”remove_featured_image”:”Remove featured image for this Store”,”use_featured_image”:”Use as featured image for this Store”,”archives”:”Store archives”,”insert_into_item”:”Insert into Store”,”uploaded_to_this_item”:”Upload to this Store”,”filter_items_list”:”Filter Stores list”,”items_list_navigation”:”Stores list navigation”,”items_list”:”Stores list”,”attributes”:”Stores attributes”,”name_admin_bar”:”Store”,”item_published”:”Store published”,”item_published_privately”:”Store published privately.”,”item_reverted_to_draft”:”Store reverted to draft.”,”item_scheduled”:”Store scheduled”,”item_updated”:”Store updated.”,”parent_item_colon”:”Parent Store:”},”custom_supports”:””,”enter_title_here”:”Add Store”}}
All the labels in the actual code above have the entity code for it, but it’s not showing.
Thank you
Definitely still trying to recreate, but even with importing the JSON above, this is what I’m seeing in my menu:
I’m also wondering when it’s getting encoded, like if you were to grab the raw database option for our settings, is it accurate there or is it encoded in the way not wanted, which would mean it’s getting encoded later at the time of rendering the menu itself.
Hi Michael,
V strange. When I look in the DB, it’s all the same (pre encoded): https://pastebin.com/bqLf2vFU
I’ve tried disabling all plugins (except CPT) and swapped themes to a default WP one and it’s still happening.
When I tested and imported into another site, it’s fine for me too.
Thanks
Just to make sure I’m still on the right track, the original site it was fetched from still has the issue, but when you imported to a different site, the issue was not present?
Correct, yep.
Worth a shot just re-importing into the original one. It’ll overwrite the previous settings with the exact same settings, but hopefully fix the issue.
Yep that did the trip! Very weird but thank you for you assistance!
Welcome
-
This reply was modified 2 years ago by
- The topic ‘Using apostrophes in labels’ is closed to new replies.