If you a look at the source you’ll see it’s because the sanitize_title filter fires after remove_accents() is called by sanitize_title().
It does however, pass the raw title as the second argument so you can perform any substitutions on the raw title, apply remove_accents() and return it:
function wpsesanitize_title_extra( $title, $raw_title, $context ) {
$new_title = $raw_title;
$new_title = str_replace( '€', 'euro', $new_title );
$new_title = str_replace( '€', 'euro', $new_title );
$new_title = str_replace( '€', 'euro', $new_title );
if( 'save' == $context ){
$new_title = remove_accents( $new_title );
}
return $new_title;
}
add_filter( 'sanitize_title', 'wpsesanitize_title_extra', 5, 3 );
Related Posts:
- which is the function that removes accented vowels?
- Slugs as breadcrumbs for Pages
- Get page slug and assign a variable within functions.php
- is_account_page() change to page slug
- Identical custom taxonomy slugs for same hierarchical children
- Use /prefix/postname as a slug in post_name?
- Get term slug by term id and then explode it
- How to assign php file(template) to several pages with same prefix page name/slug
- How Can I Create a Friendly Slug for a Dynamic Page?
- Display list of pages that contain a certain string within the slug
- Get child-pages slugs of current page into js-file
- Adding a second email address to a completed order in WooCommerce [closed]
- What is the difference between get_page_link and get_permalink functions?
- Possible to search by author name with default WordPress search function?
- Breadcrumbs showing Parent and Child Pages
- Influence of WordPress functions on site speed
- Is it possible to override this function/class in a child theme?
- mysql custom wp query
- TinyMCE custom stylesheets for different post types
- When new user register then add new user role
- Change meta tags programatically
- Order get_users() by last login date. Is it possible?
- Display random text from a file with the WP built-in AJAX API
- Remove bulk actions based on user role or capabilities
- Set first oembed in post to a global variable or function
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Use a function to update post meta based on other post meta
- wp_delete_attachment
- Adding body class when post contains a specific shortcode
- WordPress registration and contact form 7 [closed]
- Detect Safari desktop browser and include the detection in a shortcode
- Is It wrong to use oop approach on functions.php?
- How to preserve edits to Name or Slug of term when using wp_update_term on save?
- Woocommerce checkout field maxlength, make input number field only (postcode)
- My simple custom shortcode is not longer working (possibly due to upgrade to WordPress 4.4 ?)
- PHP files included in functions.php don’t seem to work
- how to add an image to the footer?
- How to properly add function called by action-hooked function to functions.php?
- Get Current User info using wp_localize_script, in functions.php
- How to add new embed handler not supported by oembed?
- How do I permanently Disable Attachment Post URL
- Need to add class=”lightbox” for every single post image
- Child Theme files – what is needed?
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Stuck on maintenance mode
- Publish/Update post is changing image links from file url to post url
- How to stop twenty fifteen theme from cropping featured images?
- How to display custom option field in woocommerce orders in admin panel?
- WordPress function saves a post twice and updates all posts
- Change CSS for logged in users
- if statement for wordpress default featured image on single post
- Function to display post by specific author
- Return category name with & Ampersand doesnt work
- Control the srcset much more (not all sizes in it each time)
- Change Slug of a Custom Post Type
- Warning: join(): Invalid arguments passed in post-template.php
- javascript and css links not working on sever
- is_page() or is_single not working
- What are the meta fields for an attachment?
- Adding product to WooCommerce cart [closed]
- Add loggedout class on body using a function or JS
- Insert a field with PREG_REPLACE – strange behaviour
- Difference between get_userdata() and get_currentuserinfo()
- Astra theme – cannot set short product description under the product title (product name)
- Is posible to redirect a few URL?
- Default click “I have read and agree to the website terms and conditions”
- Run function with schedule is not working correctly
- Combine page types and Custom Taxonomy in a functions.php command
- Fatal error: Call to undefined function load_theme_textdomain() in /var/www/vhosts/61/151172/webspace/httpdocs/wp-includes/functions.php on line 5
- Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
- I have defined 2 text strings, how do I use them in my posts?
- Variable function names
- Create New User Custom Field not Saving
- Keep Admin Logged In For a Year
- WordPress Ajaxifying not working properly
- Strange result of get_stylesheet_directory()
- Comment function for page
- Using a variable in name of dynamically-called helper function
- How to add function to custom fields when page/post has a password?
- custom COOKIE on custom page
- List all post title in category using functions.php
- Quicktags external functions file
- Remove Captions from Custom Gallery function.php
- admin-ajax.php nulls all php variables
- Optimizing multiple WP_querys into one call?
- How to remove “login to reply” from individual comments [duplicate]
- How do I get my nav menu to show sub pages?
- Gallery Shortcode Function Help
- Echo custom field value in shortcode function
- WordPress Comment functions
- How do I add e-mail subscription functionality
- Why functions metaboxes is causing White Screen in Admin [closed]
- Rename file after title , one small problem
- reusing code in function and running it with loop
- Explode Array from Repeatable Custom Field
- image_size with respect to aspect ratios
- Automatically delete posts that aren’t in an array
- Ads Only at one website inside multisite network – code error
- How to disable calculation costs of Woocommerce Booking plugin [closed]
- WordPress internal functions : why not use them?