Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. class WP_Label_Image_Control extends WP_Customize_Upload_Control {
  2. public $type = 'image';
  3. public $mime_type = 'image';
  4.  
  5. /**
  6. * Constructor.
  7. *
  8. * @since 3.4.0
  9. * @uses WP_Customize_Upload_Control::__construct()
  10. *
  11. * @param WP_Customize_Manager $manager
  12. * @param string $id
  13. * @param array $args
  14. */
  15. public function __construct( $manager, $id, $args = array() ) {
  16. parent::__construct( $manager, $id, $args );
  17.  
  18. $this->button_labels = array(
  19. 'select' => __( 'Select Image' ),
  20. 'change' => __( 'Change Image' ),
  21. 'remove' => __( 'Remove' ),
  22. 'default' => __( 'NEW LABEL' ),
  23. 'placeholder' => __( 'No image selected' ),
  24. 'frame_title' => __( 'Select Image' ),
  25. 'frame_button' => __( 'Choose Image' ),
  26. );
  27. }
  28.  
  29. /**
  30. * @since 3.4.2
  31. * @deprecated 4.1.0
  32. */
  33. public function prepare_control() {}
  34.  
  35. /**
  36. * @since 3.4.0
  37. * @deprecated 4.1.0
  38. *
  39. * @param string $id
  40. * @param string $label
  41. * @param mixed $callback
  42. */
  43. public function add_tab( $id, $label, $callback ) {}
  44.  
  45. /**
  46. * @since 3.4.0
  47. * @deprecated 4.1.0
  48. *
  49. * @param string $id
  50. */
  51. public function remove_tab( $id ) {}
  52.  
  53. /**
  54. * @since 3.4.0
  55. * @deprecated 4.1.0
  56. *
  57. * @param string $url
  58. * @param string $thumbnail_url
  59. */
  60. public function print_tab_image( $url, $thumbnail_url = null ) {}
  61. }
  62.  
  63. $wp_customize->add_control(
  64. new WP_Label_Image_Control(
  65. $wp_customize,
  66. 'logo',
  67. array(
  68. 'label' => __( 'Label', 'theme-slug' ),
  69. 'description' => 'This is a description.',
  70. 'section' => 'section_id',
  71. 'settings' => 'setting_id',
  72. )
  73. )
  74. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement