• Resolved Scott Kingsley Clark

    (@sc0ttkclark)


    Here’s the problem code in the file: digital-download/inc/custom-functions.php

    if( ! function_exists( 'digital_download_update_admin_notice' ) ) :
    /**
     * Updating admin notice on dismiss
    */
    function digital_download_update_admin_notice(){
        if (!current_user_can('manage_options')) {
            exit;
        }
    
        // Bail if the nonce doesn't check out
        if ( isset( $_GET['digital_download_admin_notice'] ) && $_GET['digital_download_admin_notice'] = '1' && wp_verify_nonce( $_GET['_wpnonce'], 'digital_download_admin_notice' )) {
            update_option( 'digital_download_admin_notice', true );
        }
    }
    endif;
    add_action( 'admin_init', 'digital_download_update_admin_notice' );

    The exit; there is the problem, it should be doing a return;

    Also the logic for that $_GET conditional is broken because it sets the $_GET to ‘1’. You should be doing a === check there instead.

Viewing 1 replies (of 1 total)
  • Thread Starter Scott Kingsley Clark

    (@sc0ttkclark)

    It looks like you saw my post and implemented both fixes in your latest release. Thank you.

Viewing 1 replies (of 1 total)
  • The topic ‘Admin AJAX / Checkout broken with digital_download_update_admin_notice’ is closed to new replies.