equal
deleted
inserted
replaced
15 class Custom_Background { |
15 class Custom_Background { |
16 |
16 |
17 /** |
17 /** |
18 * Callback for administration header. |
18 * Callback for administration header. |
19 * |
19 * |
|
20 * @since 3.0.0 |
20 * @var callable |
21 * @var callable |
21 * @since 3.0.0 |
|
22 */ |
22 */ |
23 public $admin_header_callback; |
23 public $admin_header_callback; |
24 |
24 |
25 /** |
25 /** |
26 * Callback for header div. |
26 * Callback for header div. |
27 * |
27 * |
|
28 * @since 3.0.0 |
28 * @var callable |
29 * @var callable |
29 * @since 3.0.0 |
|
30 */ |
30 */ |
31 public $admin_image_div_callback; |
31 public $admin_image_div_callback; |
32 |
32 |
33 /** |
33 /** |
34 * Used to trigger a success message when settings updated and set to true. |
34 * Used to trigger a success message when settings updated and set to true. |
286 call_user_func( $this->admin_image_div_callback ); |
286 call_user_func( $this->admin_image_div_callback ); |
287 } else { |
287 } else { |
288 $background_styles = ''; |
288 $background_styles = ''; |
289 $bgcolor = get_background_color(); |
289 $bgcolor = get_background_color(); |
290 if ( $bgcolor ) { |
290 if ( $bgcolor ) { |
291 $background_styles .= 'background-color: #' . $bgcolor . ';'; |
291 $background_styles .= 'background-color: ' . maybe_hash_hex_color( $bgcolor ) . ';'; |
292 } |
292 } |
293 |
293 |
294 $background_image_thumb = get_background_image(); |
294 $background_image_thumb = get_background_image(); |
295 if ( $background_image_thumb ) { |
295 if ( $background_image_thumb ) { |
296 $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) ); |
296 $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) ); |
352 <p> |
352 <p> |
353 <label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br /> |
353 <label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br /> |
354 <input type="file" id="upload" name="import" /> |
354 <input type="file" id="upload" name="import" /> |
355 <input type="hidden" name="action" value="save" /> |
355 <input type="hidden" name="action" value="save" /> |
356 <?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?> |
356 <?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?> |
357 <?php submit_button( __( 'Upload' ), '', 'submit', false ); ?> |
357 <?php submit_button( _x( 'Upload', 'verb' ), '', 'submit', false ); ?> |
358 </p> |
358 </p> |
359 <p> |
359 <p> |
360 <label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br /> |
360 <label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br /> |
361 <button id="choose-from-library-link" class="button" |
361 <button id="choose-from-library-link" class="button" |
362 data-choose="<?php esc_attr_e( 'Choose a Background Image' ); ?>" |
362 data-choose="<?php esc_attr_e( 'Choose a Background Image' ); ?>" |