wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_widgets_add_menu › WordPress Function

Since2.2.0
已弃用n/a
wp_widgets_add_menu ( 没有参数 )
定义在:
文档:
Change Log:
  • 5.9.3

Appends the Widgets menu to the themes main menu.



源码

function wp_widgets_add_menu() {
	global $submenu;

	if ( ! current_theme_supports( 'widgets' ) ) {
		return;
	}

	$menu_name = __( 'Widgets' );
	if ( wp_is_block_theme() || current_theme_supports( 'block-template-parts' ) ) {
		$submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
	} else {
		$submenu['themes.php'][8] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
	}

	ksort( $submenu['themes.php'], SORT_NUMERIC );
}