buddypress/bp-xprofile/bp-xprofile-cssjs.php
r-a-y 798f8c4e89 EOF:
* Fall in line with WordPress 3.4 coding practices by removing all EOF closing PHP tags.

* Fixes #4443.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@6342 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2012-09-18 18:03:00 +00:00

44 lines
1.4 KiB
PHP

<?php
/**
* BuddyPress XProfile CSS and JS
*
* @package BuddyPress
* @subpackage XProfileScripts
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Enqueue the CSS for XProfile admin styling
*
* @since BuddyPress (1.1)
*/
function xprofile_add_admin_css() {
if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . "bp-xprofile/admin/css/admin{$min}.css", array(), bp_get_version() );
}
}
add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_css' );
/**
* Enqueue the jQuery libraries for handling drag/drop/sort
*
* @since BuddyPress (1.5)
*/
function xprofile_add_admin_js() {
if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script( 'jquery-ui-mouse' );
wp_enqueue_script( 'jquery-ui-draggable' );
wp_enqueue_script( 'jquery-ui-droppable' );
wp_enqueue_script( 'jquery-ui-sortable' );
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . "bp-xprofile/admin/js/admin{$min}.js", array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() );
}
}
add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_js', 1 );