Skip to content

Commit

Permalink
Fix wp_enqueue_media script being loaded incorrectly causing inadverd…
Browse files Browse the repository at this point in the history
…ent behavior closes #376
  • Loading branch information
roykho committed Feb 23, 2018
1 parent a6749c0 commit eb3edfb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
17 changes: 13 additions & 4 deletions includes/abstracts/abstract-wc-gateway-ppec.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,22 @@ public function __construct() {
$this->description = $this->get_option( 'description' );
}
} else {
// Image upload.
wp_enqueue_media();

wp_enqueue_script( 'wc-gateway-ppec-settings', wc_gateway_ppec()->plugin_url . 'assets/js/wc-gateway-ppec-settings.js', array( 'jquery' ), wc_gateway_ppec()->version, true );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
}
}

/**
* Enqueues admin scripts.
*
* @since 1.5.2
*/
public function enqueue_scripts() {
// Image upload.
wp_enqueue_media();

wp_enqueue_script( 'wc-gateway-ppec-settings', wc_gateway_ppec()->plugin_url . 'assets/js/wc-gateway-ppec-settings.js', array( 'jquery' ), wc_gateway_ppec()->version, true );
}

/**
* Initialise Gateway Settings Form Fields.
*/
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ Please use this to inform us about bugs, or make contributions via PRs.

== Changelog ==

= 1.5.3 - 2018-xx-xx =
* Fix - wp_enqueue_media was not correctly loaded causing weird behavior with other parts of system wanting to use it.

= 1.5.2 - 2018-02-20 =
* Tweak - Express checkout shouldn't display "Review your order before the payment".
* Fix - Compatibility with Subscriptions and Checkout from Single Product page.
Expand Down

0 comments on commit eb3edfb

Please sign in to comment.