“wp_customize_image_control” Código de respuesta

wp_customize_image_control

$wp_customize->add_setting( 'logo', array(
    'capability'        => 'edit_theme_options',
    'default'           => '',
    'sanitize_callback' => 'ic_sanitize_image',
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'logo',
    array(
        'label'    => __( 'Logo', 'text-domain' ),
        'section'  => 'general',
        'settings' => 'logo',
    )
) );
Tired Tuatara

Imagen WP_Customize

$wp_customize->add_control(
       new WP_Customize_Image_Control(
           $wp_customize,
           'logo',
           array(
               'label'      => __( 'Upload a logo', 'theme_name' ),
               'section'    => 'your_section_id',
               'settings'   => 'your_setting_id',
               'context'    => 'your_setting_context'
           )
       )
   );
Tired Tuatara

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código