Download the PHP package barnythorpe/wp-fluent-queries without Composer
On this page you can find all versions of the php package barnythorpe/wp-fluent-queries. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download barnythorpe/wp-fluent-queries
More information about barnythorpe/wp-fluent-queries
Files in barnythorpe/wp-fluent-queries
Package wp-fluent-queries
Short Description A fluent interface for constructing Wordpress queries in a safe, readable and clean manner.
License MIT
Informations about the package wp-fluent-queries
WP Fluent Queries
[!NOTE]
This package has been moved into: https://github.com/Barny-Thorpe/fluent-wp
This package aims to create a fluent interface for constructing Wordpress queries in a safe, readable and clean manner.
🔧 Installation
🛠 Usage
Main Query Builders
The package provides query builders for the following:
- WP_Query - https://developer.wordpress.org/reference/classes/wp_query/
- WP_Term_Query - https://developer.wordpress.org/reference/classes/wp_term_query/
- WP_User_Query - https://developer.wordpress.org/reference/classes/wp_user_query/
The queries are constructed like so:
or to make life simpler using the factory class:
Nesting Conditions
The package also provides a solution for the complex nested queries within the main wordpress queries:
- WP_Meta_Query - https://developer.wordpress.org/reference/classes/wp_meta_query/
- WP_Tax_Query - https://developer.wordpress.org/reference/classes/wp_tax_query/
- WP_Date_Query - https://developer.wordpress.org/reference/classes/wp_date_query/
These can be constructed using the group and condition classes and added to the main query like so:
Please go to the Groups and Conditions tests for more examples:
- Groups
- Conditions