Show wp_die if url form comment not emply

For all simple operations prior to comment submission use the action pre_comment_on_post. Like this: add_action( ‘pre_comment_on_post’, function() { if ( !empty( $_POST[‘url’] ) ) { wp_die( ‘Go away!’, ‘Nope’, [ ‘response’ => 403, ‘exit’ => true ] ); } });

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 automatically evaluate comment content without user seeing the delay?

The desired results mentioned in the question were achieved by using the wp_schedule_event() function, now: The user always sees the “awaiting moderation” message without experiencing any delay. The API requests happen without the users experiencing delay, they happen asynchronously when anyone visits the page and the time interval given as argument to the wp_schedule_event() has … Read more