Opened 8 years ago
Last modified 5 years ago
#37916 new enhancement
Customize: ability to disable content creation in menus
Reported by: | celloexpressions | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Customize | Keywords: | needs-patch |
Focuses: | Cc: |
Description
There should be a hook to disable the ability to create new posts (and eventually terms, see #37915) in nav menus in the customizer. Ideally, it should be able to be disabled for specific post types as well as all post types. For terms, we'll need to turn it off for the post_format
taxonomy.
This is being split out from the initial merge in #34923, where there are patches with an approach we could take here.
Attachments (2)
Change History (11)
This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.
8 years ago
This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.
8 years ago
#4
@
8 years ago
@jorbin this was created after that commit :) Still waiting for dev feedback here, if you have any, please provide.
We're kind of waiting for #37914 as term support might change the approach here. My preference would still be to have something that can work for both post and term objects, though, and filters an array that contains only taxonomy_post_format
as a disallowed type by default. Passing __return_false
to that filter would disable the feature for all post types and taxonomies.
#5
@
8 years ago
@celloexpressions totally missed the timing :) sorry about that.
I'm considerably less familiar with the customizor code, so I would likely defer to you or @westonruter, but perhaps a filter that is in
ajax_insert_auto_draft_post
and whatever handler is used for taxonomies who's value is also output as a JS var that can be used to decide if we should show the add new box and button?
#8
@
8 years ago
- Keywords dev-feedback removed
- Milestone changed from 4.7 to Future Release
I don't think we currently *need* a way to turn off the ability to create stubs for nav menu items. Since the post_format
taxonomy is the only known use case for needing to turn off stub creation, and since term stubs aren't going to be part of 4.7 (per #37915) I think we can punt this to Future Release.
And the ticket isn't about turning off stub creation _entirely_ but rather turning off stub creation for specific object types. So in 37916.2.diff the customize_create_nav_menu_content
filter would need to be amended with additional context for the specific post_type
or taxonomy
.
@celloexpressions Now that #34923 has been committed, is this something you want to revist?