Loading comments in ajax – comment-reply function missing $args

You do not need an existing $args variable here, you can define your own arguments and they will override the defaults. See the get_comment_reply_link() docs for the defaults. Instead, you can pass the arguments you want directly. comment_reply_link( array( ‘reply_text’ => __( ‘Répondre ‘, ‘autourdesanimaux’ ), ‘depth’ => $depth, ‘max_depth’ => get_option( ‘thread_comments_depth’ ) ) … Read more

How to create an ajax endpoint without js?

When using JS fetch api with the wordpress is set up your issue is with the body. fetch passes body data in a way that wordpress can’t understand. Your body: {} should be like this body: new URLSearchParams({ username: ‘thewhitefang’, password: ‘@bhishek01’, action: ‘login_ajax’ }) and you need to change your content-type as well. ‘Content-Type’: … Read more

PHP 8, AJAX mail form to function.php doesn’t work

This is the cause of your problem: function true_add_ajaxform(){ … function set_html_content_type() { return ‘text/html’; } } You shouldn’t nest function definitions! Move it out of the function like this: function true_add_ajaxform(){ … } function set_html_content_type() { return ‘text/html’; }

WordPress Sending data to Ajax with select option

I would start with checking what’s sql query you have print_r(“Select * From wp_ilce where il_id={$_POST[‘il’]}”); Next copy it to the sql tab in your phpmyadmin and see if it returns the currect data, could be the the wp_ prefix is incorrect, mabe $_POST[‘il’] contains an incorrect value. But aside from all that WP has … Read more

Ajax call not working

I have updated the code in your shared code. Please ask in the comments if you did not get changes. add_action(‘wp_ajax_dynamic_price’, ‘get_update_dynamic_price_xyz’); add_action(‘wp_ajax_nopriv_dynamic_price’, ‘get_update_dynamic_price_xyz’); function get_update_dynamic_price_xyz() { global $product; /** * Get the discount details of given product with custom price * @param $price float/integer * @param $product object (Product object Example: wc_get_product($product_id)) * @param … Read more