-
StackOverflow 文件
-
WordPress 教程
-
定製器基礎(新增面板,部分,設定,控制)
-
新增自定義面板
<?php
/**
* Panel: WPCustomize
*
* Basic Customizer panel with basic controls.
*
* @since 1.0.0
* @package WPC
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Customize function.
if ( ! function_exists( 'wpc_panel_wpcustomize' ) ) {
// Customize Register action.
add_action( 'customize_register', 'wpc_panel_wpcustomize' );
/**
* Customize Panel.
*
* Adds a Panel, Section with basic controls.
*
* @param object WP_Customize $wp_customize Instance of the WP_Customize_Manager class.
* @since 1.0.0
*/
function wpc_panel_wpcustomize( $wp_customize ) {
// Panel: Basic.
$wp_customize->add_panel( 'wpc_panel_wpcustomize', array(
'priority' => 10,
'title' => __( 'WPCustomize Panel Title', 'WPC' ),
'description' => __( 'Panel Description', 'WPC' ),
'capability' => 'edit_theme_options'
) );
}
}