On line 652 of rest-manager/includes/class-rest-manager-settings.php
, it currently says:
$callback = create_function('', 'echo "'.str_replace('"', '\"', $section['desc']).'";');
create_function
is deprecated in PHP 7.2, so this line should be changed to:
$callback = function() {
echo str_replace('"', '\"', $section['desc']);
};
]]>
I got stuck on this for a considerable amount of time, thinking it was something to do with how I was engineering a custom end point.
If you add/edit an endpoint, you need to go into the rest manager and save. So if this plugin is used in dev, like in my case to track routes and ensure they are visible and keep an eye on what plugins are added routes that are needed / are not you will run into issues.
So I think if $route_settings[‘active’] is not set in rest_manager_get_active_routes it should add it as a new route and active by default.
Just my thoughts, Thankfully there is a filter I can use to do it manually for now “rest_manager_active_routes”.
If you want to see my epic time sink:
https://wordpress.stackexchange.com/questions/301067/register-rest-route-regex-option-for-base64-or-alternate/301094#301094
I blame myself for not ensuring I was recreating the issue with plugins disabled, regardless though I can see this same thing coming up for others.
]]>So I’m trying to filter active plugins on an install and basically it’s just not working, now I don’t know if I’m too dense or what but I just can’t tell how this exactly filters the plugins, I will appreciate your help.
I’ve setup a test on a dummy plugin and regardless on which part of the filter the plugin is it always shows the dummy output.
Here is the example of the test I’m doing, if my route has the test parameter it triggers, regardless of the plugin filter.
if ( $_GET['test'] ) {
var_dump('test');
exit();
}
]]>
There seems to be some unnecessary code at the top of your mu-plugin. What is the purpose of redefining functions like wp_get_current_user
?
In addition, on the plugin’s settings page, what is the purpose of the Select checkboxes? What is the difference between checking them and not checking them?
]]>I am getting this error when I try to activate the plugin from the “Add Plugins” page. The activation page path is /wp-admin/plugins.php?_wpnonce=e7f3bcc8f2&action=activate&plugin=rest-manager/lib/rest-manager.php
However, it does work if I activate from the “Plugins” page.
With plugin installed I can see the “Rest Manager” options page at /wp-admin/options-general.php?page=settings_rest-manager
However, if I visit my website’s homepage I get a fatal PHP error.
Fatal error: Uncaught Error: Call to undefined function is_user_logged_in() in C:\wamp64\www\wordpress.dev\wp-includes\class-wp-query.php on line 2352
It seems to fail at Rest_Manager_Request->request_filter()