[wp-trac] [WordPress Trac] #33357: Customizer: Error with cropped-image control

WordPress Trac noreply at wordpress.org
Wed Aug 12 20:09:16 UTC 2015


#33357: Customizer: Error with cropped-image control
----------------------------+-----------------------------
 Reporter:  pekz0r          |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Customize       |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 The example code for the cropped-image control in the following post
 generates an error: https://make.wordpress.org/core/2015/07/16/new-
 customizer-media-controls-in-4-3-and-4-2/

 This code:


 {{{
 $wp_customize->add_control( new WP_Customize_Cropped_Image_Control(
 $wp_customize, 'cropped_image', array(
     'section'     => 'background_image',
     'label'       => __( 'Croppable Image' ),
     'flex_width'  => true, // Allow any width, making the specified value
 recommended. False by default.
     'flex_height' => false, // Require the resulting image to be exactly
 as tall as the height attribute (default).
     'width'       => 1920,
     'height'      => 1080,
 ) ) );
 }}}


 Generates this error:


 {{{
 Fatal error: Call to a member function check_capabilities() on null in
 /var/www/site/public/wp/wp-includes/class-wp-customize-control.php on line
 283
 }}}


 I use WordPress 4.3-RC2-33611

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33357>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list