bp_core_get_js_strings
Filters core JavaScript strings for internationalization before AJAX usage.
Description
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.
- $var = apply_filters( 'bp_core_get_js_strings', $var );
- if ( !empty( $var ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_core_get_js_strings callback
- function filter_bp_core_get_js_strings( $var ) {
- // make filter magic happen here...
- return $var;
- };
- // add the filter
- add_filter( 'bp_core_get_js_strings', 'filter_bp_core_get_js_strings', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- $params = apply_filters( 'bp_core_get_js_strings', array(