mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Code is Poetry.
WordPress' code just... wasn't. This is now dealt with. Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS. Fixes #41057. git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -213,7 +213,7 @@ class WP_Customize_Control {
|
||||
}
|
||||
|
||||
$this->manager = $manager;
|
||||
$this->id = $id;
|
||||
$this->id = $id;
|
||||
if ( empty( $this->active_callback ) ) {
|
||||
$this->active_callback = array( $this, 'active_callback' );
|
||||
}
|
||||
@@ -230,8 +230,8 @@ class WP_Customize_Control {
|
||||
foreach ( $this->settings as $key => $setting ) {
|
||||
$settings[ $key ] = $this->manager->get_setting( $setting );
|
||||
}
|
||||
} else if ( is_string( $this->settings ) ) {
|
||||
$this->setting = $this->manager->get_setting( $this->settings );
|
||||
} elseif ( is_string( $this->settings ) ) {
|
||||
$this->setting = $this->manager->get_setting( $this->settings );
|
||||
$settings['default'] = $this->setting;
|
||||
}
|
||||
$this->settings = $settings;
|
||||
@@ -253,7 +253,7 @@ class WP_Customize_Control {
|
||||
*/
|
||||
final public function active() {
|
||||
$control = $this;
|
||||
$active = call_user_func( $this->active_callback, $this );
|
||||
$active = call_user_func( $this->active_callback, $this );
|
||||
|
||||
/**
|
||||
* Filters response of WP_Customize_Control::active().
|
||||
@@ -308,13 +308,13 @@ class WP_Customize_Control {
|
||||
$this->json['settings'][ $key ] = $setting->id;
|
||||
}
|
||||
|
||||
$this->json['type'] = $this->type;
|
||||
$this->json['priority'] = $this->priority;
|
||||
$this->json['active'] = $this->active();
|
||||
$this->json['section'] = $this->section;
|
||||
$this->json['content'] = $this->get_content();
|
||||
$this->json['label'] = $this->label;
|
||||
$this->json['description'] = $this->description;
|
||||
$this->json['type'] = $this->type;
|
||||
$this->json['priority'] = $this->priority;
|
||||
$this->json['active'] = $this->active();
|
||||
$this->json['section'] = $this->section;
|
||||
$this->json['content'] = $this->get_content();
|
||||
$this->json['label'] = $this->label;
|
||||
$this->json['description'] = $this->description;
|
||||
$this->json['instanceNumber'] = $this->instance_number;
|
||||
|
||||
if ( 'dropdown-pages' === $this->type ) {
|
||||
@@ -385,8 +385,9 @@ class WP_Customize_Control {
|
||||
* @uses WP_Customize_Control::render()
|
||||
*/
|
||||
final public function maybe_render() {
|
||||
if ( ! $this->check_capabilities() )
|
||||
if ( ! $this->check_capabilities() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires just before the current Customizer control is rendered.
|
||||
@@ -480,8 +481,8 @@ class WP_Customize_Control {
|
||||
* @since 3.4.0
|
||||
*/
|
||||
protected function render_content() {
|
||||
$input_id = '_customize-input-' . $this->id;
|
||||
$description_id = '_customize-description-' . $this->id;
|
||||
$input_id = '_customize-input-' . $this->id;
|
||||
$description_id = '_customize-description-' . $this->id;
|
||||
$describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : '';
|
||||
switch ( $this->type ) {
|
||||
case 'checkbox':
|
||||
@@ -513,7 +514,7 @@ class WP_Customize_Control {
|
||||
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! empty( $this->description ) ) : ?>
|
||||
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description ; ?></span>
|
||||
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ( $this->choices as $value => $label ) : ?>
|
||||
@@ -582,10 +583,10 @@ class WP_Customize_Control {
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$dropdown_name = '_customize-dropdown-pages-' . $this->id;
|
||||
$show_option_none = __( '— Select —' );
|
||||
$dropdown_name = '_customize-dropdown-pages-' . $this->id;
|
||||
$show_option_none = __( '— Select —' );
|
||||
$option_none_value = '0';
|
||||
$dropdown = wp_dropdown_pages(
|
||||
$dropdown = wp_dropdown_pages(
|
||||
array(
|
||||
'name' => $dropdown_name,
|
||||
'echo' => 0,
|
||||
@@ -595,7 +596,7 @@ class WP_Customize_Control {
|
||||
)
|
||||
);
|
||||
if ( empty( $dropdown ) ) {
|
||||
$dropdown = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) );
|
||||
$dropdown = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) );
|
||||
$dropdown .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $option_none_value ), esc_html( $show_option_none ) );
|
||||
$dropdown .= '</select>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user