{"repo":"jjgrainger/Query","free":true,"listed":false,"github":"https://github.com/jjgrainger/Query","clone":"git clone https://github.com/jjgrainger/Query.git","description":"A fluent interface for creating WordPress Queries","language":"PHP","stars":20,"topics":["wordpress","wordpress-php-library","query-builder"],"license":"MIT","category":"self-hosted-apps","readme_excerpt":"WordPress Query Builder v0.2.0 A fluent interface for creating WordPress Queries Requirements PHP = 7.2 Composer WordPress 5.3.2 Installation Usage The Query class provides a fluent interface for create WP Query in WordPress. Creating Custom Query Classes Custom query classes can be created by extending the Query class. Custom query classes can encapsulate default parameters which can then be expanded upon with query methods. For example, a FeaturedPostsQuery can be created to return posts with the 'featured' taxonomy term. The default query parameters are defined within the setup() method that receives a Builder instance. Once the query class is created it can be used through out the project in a vairety of ways. Custom Scopes Custom scopes can be added to the global Query using the static addScope method. One of the simplest ways to add a scope is with a closure. Custom Scope Classes Custom scope classes can be added to the global Query . The custom scope class will need to implement the Scope interface and contain the required apply method. The apply method should accept the query Builder as the first argument and any optional arguments passed via the scope. Once added to the Query class the scope will be available by the class name with the first letter lowecase. Notes The library is still in active development and not intended for production use. Licensed under the MIT License Maintained under the Semantic Versioning Guide Author Joe Grainger https://jjgrainger.co.uk htt","default_branch":null,"files":null,"tree":[],"storefront":"/r/jjgrainger","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jjgrainger/Query/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}