How to check a meta_value using ajax in wordpress?
I need to check if a meta value already exists using ajax, if exists
display error otherwise carry on.
This a query that I have to display the name list:
$args = array(
'posts_per_page' => -1,
'meta_key' => 'user_submit_name',
'meta_value' => get_the_author(),
'meta_compare' => '='
);
So basically we have an input field for author name, while the user write
its name, the site checks if the value already exists. If so display an
error (Username already exists, try another one) otherwise it's ok.
The value that I need to check I guess is 'meta_value' => get_the_author()
No comments:
Post a Comment