Try $name = trim( sanitize_user( $_POST['name'], true ) );
Be sure that the function does what you want! Read here
Related Posts:
- What are the common security flaws I need to look for? [closed]
- Making my plugin multi-site compatible
- Creating 20,000 Posts or Pages using a .csv file?
- What’s the easiest way to duplicate an entire navigation menu?
- Updating WooCommerce variable product stock issue
- How can I get a list of plugins and which blogs are using them?
- What is the easiest way to implement cascading database upgrade for my plugin?
- Plugin Development sqlite or WordPress’ database
- Retrieving a Value from a wp-database
- Problem with creating tables for Plugin
- Prevent duplicate records in plugin table
- WordPress WPforms customization
- How do I run SQL queries on a WordPress web page? [closed]
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- How to create multiple database tables on plugin activation?
- Does deleting a Plugin via the WordPress admin ‘completely’ remove the code?
- Speeding SQL queries for a large database?
- correct validate and sql query
- correct sql query
- SQL query, error
- $wpdb update query in plugin only updating one column
- Woocommerce Backend Search by Title and SKU
- problem with sql query
- Deactivation Hook does not remove database
- Using AJAX to run SQL statement and populate dropdown
- Adding CASE in WP_Query
- JOIN and SUM different statement results (Mailster Database)
- How to get specific column data conditionally in database in WordPress?
- Memcaching recurring SQL Queries
- add products to WordPress site automatically
- How to get database connection details without longing to cpanel in WordPress?
- Performing CRUD operations on front end in wordpress
- Display a number value from mysql query in WP
- Looping the data from WordPress database using foreach
- How To Toggle User_Meta in frontend in a form using PHP
- Get and Update Most Meta Value as an array in HTML form
- WordPress filter from custom table is not working properly
- errno: 150 “Foreign key constraint is incorrectly formed” [closed]
- Create Array from data in the OPTIONS table
- Custom Table doesn’t create on plugin activation
- Get all the related data from WordPress DB
- How to change and edit users according to the extension in the URL
- Changing the “Plugin Activated” Message Default
- How can I prevent a plugin from updating unless it’s minimum PHP version is met?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Notify Admins about Plugin Merge
- Additional, optional fee on Woocommerce Checkout [closed]
- Why does including a file in theme’s functions.php not work?
- While using WordPress Multisite is it possible to display data to main site from subsites?
- disable active plugins for specific theme
- Flickr plugin that will display photos from multiple group pools? [closed]
- Generate JWT Token without username and password
- WordPress web page struggling with performance
- Making menu link open in new tab?
- ReOrder Post Within Categories plugin with featured image
- How to initialize something in unit test before the init hook being called?
- add_filter comment_edit_redirect not working
- Global matrix for shortcodes/content for every page
- How to write a plugin to add users to a mail list
- Use the page title in the plugin
- Two text domains in one plugin
- Cron job not firing
- See which user installed a plugin?
- Plugin or method to delete uploads not in media library?
- Add woocommerce variation images in gallery?
- Add a CSS class based on categroy id to archive pages
- Add button gutenberg help
- How to add media field to WP_Widget form function?
- Troubleshooting Plugins.php HTTP install path vs. a HTTPS for a single Plug-In
- Save values from a pre_post_update
- How to grab facebook page feed?
- plugin active error
- (WordPress 5.8.3) Function.php or a plugin for better performance? [duplicate]
- How to translate wordpress error message
- wp_localize_script not passing the data
- How to downgrade plugin?
- More gentle way to hook WordPress custom url
- Adding Gallery to Footer of Homepage
- Minification Plugins break my website
- What snippet do I need to type to show my ACF field show up on my theme?
- Unable to locate inline CSS causing parts of page to be blank
- Xamp installed local wordpress not allowing to publish or install plugin
- Elementor pro page editing gives error There has been a critical error on this website. Please check your site admin email inbox for instructions
- redirect to homepage once action is completed
- Correct way to expand custom WordPress plugin functions
- FPDF for creating pdf diplomas
- multiple string replace of post’s content for large data
- Extending on a WordPress Plugin
- Creating plugin for changing slug
- change output location of plugin function using a custom hook
- Issues with Post 2 Post Plugin
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- WordPress Options-Theme STD (default) value does not work
- Using one-click plugin upgrade feature securely on suexec server
- WordPress shortcode plugin not working
- FacetWP: Plugin breaks button/modal functionality inside searchable content area
- Undefined property: stdClass::$ AND Trying to get property ‘name’ of non-object Error in plugin
- get_option returning a different value from what’s saved
- How does one add numbers to an admin menu?