Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class WP_Label_Image_Control extends WP_Customize_Upload_Control {
- public $type = 'image';
- public $mime_type = 'image';
- /**
- * Constructor.
- *
- * @since 3.4.0
- * @uses WP_Customize_Upload_Control::__construct()
- *
- * @param WP_Customize_Manager $manager
- * @param string $id
- * @param array $args
- */
- public function __construct( $manager, $id, $args = array() ) {
- parent::__construct( $manager, $id, $args );
- $this->button_labels = array(
- 'select' => __( 'Select Image' ),
- 'change' => __( 'Change Image' ),
- 'remove' => __( 'Remove' ),
- 'default' => __( 'NEW LABEL' ),
- 'placeholder' => __( 'No image selected' ),
- 'frame_title' => __( 'Select Image' ),
- 'frame_button' => __( 'Choose Image' ),
- );
- }
- /**
- * @since 3.4.2
- * @deprecated 4.1.0
- */
- public function prepare_control() {}
- /**
- * @since 3.4.0
- * @deprecated 4.1.0
- *
- * @param string $id
- * @param string $label
- * @param mixed $callback
- */
- public function add_tab( $id, $label, $callback ) {}
- /**
- * @since 3.4.0
- * @deprecated 4.1.0
- *
- * @param string $id
- */
- public function remove_tab( $id ) {}
- /**
- * @since 3.4.0
- * @deprecated 4.1.0
- *
- * @param string $url
- * @param string $thumbnail_url
- */
- public function print_tab_image( $url, $thumbnail_url = null ) {}
- }
- $wp_customize->add_control(
- new WP_Label_Image_Control(
- $wp_customize,
- 'logo',
- array(
- 'label' => __( 'Label', 'theme-slug' ),
- 'description' => 'This is a description.',
- 'section' => 'section_id',
- 'settings' => 'setting_id',
- )
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement