elvishp2006/carbon-field-rest-api-select
Composer 安装命令:
composer require elvishp2006/carbon-field-rest-api-select
包简介
Carbon Fields extension, that adds a rest_api_select field type.
README 文档
README
Disponibilize the rest_api_select field that fill options using the WP REST API.
Installing
composer require elvishp2006/carbon-field-rest-api-select
Example
Field::make( 'rest_api_select', 'id', __( 'Post' ) ) ->set_endpoint_label_path( 'title.rendered' ) // Default: 'title.rendered' ->set_endpoint_value_path( 'id' ) // Default 'id' ->set_endpoint_search_param( 'search' ) // Default 'search' ->set_endpoint_params( [ 'per_page' => 20, 'orderby' => 'relevance', ] ) ->set_endpoint( rest_url( 'wp/v2/posts' ) )
统计信息
- 总下载量: 503
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2018-08-30