mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-07 19:25:44 +03:00
Hook up "Remove" button
This commit is contained in:
parent
d5c740ae84
commit
eacd2bf3f2
4 changed files with 59 additions and 11 deletions
|
@ -480,7 +480,18 @@ function enqueue_assets() {
|
|||
|
||||
$ver = filemtime( FiveForTheFuture\PATH . '/assets/js/admin.js' );
|
||||
wp_register_script( '5ftf-admin', plugins_url( 'assets/js/admin.js', __DIR__ ), [ 'jquery' ], $ver );
|
||||
wp_localize_script( '5ftf-admin', 'FiveForTheFuture_ManageNonce', wp_create_nonce( 'manage-pledge' ) );
|
||||
|
||||
$script_data = [
|
||||
'manageNonce' => wp_create_nonce( 'manage-pledge' ),
|
||||
];
|
||||
wp_add_inline_script(
|
||||
'5ftf-admin',
|
||||
sprintf(
|
||||
'var FiveForTheFuture = JSON.parse( decodeURIComponent( \'%s\' ) );',
|
||||
rawurlencode( wp_json_encode( $script_data ) )
|
||||
),
|
||||
'before'
|
||||
);
|
||||
|
||||
$current_page = get_current_screen();
|
||||
if ( Pledge\CPT_ID === $current_page->id ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue