diff --git a/.gitignore b/.gitignore
index 47b60df71..e29dea408 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ node_modules/
inc/log.txt
log.txt
includes/log.txt
+vendor
\ No newline at end of file
diff --git a/admin/class-convertkit-settings.php b/admin/class-convertkit-settings.php
index e317faf44..2eff06da4 100644
--- a/admin/class-convertkit-settings.php
+++ b/admin/class-convertkit-settings.php
@@ -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
@@ -59,6 +61,21 @@ 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
*/
@@ -85,35 +102,35 @@ public function display_settings_page() {
}
?>
-
| ';
// Check for error in response.
if ( isset( $forms[0]['id'] ) && '-2' === $forms[0]['id'] ) {
diff --git a/admin/section/class-convertkit-settings-contactform7.php b/admin/section/class-convertkit-settings-contactform7.php
index 4e5917e51..bd0346362 100644
--- a/admin/section/class-convertkit-settings-contactform7.php
+++ b/admin/section/class-convertkit-settings-contactform7.php
@@ -224,7 +224,7 @@ public function cf7_form_callback( $args ) {
$cf7_form_id = $args['cf7_form_id'];
$forms = $args['forms'];
- $html = sprintf( ' |
---|