Make WordPress Core


Ignore:
Timestamp:
06/10/2012 12:32:19 AM (14 years ago)
Author:
ryan
Message:
  • Introduce remove_header_image(), reset_header_image(), set_header_image(), and get_header_image_data() for Custom_Image_Header.
  • Handle all set/get of header theme mod through these methods.
  • Use these methods in the customizer.

Props kovshenin, nacin, SergeyBiryukov, koopersmith.
fixes #20871

File:
1 edited

Legend:

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

    r21009 r21037  
    384384                update_post_meta( $id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
    385385
    386                 set_theme_mod('background_image', esc_url($url));
     386                set_theme_mod('background_image', esc_url_raw($url));
    387387
    388388                $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
    389                 set_theme_mod('background_image_thumb', esc_url( $thumbnail[0] ) );
     389                set_theme_mod('background_image_thumb', esc_url_raw( $thumbnail[0] ) );
    390390
    391391                do_action('wp_create_file_in_uploads', $file, $id); // For replication
     
    426426                $url = wp_get_attachment_image_src( $attachment_id, $size );
    427427                $thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
    428                 set_theme_mod( 'background_image', esc_url( $url[0] ) );
    429                 set_theme_mod( 'background_image_thumb', esc_url( $thumbnail[0] ) );
     428                set_theme_mod( 'background_image', esc_url_raw( $url[0] ) );
     429                set_theme_mod( 'background_image_thumb', esc_url_raw( $thumbnail[0] ) );
    430430                exit;
    431431        }
Note: See TracChangeset for help on using the changeset viewer.