Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function add_my_media_controls($wp_customize) {
  2.  
  3. $wp_customize->add_section( 'theme_banner_image', array(
  4. 'title' => __( 'Banner Image', 'theme_banner_image' ),
  5. 'priority' => 35,
  6. ) );
  7.  
  8. $wp_customize->add_setting('banner_image', array(
  9. 'type' => 'theme_mod',
  10. 'capability' => 'edit_theme_options',
  11. 'sanitize_callback' => 'absint'
  12. ));
  13.  
  14. $wp_customize->add_control(new WP_Customize_Cropped_Image_Control($wp_customize, 'banner_image', array(
  15. 'section' => 'theme_banner_image',
  16. 'label' => 'Banner Image',
  17. 'width' => 2000,
  18. 'height' => 1200
  19. )));
  20. }
  21. add_action('customize_register', 'add_my_media_controls');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement