mirror of
https://github.com/typecho/typecho.git
synced 2025-03-20 01:49:40 +01:00
增加模板自定义字段hook
This commit is contained in:
parent
45ecb0cd29
commit
a644568299
@ -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';
|
||||
|
||||
/**
|
||||
* 执行函数
|
||||
*
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user