Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

The EDD CSS files were too aggressively loaded #2098

Closed
wants to merge 2 commits into from

4 participants

@zackkatz

The jQuery UI scripts in particular were being used throughout the admin and altering non-EDD page layouts.

@zackkatz zackkatz The EDD CSS files were too aggressively loaded
The jQuery UI scripts in particular were being used throughout the admin and altering non-EDD page layouts.
5b36292
@chriscct7
Owner

Hi there,
Thanks for the pull request :+1: . This indeed was a topic we wanted to revisit for 2.0.

You need to add a filter so extensions can also hook in. Alot of EDD extensions are built using those jQuery UI css files, and have pages that won't qualify as under the downloads post type or start using edd for the page names.

Also, this patch needs to be submitted to the release/2.0 or release/2.1, since we'll need to give some time for the affected extension authors to update their extensions to use the aforementioned filter.

I'm personally thinking 2.1 at the moment, but we'll discuss this later today and get back to you.

In the meantime, if you need to dequeue the UI files, you can use this: http://wordpress.org/support/topic/edd-is-loading-jquery-ui-css-on-non-edd-admin-pages?replies=4

@chriscct7 chriscct7 added this to the 2.0 milestone
@chriscct7 chriscct7 self-assigned this
@zackkatz zackkatz Add `edd_force_load_scripts` filter
Extensions can use `add_filter('edd_force_load_scripts',
'__return_true');` to have EDD scripts to load on their page.
31895b3
@zackkatz

Hi Chris,
I've added the edd_force_load_scripts filter to override the page check. I wasn't sure what the name of the filter should be...

Let me know which version I should submit to. Thanks!

@coveralls

Coverage Status

Coverage remained the same when pulling 31895b3 on zackkatz:patch-1 into e57e274 on easydigitaldownloads:master.

@pippinsplugins

Another alternate method for this has been proposed here: #2077

@zackkatz

Right, @pippinsplugins - I like #2077 better.

@zackkatz zackkatz closed this
@pippinsplugins

Cool, so do I :)

@zackkatz zackkatz deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2014
  1. @zackkatz

    The EDD CSS files were too aggressively loaded

    zackkatz authored
    The jQuery UI scripts in particular were being used throughout the admin and altering non-EDD page layouts.
  2. @zackkatz

    Add `edd_force_load_scripts` filter

    zackkatz authored
    Extensions can use `add_filter('edd_force_load_scripts',
    '__return_true');` to have EDD scripts to load on their page.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 includes/scripts.php
View
5 includes/scripts.php
@@ -143,7 +143,10 @@ function edd_register_styles() {
* @return void
*/
function edd_load_admin_scripts( $hook ) {
- global $wp_version;
+ 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 && apply_filters( 'edd_force_load_scripts', false ) === false) { return; }
$js_dir = EDD_PLUGIN_URL . 'assets/js/';
$css_dir = EDD_PLUGIN_URL . 'assets/css/';
Something went wrong with that request. Please try again.