Media Image

Media image allows to select images using WordPress Media Library.

Field Parameters

Name Type Default Description
type string media-image Value identifies the field types.
id string Identifies unique ID for the field. It must be different from other existing field IDs
title string Displays the field label.
desc string Describe the field option in details, appears underneath the field control.
required array Acts like boolean operator and provides the parent, comparison operation, and value which decides the field visibility.
value string Display default string in the text input.
size string full allow to define image size as large, medium, and thumbnail

Example Declaration

    'type'  => 'media-image',
    'id'    => 'image',
    'title' => esc_html__( 'Label', 'ultimate-page-builder' ),
    'desc'  => wp_kses_post( __( 'Description', 'ultimate-page-builder' )),
    'value' => '',
    // 'size'=>'full' // large, medium, thumbnail etc...
  • size - Media image size, default is: full.
  • Add more sizes by image_size_names_choose filter hook.
  • Use getMediaImageSrc(string) method on preview section to get image source.
  • Use upb_get_media_image($image, $attr) to get media image on shortcode section

results matching ""

    No results matching ""