Is this something that could work for you?
/**
* Hooks before login and filters out the CPF mask if it exists
*/
add_action( 'wp_authenticate' , 'somos_filter_username' );
function somos_filter_username() {
$cpf = preg_replace('/[^0-9]/is', '', $_POST['user_login']);
if (is_valid_cpf($cpf)) {
return $cpf;
}
}
Related Posts:
- Sending the reset password link programatically
- Enforcing password complexity
- Change Password Hint
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- Password protecting content in custom template
- How to limit the number of forgot password reset attempts in WordPress?
- Styling my own password protected page, how to deal with wrong password?
- How to know where this function definition is declared?
- Password minimum length in personal subscription [closed]
- Redirecting to a custom forgot password page
- How do I create a function that modifies a message in the wp-login.php file?
- WordPress produces identical hash all the time
- Change page password every day (predictable password ;) )
- Remove password protection from all posts
- Password protect URLs
- Redirecting the lost password page request when using a custon login page
- Hook into all password resets in WordPress and get password before hashing?
- Issue encountered while trying to keep website private
- Password form redirection to belonging post
- How does printf( __( ) ); work?
- Return HTML Template Page with PHP Function
- Displaying Logged-In User Name in WordPress Menu
- Change the filename format of saved featured images
- Getting the comment number relative to all the post’s comments
- Config apple-app-site-association file with wordpress
- How to use the php if statement [closed]
- lazy load comments wordpress on click
- Use Filename for Alt and Title Tags
- Should I use wp_mail or PHP’s mail? [duplicate]
- Trying to use Ternary operators with WP Conditionals
- How can one utilize a variable as a callback function name for add_settings_field
- Filter link to existing content suggestion
- How to strip non-alphanumeric characters, convert spaces to dashes, uppercase to lowercase in this context
- Generate an array of parent/child page IDs, based on parent page name
- Link to file in plugin directory from wordpress template?
- Using a switch statement in WordPress
- wp_handle_upload – The uploaded file could not be moved to wp-content/uploads/2012/09
- Strange wordpress slowness
- Create a new usermeta field for users
- Where to edit the template that is generating the code for dynamic_sidebar left-sidebar in the Understrap theme? [closed]
- Append HTML Using Shortcode
- Get rid of this Strict Standards warning [closed]
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- Use DOMDocument with ob_start breaks my HTML code
- How to only enqueue script if it’s a post
- how to fix error “called incorrectly, should not be accessed directly”?
- trigger html cleanup for all posts
- get widget number from array dynamically
- Validation algorithm in checkout field
- If has $title in widgets
- get href content [closed]
- Warning: Attempt to read property “ID” on null in D:\xampp\htdocs\yba\wp-content\themes\young-brand-child\functions.php on line 162 [closed]
- Illegal string offset in PHP function
- Problem with AJAX in wordpress plugin
- Displaying text if post was within 5 hours
- Trouble inputting variable into WP query
- Change “No Comments” link to “My String” on Blog Post (Find Snippet in Code or use CSS, PHP Solution) [closed]
- How to say if meta_value is greater than 0 in an array?
- Adding a tag_ID column into Categories inside the admin dashboard?
- My website is not showing Footer section
- How to get category name or ID by post?
- Best Way to Change a String in a WordPress Post
- WordPress site with embedded menu – gives You don’t have permission to access /wp-content/themes/xxx/taxonomy-redirect.php on this server
- Show get_sub_field value if it exists [closed]
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- Dividing the loop to style post differently
- How to Display a List of Child Pages For a Parent Page in WordPress
- Custom search query on WordPress page not working
- User meta needed in query is serialized – how to unserialize safely?
- PHP calling AJAX function that relies on passed PHP function values not working
- Order by title Child Pages displayed in a Parent Page
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Intermittent problem can the debug log give any clues?
- Echo short code syntax
- WordPress recent post
- Filter by Post Type
- Need help to create WordPress page that decodes a text file and publishes it in JSON format
- My blog posts section seems to be rendering the other blog posts inside the first? :/
- How to get total gross revenue for current month in the woocommerce dashboard status widget
- Decoding an array in PHP (from the Shopify API) [closed]
- PHP is_embed error showing up
- How fix error in the WordPress loop?
- PHP Session Variable to WordPress Error
- Run code before WordPress loads and insert data into WP if need be
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- need help to arabic text in wordpress
- Sorting Meta Fields?
- Themes with variable width or single columns? I want to display source code
- Category List in Theme Options Page
- Showing all post from all post type in admin backstage
- Pagination not displaying
- upload images on front by user using form
- Masking external links with internal link for member-only
- What does this if-statement do?: if($pages=’ ‘) {}
- Really slow WordPress site [closed]
- How to add Paragraph Tags in WordPress using Visual Composer?
- PHP – Multiple variables in insert post array
- Search custom post type posts only by meta fields?