定制 mehedimi/wp-query-builder-ext 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mehedimi/wp-query-builder-ext

最新稳定版本:0.3

Composer 安装命令:

composer require mehedimi/wp-query-builder-ext

包简介

An Extension of WP Query Builder

README 文档

README

WP Query Builder Extension Banner

WP Query Builder Extension

This is an extension of WP Query Builder.

Installation

It is a composer package. You can install it using composer by executing following composer command.

composer require mehedimi/wp-query-builder-ext

It has some relations and plugins of WP Query Builder.

Relations

WithTaxonomy

With this relation you will be able to load associative taxonomies of specific posts.

// Retrieve all posts with associative taxonomies.
DB::table('posts')
->withRelation(new WithTaxonomy('taxonomies'))
->get()

If you need group by taxonomy type then just call groupByTaxonomy method on WithTaxonomy relation.

// Retrieve all posts with associative taxonomies group by with its type.
DB::table('posts')
->withRelation(new WithTaxonomy('taxonomies'), function(WithTaxonomy $taxonomy){
    $taxonomy->groupByTaxonomy()
})
->get();

Optionally you add constrain of taxonomy type by calling taxonomy method of WithTaxonomy relation.

// This will fetch only category type of taxonomy.
DB::table('posts')
    ->withRelation(new WithTaxonomy('categories'), function(WithTaxonomy $taxonomy){
        $taxonomy->taxonomy('category');
    })->get();

Plugins

JoinPostWithMeta

With this plugin, you will be able to join postmeta table with posts very easily. You need to just apply that plugin and that's it. Some examples are given below:

DB::plugin(new JoinPostWithMeta())->select('posts.*')->where('meta_key', 'some meta key name')->get()

You could supply the join type on JoinPostWithMeta class constructor as well.

// For joining right join `postmeta` with `posts` table
DB::plugin(new JoinPostWithMeta('right'))->select('posts.*')->where('meta_key', 'some meta key name')->get()

统计信息

  • 总下载量: 45
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固