prepare select of array
prepare select of array
prepare select of array
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.
Prevent WordPress Link Editor from Automatically Adding “http://”
WordPress site shows empty image as first entry in featured image window [closed]
I’m looking real hard at the code around both hooks, and they run one right after the other, with the same arguments, and I just can’t see any meaningful difference. Theoretically only parse_query would run, and not pre_get_posts, if WP_Query::parse_query() were to be run directly on its own, but WordPress itself never does that. Maybe … Read more
I have mostly found the answer to my questions. WordPress utilizes the GD Library or IMagick (ImageMagick by John Cristy) to create various sized thumbnails whenever a image is uploaded to the WP Media Library. Depending upon your theme, what you have in WP Dashboard/Settings/Media, and what plugins you have, you may get anywhere from … Read more
There is no official public API to inject custom buttons into that area. This can be confirmed by inspecting the source code for this area, rendered by the DocumentTools component in the @wordpress/editor package. As alternatives, you could render a button to the right of the Save/Publish button on the right side. This button would … Read more
If you’re using javascript to submit the form data to the REST endpoint, then you should handle the redirection at the client side, not at the server with PHP. Read the location header from the response and pass it to window.location to redirect the user somewhere. Here’s a simplified example – not tested, requires fleshing … Read more
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
✨ 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