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
- How do I query by post format in WordPress 3.1
- How to set posts per page using WP_Query()
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Custom Post Type “Event”: chronological list of recurring events
- Order by meta value, pro first, then free
- How to create an attachments archive with working pagination?
- Include different loop templates in search query
- Show Posts From Same Category OR Same Tag
- Get posts by category with pure SQL query
- Pass the same object to multiple widgets in a template with one query
- Different number of posts on the front page
- Query posts without a specific ID
- What is considered a default query for the request filter?
- How to apply filter at search of woocommerce products?
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- How to query a custom post type with a taxonomy filter but display post type archive page?
- How do I correctly get all posts within the last year using the query_posts function?
- How to edit dashboard search posts button texts for my CPT?
- Change query_posts to WP_Query in page but does not work
- WP Query with custom Shortcode
- Query reset problem or flawed code to enable custom post type query
- Filter posts in category archive page by year using a dropdown
- Add class to first post in custom loop using post_class filter
- WordPress tax_query not showing private posts
- WordPress /page/2 not working
- Get Posts updated or published within the last x hours
- WooCommerce search products between price range using WP_Query
- get_the_title outputs title until spacing; it does not get full length of title
- Filter Custom Taxonomy Posts
- Counter is skipping post when I still want it visible [closed]
- Display trimmed version of the_post()
- How to show the number of each post has been read in a while loop?
- Modify loop but keep the original query, what am I doing wrong?
- Post per page not working if no category specified
- Query to list all galleries under a parent post?
- How exclude 3 latest posts of a category in query_posts
- Filtering custom posts by custom fields (ACF) [closed]
- filter posts by meta key with pagination
- Weird problem on if statement
- Issue with sidebar widgets not showing when I do custom queries
- Why would post_type be ignored in this query?
- query_posts call sets is_home() to true
- Script that gets the first tag of post and query all other posts with the same tag
- Trouble highlighting correct menu parent with wp_nav_menu classes while viewing “single posts”
- Latest 5 post excerpts from 5 different authors in Sidebar
- Change pure SQL database query to WordPress post query?
- Search & column order by meta value in admin
- Filter orders by modify date
- How to add url parameter to every search query in SearchWp?
- Help with query_posts function
- Speed up search query that searches in post meta?
- Remove the post_content search from WHERE clause (and CONCAT sql function)
- How to organize a WP_Query’s list of posts by category and display category title?
- Need help setting up a search form for wordpress [duplicate]
- Query Posts From Multiple Post Types
- get_posts and wp_autop (remove filter)
- Adding an orderby filter, casting postmeta with multiple keys
- Including post data in a sidebar occurring outside of and before the Loop