use a single nonce in three different nonce field

You can pass multiple nonces with wp_localize_script() by just including them as separate properties in the ajax_login_object object. wp_localize_script( ‘ajax-login-script’, ‘ajax_login_object’, array( ‘ajax_url’ => admin_url( ‘admin-ajax.php’ ), ‘login_nonce_token’ => wp_create_nonce( ‘login_nonce’ ), ‘register_nonce_token’ => wp_create_nonce( ‘register_nonce’ ), ‘lostpassword_nonce_token’ => wp_create_nonce( ‘lostpassword_nonce’ ), ) ); Then in your JS, use the correct one from your localize … Read more

Proper use of Output Buffer for a whole php clas

Your code does not need to use output buffering anywhere. There’s nowhere that you need it. Your shortcode function is already properly using return for the output output, so nothing needs to be captured, and your popup_bootmodal_form() function is outputting in wp_footer, which is fine, and doesn’t need to be captured either.

Error Handling when building WordPress themes

When developing it’s a good idea to enable debugging, as described in this article in the developer handbook. Essentially in wp-config.php you want to define the WP_DEBUG as true. define( ‘WP_DEBUG’, true ); This will cause WordPress to output more errors and warnings to the screen, which can help finding issues. You can also log … Read more

WordPress wp_get_current_user returning blank values until refresh

Your header.php file is going to be called after the init action. If you want the logic to run in your header.php file first, maybe you can hook into another action done at a later point in WordPress: add_action(‘wp_head’, ‘ax_get_user_info’); function avox_get_user_info() { if (is_user_logged_in()) { $currentUser = wp_get_current_user(); $fName = $currentUser->user_firstname; } return $fName; … Read more