增加模板自定义字段hook

This commit is contained in:
joyqi 2013-12-10 23:41:09 +08:00
parent 45ecb0cd29
commit a644568299
2 changed files with 20 additions and 0 deletions

View File

@ -20,6 +20,14 @@
*/
class Widget_Contents_Page_Edit extends Widget_Contents_Post_Edit implements Widget_Interface_Do
{
/**
* 自定义字段的hook名称
*
* @var string
* @access protected
*/
protected $themeCustomFieldsHook = 'themePageFields';
/**
* 执行函数
*

View File

@ -20,6 +20,14 @@
*/
class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widget_Interface_Do
{
/**
* 自定义字段的hook名称
*
* @var string
* @access protected
*/
protected $themeCustomFieldsHook = 'themePostFields';
/**
* 将tags取出
*
@ -489,6 +497,10 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
if (function_exists('themeFields')) {
themeFields($layout);
}
if (function_exists($this->themeCustomFieldsHook)) {
call_user_func($this->themeCustomFieldsHook, $layout);
}
}
$items = $layout->getItems();