WordPress.org

Make WordPress Core

Ticket #47069: 47069.diff

File 47069.diff, 584 bytes (added by audrasjb, 2 months ago)

First step: enqueue jQuery if the Admin Bar is displayed

  • src/wp-content/themes/twentynineteen/functions.php

    diff --git a/src/wp-content/themes/twentynineteen/functions.php b/src/wp-content/themes/twentynineteen/functions.php
    index 79dfb7c..e94833c 100644
    a b function twentynineteen_scripts() { 
    231231        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    232232                wp_enqueue_script( 'comment-reply' );
    233233        }
     234
     235        if ( is_admin_bar_showing() ) {
     236                wp_enqueue_script( 'jquery' );
     237        }
    234238}
    235239add_action( 'wp_enqueue_scripts', 'twentynineteen_scripts' );
    236240