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. git-svn-id: http://svn.automattic.com/wordpress/trunk@20254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
97a194e95c
commit
1d19466272
|
@ -382,6 +382,21 @@ class WP_Customize_Setting {
|
|||
</label>
|
||||
<?php
|
||||
break;
|
||||
case 'dropdown-pages':
|
||||
printf(
|
||||
'<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>',
|
||||
$this->label,
|
||||
wp_dropdown_pages(
|
||||
array(
|
||||
'name' => $this->get_name(),
|
||||
'echo' => 0,
|
||||
'show_option_none' => __( '— Select —' ),
|
||||
'option_none_value' => '0',
|
||||
'selected' => get_option( $this->id )
|
||||
)
|
||||
)
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -672,21 +672,3 @@ function sanitize_hexcolor( $color ) {
|
|||
|
||||
return $color;
|
||||
}
|
||||
|
||||
// Custome render type for a dropdown menu.
|
||||
function customize_control_dropdown_pages( $setting ) {
|
||||
printf(
|
||||
'<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>',
|
||||
$setting->label,
|
||||
wp_dropdown_pages(
|
||||
array(
|
||||
'name' => $setting->get_name(),
|
||||
'echo' => 0,
|
||||
'show_option_none' => __( '— Select —' ),
|
||||
'option_none_value' => '0',
|
||||
'selected' => get_option( $setting->id )
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'customize_render_control-dropdown-pages', 'customize_control_dropdown_pages' );
|
||||
|
|
Loading…
Reference in New Issue