Kharis Sulistiyono
Author URI: http://www.kharissulistiyono.com
Plugin URI: https://github.com/kharissulistiyo/7K-Image-Uploader-Meta-Box
*/
// Create meta box
function add_iumb_metabox($post_type) {
$types = array('post');
if (in_array($post_type, $types)) {
add_meta_box(
'image-uploader-meta-box',
'7K Image Uploader',
'iumb_meta_callback',
$post_type,
'normal',
'low'
);
}
}
add_action('add_meta_boxes', 'add_iumb_metabox');
function iumb_meta_callback($post) {
wp_nonce_field( basename(__FILE__), 'iumb_meta_nonce' );
$id = get_post_meta($post->ID, 'iumb', true);
$image = wp_get_attachment_image_src($id, 'full-size');
?>
Upload Change Remove
Select an image
Upload Change RemoveSelect an image