定制 cmatosbc/oopress-menus 二次开发

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

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

cmatosbc/oopress-menus

最新稳定版本:1.0.0

Composer 安装命令:

composer require cmatosbc/oopress-menus

包简介

Menus OOP structures and better iterators.

README 文档

README

Retrieve WP menus as pure data, as array or JSON. Also allows the data to be passed to a particular template in Wordpress.

OOPress

Usage

Usage is pretty simple. You need to instantiate the class with the menu ID or slug, then use the method fetch() to access the data. Further, the method getItems() may return the structured menu data as array or JSON (using true). Finally, the method render() passes the menu data through a template part, rendering it (in the template, the menu data can be accessed from $args['data']).

// Create the instance for "menu-1" menu
$menuData = (new \Oopress\Menus\Fetcher('testing'))
            ->fetch()
            ->getItems(true); // Fetches menu data and returns the data in JSON (or array if not TRUE)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: gpl-3.0-or-later
  • 更新时间: 2024-11-11