定制 page-carbajal/wpexpress-query 二次开发

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

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

page-carbajal/wpexpress-query

Composer 安装命令:

composer require page-carbajal/wpexpress-query

包简介

A <wpdb> abstraction

README 文档

README

An abstraction layer for WPDB.

Love WordPress I started looking for a composer package to abstract working with the WPDB the way we work with databases on other PHP projects.

None met my expectations, some try to skip the WBDP and write SQL on their own. WPDB is robust enough, I just want a wrapper that makes read and writing code easier.

The Query class is a container for static methods to instantiate every class (Post, MetaField, Taxonomy) related to the DB.

You can use WPExpress/Query to simplify your interactions with the WPDB and make your code easier to read and write.

Run a DB Query for Custom Post Type BOOKS, and limit to 5 results

function getFiveBooksPermalinks()
{
    $list = array();
    $fiveBooks = Query::Custom('book')->limit(5)->get();

    foreach($fiveBooks as $post)
    {
        $list[] = get_permalink($post->ID);
    }
    return $list;
}

Run a DB Query to get 5 posts

    $Posts = Posts()->limit(5)->get();

    foreach($Posts as $post)
    {
        // TODO: Write your code here
    }

Road Map

Next minor

  • Add methods insert, save and delete to Post class
  • Develop methods for User class
    • insert
    • save
    • delete
    • resetPassword
    • get, get first, get last
    • getAll
    • getByMeta
    • getByEmail
  • Add method Query::User. Returns an instance of User

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL3
  • 更新时间: 2016-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固