內容簡介
這是一個基於Daryl Koopersmith的模組化主題概念和修補程序(#12877)的外掛實現。 它提供了get_template_module()函數,使主題的代碼高度可重用並且具有良好的結構。要了解有關使用此函數的更多信息,請閱讀Daryl系列文章:
模組化主題,第1部分:為什麼?
模組化主題,第2部分:主題組織
模組化主題,性能
如果你喜歡這種 WordPress 主題設計方法,請投票支持票 #12877。理想情況是將此功能提供在WordPress核心中,而此外掛僅是一個概念證明的例子,並且為主題開發人員提供了一種開始使用模組化主題的簡單方法。大部分外掛程式碼直接從Daryl的修補程序中複製而來,唯一的例外是update_template_hierarchy()函數,在WordPress核心中它複製了許多來自wp-includes / theme.php的模板選擇邏輯。
外掛標籤
開發者團隊
原文外掛簡介
This is a plugin based implementation of Daryl Koopersmith’s modular themes concept and patch
(#12877). It provides the get_template_module() function, which allows for the creation
of well-architected themes with highly reusable code. For more on the use of this function,
read Daryl’s series of posts:
Modular Themes, Part 1: Why?
Modular Themes, Part 2: Theme Organization
Modular Themes, Performance
If you like this method of WordPress theme design, then vote up ticket #12877. The ideal
scenario is for this functionality to be provided in WordPress core. This plugin is simply a proof
of concept, and provides an easy way for theme developers to start playing with modular themes. The
bulk of this plugin is directly from Daryl’s patch. The one exception being the
update_template_hierarchy() function, which duplicates much of the template selection logic from
wp-includes/theme.php in WordPress core.
