Skip to content

Commit

Permalink
Add edd_force_load_scripts filter
Browse files Browse the repository at this point in the history
Extensions can use `add_filter('edd_force_load_scripts',
'__return_true');` to have EDD scripts to load on their page.
  • Loading branch information
zackkatz committed Mar 5, 2014
1 parent 5b36292 commit 31895b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/scripts.php
Expand Up @@ -144,10 +144,10 @@ function edd_register_styles() {
*/
function edd_load_admin_scripts( $hook ) {
global $wp_version,$typenow,$plugin_page;

// Make sure we're on an EDD page: either "download" post type, or `?page=edd-*`
if($typenow !== 'download' && strpos($plugin_page, 'edd-') === false) { return; }
if($typenow !== 'download' && strpos($plugin_page, 'edd-') === false && apply_filters( 'edd_force_load_scripts', false ) === false) { return; }

$js_dir = EDD_PLUGIN_URL . 'assets/js/';
$css_dir = EDD_PLUGIN_URL . 'assets/css/';

Expand Down

0 comments on commit 31895b3

Please sign in to comment.