How do I return XML to an API post request

because you don’t return JSON, you can use admin-post.php. create a hook like that : add_action(“admin_post_nopriv_MY_PLUGIN__answer”, function () { header(“Content-type: text/xml”); echo “<abc><def>1</def></abc>”; exit(); }); and then use the url /wp-admin/admin-post.php?action=MY_PLUGIN__answer. when you do debugging, don’t forget that admin_post_nopriv only answers on unconnected users then you can open the url in another browser.

How is wp_admin_notice supposed to work?

If you look at the user-edit.php file, you can see, when updating an user, if there are no errors, then WP performs an redirect. This effectively wipes the admin notice you’re trying to display as it is not stored anywhere. One workaround for this is to store the custom error as a temporary option value … Read more

How to customize WP_Error (REST JWT authentication plugin) [closed]

✨ Solution I’m not sure this is the most efficient way to use rest_post_dispatch (documentation) for this purpose (maybe overkill but I didn’t found other way). It works as expected. add_filter(“rest_post_dispatch”, “rest_customize_result”, 10, 3); function rest_customize_result( WP_REST_Response $result, WP_REST_Server $server, WP_REST_Request $request ) { if ( $request->get_route() === “/jwt-auth/v1/token” && $result->get_status() === 403 ) { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)