function uncode_media_element_settings_field($settings, $value)
{
    return '<input type="hidden" class="wpb_vc_param_value uncode_gallery_attached_images_ids ' . $settings['param_name'] . ' ' . $settings['type'] . '" name="' . $settings['param_name'] . '" value="' . $value . '" />
	   		<div class="uncode_widget_attached_images">
				<ul class="uncode_widget_attached_images_list">
					' . ($value != '' ? uncode_fieldAttachedMedia(explode(",", $value)) : '') . '
				</ul>
			</div>
			<div class="gallery_widget_site_images">
			</div>
	   		<a class="add_media_widget" href="#" use-single="' . ($settings['param_name'] === 'medias' ? 'false' : 'true') . '" title="' . esc_html__('Add media', "uncode") . '">' . esc_html__('Add media', "uncode") . '</a>';
}
Ejemplo n.º 2
0
function uncode_display_metabox()
{
    global $post;
    wp_enqueue_script('media_items_js', plugins_url('uncode-core/vc_extend/assets/js/media_items.js'), array('jquery'));
    $ids = get_post_meta($post->ID, '_uncode_featured_media', 1);
    ?>

	<input type="hidden" name="uncode_medias_noncedata" id="uncode_medias_noncedata" value="<?php 
    echo wp_create_nonce('uncode_medias_noncedata');
    ?>
" />

	<div class="edit_form_line">
		<input type="hidden" class="wpb_vc_param_value uncode_gallery_attached_images_ids medias media_element" name="medias" value="<?php 
    echo esc_attr($ids);
    ?>
">
		<div class="gallery_widget_site_images"></div>
   		<a class="add_media_widget vc_btn vc_btn-sm vc_btn-primary" href="#" use-single="false" title="Add media"><?php 
    esc_html_e('Select medias', 'uncode');
    ?>
</a>
   		<a href="#" class="vc_btn vc_btn-sm vc_btn-grey btn-remove-all"<?php 
    if ($ids === '') {
        echo ' style="display:none;"';
    }
    ?>
><?php 
    esc_html_e('Remove All', 'uncode');
    ?>
</a>
   		<div class="uncode_widget_attached_images">
			<ul class="uncode_widget_attached_images_list">
				<?php 
    echo $ids != '' ? uncode_fieldAttachedMedia(explode(",", $ids)) : '';
    ?>
			</ul>
			<div style="clear:both;"></div>
		</div>
   	</div>
	<?php 
    $media_display = get_post_meta($post->ID, '_uncode_featured_media_display', 1);
    ?>
	<hr />
	<div class="edit_form_line">
		<p>
			<strong><?php 
    esc_html_e('Post media display', 'uncode');
    ?>
</strong>
			<label class="screen-reader-text" for="media_display"><?php 
    esc_html_e('Post media display', 'uncode');
    ?>
</label>
		</p>
		<p>
			<select name="media_display">
				<option value="carousel" <?php 
    if (isset($media_display)) {
        selected($media_display, 'carousel');
    }
    ?>
><?php 
    esc_html_e('Carousel', 'uncode');
    ?>
</option>';
				<option value="stack" <?php 
    if (isset($media_display)) {
        selected($media_display, 'stack');
    }
    ?>
><?php 
    esc_html_e('Stack', 'uncode');
    ?>
</option>';
				<option value="isotope" <?php 
    if (isset($media_display)) {
        selected($media_display, 'isotope');
    }
    ?>
><?php 
    esc_html_e('Isotope', 'uncode');
    ?>
</option>';
			</select>
		</p>
	</div>
	<?php 
}