/home/desid573/verdenaturopathy.com.au/wp-content/plugins/meta-box/inc/fields
NameSizeModeActions
autocomplete.php31460644editdlrm
background.php56050644editdlrm
button-group.php19650644editdlrm
button.php13460644editdlrm
checkbox-list.php5010644editdlrm
checkbox.php14050644editdlrm
choice.php18850644editdlrm
color.php26070644editdlrm
custom-html.php6380644editdlrm
date.php7350644editdlrm
datetime.php88340644editdlrm
divider.php8930644editdlrm
fieldset-text.php33180644editdlrm
file-input.php16370644editdlrm
file-upload.php11650644editdlrm
file.php159160644editdlrm
heading.php9590644editdlrm
image-advanced.php25330644editdlrm
image-select.php24150644editdlrm
image-upload.php10210644editdlrm
image.php48140644editdlrm
input-list.php26900644editdlrm
input.php31390644editdlrm
key-value.php37480644editdlrm
map.php67140644editdlrm
media.php71400644editdlrm
multiple-values.php13960644editdlrm
number.php9710644editdlrm
object-choice.php41740644editdlrm
oembed.php41140644editdlrm
osm.php51820644editdlrm
password.php5640644editdlrm
post.php57370644editdlrm
radio.php4050644editdlrm
range.php15290644editdlrm
select-advanced.php23960644editdlrm
select-tree.php15360644editdlrm
select.php25850644editdlrm
sidebar.php15330644editdlrm
single-image.php18300644editdlrm
slider.php20910644editdlrm
switch.php23900644editdlrm
taxonomy-advanced.php30310644editdlrm
taxonomy.php101110644editdlrm
text-list.php34630644editdlrm
text.php10190644editdlrm
textarea.php18910644editdlrm
time.php7210644editdlrm
user.php46840644editdlrm
video.php41420644editdlrm
wysiwyg.php24170644editdlrm
Edit: /home/desid573/verdenaturopathy.com.au/wp-content/plugins/meta-box/inc/fields/image.php (4814B)
. * * @package Meta Box */ /** * Image field class which uses to upload. */ class RWMB_Image_Field extends RWMB_File_Field { /** * Enqueue scripts and styles. */ public static function admin_enqueue_scripts() { parent::admin_enqueue_scripts(); wp_enqueue_media(); wp_enqueue_style( 'rwmb-image', RWMB_CSS_URL . 'image.css', array(), RWMB_VER ); } /** * Get HTML for uploaded file. * * @param int $file Attachment (file) ID. * @param int $index File index. * @param array $field Field data. * * @return string */ protected static function file_html( $file, $index, $field ) { $attributes = self::get_attributes( $field, $file ); $edit_link = get_edit_post_link( $file ); if ( $edit_link ) { $edit_link = sprintf( '', $edit_link ); } return sprintf( '
  • %s
    %s
  • ', esc_attr( $field['image_size'] ), $attributes['name'], $index, $file, wp_get_attachment_image( $file, $field['image_size'] ), $edit_link, $file ); } /** * Normalize field settings. * * @param array $field Field settings. * * @return array */ public static function normalize( $field ) { $field = parent::normalize( $field ); $field = wp_parse_args( $field, array( 'image_size' => 'thumbnail', ) ); $field['attributes'] = wp_parse_args( $field['attributes'], array( 'accept' => 'image/*', ) ); return $field; } /** * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. * * @param array $field Field parameters. * @param array $value The value. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. * * @return string */ public static function format_single_value( $field, $value, $args, $post_id ) { $output = sprintf( '%s', esc_url( $value['url'] ), esc_attr( $value['alt'] ) ); // Link thumbnail to full size image? if ( ! empty( $args['link'] ) ) { $output = sprintf( '%s', esc_url( $value['full_url'] ), esc_attr( $value['title'] ), $output ); } return $output; } /** * Get uploaded file information. * * @param int $file Attachment image ID (post ID). Required. * @param array $args Array of arguments (for size). * @param array $field Field settings. * * @return array|bool False if file not found. Array of image info on success. */ public static function file_info( $file, $args = array(), $field = array() ) { $path = get_attached_file( $file ); if ( ! $path ) { return false; } $args = wp_parse_args( $args, array( 'size' => 'thumbnail', ) ); $image = wp_get_attachment_image_src( $file, $args['size'] ); $attachment = get_post( $file ); $info = array( 'ID' => $file, 'name' => basename( $path ), 'path' => $path, 'url' => $image[0], 'full_url' => wp_get_attachment_url( $file ), 'title' => $attachment->post_title, 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content, 'alt' => get_post_meta( $file, '_wp_attachment_image_alt', true ), ); if ( function_exists( 'wp_get_attachment_image_srcset' ) ) { $info['srcset'] = wp_get_attachment_image_srcset( $file, $args['size'] ); } $info = wp_parse_args( $info, self::get_image_meta_data( $file ) ); // Do not overwrite width and height by returned value of image meta. $info['width'] = $image[1]; $info['height'] = $image[2]; return $info; } /** * Get image meta data. * * @param int $attachment_id Attachment ID. * @return array */ protected static function get_image_meta_data( $attachment_id ) { $metadata = wp_get_attachment_metadata( $attachment_id ); if ( empty( $metadata['sizes'] ) ) { return $metadata; } $dir_url = dirname( wp_get_attachment_url( $attachment_id ) ); foreach ( $metadata['sizes'] as &$size ) { $size['url'] = "{$dir_url}/{$size['file']}"; } return $metadata; } }