WPIntell

Source evidence

WordPress 5.5 Support

WP API Menus · support · 2020-07-28T21:04:00+00:00

complaintsentiment
mediumseverity
0.93relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

2 / 30 rows with source links

6.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Austin unresolved
Just cross posting for those who are not on GitHub: https://github.com/unfulvio/wp-api-menus/issues/57 You can read about the REST changes here: https://make.wordpress.org/core/2020/07/22/rest-api-changes-in-wordpress-5-5/ > In [[48526]( https://core.trac.wordpress.org/changeset/48526 )] a _doing_it_wrong notice has been added when a permission callback is omitted. For REST API routes that are intended to be public, it is recommended to set the permission callback to the __return_true built in function. _Running WordPress 5.5 beta4._ See example notice: PHP Notice: register_rest_route was called <strong>incorrectly</strong>. The REST API route definition for <code>wp-api-menus/v2/menus</code> is missing the required <code>permission_callback</code> argument. For REST API routes that are intended to be public, use <code>__return_true</code> as the permission callback. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.5.0.) in /usr/local/wordpress/wp-includes/functions.php on line 5225 Just updated an installation to the final version of WP 5.5 and stumbled upon this notice as well. Would be great if it could be fixed! The WordPress documentation says the following about this: As of WordPress 5.5, if a permission_callback is not provided, the REST API will issue a _doing_it_wrong notice. The REST API route definition for myplugin/v1/author is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. If your REST API endpoint is public, you can use __return_true as the permission callback. <?php add_action( 'rest_api_init', function () { register_rest_route( 'myplugin/v1', '/author/(?P<id>\d+)', array( 'methods' => 'GET', 'callback' => 'my_awesome_func', 'permission_callback' => '__return_true', ) ); } ); See: https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/ From the developer, he advised me he doesn’t have the time to maintain this plugin. I do have an open PR to fix the issue on GitHub , so unless @nekojira adds me as a contributor to GitHub and the WP plugin, I would suggest you use a forked (non wp.org package, like I am going to be doing here this week) version. This reply was modified 5 years, 9 months ago by Austin . @austyfrosty please let me know your GitHub handle and I’ll add you as collaborator just invited 🙂 please check https://github.com/unfulvio/wp-api-menus/issues/60

Comments

5 shown
ProxxiM 2020-08-12T07:28:00+00:00

Just updated an installation to the final version of WP 5.5 and stumbled upon this notice as well. Would be great if it could be fixed!

ProxxiM 2020-08-12T07:38:00+00:00

The WordPress documentation says the following about this: As of WordPress 5.5, if a permission_callback is not provided, the REST API will issue a _doing_it_wrong notice. The REST API route definition for myplugin/v1/author is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. If your REST API endpoint is public, you can use __return_true as the permission callback. <?php add_action( 'rest_api_init', function () { register_rest_route( 'myplugin/v1', '/author/(?P<id>\d+)', array( 'methods' => 'GET', 'callback' => 'my_awesome_func', 'permission_callback' => '__return_true', ) ); } ); See: https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/

Austin 2020-08-12T14:43:00+00:00

From the developer, he advised me he doesn’t have the time to maintain this plugin. I do have an open PR to fix the issue on GitHub , so unless @nekojira adds me as a contributor to GitHub and the WP plugin, I would suggest you use a forked (non wp.org package, like I am going to be doing here this week) version. This reply was modified 5 years, 9 months ago by Austin .

Fulvio Notarstefano 2020-08-12T14:50:00+00:00

@austyfrosty please let me know your GitHub handle and I’ll add you as collaborator

Fulvio Notarstefano 2020-08-12T15:03:00+00:00

just invited 🙂 please check https://github.com/unfulvio/wp-api-menus/issues/60