WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/22/2012 04:14:26 AM (7 years ago)
Author:
koopersmith
Message:

Theme Customizer: Make dropdown-pages a native customize control. see #19910.

While the customize_render_control- action has been removed, we could still accomplish this with the customize_render_setting action. That said, in this case, avoiding native integration was a matter of minor semantics that ended in the same result.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-customize.php

    r20251 r20254  
    673673    return $color;
    674674}
    675 
    676 // Custome render type for a dropdown menu.
    677 function customize_control_dropdown_pages( $setting ) {
    678     printf(
    679         '<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>',
    680         $setting->label,
    681         wp_dropdown_pages(
    682             array(
    683                 'name'              => $setting->get_name(),
    684                 'echo'              => 0,
    685                 'show_option_none'  => __( '&mdash; Select &mdash;' ),
    686                 'option_none_value' => '0',
    687                 'selected'          => get_option( $setting->id )
    688             )
    689         )
    690     );
    691 }
    692 add_action( 'customize_render_control-dropdown-pages', 'customize_control_dropdown_pages' );
Note: See TracChangeset for help on using the changeset viewer.