Skip to content

Commit b15e5f8

Browse files
committed
Add icon to admin bar.
1 parent 95f7418 commit b15e5f8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/WpAdmin/Admin.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,22 @@ protected function adminBarMenu(WP_Admin_Bar $wp_admin_bar)
118118

119119
$wp_admin_bar->add_node([
120120
'id' => WpRestApiCache::ID,
121-
'title' => \esc_html__('REST API Cache', 'wp-rest-api-cache'),
121+
'title' => \sprintf(
122+
'<span class="ab-icon dashicons dashicons-shield" title="%s"></span><span class="ab-label">%s</span>',
123+
\esc_attr__('REST API Cache', 'wp-rest-api-cache'),
124+
\esc_html__('REST Cache', 'wp-rest-api-cache')
125+
)
122126
]);
123127
$wp_admin_bar->add_menu([
124128
'parent' => WpRestApiCache::ID,
125129
'id' => self::MENU_ID,
126130
'title' => \esc_html__('Empty all cache', 'wp-rest-api-cache'),
127131
'href' => \esc_url($this->getEmptyCacheUrl()),
128132
'meta' => [
129-
'onclick' => 'return confirm("This will clear ALL cache, continue?")'
133+
'onclick' => \sprintf(
134+
'return confirm("%s")',
135+
\esc_attr__('This will clear ALL cache, continue?', 'wp-rest-api-cache')
136+
)
130137
]
131138
]);
132139
}

0 commit comments

Comments
 (0)