Firest of all you have to make sure that is_page() is right. I think the right syntax is
is_page( 'min-konto' )
or
is_page($pageid)
then the function should be
if( is_page( $account_settings_page_id ) && is_user_logged_in() ) {
wp_redirect( home_url( '/dashboard/' ) );
exit();
}
Related Posts:
- template_redirect action only firing if logged in
- Postback redirect through add_action is not triggered
- Trying to use add_action and do_action with parameters
- How to use the do_action () with parameter
- Perform an action when post is updated/published
- Extract image from content and set it as the featured image
- Do WordPress’ cron’s clean up expired transients?
- Refresh page after form action
- How to restrict actions and filters “properly” by conditions
- How to count number of functions attached to an action hook?
- Masking logout URL
- Logout/login redirect CSS issue
- How can I tell if I’m on a login page? [duplicate]
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- Change meta tags programatically
- redirect wp-login.php to another page
- Convert hyphen to underscore in permalinks
- Using get_terms for custom taxonomy in functions.php
- Fatal error: Call to undefined function add_action() – an untouched problem
- Reuse variable in hook callback
- Call to undefined add_action() in theme’s functions.php
- How do I redirect upon login a specific user based on role?
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Can’t Update function.php after writing short code
- How to update feed only 2-3 times a week (for Feedburner email)?
- Passing arguments to my function with do_action and add_action is not working
- How to select a page within admin?
- How to manage arrays from custom functions stored in functions.php?
- How do I pass arguments for multiple functions hooked to a single action?
- Redirect specific page in WordPress for first time visit
- Which action does wp_update_user triggers?
- How can I get my Script to work on the Login page?
- Trigger a custom function when option are saved in admin area
- 404 redirect to previous category
- Reuse variable in hook callback
- Multiple Loops Meta Data
- Incorrect redirect after commenting
- Function added using `add_action()` not being called
- Difference b/w Simple function call & do_action call
- jQuery does not work
- Override the WordPress core function wp_referer_field
- Set Taxonomy based on post status
- Two functions with different arguments and add_actions, but identical code
- add_action template_redirect not working for home page
- AMP – Change rel=”canonical” from functions.php [closed]
- How i can put $_GET codes in function.php?
- Scripts not loading when using the wp_enqueue_scripts action
- Is there a way to prevent a function/method from being called outside a specific hook?
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- Missing argument for the function
- current_user_can comma list vs OR (||) list
- Page get parameter doesn’t work with is_single() function
- Adding code before post title with the_title produces weird results
- Add back in child theme what the parent theme removed with remove_action
- login_headertitle is deprecated since version 5.2.0
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Contact Form 7 If Condition
- Init action and refresh page after form action
- Redirect to other page if login
- 400 Bad Request – JavaScript App calling Custom wp-json endpoint
- How to add array [closed]
- WordPress website keeps loading the maintenance page
- Changing where my author box is printed
- Redirects based on a JSON file
- Use add_action within template
- Problem with custom function when I go back with the browser
- Replace admin header logo with an image
- How do I find the code executed when wp_head() is called?
- How to use wp_enqueue_script properly?
- How to redirect Subscribers on login to specific page, when logging in from a Page
- Using get_terms for custom taxonomy in functions.php
- Issue passing action class to nested function. Admin Columns
- How to Override Page Template if URL matches query?
- Save_post – Warning: Cannot modify header information
- If has action not working as expected
- Modifying a WordPress Plugin
- Is_Page doesnt detect my page
- How do you insert code into the sidebar?
- How Do I Unhook This Parent Theme Function?
- How to show only specific category post by user role without plugin and restrict all other cats
- Wildcard 301 Redirect Using Theme Function
- Remove action hook from Class, understanding OOP
- Restrict access if logged out except for homepage
- How to change form action of wp-login page with a function
- Which method is more correct for removing WooCommerce Extensions menu item?
- Custom download page
- WordPress hooks to call a function inside a construct
- Sending Messages Back to the Template After Processing?
- Pass arguments to function class with do_action()
- custom COOKIE on custom page
- What add_action reference should I be using or should I use do_action?
- Getting error while trying to use custom comment function
- Settings in functions.php used by a plugin
- Allow the access over wp-login.php
- Making an under maintenance page (without using plugins)
- Do something when user creates post (that’s pending)
- add variable to actions/functions across different files (woocommerce)
- delete_term is not working properly with add_action()
- Disable Attachment Page Except for Category
- How to get variable from other function inside class function using add_action for Ajax call