In the class WP_Query, there is a hook posts_pre_query
wich allow to set the result of a query before the DB call
https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-includes/class-wp-query.php#L2755
Related Posts:
- Count & Display Database Queries
- cache specific data?
- get_results using wpdb
- Using transients in conjunction with memcached
- Hook into $wpdb
- Export wordpress table to excel
- How best to inject ads between posts in the loop?
- Change SQL get_results to search for posts with custom term in custom taxonomy
- Hook to be used when creating a database table
- Change all http to https in mysql databse?
- WooCommerce – Query for ordered products
- PHP variable in WordPress database query
- Block search SQL from happening
- Usage of Direct Database Call Without Caching Error
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Query WordPress database by registered date and role
- Trigger Plugin database update after git pull
- How to prevent WordPress from retrieving data for the last 10 posts in the database?
- Query from a different database than the default
- How to query the WordPress database to get posts of a certain custom post type, taxonomy and field?
- Select Multiple meta_value from WP DB; Single Query
- CRUD operations using WordPress database API
- Transient feeds and caching error
- Advanced SELECT query with condtional statements
- Select two sums with single get_var statement
- Replace/Mute/Stop Search Query
- Slow queries constantly getting stuck on WordPress database of ~100,000 posts
- WordPress returns to an old version
- How to Access wp_usermeta Data Immediately After a New User is Created
- How to update the values when the featured image has changed?
- How to prevent/delay MySQL connections when an object cache is used?
- How Can I Put Meta_Compare in the Database-Query?
- How to paginate information obtained from a query to a custom table?
- Historic WordPress database connection
- Check if an option exists and get its value in one hit
- Query multiple tables at once?
- $wpdb->query can’t insert data
- Custom WordPress Table wpdb
- Best practice to limit results in get_row()?
- How to display content from external db with relevant urls
- Connecting to a different database
- Should I store critical css in the database or in my theme’s filesystem?
- content disappearing minutes after it’s published
- SQL query to set posts in bulk based on the post content
- Query Column of Specific ID from Database Table
- Custom search query by category id
- Website displays old version of page
- How to display data from db in select list [closed]
- How can I query the db to access current post information?
- Compare User meta_value with Product meta_value
- How to insert a value to decimal type field using wpdb->prepare?
- Join Query on WP_USERMETA Table
- Insert NULL value using prepare()
- WP 5.5, child themes, customizer and a weird cache issue
- Job and Employee Performance Tracking with Product Safety
- adding user_id and name to a separate table whenever a user register based on role
- WordPress Database Query works in phpMyAdmin but not in the code
- wpdb query to insert images in to post/page gallery
- Set SQL_BIG_SELECTS and MAX_JOIN_SIZE on a WP_Query
- About wp database hooks (error establishing connection)
- Performance bug – slow DB query
- How to optimise this database query?
- How can we speed up wp_get_nav_menu_items()?
- Extracted CSV as Array for Custom Query Loop
- Should I Use only wpdb Class to Write Custom Queries?
- Generating an HTML table from an array based on dynamic key values
- Improving wpdb queries with large data
- Pulling values from a sepcific row in table
- Using class id from array for query
- Attach posts based on category and position
- database search feature
- SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta
- SQL query to rewrite all media URLs to end with .webp
- How do I find users by password?
- What is a relation in database terminology?
- Why WordPress choose data serialization over json_encode?
- Does WordPress use the InnoDB engine for MySQL by default?
- Best way to import users, post and categories from an external database
- Performance tips for a large user base [closed]
- wp_options is GB in size
- How can I create a Bible search engine via WordPress? [closed]
- How to change database values on theme update
- Unable to set a default serialized array using dbdelta()
- Combining several CSS files into one for optimization
- Change the default data installed when setting up WordPress
- SymmetricDS in dev + prod workflow?
- Fixing YARPP plugin FULLTEXT MySQL indexing
- wpdb Insert unknown post data dynamic foreach loop
- How do I use a database in a custom theme?
- I imported an restore an database and It shows #1067 – Invalid default value for ‘user_registered’
- How do you enable scripts on a WordPress installation in Softaculous?
- How to rerieve comments and their replies from DB
- Inserting data with Geometry field
- Export only a part of the database for migration
- database error WordPress move from one hosting to other
- WP search exclude last letter from string
- update multiple user meta field based on another meta field
- execute custom function on database connection error
- How to back-up a database on IIS
- Where are database files of a WordPress website?