get_permalink() returns in wrong format via AJAX
get_permalink() returns in wrong format via AJAX
get_permalink() returns in wrong format via AJAX
I guess, that whitelisting the endpoint is not possible, as this is the simplest solution here. It will be a little workaround here, but you can try to replace your AJAX endpoint, with a REST API endpoint. Your main upload logic should stay the same, request will be similar. Maybe you can even use the … Read more
Can’t have two simultaneous charts using Apex Charts
It has nothing to do with child themes, the problem is here: add_action(“wp_ajax_nopriv_x_before_process”, “x_before_process”); Notice the nopriv, this is for logged out users, but it’s likely you are logged in This needs adding: add_action(“wp_ajax_x_before_process”, “x_before_process”); Note that this would not have been an issue if it was built using a more modern AJAX API such … Read more
There are several potential reasons for this issue: Permissions: Non-admin users may not have the necessary permissions to access the admin-ajax.php file, which is being called in your AJAX request. Make sure that the required permissions are set for the user roles other than admin. Authentication: Non-admin users may not be authenticated to access the … Read more
I “resolved” it in the following way: In src -> App -> Frontend -> FrontRequestHandler.php i added the handler function that will insert the Custom Post. <?php /** * Class Enqueue * * @package DemoPlugin\App\Frontend * @since 1.0.0 */ class FrontRequestHandler extends Base { /** * Initialize the class. * * @since 1.0.0 */ public … Read more
wordpress admin-ajax bad request 400
How to update my jquery/PHP function to add/remove user as favorites in (WordPress) users list
Found the solution in case anyone is having the same problem. Before the Query call I ran: remove_all_actions(‘pre_get_posts’);
admin-ajax.php is treated as part of the admin, so protected statuses will be included. To solve this just explicitly define post_status as publish to only get published posts: $args = array( ‘post_type’ => ‘project’, ‘post_status’ => ‘publish’ ); Or, better yet, consider using the REST API for AJAX requests, instead of the aging admin-ajax.php approach. … Read more