voceconnect / voce-post-meta-psu
用于Post选择UI字段的Post Meta API扩展
1.3.1
2015-10-09 02:01 UTC
Requires
README
贡献者:kevinlangleyjr, voceplatforms
标签:meta, psu, post, selection
至少需要:3.0
测试到:4.3.1
稳定标签:1.2.0
许可证:GPLv2或更高版本
许可证URI:https://gnu.ac.cn/licenses/gpl-2.0.html
描述
通过post selection ui输入扩展Voce Post Meta
安装
作为标准插件
见安装插件。
作为主题或插件依赖项
将插件拖入包含的主题或插件后,添加以下内容
if( ! class_exists( 'Voce_Post_Meta_Post_Selection_UI' ) ) { require_once( $path_to_voce_post_meta_psu . '/voce-post-meta-psu.php' ); }
用法
示例
<?php add_action('init', function(){ add_metadata_group( 'demo_meta', 'Page Options', array( 'capability' => 'edit_posts' )); add_metadata_field( 'demo_meta', 'post_selection_ui_key', 'Title', 'psu', array( 'post_type' => 'custom_post_type', 'post_status' => 'publish', 'limit' => 3 ) ); add_post_type_support( 'page', 'demo_meta' ); }); ?>
1.3.0
*当多个项目依赖项需要时,更好地处理自动加载文件
1.2.0
将sanitize回调函数单独成方法,而不是匿名函数。增加对post选择UI值的更好验证。
1.1.1
更新composer.json,将要求VPM ~1.6而不是~1.6.0
1.1.0
如果$new_value为空,现在将sanitize回调返回null
1.0.0
初始版本。