add_post_meta not saved
add_post_meta not saved
add_post_meta not saved
Adding Image Description below Images Inserted into Posts
Run function after post is updated
After I removed all the wp_nonce fields everything is working slightly. As far as I can remember, their job is to prevent sending requests from undesireable places and some actions. I guess I can’t make a proper nonce verification.
You have to use JOIN for that. Try it like this: $wpdb->get_results(“SELECT tags.*, $wpdb->posts.*, $wpdb->postmeta.* FROM tags INNER JOIN $wpdb->posts ON tags.charity_id = $wpdb->posts.ID INNER JOIN $wpdb->postmeta ON tags.charity_id = $wpdb->postmeta.post_id WHERE tags.charity_id = $charity_id” );
Re-order posts inside tax query
The problem is that you are passing a comma separated list of terms, not an array of term. For example, if you enter ‘army,navy,airforce’ in the custom field: $related = array ( get_post_meta($post->ID, ‘related_categories’, true) ); //$related = array(‘army,navy,airforce’); //What you need is //$related = array(‘army’,’navy,’airforce’); You need to transform each term into a array … Read more
First of all, You don’t have to add ‘form’ html tag in the metabox. You missed to pass the ‘$post’ parameter to the function ‘display_post_options’ and you used selected() function wrong too. Here is the code after I updated it. function display_post_options( $post){ wp_nonce_field( basename( __FILE__ ), ‘post_options_nonce’ ); $post_options_select_value = get_post_meta($post->ID,’post_options_select’,true); ?> Choose Your … Read more
Please try to replace: update_post_meta( $post_id, ‘figure_sugsubject_repeatable_fields’, $new ); with: add_post_meta( $post_id, ‘figure_sugsubject_repeatable_fields’, $new ); to add more values related to the figure_sugsubject_repeatable_fields meta key. You should also consider using filter_input() instead of $_POST.
wp_schedule_event not working