Add filter to localized js strings

This commit is contained in:
Brian Miyaji
2015-09-23 21:44:28 +10:00
parent b5ee62610e
commit 2775a6b6e2

View File

@@ -110,7 +110,7 @@ class SP_Admin_Assets {
wp_enqueue_script( 'jquery-fitvids' );
wp_enqueue_script( 'sportspress-admin', SP()->plugin_url() . '/assets/js/admin/sportspress-admin.js', array( 'jquery', 'chosen', 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-tiptip', 'jquery-caret', 'jquery-countdown', 'jquery-fitvids' ), SP_VERSION, true );
$strings = array(
$strings = apply_filters( 'sportspress_localized_strings', array(
'none' => __( 'None', 'sportspress' ),
'remove_text' => __( '— Remove —', 'sportspress' ),
'days' => __( 'days', 'sportspress' ),
@@ -118,7 +118,7 @@ class SP_Admin_Assets {
'mins' => __( 'mins', 'sportspress' ),
'secs' => __( 'secs', 'sportspress' ),
'displaying_posts' => html_entity_decode( __( 'Displaying %s–%s of %s', 'sportspress' ) ),
);
) );
// Localize scripts
wp_localize_script( 'sportspress-admin', 'localized_strings', $strings );