Make WordPress Core


Ignore:
Timestamp:
12/02/2016 12:25:47 AM (10 years ago)
Author:
westonruter
Message:

Customize: Reuse existing non-auto-draft posts and existing auto-draft posts in the customized state with matching slugs when applying starter content.

  • Updates wp_unique_post_slug() to ignore auto-draft posts. Prevents publishing multiple posts that have the same slugs from starter content.
  • Fixes fatal error when attempting to save an header_image setting from a non-admin context.
  • Fixes substituting attachment symbols in options and theme mods.
  • Fixes applying starter content for header images and background images.

Merges [39411] to 4.7 branch.
See #38114.
Fixes #38928 for 4.7.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/customize/class-wp-customize-header-image-setting.php

    r35385 r39412  
    3030                global $custom_image_header;
    3131
     32                // If _custom_header_background_just_in_time() fails to initialize $custom_image_header when not is_admin().
     33                if ( empty( $custom_image_header ) ) {
     34                        require_once( ABSPATH . 'wp-admin/custom-header.php' );
     35                        $args = get_theme_support( 'custom-header' );
     36                        $admin_head_callback = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null;
     37                        $admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null;
     38                        $custom_image_header = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );
     39                }
     40
    3241                // If the value doesn't exist (removed or random),
    3342                // use the header_image value.
Note: See TracChangeset for help on using the changeset viewer.