PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
gutenberg / lib / experimental / dashboard-widgets / widget-icons.php

widget-icons.php in Gutenberg 24.1.0, at lib/experimental/dashboard-widgets/widget-icons.php

67 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Widget-owned icons.
4 *
5 * Icons the widgets reference declaratively but that are not public in
6 * the `core` collection, registered under a collection the widgets own.
7 *
8 * @package gutenberg
9 */
10
11 /**
12 * Registers the dashboard widgets icon collection and its icons.
13 *
14 * Content is sourced from the `@wordpress/icons` library files.
15 */
16 function gutenberg_register_dashboard_widget_icons() {
17 if ( ! function_exists( 'wp_register_icon_collection' ) ) {
18 return;
19 }
20
21 // Register widget-dashboard icon collection
22 wp_register_icon_collection(
23 'dashboard-widgets',
24 array(
25 'label' => __( 'Dashboard Widgets', 'gutenberg' ),
26 'description' => __( 'Icons owned by the dashboard widgets.', 'gutenberg' ),
27 )
28 );
29
30 // Register temporary draft icon since it's still a core private icon
31 wp_register_icon(
32 'dashboard-widgets/drafts',
33 array(
34 'label' => __( 'Drafts', 'gutenberg' ),
35 'file_path' => gutenberg_dir_path() . 'packages/icons/src/library/drafts.svg',
36 )
37 );
38
39 // Register temporary WordPress icon since it's still a core private icon
40 wp_register_icon(
41 'dashboard-widgets/wordpress',
42 array(
43 'label' => __( 'WordPress', 'gutenberg' ),
44 'file_path' => gutenberg_dir_path() . 'packages/icons/src/library/wordpress.svg',
45 )
46 );
47
48 // Register temporary site logo icon since it's still a core private icon
49 wp_register_icon(
50 'dashboard-widgets/site-logo',
51 array(
52 'label' => __( 'Site Logo', 'gutenberg' ),
53 'file_path' => gutenberg_dir_path() . 'packages/icons/src/library/site-logo.svg',
54 )
55 );
56
57 // Register temporary seen icon since it's still a core private icon
58 wp_register_icon(
59 'dashboard-widgets/seen',
60 array(
61 'label' => __( 'Seen', 'gutenberg' ),
62 'file_path' => gutenberg_dir_path() . 'packages/icons/src/library/seen.svg',
63 )
64 );
65 }
66 add_action( 'init', 'gutenberg_register_dashboard_widget_icons' );
67