I had to do it with WordPress’s inbuilt redirect function; wp_redirect();
wp_redirect( $payment->getPaymentUrl() );
exit;
Related Posts:
- Session management issues with WordPRess 404 Error page
- Difference between after_setup_theme and init action hooks?
- Use wp init hook to call other hooks?
- Hook for URL Request
- wp_redirect() not working on form submission with init hook
- What is the best filter where to use register_block_type?
- How to get session token of current user in wp_login hook?
- Get log of function/method calls made by do_action() on WordPress initialization
- Plugins rewrite rules the right way
- Issues with if, else, and elseif statements
- How can I modify the header of RSS feed items?
- How to read and write session data?
- Moving Javascript from footer to header
- WP_mail() Issue. Duplicate emails if $_GET[‘A’] == email
- Function Hooked on Init Running Multiple Times
- Init hook for header send
- How to hook update_post_meta and delete_post_meta?
- Are there any hooks that alter the 404 logic?
- Which hook should be used to add an action containing a redirect?
- WooCommerce: change display order of product short description and price [closed]
- Add_action to wp_head via functions.php
- Is there a WordPress core & plugins update action hook?
- trigger save_post event programmatically
- Implementing advanced add_* function wrappers
- My add_action (wp_footer, ‘method’) is not calling?
- Hook into wp_head(); in a plugin
- is it possible to get the hook name in add_action?
- What hook is executed just after wp_query has been executed?
- How can I hook into the post editor title field in order to change the HTML?
- How to properly test a method that is called by an action hook
- How can I do customizations on login, registration and password recovery forms?
- WordPress v5.0.3 Gutenberg & JS error “Uncaught SyntaxError: missing ) after argument list”
- Custom form action hook
- How to send an automated user ‘inactivity’ email?
- How do I successfully create a hook for an email override?
- Cast string to number
- How to debug user_register hook
- Storing state between hook functions
- Using wp_editor tinyMCE in metabox cause form alert on leaving page
- What’s the difference between “wp” and “wp_loaded”?
- WordPress capabilities and restricted categories access
- Query categories that have a description
- How to use custom form on add_meta_boxes callback
- Is it possible to switch Gutenberg’s editor styles when document settings change?
- schedule event in class oriented plugin
- load-* hook for dashboard
- Having Issue on Redirecting With Session in WordPress
- I don’t understand how add_action and do_action work in tandem. The former executes the code already…what is do_action for?
- Insert HTML in post, below nav bar but above content?
- Convert Gravity Form Entry Date on Export
- Hook Adding content after title
- Fatal error: Call to a member function get_queried_object_id()
- Use an array of page template slugs and $hook
- “admin_enqueue_scripts” hook or $_GET[‘page’]?
- Can’t Access Sessions or Variables through pages
- How to add content to suscriptor dashboard frontend?
- Add PHP code to header section from plugin
- How to change a WordPress term’s slug before saving
- dynamic add_action according to child pages (for homepage control)
- Remove action in a parent theme from the child theme
- Remove action within a class in a parent theme’s includes folder from the child theme
- Action hook save_post for newly created posts – $post object data is all empty
- add_filter to the_content from plugin function
- Add html code in admin page
- What hook should I use that will fire whenever I open a post for editing in the WP back-end?
- Can not using get_header() cause trouble (later on)?
- Is there a author_update action?
- How to set Media Box form elements default value?
- How to get product information using hooks?
- Print additional fields in wp_new_user_notification_email_admin
- Creating custom post on registration in wordpress?
- Display custom user profile fields in wordpress
- profile_update not supplying old data
- remove_action not working for a function
- Is there no concise way, a library maybe, to help with unhooking class functions and so on?
- Debug a WP install: how to find which functions write post updates during a process (a woocommerce checkout in my case)
- What hook should I use to add post meta data with on update?
- add_image_size not working with after_switch_theme
- Problem with call_user_func_array front end
- How to I prevent WordPress from switching external HTTP links to HTTPS?
- Stylesheet is getting removed/deregistered automatically
- How to override get_avatar() function?
- add extra parameter in default hook in wordpress
- Change user role if it’s orders count more than
- Exclude WooCommerce terminations from YOAST
- set_post_format called after wp_update_post when using bulk edit?
- save_post hook – headers already sent?
- How to hook watchdog script for existence of a WP page?
- Using actions, hooks and filters in a non-WordPress page
- Hook into create_category
- Trouble adding data to options table
- How to hook into publish_posttype?
- How to add a new link to the default register form’s footer links?
- $GLOBALS & global doesn’t work [closed]
- Hooks not working on live server
- Do New_to_publish hooks work for custom post types
- Creating my own “recent blog posts” static Gutenberg block, can’t use react hooks in the frontend
- How do I set a custom post type Category after import using wp_set_post_terms
- How can I get the ID before after_setup_theme?
- Hook on opening a media/document