Support » Plugin: Meta Box » No table to use same images for other uploading option

  • Resolved kayapati

    (@kayapati)


    I seem to be having problems with uploading pictures for multiple options, suppose if I use a picture for Upload 1 and I will not be able to use the same picture for upload 2, this was working fine earlier version but got issue only in the recent updates version 4.10.3

    Same issue raised by one of my client:

    I’ve been trying to upload pictures to some profiles, and it seems I no longer put the same pictures in both “images” and “comp cards”? Is this a change you’ve made?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi, can you please post the code you’re using to register meta boxes? I’ve just checked and it works fine to me. Here is my screenshot:

    http://prntscr.com/ebehnl

    kayapati

    (@kayapati)

    But the same code works fine when we use 4.10 version, what might be issue?

    Plugin Author Anh Tran

    (@rilwis)

    Hi @kayapati,

    Probably we did something wrong when updating the plugin. I need the code to analyze it. Can you help me?

    kayapati

    (@kayapati)

    Sure I will send it with in few minutes.

    kayapati

    (@kayapati)

    global $kta_meta_boxes;
    $kta_meta_boxes = array();

    $kta_meta_boxes[] = array(
    ‘id’ => ‘portfolio_tab2_images’,
    ‘title’ => __(‘Polaroid Images’, ‘talentagency’),
    ‘pages’ => array( ‘portfolio’ ),
    ‘priority’ => ‘high’,
    ‘context’ => ‘normal’,
    ‘fields’ => array(
    array(
    ‘name’ => __(‘Upload Polaroid Images’,’talentagency’),
    ‘desc’ => ”,
    ‘id’ => $prefix . ‘upload_pf_polaroid_images’,
    ‘type’ => ‘image_advanced’,
    ‘max_file_uploads’ => 5,
    ),
    array(
    ‘name’ => __(‘Upload Profile Images’,’talentagency’),
    ‘desc’ => ”,
    ‘id’ => $prefix . ‘upload_pf_profile_images’,
    ‘type’ => ‘image_advanced’,
    ‘max_file_uploads’ => 10,
    ),
    )
    );

    function kta_register_meta_boxes()
    {
    global $kta_meta_boxes;
    // Make sure there’s no errors when the plugin is deactivated or during upgrade
    if ( class_exists( ‘RW_Meta_Box’ ) )
    {
    foreach ( $kta_meta_boxes as $meta_box )
    {
    new RW_Meta_Box( $meta_box );
    }
    }
    }
    add_action( ‘admin_init’, ‘kta_register_meta_boxes’ );

    kayapati

    (@kayapati)

    Please update us once you finalised where the issue is.

    Plugin Author Anh Tran

    (@rilwis)

    I’ve just tried your code and found the problem. We have fixed it on Github and will release the new version soon.

    By the way, the code above uses an old way to register meta boxes, which is not recommended anymore. You should change it to:

    function kta_register_meta_boxes( $meta_boxes ) {
    	$meta_boxes[] = array(
    		'id'       => 'portfolio_tab2_images',
    		'title'    => __( 'Polaroid Images', 'talentagency' ),
    		'pages'    => array( 'portfolio' ),
    		'priority' => 'high',
    		'context'  => 'normal',
    		'fields'   => array(
    			array(
    				'name'             => __( 'Upload Polaroid Images', 'talentagency' ),
    				'desc'             => '',
    				'id'               => $prefix . 'upload_pf_polaroid_images',
    				'type'             => 'image_advanced',
    				'max_file_uploads' => 5,
    			),
    			array(
    				'name'             => __( 'Upload Profile Images', 'talentagency' ),
    				'desc'             => '',
    				'id'               => $prefix . 'upload_pf_profile_images',
    				'type'             => 'image_advanced',
    				'max_file_uploads' => 10,
    			),
    		),
    	);
    
    	return $meta_boxes;
    }
    
    add_filter( 'rwmb_meta_boxes', 'kta_register_meta_boxes' );
    kayapati

    (@kayapati)

    Thank you Anh Tran

    Plugin Author Anh Tran

    (@rilwis)

    New version is available. Please update!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.