bp_core_enqueue_livestamp()

Enqueue and localize livestamp.js script.

Description

Source

File: bp-core/bp-core-cssjs.php

757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
function bp_core_enqueue_livestamp() {
    // If bp-livestamp isn't enqueued, do it now.
    if ( wp_script_is( 'bp-livestamp' ) ) {
        return;
    }
 
    /*
     * Only enqueue Moment.js locale if we registered it in
     * bp_core_register_common_scripts().
     */
    if ( wp_script_is( 'bp-moment-locale', 'registered' ) ) {
        wp_enqueue_script( 'bp-moment-locale' );
 
        if ( function_exists( 'wp_add_inline_script' ) ) {
            wp_add_inline_script ( 'bp-livestamp', bp_core_moment_js_config() );
        } else {
            add_action( 'wp_footer', '_bp_core_moment_js_config_footer', 20 );
        }
    }
 
    wp_enqueue_script( 'bp-livestamp' );
}

Changelog

Changelog
Version Description
BuddyPress 2.7.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.