GC_Customize_Manager::remove_panel()

最后更新于:2021-11-27 01:43:37

GC_Customize_Manager::remove_panel( string$id)

Remove a customize panel.

参数

$id

(string) (Required) Panel ID to remove.

源文件

文件: gc-includes/class-gc-customize-manager.php

	public function remove_panel( $id ) {
		// Removing core components this way is _doing_it_wrong().
		if ( in_array( $id, $this->components, true ) ) {
			_doing_it_wrong(
				__METHOD__,
				sprintf(
					/* translators: 1: Panel ID, 2: Link to 'customize_loaded_components' filter reference. */
					__( 'Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.' ),
					$id,
					sprintf(
						'<a href="https://docs.gechiui.com/classes/gc_customize_manager/remove_panel/%1$s">%2$s</a>',
						esc_url( 'https://docs.gechiui.com/hooks/customize_loaded_components/' ),
						'<code>customize_loaded_components</code>'
					)
				),
				'4.5.0'
			);
		}
		unset( $this->panels[ $id ] );
	}