window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes

I did similar thing recently but used the wp.media instead of ThickBox https://codex.wordpress.org/Javascript_Reference/wp.media with the same code from Codex. The only thing to make it work with multiple inputs is to move the frame variable from global scope to click function, so the ‘frame’ will be fresh for each click.

Metabox will not save

<input type=”number” name=”listing_price” id=”listing-price” value=”<?php if ( ! empty ( $cns_stored_meta[‘listing_price’] ) ) { echo esc_attr( $cns_store_meta[‘listing_price’][0] ); } ?>”/> You forget to put “d” where you echo your listing price. You also not write code for listing_description for save listing editor content. if( isset( $_POST[‘listing_description’] ) ) { update_post_meta( $post_id, ‘listing_description’, sanitize_text_field( $_POST[ ‘listing_description’ … Read more

How to Duplicate (multiple meta box)?

You didn’t add the save meta action for the facebook meta box. <?php /* Fire our meta box setup function on the post editor screen. */ add_action( ‘load-post.php’, ‘sw_post_meta_boxes_setup’ ); add_action( ‘load-post-new.php’, ‘sw_post_meta_boxes_setup’ ); /* Meta box setup function. */ function sw_post_meta_boxes_setup() { /* Add meta boxes on the ‘add_meta_boxes’ hook. */ add_action( ‘add_meta_boxes’, ‘sw_add_post_meta_boxes’ … Read more

Copy custom field value to post title

Okay! Finally, I was able to make it work. Below is the complete working code. add_filter( ‘wp_insert_post_data’ , ‘modify_post_title’ , ’99’, 2 ); // Grabs the inserted post data so you can modify it. function modify_post_title( $data ) { if($data[‘post_type’] == ‘artist’ && isset($_POST[‘acf’][‘field_573676a95d920’])) { // If the actual field name of the rating date … Read more