PATH:
home
/
letacommog
/
supportleta
/
wp-content
/
themes
/
easyweb
/
inc
/
meta-box
/
inc
/
fields
<?php /** * Image upload field which uses thickbox library to upload. * @deprecated Use image_advanced instead */ class RWMB_Thickbox_Image_Field extends RWMB_Image_Field { /** * Add custom actions for the field. */ public static function add_actions() { parent::add_actions(); add_filter( 'get_media_item_args', array( __CLASS__, 'allow_img_insertion' ) ); } /** * Always enable insert to post button in the popup * @link https://github.com/rilwis/meta-box/issues/809 * @link http://wordpress.stackexchange.com/q/22175/2051 * @param array $vars * @return array */ public static function allow_img_insertion( $vars ) { $vars['send'] = true; // 'send' as in "Send to Editor" return $vars; } /** * Enqueue scripts and styles */ public static function admin_enqueue_scripts() { parent::admin_enqueue_scripts(); add_thickbox(); wp_enqueue_script( 'media-upload' ); wp_enqueue_script( 'rwmb-thickbox-image', RWMB_JS_URL . 'thickbox-image.js', array( 'jquery' ), RWMB_VER, true ); } /** * Get field HTML * * @param mixed $meta * @param array $field * * @return string */ public static function html( $meta, $field ) { $i18n_title = apply_filters( 'rwmb_thickbox_image_upload_string', _x( 'Upload Images', 'image upload', 'meta-box' ), $field ); // Uploaded images $html = parent::get_uploaded_images( $meta, $field ); // Show form upload $html .= "<a href='#' class='button rwmb-thickbox-upload' data-field_id='{$field['id']}'>{$i18n_title}</a>"; return $html; } /** * Get field value * It's the combination of new (uploaded) images and saved images * * @param array $new * @param array $old * @param int $post_id * @param array $field * * @return array */ public static function value( $new, $old, $post_id, $field ) { return array_unique( array_merge( $old, $new ) ); } }
[+]
..
[-] oembed.php
[edit]
[-] taxonomy-advanced.php
[edit]
[-] email.php
[edit]
[-] autocomplete.php
[edit]
[-] multiple-values.php
[edit]
[-] input-list.php
[edit]
[-] checkbox-list.php
[edit]
[-] button.php
[edit]
[-] object-choice.php
[edit]
[-] image-select.php
[edit]
[-] radio.php
[edit]
[-] fieldset-text.php
[edit]
[-] heading.php
[edit]
[-] hidden.php
[edit]
[-] user.php
[edit]
[-] time.php
[edit]
[-] file-upload.php
[edit]
[-] text-list.php
[edit]
[-] textarea.php
[edit]
[-] url.php
[edit]
[-] key-value.php
[edit]
[-] date.php
[edit]
[-] wysiwyg.php
[edit]
[-] password.php
[edit]
[-] text.php
[edit]
[-] file-advanced.php
[edit]
[-] post.php
[edit]
[-] map.php
[edit]
[-] select-advanced.php
[edit]
[-] plupload-image.php
[edit]
[-] file.php
[edit]
[-] image-upload.php
[edit]
[-] number.php
[edit]
[-] taxonomy.php
[edit]
[-] file-input.php
[edit]
[-] slider.php
[edit]
[-] thickbox-image.php
[edit]
[-] datetime.php
[edit]
[-] divider.php
[edit]
[-] color.php
[edit]
[-] custom-html.php
[edit]
[-] image-advanced.php
[edit]
[-] media.php
[edit]
[-] select-tree.php
[edit]
[-] choice.php
[edit]
[-] input.php
[edit]
[-] range.php
[edit]
[-] select.php
[edit]
[-] switcher.php
[edit]
[-] checkbox.php
[edit]
[-] image.php
[edit]