Skip to content

Commit

Permalink
Merge pull request WebDevStudios#3 from destos/master
Browse files Browse the repository at this point in the history
Class and its related files can now be placed anywhere in the theme or wp-content directory.
  • Loading branch information
norcross committed May 19, 2011
2 parents cfd80fc + 12615bc commit b3dee43
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ function check_text( $text ) {
}


/*
* Script url to load local resources.
*/

define( CMB_META_BOX_URL, trailingslashit( str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname(__FILE__) ) ) );

/**
* Create meta boxes
*/
Expand Down Expand Up @@ -325,7 +331,7 @@ function save( $post_id) {

function cmb_scripts( $hook ) {
if ( $hook == 'post.php' OR $hook == 'post-new.php' OR $hook == 'page-new.php' OR $hook == 'page.php' ) {
wp_register_script( 'cmb-scripts', get_bloginfo('stylesheet_directory').'/lib/metabox/jquery.cmbScripts.js', array('jquery','media-upload','thickbox'));
wp_register_script( 'cmb-scripts', CMB_META_BOX_URL.'jquery.cmbScripts.js', array('jquery','media-upload','thickbox'));
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery-ui-core' ); // Make sure and use elements form the 1.7.3 UI - not 1.8.9
wp_enqueue_script( 'media-upload' );
Expand Down Expand Up @@ -370,7 +376,7 @@ function cmb_editor_footer_scripts() { ?>
add_action('admin_print_footer_scripts','cmb_editor_footer_scripts',99);

function cmb_styles_inline() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/lib/metabox/style.css" />';
echo '<link rel="stylesheet" type="text/css" href="' . CMB_META_BOX_URL.'style.css" />';
// For some reason this script doesn't like to register
?>
<style type="text/css">
Expand Down

0 comments on commit b3dee43

Please sign in to comment.