Changeset 10416
- Timestamp:
- 12/18/2015 10:40:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-admin.php
r10414 r10416 143 143 144 144 // Enqueue all admin JS and CSS. 145 add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_styles' ), 1 ); 146 add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_scripts' ), 1 ); 145 147 add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 146 148 … … 474 476 */ 475 477 public function enqueue_scripts() { 476 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 477 478 $file = $this->css_url . "common{$min}.css"; 479 480 /** 481 * Filters the BuddyPress Core Admin CSS file path. 482 * 483 * @since 1.6.0 484 * 485 * @param string $file File path for the admin CSS. 486 */ 487 $file = apply_filters( 'bp_core_admin_common_css', $file ); 488 wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() ); 489 490 wp_style_add_data( 'bp-admin-common-css', 'rtl', true ); 491 if ( $min ) { 492 wp_style_add_data( 'bp-admin-common-css', 'suffix', $min ); 493 } 478 wp_enqueue_style( 'bp-admin-common-css' ); 494 479 } 495 480 … … 889 874 return $display; 890 875 } 876 877 /** 878 * Register styles commonly used by BuddyPress wp-admin screens. 879 * 880 * @since 2.5.0 881 */ 882 public function admin_register_styles() { 883 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 884 $url = $this->css_url; 885 886 /** 887 * Filters the BuddyPress Core Admin CSS file path. 888 * 889 * @since 1.6.0 890 * 891 * @param string $file File path for the admin CSS. 892 */ 893 $common_css = apply_filters( 'bp_core_admin_common_css', "{$url}common{$min}.css" ); 894 895 /** 896 * Filters the BuddyPress admin stylesheet files to register. 897 * 898 * @since 2.5.0 899 * 900 * @param array $value Array of admin stylesheet file information to register. 901 */ 902 $styles = apply_filters( 'bp_core_admin_register_styles', array( 903 // Legacy 904 'bp-admin-common-css' => array( 905 'file' => $common_css, 906 'dependencies' => array(), 907 ), 908 ) ); 909 910 911 $version = bp_get_version(); 912 913 foreach ( $styles as $id => $style ) { 914 wp_register_style( $id, $style['file'], $style['dependencies'], $version ); 915 wp_style_add_data( $id, 'rtl', true ); 916 917 if ( $min ) { 918 wp_style_add_data( $id, 'suffix', $min ); 919 } 920 } 921 } 922 923 /** 924 * Register JS commonly used by BuddyPress wp-admin screens. 925 * 926 * @since 2.5.0 927 */ 928 public function admin_register_scripts() { 929 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 930 $url = $this->js_url; 931 932 /** 933 * Filters the BuddyPress admin JS files to register. 934 * 935 * @since 2.5.0 936 * 937 * @param array $value Array of admin JS file information to register. 938 */ 939 $scripts = apply_filters( 'bp_core_admin_register_scripts', array( 940 ) ); 941 942 943 $version = bp_get_version(); 944 945 foreach ( $scripts as $id => $script ) { 946 wp_register_script( $id, $script['file'], $script['dependencies'], $version, $script['footer'] ); 947 } 948 } 891 949 } 892 950 endif; // End class_exists check.
Note: See TracChangeset
for help on using the changeset viewer.