From a6445682990f5271ac1752cd111839185e3bae57 Mon Sep 17 00:00:00 2001 From: joyqi Date: Tue, 10 Dec 2013 23:41:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- var/Widget/Contents/Page/Edit.php | 8 ++++++++ var/Widget/Contents/Post/Edit.php | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/var/Widget/Contents/Page/Edit.php b/var/Widget/Contents/Page/Edit.php index 9b641f0a..490b5552 100644 --- a/var/Widget/Contents/Page/Edit.php +++ b/var/Widget/Contents/Page/Edit.php @@ -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'; + /** * 执行函数 * diff --git a/var/Widget/Contents/Post/Edit.php b/var/Widget/Contents/Post/Edit.php index 9d2d2aeb..04117c5c 100644 --- a/var/Widget/Contents/Post/Edit.php +++ b/var/Widget/Contents/Post/Edit.php @@ -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();