pbs_localize_scripts
Adds Javascript properties to the pbsParams
object in the front-end. The pbsParams
object is available in the front-end when the user is logged in and is capable of editing the page.
This variable also carries a lot of the properties used by PBS during editing, such as nonces, a list of all loaded shortcodes, and translation strings.
Parameters
$params
Array. An array of keys and values which will become available in the window-level Javascript variable pbsParams
Example
Add a non-detected shortcode into the editor
add_filter( 'pbs_frontend_scripts, 'add_my_shortcode' ); function add_my_shortcode( $params ) { $params['shortcodes'][] = 'my_shortcode'; return $params; }