bb_just_in_time_script_localization

Load localized script just in time for MCE.

Description

bb_just_in_time_script_localization(); 

These localizations require information that may not be loaded even by init.


Usage

  1. if ( !function_exists( 'bb_just_in_time_script_localization' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-script-loader.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bb_just_in_time_script_localization(); 
  7.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-script-loader.php  
  1. function bb_just_in_time_script_localization() { 
  2. wp_localize_script( 'topic', 'bbTopicJS', array( 
  3. 'currentUserId' => bb_get_current_user_info( 'id' ),  
  4. 'topicId' => get_topic_id(),  
  5. 'favoritesLink' => get_favorites_link(),  
  6. 'isFav' => (int) is_user_favorite( bb_get_current_user_info( 'id' ) ),  
  7. 'confirmPostDelete' => __("Are you sure you want to delete this post?"),  
  8. 'confirmPostUnDelete' => __("Are you sure you want to undelete this post?"),  
  9. 'favLinkYes' => __( 'favorites' ),  
  10. 'favLinkNo' => __( '?' ),  
  11. 'favYes' => __( 'This topic is one of your %favLinkYes% [%favDel%]' ),  
  12. 'favNo' => __( '%favAdd% (%favLinkNo%)' ),  
  13. 'favDel' => __( '×' ),  
  14. 'favAdd' => __( 'Add this topic to your favorites' ) 
  15. ));