Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/deactivate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions js/src/deactivate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global window wp cloudinaryApi */
/* global window wp CLD_Deactivate */

const Deactivate = {
// The link that triggers the ThickBox
Expand Down Expand Up @@ -58,13 +58,13 @@ const Deactivate = {
// Add event listener to submit the feedback.
context.submitButton.addEventListener( 'click', function() {
wp.ajax.send( {
url: cloudinaryApi.endpoint,
url: CLD_Deactivate.endpoint,
data: {
reason: context.reason,
more: context.more?.value,
},
beforeSend: function( request ) {
request.setRequestHeader( 'X-WP-Nonce', cloudinaryApi.nonce );
request.setRequestHeader( 'X-WP-Nonce', CLD_Deactivate.nonce );
},
} ).always( function() {
window.location.href = context.deactivationUrl;
Expand Down
2 changes: 1 addition & 1 deletion php/class-deactivation.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function enqueue_scripts() {
wp_enqueue_script( 'cloudinary-deactivation', $this->plugin->dir_url . 'js/deactivate.js', array(), $this->plugin->version, true );
wp_localize_script(
'cloudinary-deactivation',
'cloudinaryApi',
'CLD_Deactivate',
array(
'endpoint' => rest_url( REST_API::BASE . '/' . self::$internal_endpoint ),
'nonce' => wp_create_nonce( 'wp_rest' ),
Expand Down