From 90db79a7060eef402eb6a079a9b7cceeb1075b05 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Tue, 20 Jun 2017 12:01:28 -0300 Subject: [PATCH] Update Assets call. --- functions.php | 9 +++++---- theme-information.php | 12 ------------ 2 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 theme-information.php diff --git a/functions.php b/functions.php index 6b59ec696..92ae84b21 100644 --- a/functions.php +++ b/functions.php @@ -29,8 +29,8 @@ * ------------------------------------------------------------------------ */ function pressbooks_book_info_page () { - $assets_pb = new Assets( 'pressbooks', 'assets/dist', 'plugin' ); - $assets = new Assets( 'pressbooks-book', 'dist', 'theme' ); + $assets = new Assets( 'pressbooks-book', 'theme' ); + $assets->setSrcDirectory( 'assets' )->setDistDirectory( 'dist' ); if ( is_front_page() ) { wp_enqueue_style( 'pressbooks-book-info', $assets->getPath( 'styles/book-info.css' ), [], null, 'all' ); @@ -41,7 +41,7 @@ function pressbooks_book_info_page () { wp_enqueue_script( 'columnizer-load', $assets->getPath( 'scripts/columnizer-load.js' ), [ 'jquery', 'columnizer' ], '1.7.0', false ); // Sharer.js - wp_enqueue_script( 'sharer', $assets_pb->getPath( 'scripts/sharer.js' ) ); + wp_enqueue_script( 'sharer', $assets->getPath( 'scripts/sharer.js' ) ); } } add_action( 'wp_enqueue_scripts', 'pressbooks_book_info_page' ); @@ -75,7 +75,8 @@ function pressbooks_async_scripts( $tag, $handle, $src ) { * Register and enqueue scripts and stylesheets. * ------------------------------------------------------------------------ */ function pb_enqueue_scripts() { - $assets = new Assets( 'pressbooks-book', 'dist', 'theme' ); + $assets = new Assets( 'pressbooks-book', 'theme' ); + $assets->setSrcDirectory( 'assets' )->setDistDirectory( 'dist' ); wp_enqueue_style( 'pressbooks/structure', $assets->getPath( 'styles/structure.css' ), [], '1.7.0', 'screen, print' ); wp_enqueue_style( 'pressbooks/webfonts', 'https://fonts.googleapis.com/css?family=Oswald|Open+Sans+Condensed:300,300italic&subset=latin,cyrillic,greek,cyrillic-ext,greek-ext', false, null ); diff --git a/theme-information.php b/theme-information.php deleted file mode 100644 index 64377a003..000000000 --- a/theme-information.php +++ /dev/null @@ -1,12 +0,0 @@ - - * @license GPLv2 (or any later version) - */ - -/* ------------------------------------------------------------------------ * - * Provide Pressbooks with some information about this theme. - * ------------------------------------------------------------------------ */ - -$supported_languages = array( -); \ No newline at end of file