Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
Fixes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
bkader committed May 28, 2018
1 parent 2dcb1ab commit 6b63605
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 203 deletions.
20 changes: 10 additions & 10 deletions content/themes/default/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,25 +208,25 @@ public function after_theme_setup() {

// Load Font Awesome.
if ( ENVIRONMENT === 'development') {
add_style( 'opensans', 'assets/css/open-sans.min', null, true);
add_style( 'fontawesome', get_common_url( 'css/font-awesome.min' ), null, true);
add_style( 'bootstrap', 'assets/css/bootstrap.min', null, true);
add_script( 'bootstrap', 'assets/js/bootstrap.min');
add_style( 'opensans', get_theme_url('assets/css/open-sans.min.css', ''), null, true);
add_style( 'fontawesome', get_common_url( 'css/font-awesome.min.css', ''), null, true);
add_style( 'bootstrap', get_theme_url('assets/css/bootstrap.min.css', ''), null, true);
add_script( 'bootstrap', get_theme_url('assets/js/bootstrap.min.js', ''));
} else {
add_style( 'opensans', 'https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i', null, true);
add_style( 'opensans', 'https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i', null, true);
add_style( 'fontawesome', 'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', null, true);
add_style( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', null, true);
add_script( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js');
add_style( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', null, true);
add_script( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js');
}

// Load main theme style.
add_style( 'style', 'style', null, true);
add_style( 'style', get_theme_url('style.min.css', ''), null, true);

// Right to left language?
if (langinfo('direction' ) === 'rtl' )
{
add_style( 'bootstrap-rtl', 'assets/css/bootstrap-rtl.min', null, true);
add_style( 'style-rtl', 'style-rtl', null, true);
add_style( 'bootstrap-rtl', get_theme_url('assets/css/bootstrap-rtl.min.css', ''), null, true);
add_style( 'style-rtl', get_theme_url('style-rtl.min.css', ''), null, true);
}
}

Expand Down
26 changes: 14 additions & 12 deletions skeleton/core/Admin_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,13 @@ public function _remap($method, $params = array())
? array_clean($this->styles)
: array_unique(array_filter(array_map('trim', $this->styles)));

$this->theme
->no_extension()
->add('css', admin_url('load/styles?load='.implode(',', $this->styles), 'http'), null, null, true);
$this->theme->add(
'css',
admin_url('load/styles?load='.implode(',', $this->styles), ''),
null, // No handle.
null, // No version.
true // At the top
);
}

// Do we have any JS files to laod?
Expand All @@ -183,17 +187,15 @@ public function _remap($method, $params = array())
? array_clean($this->scripts)
: array_unique(array_filter(array_map('trim', $this->scripts)));

$this->theme
->no_extension()
->add('js', admin_url('load/scripts?load='.implode(',', $this->scripts), 'http'), null, null, true);
$this->theme->add(
'js',
admin_url('load/scripts?load='.implode(',', $this->scripts), ''),
null, // No handle.
null, // No version.
true // At the top
);
}

/**
* We make sure to make theme library put back extensions.
* @since 1.5.0
*/
$this->theme->do_extension();

/**
* Admin menu is called only of method that load views.
* @since 2.1.0
Expand Down
Loading

0 comments on commit 6b63605

Please sign in to comment.