Sanitize and data validation with apply_filters() function

There’s some confusion here, because not all of these are validation, there are 2 others that are necessary to understand what’s appropriate: validation sanitisation escaping Sanitisation Sanitisation makes things clean and well formed This cleans up the data, e.g. trimming trailing spaces, removing letters in a number field, making an all lowercase field all lowercase, … Read more

don’t publish custom post type post if a meta data field isn’t valid

You can stop the post from saving all together with minor JQuery hacks and validate the fields before saving on the client side or server side with ajax: first we add our JavaScript to capture the submit/publish event and use it to submit our own ajax function before the actual submit: add_action(‘wp_print_scripts’,’my_publish_admin_hook’); function my_publish_admin_hook(){ if … Read more

A non well formed numeric value encountered

Because you are passing a string as the second argument to the date function, which should be an integer. string date ( string $format [, int $timestamp = time() ] ) Try strtotime which will Parse about any English textual datetime description into a Unix timestamp (integer):

Check if inputs are empty using jQuery

And you don’t necessarily need .length or see if it’s >0 since an empty string evaluates to false anyway but if you’d like to for readability purposes: If you’re sure it will always operate on a textfield element then you can just use this.value. Also you should take note that $(‘input:text’) grabs multiple elements, specify … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)