WordPress.org

Make WordPress Core

Changeset 31189


Ignore:
Timestamp:
01/16/2015 01:10:39 AM (6 years ago)
Author:
wonderboymusic
Message:

Revert [31032], this did not get much love.

See #25277.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class.wp-scripts.php

    r31033 r31189  
    2828    public $print_code = '';
    2929    public $ext_handles = '';
    30     public $print_after_html = '';
    3130    public $ext_version = '';
    3231    public $default_dirs;
     
    6968    }
    7069
    71     public function print_extra_script( $handle, $echo = true, $key = 'data' ) {
    72         if ( ! $output = $this->get_data( $handle, $key ) ) {
     70    public function print_extra_script( $handle, $echo = true ) {
     71        if ( !$output = $this->get_data( $handle, 'data' ) )
    7372            return;
    74         }
    75 
    76         if ( ! $echo ) {
     73
     74        if ( !$echo )
    7775            return $output;
    78         }
    7976
    8077        echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5
     
    121118            if ( $this->in_default_dir($srce) ) {
    122119                $this->print_code .= $this->print_extra_script( $handle, false );
    123                 $this->print_after_html .= "\n" . $this->print_extra_script( $handle, false, 'data-after' );
    124120                $this->concat .= "$handle,";
    125121                $this->concat_version .= "$handle$ver";
     
    160156        if ( $this->do_concat ) {
    161157            $this->print_html .= $tag;
    162             $this->print_after_html .= $this->print_extra_script( $handle, false, 'data-after' ) . "\n";
    163158        } else {
    164159            echo $tag;
    165             $this->print_extra_script( $handle, true, 'data-after' );
    166160        }
    167161
     
    268262        $this->concat_version = '';
    269263        $this->print_html = '';
    270         $this->print_after_html = '';
    271264        $this->ext_version = '';
    272265        $this->ext_handles = '';
  • trunk/src/wp-includes/script-loader.php

    r31188 r31189  
    861861    }
    862862
    863     if ( ! empty( $wp_scripts->print_html ) ) {
     863    if ( !empty($wp_scripts->print_html) )
    864864        echo $wp_scripts->print_html;
    865     }
    866 
    867     if ( ! empty( $wp_scripts->print_after_html ) ) {
    868         if ( $wp_scripts->do_concat ) {
    869             echo "<script type='text/javascript'>\n";
    870             echo "/* <![CDATA[ */\n"; // not needed in HTML 5
    871             echo trim( $wp_scripts->print_after_html ) . "\n";
    872             echo "/* ]]> */\n";
    873             echo "</script>\n";
    874         } else {
    875             echo $wp_scripts->print_after_html;
    876         }
    877     }
    878865}
    879866
Note: See TracChangeset for help on using the changeset viewer.