2015-10-24 14:57:25 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Customize API: WP_Customize_Site_Icon_Control class
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Customize
|
|
|
|
* @since 4.4.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Customize Site Icon control class.
|
|
|
|
*
|
|
|
|
* Used only for custom functionality in JavaScript.
|
|
|
|
*
|
|
|
|
* @since 4.3.0
|
|
|
|
*
|
|
|
|
* @see WP_Customize_Cropped_Image_Control
|
|
|
|
*/
|
|
|
|
class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Control type.
|
|
|
|
*
|
|
|
|
* @since 4.3.0
|
|
|
|
* @access public
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $type = 'site_icon';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*
|
|
|
|
* @since 4.3.0
|
|
|
|
* @access public
|
|
|
|
*
|
|
|
|
* @param WP_Customize_Manager $manager Customizer bootstrap instance.
|
|
|
|
* @param string $id Control ID.
|
|
|
|
* @param array $args Optional. Arguments to override class property defaults.
|
|
|
|
*/
|
|
|
|
public function __construct( $manager, $id, $args = array() ) {
|
|
|
|
parent::__construct( $manager, $id, $args );
|
|
|
|
add_action( 'customize_controls_print_styles', 'wp_site_icon', 99 );
|
|
|
|
}
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
|
|
|
|
/**
|
2016-03-16 12:41:27 -04:00
|
|
|
* Renders a JS template for the content of the site icon control.
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
*
|
|
|
|
* @since 4.5.0
|
2016-03-16 12:41:27 -04:00
|
|
|
* @access public
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
*/
|
|
|
|
public function content_template() {
|
|
|
|
?>
|
|
|
|
<label for="{{ data.settings['default'] }}-button">
|
|
|
|
<# if ( data.label ) { #>
|
|
|
|
<span class="customize-control-title">{{ data.label }}</span>
|
|
|
|
<# } #>
|
|
|
|
<# if ( data.description ) { #>
|
|
|
|
<span class="description customize-control-description">{{{ data.description }}}</span>
|
|
|
|
<# } #>
|
|
|
|
</label>
|
|
|
|
|
2016-06-16 05:45:27 -04:00
|
|
|
<# if ( data.attachment && data.attachment.id ) { #>
|
2016-05-12 16:23:54 -04:00
|
|
|
<div class="attachment-media-view">
|
2016-06-16 05:45:27 -04:00
|
|
|
<# if ( data.attachment.sizes ) { #>
|
|
|
|
<div class="site-icon-preview">
|
|
|
|
<div class="favicon-preview">
|
2016-07-05 07:32:29 -04:00
|
|
|
<img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" alt="" />
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
|
2016-06-16 05:45:27 -04:00
|
|
|
<div class="favicon">
|
2017-03-25 11:26:33 -04:00
|
|
|
<img src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>"/>
|
2016-06-16 05:45:27 -04:00
|
|
|
</div>
|
Grouped backports to the 4.7 branch.
- Posts, Post types: Apply KSES to post-by-email content,
- General: Validate host on "Are you sure?" screen,
- Posts, Post types: Remove emails from post-by-email logs,
- Media: Refactor search by filename within the admin,
- Pings/trackbacks: Apply KSES to all trackbacks,
- Comments: Apply kses when editing comments,
- Customize: Escape blogname option in underscores templates,
- REST API: Lockdown post parameter of the terms endpoint,
- Mail: Reset PHPMailer properties between use,
- Query: Validate relation in `WP_Date_Query`,
- Widgets: Escape RSS error messages for display.
Merges [54521], [54522], [54523], [54524], [54525], [54526], [54527], [54528], [54529], [54530], [54541] to the 4.7 branch.
Props voldemortensen, johnbillion, paulkevan, peterwilsoncc, xknown, dd32, audrasjb, martinkrcho, vortfu, davidbaumwald, tykoted, timothyblynjacobs, johnjamesjacoby, ehtis, matveb, talldanwp.
Built from https://develop.svn.wordpress.org/branches/4.7@54566
git-svn-id: http://core.svn.wordpress.org/branches/4.7@54120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 14:12:04 -04:00
|
|
|
<span class="browser-title" aria-hidden="true"><?php echo esc_js( get_bloginfo( 'name' ) ); ?></span>
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
</div>
|
2017-03-25 11:26:33 -04:00
|
|
|
<img class="app-icon-preview" src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>"/>
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
</div>
|
2016-06-16 05:45:27 -04:00
|
|
|
<# } #>
|
2016-05-12 16:23:54 -04:00
|
|
|
<div class="actions">
|
|
|
|
<# if ( data.canUpload ) { #>
|
|
|
|
<button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
|
|
|
|
<button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button>
|
|
|
|
<div style="clear:both"></div>
|
|
|
|
<# } #>
|
|
|
|
</div>
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
</div>
|
|
|
|
<# } else { #>
|
2016-05-12 16:23:54 -04:00
|
|
|
<div class="attachment-media-view">
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
<div class="placeholder">
|
2016-05-12 16:23:54 -04:00
|
|
|
<?php echo $this->button_labels['placeholder']; ?>
|
|
|
|
</div>
|
|
|
|
<div class="actions">
|
|
|
|
<# if ( data.defaultAttachment ) { #>
|
|
|
|
<button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button>
|
|
|
|
<# } #>
|
|
|
|
<# if ( data.canUpload ) { #>
|
|
|
|
<button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button>
|
|
|
|
<# } #>
|
|
|
|
<div style="clear:both"></div>
|
Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/
Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland.
See #33755.
Built from https://develop.svn.wordpress.org/trunk@36698
git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 17:10:26 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<# } #>
|
|
|
|
<?php
|
|
|
|
}
|
2015-10-24 14:57:25 -04:00
|
|
|
}
|