mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 10:05:43 +03:00
Add a "remove pledge" action
This commit is contained in:
parent
fa8bb48ad6
commit
fedfface23
5 changed files with 45 additions and 4 deletions
|
@ -549,13 +549,14 @@ function enqueue_assets() {
|
|||
|
||||
$pledge_id = is_admin() ? get_the_ID() : absint( $_REQUEST['pledge_id'] ?? 0 );
|
||||
$auth_token = sanitize_text_field( $_REQUEST['auth_token'] ?? '' );
|
||||
$script_data = [
|
||||
$script_data = array(
|
||||
// The global ajaxurl is not set on the frontend.
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
|
||||
'pledgeId' => $pledge_id,
|
||||
'manageNonce' => wp_create_nonce( 'manage-contributors' ),
|
||||
'authToken' => $auth_token,
|
||||
];
|
||||
'removePrompt' => __( 'Are you sure you want to remove this pledge?', 'wporg-5ftf' ),
|
||||
);
|
||||
wp_add_inline_script(
|
||||
'5ftf-admin',
|
||||
sprintf(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue