WordPress.org

Make WordPress Core

Changeset 20254


Ignore:
Timestamp:
03/22/2012 04:14:26 AM (8 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.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r20248 r20254  
    383383                <?php
    384384                break;
     385            case 'dropdown-pages':
     386                printf(
     387                    '<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>',
     388                    $this->label,
     389                    wp_dropdown_pages(
     390                        array(
     391                            'name'              => $this->get_name(),
     392                            'echo'              => 0,
     393                            'show_option_none'  => __( '&mdash; Select &mdash;' ),
     394                            'option_none_value' => '0',
     395                            'selected'          => get_option( $this->id )
     396                        )
     397                    )
     398                );
     399                break;
    385400        }
    386401    }
  • 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.