Add a new tag based on the category name in the publish event

You have to add the true parameter to the wp_set_post_tags() function. Tested and works, the corrected code: add_filter(‘wp_insert_post’, ‘add_cat_to_tags’, 10, 3 ); function add_cat_to_tags( $post_ID, $post, $update ) { $tags = array(); $cats = get_the_category( $post_ID ); foreach ( $cats as $cat ) { $tags[] .= $cat->name; } // overwrites any existing tags!! wp_set_post_tags( $post_ID, … Read more

Get input form data posted by users

The most straightforward way is to utilize the $_POST super global variable. For example, if the form had a field named post-text, you could access the posted data at $_POST[ ‘post-text’ ]. Of course, you’d want to sanitize it properly before using it.

Can we validate data from jquery

Yes, you can validate data using jquery before submitting form. There is a way custom way to do that by checking the fields value length `$(document).ready(function(){ $(“#form”).submit(function(){ var field_value = $(‘input[name=”some_name”]’).val(); if(field_value.length>0){ return true; } else{ return false; } }); });` Or you can use a jquery validation library. https://jqueryvalidation.org/