1add_action('admin_menu', function () {
2 $settingsPage = add_options_page('Settings', 'Mortgage Calculator', 'manage_options', 'mortgagecalculator', function () {
3 echo "<div id='app'></div>";
4 });
5 /**
6 * Include the ember admin scripts only on pages where it's needed.
7 */
8 add_action("admin_enqueue_scripts", function ($hook) use ($settingsPage){
9 if($hook !== $settingsPage){
10 return;
11 }
12 // Remove default jQuery since Ember provides its own.
13 wp_dequeue_script('jquery');
14 wp_enqueue_script('ember-vendor', plugins_url("admin/assets/vendor.js", __FILE__));
15 wp_enqueue_script('ember-project', plugins_url("admin/assets/mortgage-plugin-ember-admin.js", __FILE__), ['ember-vendor']);
16 wp_enqueue_script('ember-live-reload', "http://localhost:4200/ember-cli-live-reload.js");
17 });
18});
19
1function my_enqueue($hook) {
2if ( 'bookings' != $hook ) {
3 return;
4}
5if ( is_admin() ) {
6wp_enqueue_style('datatablecss','//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' );
7wp_enqueue_style('datatablecss2','//cdn.datatables.net/1.10.16/css/dataTables.bootstrap.min.css' );
8wp_enqueue_script('datatablejs','//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js',array(),'1.0',false);
9wp_enqueue_script('datatablejs2','//cdn.datatables.net/1.10.16/js/dataTables.bootstrap.min.js',array(),'1.0',false);}
10add_action( 'wp_enqueue_scripts', 'my_enqueue' );
11}
12