-
Notifications
You must be signed in to change notification settings - Fork 0
Query Builder
Darko Gjorgjijoski edited this page Jun 15, 2025
·
1 revision
The QueryBuilder class allows to build up a query using its methods. It uses $wpdb in its core to build and execute the queries.
Start using the query builder by calling the global function wp_query_builder():
$builder = wp_query_builder();This will return an instance of TenQuality\WP\Database\QueryBuilder ready to be used.
Alternatively, in order to use the class directly, this must be instantiated into a variable; requires to use php's use statement at the beginning of the script:
use TenQuality\WP\Database\QueryBuilder;Default:
$builder = new QueryBuilder();Using an ID to identify the query (which can be later use for wordpress hooks):
$builder = new QueryBuilder( 'my_query' );Default:
$builder = QueryBuilder::create();Using an ID:
$builder = QueryBuilder::create( 'my_query' );(c) 2025 - CodeVerve - Query Builder Library for Wordpress