Skip to content

Commit

Permalink
Add back enqueueing the backend js
Browse files Browse the repository at this point in the history
This was removed in 0bab295
  • Loading branch information
tnorthcutt committed Jan 16, 2019
1 parent 0fc02fd commit 40a9e85
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions admin/class-convertkit-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function __construct() {
add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
add_action( 'admin_init', array( $this, 'register_sections' ) );

add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );

// AJAX callback for TinyMCE button to get list of tags
add_action( 'wp_ajax_convertkit_get_tags', array( $this, 'get_tags' ) );
// Function to output
Expand All @@ -59,6 +61,20 @@ public function __construct() {
}
}

/**
* Enqueue Scripts in Admin
*
* @param $hook
*/
public function enqueue_scripts( $hook ) {
if ( 'settings_page__wp_convertkit_settings' === $hook ) {
wp_enqueue_script( 'ck-admin-js', plugins_url( '../resources/backend/wp-convertkit.js', __FILE__ ), array( 'jquery' ), CONVERTKIT_PLUGIN_VERSION, true );
wp_localize_script( 'ck-admin-js', 'ck_admin', array(
'option_none' => __( 'None', 'convertkit' ),
));
}
}

/**
* Add the options page
*/
Expand Down

0 comments on commit 40a9e85

Please sign in to comment.