WordPress.org

Make WordPress Core

Ticket #25247: #25247_bugfix_v2.diff

File #25247_bugfix_v2.diff, 1.1 KB (added by nmarks, 5 years ago)

Revised patch for #25247

  • src/wp-includes/class.wp-dependencies.php

    diff --git src/wp-includes/class.wp-dependencies.php src/wp-includes/class.wp-dependencies.php
    index 7995a90..dd53923 100644
    class WP_Dependencies { 
    107107                                 *   <code>add( 'scriptaculous', false, array( 'scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls' ) );</code>
    108108                                 *
    109109                                 * The src property is false.
     110                                 *
     111                                 * If the item has a group set, it may need to be deferred and loaded in the footer.
     112                                 * Therefore, we also need to take into consideration the group before queueing it.
     113                                 * Only items with no group set or in the current group being processed should be queued.
    110114                                 */
    111                                 if ( ! $this->registered[$handle]->src ) {
     115                                $has_src = $this->registered[ $handle ]->src;
     116                                $has_group = isset( $this->registered[ $handle ]->extra['group'] );
     117                                $deps_group = $has_group ? $this->registered[ $handle ]->extra['group'] : NULL;
     118
     119                                if ( ( ! $has_src && ! $has_group ) || ( ! $has_src && $deps_group == $group ) ) {
    112120                                        $this->done[] = $handle;
    113121                                        continue;
    114122                                }