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.
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
其他信息
- 授权协议: gpl-3.0-or-later
- 更新时间: 2024-11-11
