bobbingwide / oik-types

oik custom content type manager
http://www.oik-plugins.com/oik-plugins/oik-types/
GNU General Public License v2.0
1 stars 0 forks source link

oik-types should be able to turn off options such as `show_in_nav_menus` #23

Open bobbingwide opened 2 years ago

bobbingwide commented 2 years ago

In Gutenberg the Navigation link block ( core/navigation ) has a number of custom variations that are dynamically generated for each of the post types that are _builtin and/or support show_in_nav_menus.

A lot of my CPTs are registered with show_in_nav_menus since that is the default for CPTs which are public.

oik-types admin doesn't have the capability of turning off the show_in_nav_menus setting.

Requirement

Proposed solution

One or more of the following:

  1. Do nothing
  2. Update the plugins that register the CPTs to set show_in_nav_menus to false.
  3. Update bw_register_post_type() to set the show_in_nav_menus value to false if it's not set.
  4. Change oik-types to support turning off of these boolean fields.

Option 1. may also require the oik-types CPT override to be changed.

bobbingwide commented 2 years ago

Note: In wp-a2z.org and/or oik-plugins there are many variations, for both the CPTs and their taxonomies.

Option CPT / Taxonomy link
0 core/navigation-link post,Custom Link Post Link
0 core/navigation-link page,Custom Link Page Link
0 core/navigation-link category,Custom Link Category Link
0 core/navigation-link tag,Custom Link Tag Link
1 / 2 core/navigation-link oik_edd_apikey,Custom Link oik EDD API key Link
1 / 2 core/navigation-link oik_shortcodes,Custom Link Shortcode Link
1 / 2 core/navigation-link oik_sc_param,Custom Link Shortcode parameter Link
1 / 2 core/navigation-link shortcode_example,Custom Link Shortcode example Link
1 / 2 core/navigation-link oik_file,Custom Link File Link
1 / 2 core/navigation-link oik_class,Custom Link Class Link
1 / 2 core/navigation-link oik_hook,Custom Link Hook Link
1 / 2 core/navigation-link oik_api,Custom Link API Link
1 / 2 core/navigation-link block,Custom Link Block Link
1 / 2 core/navigation-link block_example,Custom Link Block example Link
1 / 2 core/navigation-link opted_in,Custom Link Opted in page Link
1 / 2 core/navigation-link oik_contact,Custom Link Contact Link
1 / 2 core/navigation-link oik_testimonials,Custom Link Testimonial Link
1 / 2 core/navigation-link oik-themes,Custom Link Theme Link
1 / 2 core/navigation-link oik_themeversion,Custom Link oik theme version Link
1 / 2 core/navigation-link oik_themiumversion,Custom Link oik themium version Link
1 / 2 core/navigation-link oik_todo,Custom Link TODO Link
1 / 2 core/navigation-link oik-plugins,Custom Link Plugin Link
1 / 2 core/navigation-link oik_pluginversion,Custom Link oik plugin version Link
1 / 2 core/navigation-link oik_premiumversion,Custom Link oik premium version Link
1 / 2 core/navigation-link download,Custom Link Download Link
1 / 2 core/navigation-link oik-faq,Custom Link FAQ Link
1 / 2 core/navigation-link letters,Custom Link Letter Link
1 / 2 core/navigation-link block_category,Custom Link Block category Link
1 / 2 core/navigation-link block_keyword,Custom Link Block keyword Link
1 / 2 core/navigation-link block_classification,Custom Link Block classification Link
1 / 2 core/navigation-link testimonial_type,Custom Link Testimonial type Link
1 / 2 core/navigation-link todo_priority,Custom Link Priority Link
1 / 2 core/navigation-link todo_status,Custom Link Status Link
1 / 2 core/navigation-link required_version,Custom Link Required version Link
1 / 2 core/navigation-link compatible_up_to,Custom Link Compatible up to Link
1 / 2 core/navigation-link oik_tags,Custom Link Plugin Tag Link
1 / 2 core/navigation-link oik_letters,Custom Link API Letter Link
1 / 2 core/navigation-link block_letters,Custom Link Block letter Link
bobbingwide commented 2 years ago

Update bw_register_post_type() to set the show_in_nav_menus value to false if it's not set.

This requires a change to oik. It's actually the easiest change for CPTs. Does it work for custom taxonomies too?

bobbingwide commented 2 years ago

Does it work for custom taxonomies too?

The same logic is needed in bw_register_custom_tags() and bw_register_custom_category()

See also https://github.com/bobbingwide/oik-blocks/issues/49