Skip to:
Content
Pages
Categories
Search
Top
Bottom

javascript precedence

  • @bassjobsen

    Participant

    Hello,

    1) in bp-templates/buddypress-legacy/buddypress-functions.php the function enqueue_scripts() enqueues buddypress.js. buddypress.js not only depends on jquery but also on jquery-cookie.
    Set the $deps Array of the handles in the wp_enqueue_script() call to array('jquery','jquery-cookie') will fix this

    2) ./buddypress/bp-core/bp-core-cssjs.php sets add_action( 'wp_head', bp_core_confirmation_js', 100 ); where bp_core_confirmation_js add javascript to the head which depends on jquery. This code should be enqueued with wp_enqueue_script() to set the jquery dependency. Localization can be add with: wp_localize_script().

    Thanks for your attention. I will need this fixes to get WP Defer Loading work with BuddyPress, see: https://github.com/bassjobsen/wp-defer-loading/issues/4

Viewing 8 replies - 1 through 8 (of 8 total)
  • @henrywright-1

    Member

    @bassjobsen

    You can use Trac if you need to report a bug in BP core:
    https://buddypress.trac.wordpress.org/

    With reference to (2), you could always remove the action then enqueue the script you want.

    remove_action( 'wp_head', bp_core_confirmation_js', 100 );

    @hnla

    Participant

    ? Call your own functions.php overload the bp class or as mentioned please open a trac ticket if you believe this is an issue, as the matter will receive attention there whereas on the support forum it won’t necessarily.

    @bassjobsen

    Participant

    @henrywright-1 and @hnla thanks for your quick responses. I will post both issues in trac, i couldn’t login in there before but i can now.

    Yes indeed, i use the remove action now to fix my plugin, but i can’t write a fix for every plugin. @hnla cause i’m writing a plugin i can’t use a functions.php

    @henrywright-1

    Member

    @bassjobsen if you’re writing a plugin then you could introduce a {plugin-name}-functions.php file which could be home for your custom helper functions. Just a thought.

    @bassjobsen

    Participant

    @henrywright-1 thanks for your suggestion i will consider this. But i will facing the problem i can’t write exception for every plugin still.

    @henrywright-1

    Member

    @bassjobsen how many plugins do you plan to write? hehe. The core team are great, if there is a bug they tend to jump on them straight away – hopefully you won’t have to wait too long for the fix. 🙂

    @bassjobsen

    Participant

    @henrywright-1 i will write on plugin only, see: https://wordpress.org/plugins/wp-defer-loading/. This plugin require the theme and other installed plugins enqueue their scripts with enqueue_scripts() and dependency right.
    Buddy press breaks my plugin now.

    @djpaul

    Keymaster

    We saw your bug report and left an initial response on the ticket at https://buddypress.trac.wordpress.org/ticket/5208.

    We need a bit more information to work on this issue. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘javascript precedence’ is closed to new replies.
Skip to toolbar