[wp-trac] [WordPress Trac] #42075: Do not show default image on using WP_Customize_Cropped_Image_Control.
WordPress Trac
noreply at wordpress.org
Tue Oct 3 15:28:43 UTC 2017
#42075: Do not show default image on using WP_Customize_Cropped_Image_Control.
----------------------------+-----------------------------
Reporter: Toro_Unit | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version:
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
Add New Control use WP_Customize_Cropped_Image_Control.
Do not Show default image.
But show Default button. When click the button, nothing happens.
Instead of using WP_Customize_Image_Control, Show image.
{{{#!php
<?php
function foo_customize_register( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_section( 'theme_options', array(
'title' => __( 'Theme Options' ),
) );
$wp_customize->add_setting( 'custom_image', array(
'default' => get_parent_theme_file_uri( '/images/default-
header.jpg' ),
) );
$wp_customize->add_control( new
WP_Customize_Cropped_Image_Control( $wp_customize, 'custom_image', array(
'label' => __( 'Upload an Image' ),
'section' => 'theme_options',
'width' => 1920,
'height' => 1080,
)
)
);
}
add_action( 'customize_register', 'foo_customize_register' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42075>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list