lyfter/wp-query-builder
最新稳定版本:1.0.0
Composer 安装命令:
composer require lyfter/wp-query-builder
包简介
README 文档
README
A package that allows you to create WP_Queries in a more elegant while offering you autocompletion in you IDE. Heavily inspired by Laravel Elequent and query builder.
Replace
$query = new WP_Query([
'posts_per_page' => 5,
'post_type' => 'page'
]);
$query->get_posts();
With
WpQuery::build()
->type('page')
->limit(5)
->get();
Installation
Install with composer
Run the following in your terminal to install the package with Composer.
$ composer require lyfter/wp-query-builder
The package uses PSR-4 autoloading and can be used with the Composer's autoloader. Below is a basic example of getting started, though your setup may be different depending on how you are using Composer.
require __DIR__ . '/vendor/autoload.php'; // Not required when using bedrock use Lyfter\QueryBuilder\WpQuery; $posts = WpQuery::build() ->type(['post', 'page']) ->limit(5) ->get();
See Composer's basic usage guide for details on working with Composer and autoloading. basic usage guide for details on working with Composer and autoloading.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-04-23