Changeset 8773 for trunk/src/bp-activity/bp-activity-cssjs.php
- Timestamp:
- 08/09/2014 04:30:44 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-cssjs.php
r8770 r8773 21 21 } 22 22 23 // Special handling for New/Edit screens in wp-admin 24 if ( is_admin() ) { 25 if ( 26 ! get_current_screen() || 27 ! in_array( get_current_screen()->base, array( 'page', 'post' ) ) || 28 ! post_type_supports( get_current_screen()->post_type, 'editor' ) ) { 29 return; 30 } 31 } 32 33 23 34 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 24 35 … … 35 46 } 36 47 add_action( 'bp_enqueue_scripts', 'bp_activity_mentions_script' ); 37 38 /** 39 * Enqueue @mentions JS in wp-admin. 40 * 41 * @since BuddyPress (2.1) 42 */ 43 function bp_activity_mentions_dashboard_script() { 44 if ( ! bp_activity_maybe_load_mentions_scripts() ) { 45 return; 46 } 47 48 // Special handling for New/Edit screens in wp-admin 49 if ( 50 ! get_current_screen() || 51 ! in_array( get_current_screen()->base, array( 'page', 'post' ) ) || 52 ! post_type_supports( get_current_screen()->post_type, 'editor' ) ) { 53 return; 54 } 55 56 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 57 58 wp_enqueue_script( 'bp-mentions', buddypress()->plugin_url . "bp-activity/js/mentions{$min}.js", array( 'jquery', 'jquery-atwho' ), bp_get_version(), true ); 59 wp_enqueue_style( 'bp-mentions-css', buddypress()->plugin_url . "bp-activity/css/mentions{$min}.css", array(), bp_get_version() ); 60 61 wp_style_add_data( 'bp-mentions-css', 'rtl', true ); 62 if ( $min ) { 63 wp_style_add_data( 'bp-mentions-css', 'suffix', $min ); 64 } 65 66 // Print a list of the current user's friends to the page for quicker @mentions lookups. 67 do_action( 'bp_activity_mentions_prime_results' ); 68 } 69 add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_dashboard_script' ); 48 add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' );
Note: See TracChangeset
for help on using the changeset viewer.