Questions tagged [validation]
The validation tag has no summary.
247 questions
0votes
0answers
30views
Block validation failed for React Component block that rehydrates after taking effect
I have this specific block than when I insert in the Editor, gives me this error: and the error states: Content generated by save function: <div class="data-props" style="display:...
1vote
1answer
73views
wp_verify_nonce for comment form is not returning false
Nonce creation; for testing purposes with 30 seconds: //function to generate nonce field function noncelife(){ return 30; } add_action( 'run_custom_nonce_value', 'custom_nonce_value' ); function ...
1vote
1answer
160views
wp_verify_nonce is always false even when the nonces are identical
In a plugin i create a nonce with a time limit of 15 minutes: function noncelife(){ return 900; } add_action( 'run_custom_nonce_value', 'custom_nonce_value' ); function custom_nonce_value(){ ...
0votes
0answers
25views
Custom Form Validation not Working and junping to next step
I am working in WP and using the elementor builder. I am trying to create an own form, with steps. I am able get it working, but I want to validate the fields at submit and that is not working. By ...
0votes
0answers
12views
How to jquery validate wp_editor?
I am doing jquery validation on my form which works fine for all fields except for the wp_editor field. I can set the content like so: $("#recipe_content").html("<p>Hello</p>...
0votes
1answer
98views
Do I need to validate the nonce when using the settings api?
I have been developing a plugin. When using the 'Plugin Check' Wordpress plugin to check it before submission, it gave me a warning that 'Processing form data without nonce verification.' Do I need to ...
0votes
1answer
433views
Simple way to alert error messages in Javascript
I would like to issue an alerted message when a Wordpress content is blank. For example, this is part of the codes: if(content === '') { alert('Please write description of your post.')...
0votes
2answers
88views
jQuery - Make multiple field Required with warning at WP Admin backend
I would like to use jQuery to validate two fields on NEW/EDIT page of a Wordpress website in a way that When either of both fields are empty and Publish button is pressed, there is a warning: Please ...
1vote
1answer
34views
What is the correct way of validating running code when a particular role accesses a screen?
I'd like to run a series of actions if a particular role accesses a specific screen. For example, if( is_user_logged_in() && ! current_user_can( 'activate_plugins' ) ) { if( isset( $...
0votes
0answers
467views
Validate a custom form with js and php
I would please need help with the following: I have a form in my WP Plugin, that is validated with js, which works fine, Then I want to validate it using php, display the errors on the form and after ...
0votes
1answer
80views
Gallery Block in template, validation fails after adding column number
I have set up a template in a block like so: const TEMPLATE = ['core/spacer', {height: '100px'}], ['core/gallery', {templateLock: 'false', columns: 2}] ; const ...
0votes
1answer
334views
how to sanitizing $_POST with the correct way?
I am trying to sanitize and validate and escape this code? $positions = $_POST['positions']; foreach ($positions as $key => $position) { $id = sanitize_text_field($position[0]); ...
0votes
1answer
292views
Set post status to draft after validating post meta values in save_post hook
I have some custom meta values to a custom post type ('event'). The custom post type is displayed in the admin and the custom meta fields are appearing fine. I am using save_post_{$post->post_type} ...
1vote
2answers
1kviews
Display notice in block editor after wp_insert_post_data hook
I have a custom post type which checks and validates some (custom) meta fields added with it upon publishing. I am using wp_insert_post_data for the purpose: public function __construct() { $this-&...
0votes
1answer
52views
How to add verification on email address change?
I have custom form for changing email address and it's working perfectly. However, i realized that i have to add some precautions to prevent my users from using invalid or email address they do not ...