WordPress media manager multiple selection output

It was just my mistake… I’ve forgotten improve var selection jQuery(document).ready(function($){ var custom_uploader; $(‘#upload_image_button’).click(function(e) { e.preventDefault(); //If the uploader object has already been created, reopen the dialog if (custom_uploader) { custom_uploader.open(); return; } //Extend the wp.media object custom_uploader = wp.media.frames.file_frame = wp.media({ title: ‘Choose Image’, button: { text: ‘Choose Image’ }, multiple: true }); custom_uploader.on(‘select’, … Read more

Position right sidebar metabox right below the publish metabox?

Still if its something like client requirement then below is somewhat hack sort of solution. Add this code to your add_meta_box() function. For the sake of understanding, below I have provided complete function but you will need to use selective code 🙂 Do let me know how it goes. function myplugin_add_meta_box() { $screens = array( … Read more

Remove a metabox registered by another plugin – Woocommerce [closed]

A quick search in their GitHub repo shows the following line: add_meta_box( ‘woocommerce-product-images’, __( ‘Product Gallery’, ‘woocommerce’ ), ‘WC_Meta_Box_Product_Images::output’, ‘product’, ‘side’ ); So your call to remove_meta_box() uses the right id/handle/name as well as the right priority and context. The problem just is the hook and the priority at which the hook executes – you … Read more

remove_meta_box for all post types doesn’t seem to work

Remember Apple’s “Goto Fail”? Similar situation: Your code actually does this, when indentation is corrected: foreach ( $post_types as $post_type ) remove_meta_box(‘trackbacksdiv’, $post_type, ‘normal’); remove_meta_box(‘postcustom’, $post_type, ‘normal’); remove_meta_box(‘authordiv’, $post_type, ‘normal’); remove_meta_box(‘postexcerpt’, $post_type, ‘normal’); So, it should does the job for trackbacksdiv, but not for the rest because the function calls are outside of the foreach … Read more

datetime_timestamp shows numbers only? need in date and time

The date/time related field types for CMB2 store all their values as Unix timestamps in the database with the exception of text_datetime_timestamp_timezone which stores it’s value as a serialized DateTime object. text_date_timestamp Date Picker (UNIX timestamp) text_datetime_timestamp Text Date/Time Picker Combo (UNIX timestamp) text_datetime_timestamp_timezone Text Date/Time Picker/Time zone Combo (serialized DateTime object) See: https://github.com/WebDevStudios/CMB2/wiki/Field-Types What … Read more

How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?

Do you have custom post type videos? if not change videos to post add_meta_box( ‘my-meta-box-id’, ‘Enter Video ID’, ‘cd_meta_box_cb’, ‘post’, ‘normal’, ‘high’ ); Your code is fine but you are not saving the video type select box you just updated the id input field. Place this code in add_action(‘save_post’, ‘cd_meta_box_save’); if( isset( $_POST[‘my_meta_box_text’] ) && … Read more