Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-background.php

    r18023 r18010  
    4444
    4545    /**
    46      * PHP4 Constructor - Register administration header callback.
     46     * Constructor - Register administration header callback.
    4747     *
    4848     * @since 3.0.0
     
    5151     * @return Custom_Background
    5252     */
    53     function Custom_Background($admin_header_callback = '', $admin_image_div_callback = '') {
     53    function __construct($admin_header_callback = '', $admin_image_div_callback = '') {
    5454        $this->admin_header_callback = $admin_header_callback;
    5555        $this->admin_image_div_callback = $admin_image_div_callback;
     
    8686        '<p>' . __( 'Don&#8217;t forget to click on the Save Changes button when you are finished.' ) . '</p>' .
    8787        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    88         '<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Background_SubPanel" target="_blank">Documentation on Custom Background</a>' ) . '</p>' .
     88        '<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Background_Screen" target="_blank">Documentation on Custom Background</a>' ) . '</p>' .
    8989        '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' );
    9090        wp_enqueue_script('custom-background');
     
    238238<?php wp_nonce_field('custom-background-upload', '_wpnonce-custom-background-upload') ?>
    239239<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
    240 </p>
    241240</form>
    242241</td>
     
    271270<th scope="row"><?php _e( 'Repeat' ); ?></th>
    272271<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Repeat' ); ?></span></legend>
    273 <label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('No Repeat'); ?></option></label>
    274     <label><input type="radio" name="background-repeat" value="repeat"<?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile'); ?></option></label>
    275     <label><input type="radio" name="background-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile Horizontally'); ?></option></label>
    276     <label><input type="radio" name="background-repeat" value="repeat-y"<?php checked('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile Vertically'); ?></option></label>
     272<label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('No Repeat'); ?></label>
     273    <label><input type="radio" name="background-repeat" value="repeat"<?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile'); ?></label>
     274    <label><input type="radio" name="background-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile Horizontally'); ?></label>
     275    <label><input type="radio" name="background-repeat" value="repeat-y"<?php checked('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile Vertically'); ?></label>
    277276</fieldset></td>
    278277</tr>
     
    295294<th scope="row"><?php _e( 'Color' ); ?></th>
    296295<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
     296<?php $show_clear = get_background_color() ? '' : ' style="display:none"'; ?>
    297297<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr(get_background_color()) ?>" />
    298 <a class="hide-if-no-js" href="#" id="pickcolor"><?php _e('Select a Color'); ?></a>
     298<a class="hide-if-no-js" href="#" id="pickcolor"><?php _e('Select a Color'); ?></a> <span <?php echo $show_clear; ?>class="hide-if-no-js" id="clearcolor"> (<a href="#"><?php _e( 'Clear' ); ?></a>)</span>
    299299<div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
    300300</fieldset></td>
     
    347347        // Add the meta-data
    348348        wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
     349        update_post_meta( $id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
    349350
    350351        set_theme_mod('background_image', esc_url($url));
Note: See TracChangeset for help on using the changeset viewer.