PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.2
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.2
2.4.3 2.4.4 2.4.2 2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 All 60 releases
← All changes | includes/Admin/EasyInvoiceAdmin.php +19 -1 2.4.0 → 2.4.2 View file →
@@ -189,8 +189,26 @@
189 189 }
190 190 }
191 191
192 192 /**
193 + * The admin menu mark: the same document-and-tick glyph as the plugin
194 + * icon, monochrome so it follows WordPress' menu colour schemes. Falls
195 + * back to a dashicon if the file is ever missing from the build.
196 + *
197 + * @return string Data URI, or a dashicon class.
198 + */
199 + public static function menuIcon() {
200 + static $icon = null;
201 + if ($icon !== null) {
202 + return $icon;
203 + }
204 + $file = EASY_INVOICE_PLUGIN_DIR . 'assets/images/menu-icon.svg';
205 + $svg = is_readable($file) ? file_get_contents($file) : '';
206 + $icon = $svg ? 'data:image/svg+xml;base64,' . base64_encode($svg) : 'dashicons-media-text';
207 + return $icon;
208 + }
209 +
210 + /**
193 211 * Register admin menu pages
194 212 */
195 213 public function registerMenuPages() {
196 214 // Main menu item
@@ -199,9 +217,9 @@
199 217 __('Easy Invoice', 'easy-invoice'),
200 218 $this->menuCapability(PagesSlugs::DASHBOARD),
201 219 PagesSlugs::DASHBOARD,
202 220 array($this, 'displayMainPage'),
203 - 'dashicons-media-text',
221 + self::menuIcon(),
204 222 25
205 223 );
206 224
207 225 // Dashboard submenu