moxie-lean/wp-endpoints-admin-bar
Composer 安装命令:
composer require moxie-lean/wp-endpoints-admin-bar
包简介
Generic endpoint to expose admin bar configuration via WP-API.
关键字:
README 文档
README
Generic endpoint to expose admin bar configuration via WP-API. This extension will create an endpoint (at
`/wp-json/leean/v1/admin-bar`by default).
The endpoint takes a no parameters and returns the following data:
- Site Name
- Current User
- Admin URL
- Logout URL
- Edit Page URL
- New Items
- New Item Name
- New Item URL
Getting Started
The easiest way to install this package is by using composer from your terminal:
composer require moxie-lean/wp-endpoints-admin-bar
Or by adding the following lines on your composer.json file
"require": {
"moxie-lean/wp-endpoints-admin-bar": "dev-master"
}
This will download the files from the packagist site and set you up with the latest version located on master branch of the repository.
After that you can include the autoload.php file in order to
be able to autoload the class during the object creation.
include '/vendor/autoload.php';
Finally you need to initialise the endpoint by adding this to your code:
\Lean\Endpoints\AdminBarApi::init();
Usage
The extension has a number of filters which can be used to customised the output. In addition it does some useful extra manipulation of ACF data to make it more useful to a front-end app.
Filters
Common parameters passed by many filers are:
- $endpoint : the name of the endpoint. Always '/admin-bar' for this extension.
ln_endpoints_api_namespace
Customise the API namespace ('leean' in `/wp-json/leean/v1/admin-bar`)
add_filter( 'ln_endpoints_api_namespace', function( $namespace, $endpoint ) {
return 'my-app';
}, 10, 2 );
ln_endpoints_api_version
Customise the API version ('v1' in `/wp-json/leean/v1/admin-bar`)
add_filter( 'ln_endpoints_api_version', function( $version, $endpoint ) {
return 'v2';
}, 10, 2 );
ln_endpoints_data
Customise the results just before they are sent.
add_filter( 'ln_endpoints_data', function( $data, $endpoint ) {
$data['site_name'] = 'New Site Name';
return $data;
}, 10, 3 );
moxie-lean/wp-endpoints-admin-bar 适用场景与选型建议
moxie-lean/wp-endpoints-admin-bar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.9k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 05 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「wordpress」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 moxie-lean/wp-endpoints-admin-bar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 moxie-lean/wp-endpoints-admin-bar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 moxie-lean/wp-endpoints-admin-bar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Must-use plugin integrating WordPress with the Upsun platform: environment awareness, router-cache friendliness, safe preview clones, deploy migrations, Site Health checks, and a wp upsun CLI command.
A lightweight plain-PHP framework for database-backed CRUD APIs.
Modern, strongly-typed, PSR-compliant PHP client for the WeFact v2 API.
PHP SDK for the Enconvert file conversion API
支付宝开放平台v3协议文档,支持最新版PHP8+
统计信息
- 总下载量: 1.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-03