bp_core_enqueue_livestamp

Enqueue and localize livestamp.js script.

Description

bp_core_enqueue_livestamp(); 

Usage

  1. if ( !function_exists( 'bp_core_enqueue_livestamp' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-cssjs.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_enqueue_livestamp(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-cssjs.php  
  1. function bp_core_enqueue_livestamp() { 
  2. // If bp-livestamp isn't enqueued, do it now. 
  3. if ( wp_script_is( 'bp-livestamp' ) ) { 
  4. return; 
  5.  
  6. /** 
  7. * Only enqueue Moment.js locale if we registered it in 
  8. */ 
  9. if ( wp_script_is( 'bp-moment-locale', 'registered' ) ) { 
  10. wp_enqueue_script( 'bp-moment-locale' ); 
  11.  
  12. if ( function_exists( 'wp_add_inline_script' ) ) { 
  13. wp_add_inline_script ( 'bp-livestamp', bp_core_moment_js_config() ); 
  14. } else { 
  15.  
  16. wp_enqueue_script( 'bp-livestamp' );