对您可以在customize_register
行动例如:
<?php
// File: functions.php
add_action( \'customize_register\', function( $wp_customize ) {
require_once dirname( __FILE__ ) . \'/inc/customize.php\';
wpse256532_customize_register( $wp_customize );
} );
以及
inc/customize.php
文件:
<?php
// File: customize.php
function wpse256532_customize_register( $wp_customize ) {
$wp_customize->add_setting( /* ... */ );
$wp_customize->add_control( /* ... */ );
// ...
}
// ... any additional customizer classes and other includes ...