Changeset 8091
- Timestamp:
- 03/09/2014 02:53:15 PM (11 years ago)
- Location:
- trunk/bp-core
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-cssjs.php
r7571 r8091 14 14 */ 15 15 function bp_core_confirmation_js() { 16 if ( is_multisite() && ! bp_is_root_blog() ) { 17 return false; 18 } 16 19 17 if ( is_multisite() && ! bp_is_root_blog() )18 return false;20 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 21 wp_enqueue_script( 'bp-confirm', buddypress()->plugin_url . "bp-core/js/confirm{$min}.js", array( 'jquery' ), bp_get_version() ); 19 22 20 if ( !wp_script_is( 'jquery' ) ) 21 wp_enqueue_script( 'jquery' ); 23 wp_localize_script( 'bp-confirm', 'BP_Confirm', array( 24 'are_you_sure' => __( 'Are you sure?', 'buddypress' ), 25 ) ); 22 26 23 if ( !wp_script_is( 'jquery', 'done' ) )24 wp_print_scripts( 'jquery' ); ?>25 26 <script type="text/javascript">27 jQuery( document ).ready( function() {28 jQuery( 'a.confirm').click( function() {29 if ( confirm( '<?php _e( 'Are you sure?', 'buddypress' ) ?>' ) )30 return true; else return false;31 });32 });33 </script>34 35 <?php36 27 } 37 add_action( 'wp_ head', 'bp_core_confirmation_js', 100);38 add_action( 'admin_ head', 'bp_core_confirmation_js', 100);28 add_action( 'wp_enqueue_scripts', 'bp_core_confirmation_js' ); 29 add_action( 'admin_enqueue_scripts', 'bp_core_confirmation_js' ); 39 30 40 31 /**
Note: See TracChangeset
for help on using the changeset viewer.