This commit is contained in:
Javier Casares 2026-11-04 18:31:41 +00:00
commit b9e68a737d

View file

@ -25,6 +25,20 @@ class Robotstxt_Manager_Admin {
*/
public const PAGE_SLUG = 'robotstxt-manager';
/**
* Raw SVG for the admin menu icon: a "screen options" grid in the
* standard admin icon gray (#a7aaad), rendered by WordPress as a
* 20px background image.
*
* Served base64-encoded as a data:image/svg+xml URI — the icon format
* WordPress documents for add_menu_page() and the direction core is
* taking with inline SVG icons (dashicons are frozen). Supported by
* every WordPress version the plugin runs on.
*
* @var string
*/
private const MENU_ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><g fill="#a7aaad"><rect x="3" y="3.5" width="5.5" height="5.5" rx="1"/><rect x="11.5" y="3.5" width="5.5" height="5.5" rx="1"/><rect x="3" y="11" width="5.5" height="5.5" rx="1"/><rect x="11.5" y="11" width="5.5" height="5.5" rx="1"/></g></svg>';
/**
* Registers all hooks via the loader.
*
@ -53,7 +67,7 @@ class Robotstxt_Manager_Admin {
$cap,
self::PAGE_SLUG,
array( $this, 'render_page' ),
'dashicons-screenoptions',
'data:image/svg+xml;base64,' . base64_encode( self::MENU_ICON_SVG ), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- documented WP menu-icon format; nothing is obfuscated.
71
);
}