/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
lib/experimental/dashboard-widgets/widget-icons.php
66 строк
2 KB
Damián Suárez
Dashboard Widgets: add icon and relevance to the widget action envelope (#81275)
10 авг 2026, 13:14
Не верифицирован
10 авг 2026, 13:14
be74d5d
Код
Авторство
О чём код?
<?php /** * Widget-owned icons. * * Icons the widgets reference declaratively but that are not public in * the `core` collection, registered under a collection the widgets own. * * @package gutenberg */ /** * Registers the dashboard widgets icon collection and its icons. * * Content is sourced from the `@wordpress/icons` library files. */ function gutenberg_register_dashboard_widget_icons() { if ( ! function_exists( 'wp_register_icon_collection' ) ) { return; } // Register widget-dashboard icon collection wp_register_icon_collection( 'dashboard-widgets', array( 'label' => __( 'Dashboard Widgets', 'gutenberg' ), 'description' => __( 'Icons owned by the dashboard widgets.', 'gutenberg' ), ) ); // Register temporary draft icon since it's still a core private icon wp_register_icon( 'dashboard-widgets/drafts', array( 'label' => __( 'Drafts', 'gutenberg' ), 'file_path' => gutenberg_dir_path() . 'packages/icons/src/library/drafts.svg', ) ); // Register temporary WordPress icon since it's still a core private icon wp_register_icon( 'dashboard-widgets/wordpress', array( 'label' => __( 'WordPress', 'gutenberg' ), 'file_path' => gutenberg_dir_path() . 'packages/icons/src/library/wordpress.svg', ) ); // Register temporary site logo icon since it's still a core private icon wp_register_icon( 'dashboard-widgets/site-logo', array( 'label' => __( 'Site Logo', 'gutenberg' ), 'file_path' => gutenberg_dir_path() . 'packages/icons/src/library/site-logo.svg', ) ); // Register temporary seen icon since it's still a core private icon wp_register_icon( 'dashboard-widgets/seen', array( 'label' => __( 'Seen', 'gutenberg' ), 'file_path' => gutenberg_dir_path() . 'packages/icons/src/library/seen.svg', ) ); } add_action( 'init', 'gutenberg_register_dashboard_widget_icons' );