bp_core_get_js_strings

Filters core JavaScript strings for internationalization before AJAX usage.

Description

apply_filters( 'bp_core_get_js_strings', (callback) $var ); 

Parameters (1)

0. $var — Optional. (callback) => array( 'accepted' => __( 'Accepted', 'buddypress' ), 'close' => __( 'Close', 'buddypress' ), 'comments' => __( 'comments', 'buddypress' ), 'leave_group_confirm' => __( 'Are you sure you want to leave this group?', 'buddypress' ), 'mark_as_fav' => __( 'Favorite', 'buddypress' ), 'my_favs' => __( 'My Favorites', 'buddypress' ), 'rejected' => __( 'Rejected', 'buddypress' ), 'remove_fav' => __( 'Remove Favorite', 'buddypress' ), 'show_all' => __( 'Show all', 'buddypress' ), 'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ), 'show_x_comments' => __( 'Show all comments (%d)', 'buddypress' ), 'unsaved_changes' => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ), 'view' => __( 'View', 'buddypress' ), )
Array of key/value pairs for AJAX usage.

Usage

To run the hook, copy the example below.
  1. $var = apply_filters( 'bp_core_get_js_strings', $var ); 
  2.  
  3. if ( !empty( $var ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_core_get_js_strings callback 
  2. function filter_bp_core_get_js_strings( $var ) { 
  3. // make filter magic happen here... 
  4. return $var
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_core_get_js_strings', 'filter_bp_core_get_js_strings', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_core_get_js_strings', 'filter_bp_core_get_js_strings', 10, 1 ); 

Defined (1)

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

/bp-templates/bp-legacy/buddypress-functions.php  
  1. $params = apply_filters( 'bp_core_get_js_strings', array(