@@ -46,6 +46,37 @@ public static function instance() {
46
46
return self ::$ instance ;
47
47
}
48
48
49
+ /**
50
+ * Registers available blocks.
51
+ *
52
+ * @since 1.0.0
53
+ */
54
+ public function set_up_ajax () {
55
+ $ ajax_js = '../scripts/scan-runner.js ' ;
56
+
57
+ global $ wp_query ;
58
+
59
+ wp_register_script ( 'tide-checker ' , plugins_url ( $ ajax_js , __FILE__ ), array ( 'jquery ' ), '1.0 ' , true );
60
+
61
+ wp_enqueue_script (
62
+ 'tide-checker ' ,
63
+ plugins_url ( $ ajax_js , __FILE__ ),
64
+ array ( 'jquery ' ),
65
+ '1.0 ' ,
66
+ true
67
+ );
68
+
69
+ wp_localize_script (
70
+ 'tide-checker ' ,
71
+ 'checkerList ' ,
72
+ array (
73
+ 'pluginList ' => $ this ->generate_directory_list (),
74
+ 'themeList ' => 'tbd ' ,
75
+ 'userOptions ' => 'some user options ' ,
76
+ )
77
+ );
78
+ }
79
+
49
80
/**
50
81
* Tool Page initialization.
51
82
*/
@@ -60,6 +91,7 @@ public function init() {
60
91
61
92
// Load our JavaScript.
62
93
add_action ( 'admin_enqueue_scripts ' , array ( $ instance , 'admin_enqueue ' ) );
94
+ add_action ( 'admin_enqueue_scripts ' , array ( $ instance , 'set_up_ajax ' ) );
63
95
64
96
// The action to run the compatibility test.
65
97
// add_action( 'wp_ajax_wpephpcompat_start_test', array( $instance, 'start_test' ) );
@@ -452,7 +484,7 @@ public function admin_enqueue( $hook ) {
452
484
wp_enqueue_style ( 'wpephpcompat-style ' , plugins_url ( '/styles/css/style.css ' , __FILE__ ), array (), $ version );
453
485
454
486
// Scripts.
455
- wp_enqueue_script ( 'wpephpcompat-ajax ' , plugins_url ( '/scripts/starter-script.js ' , __FILE__ ), array ( 'jquery ' ), $ version );
487
+ // wp_enqueue_script( 'wpephpcompat-ajax', plugins_url( '/scripts/starter-script.js', __FILE__ ), array( 'jquery' ), $version );
456
488
457
489
/**
458
490
* Strings for i18n.
0 commit comments