定制 webxid/wp-post-wrapper 二次开发

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

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

webxid/wp-post-wrapper

Composer 安装命令:

composer require webxid/wp-post-wrapper

包简介

The lib help to wrap WP instances and to cache already collected data

README 文档

README

The lib help to wrap WP instances and to cache already collected data. Also, you can implement your own method for a post instance

Install

Run composer require webxid/wp-post-wrapper

How to use

E.g. we have the next implementation: PageBlocks of a posts type and the next SimpleBlock of a post and the next Category of a post taxonomy

Factory method

You can implement a separate class for a specific post and handle custom fields as the post instance properties

Get data

To get a posts list

use WebXID\WpPostWrapper\Example\PageBlocks
use WebXID\WpPostWrapper\Example\SimpleBlock;

foreach(PageBlocks::buildPostsList() $key => $post) {
    /** @var SimpleBlock $post */
    
    // do some code
}

To build a single post instance

use WebXID\WpPostWrapper\Example\PageBlocks
use WebXID\WpPostWrapper\Example\SimpleBlock;

/** @var SimpleBlock $post */
$post = PageBlocks::itemFactory(get_post());

To build a taxonomy instance

use WebXID\WpPostWrapper\Example\Category
use WebXID\WpPostWrapper\Example\SimpleBlock;


/** @var Category $post */
$category = Category::factory(get_queried_object());

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固