59 'section' => 'header_image', |
60 'section' => 'header_image', |
60 'removed' => 'remove-header', |
61 'removed' => 'remove-header', |
61 'get_url' => 'get_header_image', |
62 'get_url' => 'get_header_image', |
62 ) |
63 ) |
63 ); |
64 ); |
64 |
|
65 } |
65 } |
66 |
66 |
67 /** |
67 /** |
68 */ |
68 */ |
69 public function enqueue() { |
69 public function enqueue() { |
128 </button> |
128 </button> |
129 |
129 |
130 <# } else { #> |
130 <# } else { #> |
131 |
131 |
132 <button type="button" class="choice thumbnail" |
132 <button type="button" class="choice thumbnail" |
133 data-customize-image-value="{{{data.header.url}}}" |
133 data-customize-image-value="{{data.header.url}}" |
134 data-customize-header-image-data="{{JSON.stringify(data.header)}}"> |
134 data-customize-header-image-data="{{JSON.stringify(data.header)}}"> |
135 <span class="screen-reader-text"><?php _e( 'Set image' ); ?></span> |
135 <span class="screen-reader-text"> |
136 <img src="{{{data.header.thumbnail_url}}}" alt="{{{data.header.alt_text || data.header.description}}}" /> |
136 <?php |
|
137 /* translators: Hidden accessibility text. */ |
|
138 _e( 'Set image' ); |
|
139 ?> |
|
140 </span> |
|
141 <img src="{{data.header.thumbnail_url}}" alt="{{data.header.alt_text || data.header.description}}" /> |
137 </button> |
142 </button> |
138 |
143 |
139 <# if ( data.type === 'uploaded' ) { #> |
144 <# if ( data.type === 'uploaded' ) { #> |
140 <button type="button" class="dashicons dashicons-no close"><span class="screen-reader-text"><?php _e( 'Remove image' ); ?></span></button> |
145 <button type="button" class="dashicons dashicons-no close"> |
|
146 <span class="screen-reader-text"> |
|
147 <?php |
|
148 /* translators: Hidden accessibility text. */ |
|
149 _e( 'Remove image' ); |
|
150 ?> |
|
151 </span> |
|
152 </button> |
141 <# } #> |
153 <# } #> |
142 |
154 |
143 <# } #> |
155 <# } #> |
144 </script> |
156 </script> |
145 |
157 |
198 ?> |
210 ?> |
199 <div class="customize-control-notifications-container"></div> |
211 <div class="customize-control-notifications-container"></div> |
200 <p class="customizer-section-intro customize-control-description"> |
212 <p class="customizer-section-intro customize-control-description"> |
201 <?php |
213 <?php |
202 if ( current_theme_supports( 'custom-header', 'video' ) ) { |
214 if ( current_theme_supports( 'custom-header', 'video' ) ) { |
203 _e( 'Click “Add new image” to upload an image file from your computer. Your theme works best with an image that matches the size of your video — you’ll be able to crop your image once you upload it for a perfect fit.' ); |
215 _e( 'Click “Add New Image” to upload an image file from your computer. Your theme works best with an image that matches the size of your video — you’ll be able to crop your image once you upload it for a perfect fit.' ); |
204 } elseif ( $width && $height ) { |
216 } elseif ( $width && $height ) { |
205 printf( |
217 printf( |
206 /* translators: %s: Header size in pixels. */ |
218 /* translators: %s: Header size in pixels. */ |
207 __( 'Click “Add new image” to upload an image file from your computer. Your theme works best with an image with a header size of %s pixels — you’ll be able to crop your image once you upload it for a perfect fit.' ), |
219 __( 'Click “Add New Image” to upload an image file from your computer. Your theme works best with an image with a header size of %s pixels — you’ll be able to crop your image once you upload it for a perfect fit.' ), |
208 sprintf( '<strong>%s × %s</strong>', $width, $height ) |
220 sprintf( '<strong>%s × %s</strong>', $width, $height ) |
209 ); |
221 ); |
210 } elseif ( $width ) { |
222 } elseif ( $width ) { |
211 printf( |
223 printf( |
212 /* translators: %s: Header width in pixels. */ |
224 /* translators: %s: Header width in pixels. */ |
213 __( '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.' ), |
225 __( '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.' ), |
214 sprintf( '<strong>%s</strong>', $width ) |
226 sprintf( '<strong>%s</strong>', $width ) |
215 ); |
227 ); |
216 } else { |
228 } else { |
217 printf( |
229 printf( |
218 /* translators: %s: Header height in pixels. */ |
230 /* translators: %s: Header height in pixels. */ |
219 __( '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.' ), |
231 __( '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.' ), |
220 sprintf( '<strong>%s</strong>', $height ) |
232 sprintf( '<strong>%s</strong>', $height ) |
221 ); |
233 ); |
222 } |
234 } |
223 ?> |
235 ?> |
224 </p> |
236 </p> |
232 </div> |
244 </div> |
233 </div> |
245 </div> |
234 <div class="actions"> |
246 <div class="actions"> |
235 <?php if ( current_user_can( 'upload_files' ) ) : ?> |
247 <?php if ( current_user_can( 'upload_files' ) ) : ?> |
236 <button type="button"<?php echo $visibility; ?> class="button remove" aria-label="<?php esc_attr_e( 'Hide header image' ); ?>"><?php _e( 'Hide image' ); ?></button> |
248 <button type="button"<?php echo $visibility; ?> class="button remove" aria-label="<?php esc_attr_e( 'Hide header image' ); ?>"><?php _e( 'Hide image' ); ?></button> |
237 <button type="button" class="button new" id="header_image-button" aria-label="<?php esc_attr_e( 'Add new header image' ); ?>"><?php _e( 'Add new image' ); ?></button> |
249 <button type="button" class="button new" id="header_image-button" aria-label="<?php esc_attr_e( 'Add New Header Image' ); ?>"><?php _e( 'Add New Image' ); ?></button> |
238 <?php endif; ?> |
250 <?php endif; ?> |
239 </div> |
251 </div> |
240 <div class="choices"> |
252 <div class="choices"> |
241 <span class="customize-control-title header-previously-uploaded"> |
253 <span class="customize-control-title header-previously-uploaded"> |
242 <?php _ex( 'Previously uploaded', 'custom headers' ); ?> |
254 <?php _ex( 'Previously uploaded', 'custom headers' ); ?> |