Make WordPress Core

Opened 8 years ago

#40134 new defect (bug)

Invalid data for scripts in footer

Reported by: sebastianpisula's profile sebastian.pisula Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Script Loader Keywords:
Focuses: Cc:

Description

During register scripts via wp_register_script in last param I can choose that script should be in footer. In function we see:

<?php
if ( $in_footer ) {
     $wp_scripts->add_data( $handle, 'group', 1 );
}

so footer scripts I should check use this code:

<?php
$wp_scripts = wp_scripts();

if ( $wp_scripts->get_data( $handle, 'group' ) ) {
        echo 'in footer';
} else {
        echo 'in header';
}

I check for this: admin-bar and I have false -> in header. We can see this code:

<?php
$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );

This should be in footer (and is, but I can't check it via my script).

I think that this is bug.

Attachments (1)

40134.patch (640 bytes) - added by sebastian.pisula 8 years ago.

Download all attachments as: .zip

Change History (1)

Note: See TracTickets for help on using tickets.