' . $this->label . '';
}
?>
%s × %s', $width, $height )
);
} elseif ( $width ) {
printf(
/* translators: %s: Header width in pixels. */
__( 'Click “Add new image” to upload an image file from your computer. Your theme works best with an image with a header width of %s pixels — you’ll be able to crop your image once you upload it for a perfect fit.' ),
sprintf( '%s', $width )
);
} else {
printf(
/* translators: %s: Header height in pixels. */
__( 'Click “Add new image” to upload an image file from your computer. Your theme works best with an image with a header height of %s pixels — you’ll be able to crop your image once you upload it for a perfect fit.' ),
sprintf( '%s', $height )
);
}
?>
manager->get_setting( 'header_image' )->post_value();
}
if ( is_array( $value ) && isset( $value['choice'] ) ) {
$custom_image_header->set_header_image( $value['choice'] );
} else {
$custom_image_header->set_header_image( $value );
}
}
}
class-wp-customize-image-control.php 0000644 00000002273 15123067647 0013603 0 ustar 00 button_labels = wp_parse_args( $this->button_labels, $this->get_default_button_labels() );
}
/**
* Enqueue control related scripts/styles.
*
* @since 3.4.0
* @since 4.2.0 Moved from WP_Customize_Upload_Control.
*/
public function enqueue() {
wp_enqueue_media();
}
/**
* Refresh the parameters passed to the JavaScript via JSON.
*
* @since 3.4.0
* @since 4.2.0 Moved from WP_Customize_Upload_Control.
*
* @see WP_Customize_Control::to_json()
*/
public function to_json() {
parent::to_json();
$this->json['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );
$this->json['mime_type'] = $this->mime_type;
$this->json['button_labels'] = $this->button_labels;
$this->json['canUpload'] = current_user_can( 'upload_files' );
$value = $this->value();
if ( is_object( $this->setting ) ) {
if ( $this->setting->default ) {
// Fake an attachment model - needs all fields used by template.
// Note that the default value must be a URL, NOT an attachment ID.
$ext = substr( $this->setting->default, -3 );
$type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp' ), true ) ? 'image' : 'document';
$default_attachment = array(
'id' => 1,
'url' => $this->setting->default,
'type' => $type,
'icon' => wp_mime_type_icon( $type ),
'title' => wp_basename( $this->setting->default ),
);
if ( 'image' === $type ) {
$default_attachment['sizes'] = array(
'full' => array( 'url' => $this->setting->default ),
);
}
$this->json['defaultAttachment'] = $default_attachment;
}
if ( $value && $this->setting->default && $value === $this->setting->default ) {
// Set the default as the attachment.
$this->json['attachment'] = $this->json['defaultAttachment'];
} elseif ( $value ) {
$this->json['attachment'] = wp_prepare_attachment_for_js( $value );
}
}
}
/**
* Don't render any content for this control from PHP.
*
* @since 3.4.0
* @since 4.2.0 Moved from WP_Customize_Upload_Control.
*
* @see WP_Customize_Media_Control::content_template()
*/
public function render_content() {}
/**
* Render a JS template for the content of the media control.
*
* @since 4.1.0
* @since 4.2.0 Moved from WP_Customize_Upload_Control.
*/
public function content_template() {
?>
<#
var descriptionId = _.uniqueId( 'customize-media-control-description-' );
var describedByAttr = data.description ? ' aria-describedby="' + descriptionId + '" ' : '';
#>
<# if ( data.label ) { #>
<# } else { #>
<# } #>
<# if ( data.theme.screenshot && data.theme.screenshot[0] ) { #>
<# } else { #>
<# } #>
<# if ( 'installed' === data.theme.type && data.theme.hasUpdate ) { #>
<# if ( data.theme.updateResponse.compatibleWP && data.theme.updateResponse.compatiblePHP ) { #>
' . __( 'Update now' ) . ''
);
}
?>
<# } else { #>
<# if ( ! data.theme.updateResponse.compatibleWP && ! data.theme.updateResponse.compatiblePHP ) { #>
Please update WordPress, and then learn more about updating PHP.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '
', '' );
} elseif ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( 'Please update WordPress.' ),
self_admin_url( 'update-core.php' )
);
} elseif ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( 'Learn more about updating PHP.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '
', '' );
}
?>
<# } else if ( ! data.theme.updateResponse.compatibleWP ) { #>
Please update WordPress.' ),
self_admin_url( 'update-core.php' )
);
}
?>
<# } else if ( ! data.theme.updateResponse.compatiblePHP ) { #>
Learn more about updating PHP.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '
', '' );
}
?>
<# } #>
<# } #>
<# } #>
<# if ( ! data.theme.compatibleWP || ! data.theme.compatiblePHP ) { #>
<# if ( ! data.theme.compatibleWP && ! data.theme.compatiblePHP ) { #>
Please update WordPress, and then learn more about updating PHP.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '
', '' );
} elseif ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( 'Please update WordPress.' ),
self_admin_url( 'update-core.php' )
);
} elseif ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( 'Learn more about updating PHP.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '
', '' );
}
?>
<# } else if ( ! data.theme.compatibleWP ) { #>
Please update WordPress.' ),
self_admin_url( 'update-core.php' )
);
}
?>
<# } else if ( ! data.theme.compatiblePHP ) { #>
Learn more about updating PHP.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '
', '' );
}
?>
<# } #>
<# } #>
<# if ( data.theme.active ) { #>
<# } else if ( 'installed' === data.theme.type ) { #>
{{ data.theme.name }}
<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>
<# } else { #>
<# } #>
<# } else { #>
{{ data.theme.name }}
<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>
<# } else { #>
<# } #>
<# } #>
manager->is_theme_active() ) {
echo '' . __( 'Active theme' ) . ' {{ data.title }}';
} else {
echo '' . __( 'Previewing theme' ) . ' {{ data.title }}';
}
?>
' . __( 'Themes' ) . ''
); // Separate strings for consistency with other panels.
?>
<# if ( data.description ) { #>
<# } #>
<# if ( data.description ) { #>
{{{ data.description }}}
<# } #>
action;
$exported['filter_type'] = $this->filter_type;
return $exported;
}
/**
* Render a themes section as a JS template.
*
* The template is only rendered by PHP once, so all actions are prepared at once on the server side.
*
* @since 4.9.0
*/
protected function render_template() {
?>
filter_drawer_content_template(); ?>
support forums.' ),
__( 'https://wordpress.org/support/forums/' )
);
?>
%s', __( 'Search WordPress.org themes' ) )
);
?>
<# if ( 'wporg' === data.action ) { #>
<# } else { #>
<# } #>
0' );
?>
<# if ( 'wporg' === data.action ) { #>
<# } #>
value();
if ( $value ) {
// Get the attachment model for the existing file.
$attachment_id = attachment_url_to_postid( $value );
if ( $attachment_id ) {
$this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id );
}
}
}
}
class-wp-widget-area-customize-control.php 0000644 00000003171 15123067647 0014710 0 ustar 00 json[ $key ] = $this->$key;
}
}
/**
* Renders the control's content.
*
* @since 3.9.0
*/
public function render_content() {
$id = 'reorder-widgets-desc-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
?>
json[ $key ] = $this->$key;
}
// Get the widget_control and widget_content.
require_once ABSPATH . 'wp-admin/includes/widgets.php';
$widget = $wp_registered_widgets[ $this->widget_id ];
if ( ! isset( $widget['params'][0] ) ) {
$widget['params'][0] = array();
}
$args = array(
'widget_id' => $widget['id'],
'widget_name' => $widget['name'],
);
$args = wp_list_widget_controls_dynamic_sidebar(
array(
0 => $args,
1 => $widget['params'][0],
)
);
$widget_control_parts = $this->manager->widgets->get_widget_control_parts( $args );
$this->json['widget_control'] = $widget_control_parts['control'];
$this->json['widget_content'] = $widget_control_parts['content'];
}
/**
* Override render_content to be no-op since content is exported via to_json for deferred embedding.
*
* @since 3.9.0
*/
public function render_content() {}
/**
* Whether the current widget is rendered on the page.
*
* @since 4.0.0
*
* @return bool Whether the widget is rendered.
*/
public function active_callback() {
return $this->manager->widgets->is_widget_rendered( $this->widget_id );
}
}
class-wp-sidebar-block-editor-control.php 0000644 00000001256 15123067647 0014466 0 ustar 00
Order Allow,Deny
Deny from all