Solved it.
add_action('init','redirect_to_change_avatar');
function redirect_to_change_avatar() {
if ( strpos($_SERVER['REQUEST_URI'], '/profile/change-avatar/') !== false ) {
wp_redirect('/change-avatar/');
exit;
}
}
Related Posts:
- Masking logout URL
- Logout/login redirect CSS issue
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- redirect wp-login.php to another page
- How do I redirect upon login a specific user based on role?
- Ninja form Redirect depending on text field content [closed]
- Redirect specific page in WordPress for first time visit
- How do I redirect all 404 error url to Subcategory url
- 404 redirect to previous category
- Login Redirect if Logged in from Specific Page
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Incorrect redirect after commenting
- How i can put $_GET codes in function.php?
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- Page get parameter doesn’t work with is_single() function
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Contact Form 7 If Condition
- Redirect to other page if login
- Logout Redirect and also WP-login.php Redirect
- How to add array [closed]
- WordPress website keeps loading the maintenance page
- Redirects based on a JSON file
- template_redirect action only firing if logged in
- How to redirect Subscribers on login to specific page, when logging in from a Page
- Redirect to one of two pages after data submitted, depending on the current url
- Wildcard 301 Redirect Using Theme Function
- Competing Login Redirects – Need to be Combined?
- Postback redirect through add_action is not triggered
- Restrict access if logged out except for homepage
- Redirect specific author posts to another url
- Custom download page
- How to create a function to redirect a specified page to another page
- Language switcher for subdomains
- Allow the access over wp-login.php
- How to request login for user but not for bots
- Making an under maintenance page (without using plugins)
- Template Redirect Function Only Working When Logged In
- Disable Attachment Page Except for Category
- Adding fields to the “Add New User” screen in the dashboard
- Issues with title-tag and document_title_parts
- What’s the difference between admin_url() and get_admin_url() functions?
- Programmatically Set First Image as Featured
- add_action in a function, is it possible?
- Declaring an instance of class included in parent theme from child theme functions.php
- In WooCommerce I need to modify the thankyou.php page [closed]
- Change number of posts to show on Archive page (custom post type)
- How to use wp_get_recent_posts with many post types?
- When is wp_trim_excerpt() called?
- Set image size on media and text block with a function
- How to update WordPress and plugins at specific day and time in PHP?
- Change parent theme file function in child themes functions.php
- Unable to get_the_content(); of a post in WordPress via AJAX
- Change links automatically to affiliate links
- Ajax call theme functions from front
- Show excerpt for only first post in query
- How to add css class to image attached in all the posts?
- Is there a way to add a class to non current menu item?
- What will happen if I delete the functions.php file?
- How do I permanently Disable Attachment Post URL
- Publish/Update post is changing image links from file url to post url
- How to stop twenty fifteen theme from cropping featured images?
- Don’t display html if function returns nothing
- Load custom css in functions.php causing library issue
- In jquery use php variable to execute an enqueued jquery file
- How to stop media_sideload_image from running when deleting a post?
- I want to display latest post in marquee [closed]
- Add php code to wp_print_scripts?
- How to get an attachment id from a filename
- Remove ‘page-numbers’ class from prev and next tags
- $_Get and &_REQUEST Index Undefined on Functions.php
- Exclude Category ID in function
- get_template_directory_uri() links to child theme not parent
- Functions Filter Question [closed]
- get_template_directory() – references parent theme directory
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Shortcode of a function
- How to add a shortcode to call a function
- How can I call a PHP function inside a hardcoded shortcode?
- WordPress comment_form() does not display actual comments
- Message notification for user
- Is it possible to create a shortcode to link to a specific post/page where the tag is just an attribute?
- How can I connect to a second database and still be able to use wp functions like get_post_types()?
- Display Script in Header When URL Variable Present
- Render metabox gallery in frontend
- how to check if an element in an html file exists in another html file? [closed]
- Trying to change widgets h-tags
- I want to display the sku in the product pages of my EDD website
- Why does echo on functions.php not yield result in source code?
- Child theme, how to cut the functions.php file into several classes?
- I want to customize the_posts_navigation function by replacing prev and next with images
- wp_footer hook causing text to show on bottom of page
- Get shortcode attribute value to another function
- Child theme style.css didn’t work properly but the Customize Additional CSS did [closed]
- Instead of using $post, how do i get the thumbnail image of the $post
- List Most Read Posts from last 7 days (with custom post type and other meta queries)
- How to add an excerpt and read more link to a page?
- WPDB function not saving
- Integrating custom API for post content into Admin interface & Public Website [closed]
- Trying to decipher this code which is encoded with HTML Special Characters [closed]
- Which action is triggered before final output?