The search term was getting surrounded by asterisks.
Yes, and they are wildcard characters, and in the case of the Users list table at wp-admin/users.php
, those asterisks are being added by wp-admin/includes/class-wp-users-list-table.php
(see source on GitHub for WordPress v6.1), so that a LIKE '%<keyword>%'
query is performed by default.
So to fix the issue, yes, I’d also use trim( $search, '*' )
. But you can also use the raw search keyword, e.g. using $_REQUEST['s']
.
Related Posts:
- How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?
- How to make dynamically-generated content searchable in WordPress?
- Displaying search results in the widget itself?
- modify wordpress default search
- what are the checksums surrounding keywords in the SQL generated by WP_Query and do I need to use them too?
- Search the product by tag or category not working
- Search and Filter
- Using ob_get_content to get_search_form puts into infinite loop
- How can I replace the search results displayed by WordPress?
- Showing results from json-string in WordPress search results page
- Ajax action has 200 status but response of No response data available for this request
- ajax stopped working when not logged in wordpress
- Get search result count in plugin
- Generate Static Page to Show Search Results/Detail for API
- Modify search form with plugin
- WP Query Relations / Compare
- WordPress Search Form with Keyword Suggestion
- Simple Search Plugin Does Not Perform Search
- How to search on the field that stores escaped strings?
- Change the search results header from plugin
- How to create a custom search form and handler?
- Get custom wp_query search results to appear on search.php
- Hook a search form anywhere on the site, using a custom plugin
- Strategy On Building Plugin Using Eclipse
- Admin settings update updating every time home page is hit?
- How to prevent newline from appearing in shortcode?
- Writing a plugin that notify my friends of new post that mentions(@) them
- How to catch images with blank dimensions?
- WordPress as College Application System (Embark)
- Filter to change the content of 404 page
- PHPUnit test plugin activation
- Use an empty page to build custom plugin output
- Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types
- Dynamically override page.php or single.php with custom templates using function
- External Rewrite Rules
- How to get an image transferred via FTP or script to appear in Media Manager?
- plugin_dir_url() adds path to url
- Does settings API create settings on run time?
- Nuance in adding CPT and TAX to a submenu
- wordpress 3.0 json issue
- How to allow core Gutenberg blocks selection only when you are inside a custom inner block
- How to extend expiry time of jwt wordpress token?
- Coding a plugin on WordPress; when should I sanitize? [duplicate]
- wp_count_posts on all post types?
- Conditionally Remove a nav menu link if session is active
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- WP REST API V2 – Add user data to response
- Applying OO patterns and principles to plugin development
- Include content of file into plugin (ob_start();;include;ob_get_clean()) without
- How to schedule a cron job in plugin without waiting for page load request?
- Is it possible to change a term slug before being saved to the database?
- How To Change Logout Screen Title
- onclick post title in admin area javascript file not working
- How can I edit commit messages in my wp-hosted plugin repo?
- Why does wp_remote_post returns an empty body response on certain endpoints?
- Replace youtube embed in wordpress
- Adding dropdown list to tutor lms registration form
- How developed with version control word press site on shared host? [closed]
- Admin – Handle data before creating or updating a post, page or custom post
- How to Bind one post object Type with other postobject Type in Advanced Custom field [closed]
- wp_redirect on base wp-admin and login
- Creating custom input fields on the admin side
- Valid filenames for add_action’s first parameter
- What to hook into to check a value before a post is published?
- Correct syntax for database inserts from plugin?
- How to add a gradient component to a custom block
- wp_schedule_event() set daily, but processed every second
- Can’t get AJAX call working in custom plugin
- $wpdb->update() always need a second try
- Why aren’t some plugin styles loading when I load a template?
- How to create custom dynamic url
- Pagination not working with custom wp_query
- Any way to update_post_meta with html content? It gets stripped and becomes empty
- WordPress actions for plugin admin UI page
- wp_insert_user keeps echoing values
- Getting posts by taxonomy
- Pause plugin option page until all data manipulation is complete
- can members have multiple registration using the same password?
- Exclude Woocommerce Product Category From Sitemap
- How to show only the last two categories in a menu?
- howTo let wordpress endpoint return html-page
- User meta query using Wildcard
- use a (Polymer) web component within a plugin (or theme)?
- how to add security questions on wp-registration page and validate it
- wp_ajax add_action fuction won’t fire on custom jQuery action
- wordpress4.8.2 Multilingual Plugin
- Customize WordPress Admin Menu
- Dedicated server and WPDB Class : huge slow-down of the website
- How can I see a varibles value when my plugin runs?
- Add Button to TinyMCE Custom Menu
- How should I use wpdb class to submit a form in admin dashboard?
- Forcing ALL plugin Admin menus into a separate menu
- WordPress plugin: admin-ajax.php not passing data to custom function
- Create pages for authors
- How do I create Widget within plugin that uses its own class?
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- How to design WooCommerce-like admin tabs for plugin settings page?
- Woocommerce: block user removing cart item
- How can I dynamically change title and description in WordPress?
- Developing an IP lookup function using an API