Exclude URL’s from sanitize_html_classes
On input, esc_url_raw() is the correct function to use which replaces sanitize_url Example : $custom_field = esc_url_raw( get_post_meta( get_the_ID(), ‘_custom_url’, true ) );
On input, esc_url_raw() is the correct function to use which replaces sanitize_url Example : $custom_field = esc_url_raw( get_post_meta( get_the_ID(), ‘_custom_url’, true ) );
As you say, when triggered ‘save_post’ the changes are not been mae, so there’s not yet an association with a term. But..in the $_POST[‘product_cat’] variable you have the array (IDS) of the selected categories, so you can check if the product belongs to the ‘Keyboard’ category ( based on its ID) and decide whether or … Read more
Select input in metabox not updated
Save / Update meta data as multidimensional array
Updating failed. The response is not a valid JSON response. specific to my browser when I include javascript in my html
remove_action(‘save_post’) in function that was triggered by save post not working
save_post trigerred twice
I don’t know what you want to do besides checking the meta so i’m gonna give a very basic example. function bt_check_saved_post_meta ($post_id) { if (!empty(get_post_meta($post_id, ‘some_meta’, true))) { // do something here } } add_action(‘save_post’, ‘bt_check_saved_post_meta’);
Access NEW/UPDATED post values in save_post() callback function
I think one key question here is how _select_match_from_id meta value is saved? Is it some metafield on the post edit screen or from some other logic? If I may assume that it is from a metafield, then you could just read its value from the $_POST array. You could also improve your code by … Read more