[wp-trac] [WordPress Trac] #54304: Expose menu data public in Menus REST API
WordPress Trac
noreply at wordpress.org
Wed Oct 9 12:27:27 UTC 2024
#54304: Expose menu data public in Menus REST API
---------------------------------------------------+-----------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.8
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: has-patch needs-testing needs-refresh | Focuses: rest-api
---------------------------------------------------+-----------------------
Comment (by kadamwhite):
Responding to @spacedmonkey's question in Slack,
> So are you okay with the filter option or should this live in a plugin?
I'm fine with the filter, I think it's the simplest solution. We have a
lot of areas in REST code already that encourage developers to copy-paste
specific filter code on all projects (many people disable public REST
access entirely, many people set all their endpoint permissions_callbacks
to `__return_true` whether they should or not, etc), and this doesn't feel
like it makes that situation any different.
> Should it be 1 filter for all menus or one filter per endpoints, one for
menus, menu items and menu locations?
I feel personally that the boolean toggle is enough. However, if others
disagree, what if we did something like `allowed_block_types_all`, where
you could return a boolean `true` for "all access" or an array of route
string paths to be selective?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54304#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list