php - 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')
提前致谢 :)
解决方案
推荐阅读
- html - 阴影背景大小的问题
- database - 为什么我在 XAMP 上托管的网站在本地主机上没有数据库错误?
- blazor - 在 blazor 页面上设置参数时 IIS 和独立应用程序崩溃
- spring - 尝试将 Spring 版本从 5.1 升级到 5.2 时出错
- meshlab - Meshlab-是否有一种简单的方法可以参考单个点来设置可能的坐标系统?
- mysql - MySQL 查询客户尚未选择的日期
- magento - 在 magento 2.3 中从外部服务器导入图像
- python - 熊猫:字典列到键和值列
- c - 如何将文件的内容存储到数组中(直到其最大容量)
- html - 水平滚动菜单的问题