Make WordPress Core

Ticket #25866: 25866.diff

File 25866.diff, 2.0 KB (added by celloexpressions, 12 years ago)

Define ajaxurl directly in the customizer <head>, as it is in the rest of the admin. Also remove the code that was adding it in Twenty Fourteen.

  • wp-admin/customize.php

     
    7474$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
    7575
    7676$admin_title = sprintf( __( '%1$s &#8212; WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) );
    77 ?><title><?php echo $admin_title; ?></title><?php
     77?><title><?php echo $admin_title; ?></title>
    7878
     79<script type="text/javascript">
     80var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>';
     81</script>
     82
     83<?php
    7984/**
    8085 * Print Customizer control styles.
    8186 *
  • wp-content/themes/twentyfourteen/inc/featured-content.php

     
    372372         */
    373373        public static function enqueue_scripts() {
    374374                wp_enqueue_script( 'featured-content-suggest', get_template_directory_uri() . '/js/featured-content-admin.js', array( 'jquery', 'suggest' ), '20131022', true );
    375                 wp_localize_script( 'featured-content-suggest', 'featuredContent', array(
    376                         'ajaxurl' => admin_url( 'admin-ajax.php' ),
    377                 ) );
    378375        }
    379376
    380377
  • wp-content/themes/twentyfourteen/js/featured-content-admin.js

     
    11jQuery( function( $ ) {
    2         $( '#customize-control-featured-content-tag-name input' ).suggest( featuredContent.ajaxurl + '?action=ajax-tag-search&tax=post_tag', { delay: 500, minchars: 2 } );
     2        $( '#customize-control-featured-content-tag-name input' ).suggest( ajaxurl + '?action=ajax-tag-search&tax=post_tag', { delay: 500, minchars: 2 } );
    33} );