首页 > 解决方案 > wordpress customize_register 上的多个函数?

问题描述

为了更好地组织我的主题的functions.php,我想知道是否可以在custom_register 上使用add_action 添加多个函数?像这样的例子:

function banana_customize($wp_customize) {
///// Content of function }
add_action('customize_register','banana_customize')

function coconut_customize($wp_customize) {
///// Content of function }
add_action('customize_register','coconut_customize')

如果我这样做,我有一个错误,页面将不会加载。

如果这是不可能的,你能告诉我如何组合这样的功能:

function banana_customize($wp_customize) {
///// Content of function }

function coconut_customize($wp_customize) {
///// Content of function }

" function combined_functions = banana_customize + coconut_customize "

add_action('customize_register','combined_functions')

提前致谢 :)

标签: phpwordpressfunctionwordpress-theming

解决方案


推荐阅读