I figured out a solution that ended up being along the lines of the suggestions offered (though it felt like more work than I should have had to do just to inject some js on the page).
- I appended a variable to my redirection url:
wp_safe_redirect(esc_url(add_query_arg(‘failed_authentication’, ‘1’, ‘/register’))); - I registered the parameter variable using:
add_query_vars_filter($vars) - I registered a function with the wp_footer hook. Inside that function I retrieved the variable — get_query_var(‘failed_authentication’) — and printed my js/jQuery to inject the message (conditioned on that var).
Related Posts:
- jQuery Ajax returning correct Response, but after redirect to 404 Error
- My website frequently redirect to a different advertisement URL
- wp_signon not working fine and 302 moved temporarily?
- JavaScript sleep/wait before continuing [duplicate]
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- What is different between $(document).on() and $(element).on()
- Copy to clipboard using jquery?
- Format date to MM/dd/yyyy in JavaScript
- how to use substr() function in jquery?
- How to change a text with jQuery
- jQuery animate scroll
- jQuery removing ‘-‘ character from string
- SON Post with Customized HTTPHeader Field
- Bootstrap collapse isn’t working; hamburger menu not showing up
- How to manage a redirect request after a jQuery Ajax call
- Easiest way to toggle 2 classes in jQuery
- $.widget is not a function
- Get a form action/url with jquery
- Is this Solution for Caches vs Cookies Going to Get Me in Trouble?
- How to control what jQuery version to include, with wp_enqueue_script
- Creating Ajax backend for Specialised Page Template? Should admin-ajax.php be used?
- Best Practices for Seperating jQuery from HTML/PHP
- Infinite scroll / lazy loading with NextGen Gallery [closed]
- Using Underscore Templates in WordPress
- jquery & ajax getting data to php in wordpress
- AJAX returns response 0
- Including javascript for a shortcode
- WordPress Featured Post Slider
- adding the full image path to a wordpress javascript file
- Unable to run jQuery script in my template file
- How disable checkbox when listbox value changes in tinymce
- validate a metabox based on the category that is selected
- Dropzonejs with WPCF7 [closed]
- Edit single attachment on click (WP-admin)
- wp_mail very slow
- Unable to uncheck checkbox with jquery in wp admin
- Ajax not posting form data to query in PHP function
- Front-end Ajax File Upload
- gravity forms jQuery.load into modal [closed]
- jQuery.accordion isn’t a function even when enqueued
- “TypeError: ((n.event.special[g.origType] || {}).handle || g.handler).apply is not a function” error from jquery.js?ver=1.12.4-wp library
- How Can I Add “New” Lazy Load Images To NewsPaper WP Theme? [closed]
- WooCommerce Ajax Cart Update Stopped Working
- WordPress AJAX Load More function duplicating a post
- Send multiple attachments with JQuery and wp_mail() function
- Plugins loading multiple copies of JQuery
- How to wp_enqueue_script jQuery inside a Plugin
- jQuery accordion plugin won’t work once used in WP
- TinyMCE plugin won’t work with jQuery 3.5.1 (testing with “Test jQuery Updates”)
- What is the propre way to include jQuery UI Datepicker’s CSS in plugin?
- How register library to use jquery correct
- Why use admin-ajax.php when loading pages through AJAX?
- How do I translate string inside jQuery script with WPML?
- Using Foundation 5 in WordPress Administration Area
- change order of add_action hooks for jquery to be loaded first
- include shortcode values in Thickbox form
- specifying relative file paths in WP with jQuery requests not working
- Can’t delete the default jQuery in the theme
- WordPress jQuery crash [closed]
- How do I get my suggest to only suggest one taxonomy?
- Delete post image attachments with jQuery from the front end
- Conditional Tags – Multiple Categories
- Does WordPress support Plupload chunking when uploading asynchronously?
- Recommended Use of Bootstrap, or JQuery-UI in WP/plugin development?
- Using Jquery submit with ajax request
- Slider’s missing navigation
- Assigning tags to a post from front end using tag-it jquery UI plugin
- wordpress before or after javascript problem
- Converting a working AJAX form to work with WordPress
- ajax not working in plugin
- Accept a-z and 0-9 (restrict a-z to be lowercase without accents like ñ or ó)
- wp not defined at wp.Uploader.prototype
- Get selected image URL from wp.media.editor.attachment into text input fails. What am I doing wrong?
- How to update WordPress jQuery version?
- How to use $ with externally loaded javascript
- Customizer add query to preview URL
- Pass jquery variable to php function and run it
- jQuery function not working in WordPress but works in jsfiddle
- How to send json data to jquery
- Reload selected post in multiple post query with ajax
- Change button text with user name using jQuery after user login
- Is there a way to move WPML scripts in footer?
- Bootstrap with separate js File
- How to get this jQuary script working?
- Possibility of creating a folder in the wordpress root install and installing a file there, all via plugin?
- Disable drag metaboxes, create many functions using js not to work!
- Load more button
- All post attachments in gallery grid to full screen slideshow?
- wordpress plugin setting page not enqueueing jquery?
- Customize wp-admin form custom fields
- Convert WordPress SACK code to new admin-ajax
- Create a short code that inserts js
- Custom jQuery plugin not working
- jQuery to work on WP custom page template
- ACF link withing website is good, but not external link?
- How do I load this jQuery to my wordpress page?
- Dynamically populate Cascading Dropdown from MySQL using JQuery/AJAX [closed]
- WP Supersized & Easy Fancybox Conflict
- How to Supply Console Logs Data into the WooCommerce Cart?
- CF7 Populate Text Field Based On Checkbox Checked