diff --git a/src/admin/gallery.php b/src/admin/gallery.php index 7d5f727..c65fea5 100644 --- a/src/admin/gallery.php +++ b/src/admin/gallery.php @@ -23,20 +23,6 @@ function gallery_app_init($hook) { // Wordpress Media Library Dialog wp_enqueue_media(); - // Image Cropping Library - /*wp_enqueue_style( - 'cropper-css', - 'https://unpkg.com/cropperjs@2.1.0/dist/cropper.css', - array(), - null - ); - wp_enqueue_script( - 'cropper-js', - 'https://unpkg.com/cropperjs@2.1.0/dist/cropper.js', - array(), - null - );*/ - /* * Own scripts */ @@ -51,6 +37,12 @@ function gallery_app_init($hook) { array( 'jquery', 'jcrop' ) ); + wp_localize_script( 'theatergf-gallery-admin-js', 'wpAPISettings', array( + 'root' => esc_url_raw( rest_url() ), + 'nonce' => wp_create_nonce( 'wp_rest' ) + )); + } add_action('admin_enqueue_scripts', 'TheaterGF\Gallery\Admin\gallery_app_init'); + diff --git a/src/admin/gallery/html.php b/src/admin/gallery/html.php index 11eeeac..f614ed4 100644 --- a/src/admin/gallery/html.php +++ b/src/admin/gallery/html.php @@ -9,13 +9,11 @@ function admin_gallery_html($args) {