I know it is too late but I hope it is going to help someone in the future
You can add a filter to posts_where and add a regexp to limit it to the first letter. WordPress documentation for posts_where
add_filter( 'posts_where' , 'posts_where' );
function posts_where( $where ) {
if( is_admin() ) {
global $wpdb;
if ( isset( $_GET['author_restrict_posts'] ) && !empty( $_GET['author_restrict_posts'] ) && intval( $_GET['author_restrict_posts'] ) != 0 ) {
$author = intval( $_GET['author_restrict_posts'] );
$where .= " AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id=$author )";
}
}
return $where;
}
Related Posts:
- WordPress Search Filter Only for Page with Child of Child of Child of Child of Child
- Using dynamic conditions in ‘posts_where’ filter
- Custom search filter causes menu and query_posts problems
- Filter the query ONLY for the search results page
- Problem with ‘post__not_in’
- Sort X categories by last update and show image
- using post__in allow duplicate post id
- Counter code for paginated category pages in wordpress
- pagination in author.php template returns 404 error
- How to modify the query to exclude posts by slug?
- Custom search page and search by title, content and tag
- Taxonomy.php issue with search and filters
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Search stores (custom postcode field) within 5, 10, 15 miles of user inputted postcode.. Code modification
- Querying posts with meta value that begins with a certain pattern
- Adding Variables to post query
- Tricky WP Query
- query_posts() ALWAYS displays something?
- Error sending array of inputs
- Search breaks when querying main loop for category
- Using ajax with paging and a custom sub-query
- define orderby URL with meta_key=post_views_count
- How to remove a plugin filter’s priority on specific loops (custom queries)?
- Each post is showing twice in my custom query…?
- query_posts() – problem with “s” parameter
- Filter post query to only show direct children of category
- Exclude posts by post meta value
- Currently using a query_posts() in my theme – want to use a request filter in stead
- Custom search SQL Query to add custom field in result
- Can I use WP_Query one time and then filter the results multiple times
- Different layout based on post amount?
- How to solve this without flushing the rewrite rules for each post query the visitor triggers?
- How to check a list or feed of all posts under a category and tag?
- Best Query for blog posts
- Pre-existing arguments when using queries
- How can I modify this code to make the search box include tags and meta
- Customising the default wordpress search functionality
- WP Query Relations / Compare
- query_posts() with multiple meta data comparisons
- Adding Category Argument into an Array for WordPress Query
- Filter posts by multiple checkbox categories
- Modify WordPress Search
- Create a post automatically if search result has zero results
- Redirect to a page while maintaining search query parameters without causing an infinite loop
- How to fetch courses in all languages in WordPress?
- pre_user_query vs pre_get_posts
- Get posts for each user
- WP_Query filter by custom meta
- Get posts that match defined arrays of tags
- Creating a custom WP query for a Custom Post Type
- How to filter result set in custom metaboxes?
- List all categories that have results in a query
- How to search through “post title” and “tags” using WP_Query?
- Including taxonomy in searches
- Display posts from today and future in Elementor ‘posts widget’
- Ordering of posts, 2020 Year showing as next event when should be last
- Search with filters
- Restrict WordPress search to a single ACF field
- Query Post interferes with Pagination
- Modify WordPress search behaviour in backend?
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- Re-order search results with posts_orderby filter and post meta value
- Sorting query_posts() with a complex orderby filter
- Having issue with dynamic data within restrict_manage_posts function
- I need query_posts() to order results first by a meta value and then by post ID
- My archives page won’t sort posts by month
- Displaying posts on a page that have been assigned a value in a database
- Add to search posts query array with post IDS which will appear first
- How do i search post by jquery datepicker?
- Pagination doesn’t work in query post in tag template
- Specifying image size used in template the_content
- How to put orderby on a custom field in query_posts
- Modify behaviour of “s” parameter in wp_query
- Search has query that will return no results
- Sort by postmeta on when searching
- Group Custom Posts Types in a Relation field of ACF
- searching by keywords in post’s metas or pagination links problem
- show only one category and filter by tag
- WP Query – Search in title or author_name
- Pagination adds search query (again)
- Add option to query string before get_posts() is called on archive.php
- Show 5 posts and than 3 posts offset with pagination
- allow user to edit posts made by others users based on the user role
- Speed up search query that searches in post meta?
- How to show post title in content editor in backend?
- How to show terms from another taxonomy
- meta box loop problem with a search filter
- Filter on the day of the week from timestamp
- My entry results are not consistently alphabetized
- Modify search form with plugin
- Merge two queries and remove duplicate
- Admin view: filter posts by whether they have specific taxonomy attached
- Querying posts from current category, using a variable as array argument
- Pull new posts using feed
- How can I modify standard search query to include also ACF custom fields values?
- Remove the post_content search from WHERE clause (and CONCAT sql function)
- Issue with WordPress category search
- wp_remote_post and form post
- Ordering Posts By Meta Data
- Fetch only categorized posts