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
- Get the ID of the page a menu item links to?
- Does hooking into the same action multiple times drain memory?
- Different wp_mail_from and wp_mail_from_name for specific situations
- register_post_type for Pages?
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- is_front_page not working in functions.php
- VERY new to coding – keep breaking site trying to add to functions.php
- Restrict user registration to emails on a single domain
- Call to undefined add_action() in theme’s functions.php
- How can I rename the WordPress AJAX URL? [duplicate]
- How to add a rel attribute to images that contains their categories?
- How to enqueue JavaScript for specific WordPress pages only?
- Passing HTML in WordPress Shortcode arguments
- Can I use require() function in a template file?
- What is the most efficient method for loading widgets in functions.php
- Enqueue script o style only if a template part is loaded
- Exclude Empty Child Categories in Menu
- Can I pass two roles to the function get_users?
- Convert User ID’s to User Names in a single.php file
- Add external js file to footer with id
- How to specify which Gutenberg blocks are available in the editor for a page template
- password protected post policy
- Custom Shortcode, functions PHP WP_Query loop
- wpautop – disable tags, keep tags
- Logout hyperlink within a sub-menu
- Add function to Simple Twitter Connect to not Tweet pages
- Hard-coding custom menu elements for menu manager
- Display post shortcode content in the sidebar?
- How to use wp_trash_post (or wp_delete_post) for deleting a (or all) post(s) from custom post type?
- Do not add content filter on page template
- Create post using Ajax
- Usage of theme name in functions
- Dumping variable in custom pre_gets_post function in functions.php, returns NULL
- Function to update post_meta based on existing post_meta
- Load jquery only for certain pages in the backend
- How to load parent theme template parts in child theme
- allow only one post in specific category
- ACF not showing
- Cannot modify header information – headers already sent (wp_redirect in functions.php)
- Javascript function not working when placed in Text Block
- Use html inside shortcode function
- How to remove comment count column in Posts inside the admin dashboard?
- Cannot declare function twice [closed]
- Running script based on Category
- Unable to return values from function
- Function not working inside of a function in functions.php
- How to Use Global Variables Inside Header and Footer
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Where do I go to edit this area? [closed]
- processing form data with ajax
- Check from functions.php if function exists in footer.php
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Email Exists ERROR into Ajax registration form
- How to convert raw url to hyperlink?
- Split single-review.php to two parts
- get content from page through AJAX
- The work of WordPress Function update_post
- Facebook OpenGraph error, Call to undefined function wp_get_attachment_src()
- how can I change all wordpress media file url to custom cdn url?
- Changing the HTML of notices in WooCommerce [closed]
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- custom error message for empty username and password using authenticate filter not working
- function class doesnt work
- get_locale() is different from $locale
- Load CSS file conditionally
- my wordpress doesn’t save items to customized widget area
- Remove all video attachment, both files and post/postmeta from database?
- save_post doesn’t correctly process function call with php class
- How to include a hyperlink in the body text of a custom password protected form?
- Pass arguments to function class with do_action()
- How to a override parent theme page that has been included with require_once?
- Display most popular posts
- Dynamically generated Navigation Diagram using Custom Fields
- Excerpt length: get 2 paragraphs
- Remove heading tags on line break
- Function to get the name in database table from the comma separated string
- Full size image option removing problem
- Add custom fields after post/page title
- Ajax call does not work for this custom code
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- Sort results by name & asc order on homepage
- Add the title of a widget as an ID – for anchor links
- I want to add the alt attribute to all the photos!
- Need to use an external variable inside a function
- Creating mixture of shortcodes to use in the visual/text editor
- Correct php syntax to add an image in wp functions.php
- Get all users from role and add to dropdown (select) – wordpress, javascript
- WordPress enque the same script causes the setInterval not to work