You can use login_redirect filter. See here http://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect
I think this is what you are looking for.
This will normally redirect all logins. To be able to redirect only when you want, you can use a query string parameter in the URL. Check for the parameter, if it exists redirect.
Try to add this in your template functions.php file:
add_action( 'login_form' , 'glue_login_redirect' );
function glue_login_redirect() {
global $redirect_to;
if (!isset($_GET['redirect_to'])) {
$redirect_to = 'YOURURLHERE';
}
else{
$redirect_to = $_GET['redirect_to'];
}
}
Related Posts:
- Trouble understanding apply_filters()
- How many filter/action hooks are healthy?
- Earliest hook to reliably get $post/$posts
- What does (10, 2) mean when used with add_filter
- Valid characters for actions, hooks and filters
- How to check if a hook is hooked or not?
- How to make post and comment count unclickable with dashboard_glance_items hook
- Hook into admin post list page
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- About Hooks and Filters
- Should I use add_action(‘publish_post or add_filter(‘publish_post?
- Please explain me what the do_action does
- Removing labels and tag on WordPress’s default login form
- Too many actions/filters!
- How to get list of all hooks of current theme / plugin?
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- Customize user account activation message
- Conditionally call add_action depending on post_type?
- Is it possible to track down Actions and Filters?
- When to use actions and when to use filters
- Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?
- Same Conditionals Not Working on Two Different Hooks
- How to call a function or method that is Namespaced using another plugin
- get_header and hook avoid normal call
- Can the wp_filter object hold multiple values with the same key
- Change username before login
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- apply_filters/do_action tag characters limit
- Filter taxonomy admin pagination
- Insert term when page is published – avoid duplicates after edits
- Capture post content before page renders
- Correct method of redirecting user login
- How to remove action with slashes and arrows?
- Changing WordPress core without hacking core
- Comment search plugin
- How can I output all apply_filters and do_action?
- How do I hook my function to run only after submitting login form
- Remove actions/filters that are set with create_function()
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- Remove tags without a specific meta key from “choose from the most used tags”
- How to access page variable inside action hook
- What is the action hook to use if you want to capture the new password during password change?
- Use has_filter on comment_post
- How can I edit comment meta value before it is saved?
- Action hook to control access to certain parts of my site
- Replace Data In Post & Update Meta Field Post Is Saved
- style_loader_tag not changing stylesheet to preload
- How to redirect a unique link based on login status
- Hook to change the site URL
- Hook to add content after date in post?
- Hook inside a hook
- Hook into ‘when user logs in’ [persistent login]
- Can you call a filter hook by “add_action”?
- Change password reqts with NO plugin without breaking resetpass link?
- How do filters and hooks really work in PHP
- Is it possible to use object in add_action?
- Filter hook before create order WooCommerce
- apply_filters() slices away needed arguments
- How to add attribute to output with wp_video_shortcode add_filter
- PHP5, Inheritance, Singleton – action & filter hook limitations
- Is it possible to Hook/Filters Attachment Creation?
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- How to hook some Unicode texts into calendar widget safely?
- How to add attributes to tag when template cannot be directly modified
- WordPress tag cloud add more links
- Yoast SEO hooks overriding themselves
- Removing an action, or dequeueing style – Both not working
- Shortcodes — Using add_action, add_filter in the shortcode
- How can I get my Script to work on the Login page?
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Building a request processor for multi-page forms, etc using $_GET requests
- How to know what filter to use and how to use it?
- What hooks to hook onto for automatic cache clearing
- Modify Redux Framework Options in Child Theme
- How to customize category_description()?
- How to allow code block in wordpress comments
- remove_action: how to access to a method in an child class?
- Set default value for “Additional CSS class(es)” for specific block types
- Change login CSS
- How to redirect non-logged in users to login with post_password_required()
- How to add a filter to the get_body_class function?
- Hook add_attachment error
- How to override include_once pointed file using add_filter?
- How to find list of all functions bind to a particular hook from my plugin?
- Register new user, assign custom role then send email
- Filter page title (displayed in browser tab) of wp-login
- What is the action or filter for adding information under the Permalink in Edit Post/Page?
- output custom Posts on a Page
- Add an attribute to the root from functions.php with add_filter
- Would like to use hook or filters to customize email templates
- add_action with associative array
- Remove image of srcset
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- wp_editor customization
- Passing a parameter to filter and action functions
- What problems could happen if I replaced add_filter and add_action with the function calling
- Adding to an array & passing it through do_action/apply_filters
- Is it possible to make get variable out of filter in Class?
- How do you disable the verification process of user email changes?
- Ninja Forms: Front-End Forms, Post ID?