at path:ROOT / wp-admin / js / svg-painter.js
run:R W Run
DIR
2026-03-11 16:18:51
R W Run
2.86 KB
2026-03-11 16:18:51
R W Run
758 By
2026-03-11 16:18:51
R W Run
6.24 KB
2026-03-11 16:18:51
R W Run
2.95 KB
2026-03-11 16:18:51
R W Run
5.66 KB
2026-03-11 16:18:51
R W Run
2.04 KB
2026-03-11 16:18:51
R W Run
11.32 KB
2026-03-11 16:18:51
R W Run
3.01 KB
2026-03-11 16:18:51
R W Run
9.54 KB
2026-03-11 16:18:51
R W Run
3.4 KB
2026-03-11 16:18:51
R W Run
2.85 KB
2026-03-11 16:18:51
R W Run
1.28 KB
2026-03-11 16:18:51
R W Run
61.15 KB
2026-03-11 16:18:51
R W Run
23.12 KB
2026-03-11 16:18:51
R W Run
3.35 KB
2026-03-11 16:18:51
R W Run
1.18 KB
2026-03-11 16:18:51
R W Run
1.98 KB
2026-03-11 16:18:51
R W Run
288.41 KB
2026-03-11 16:18:51
R W Run
109.69 KB
2026-03-11 16:18:51
R W Run
111.46 KB
2026-03-11 16:18:51
R W Run
47.14 KB
2026-03-11 16:18:51
R W Run
70.05 KB
2026-03-11 16:18:51
R W Run
27.41 KB
2026-03-11 16:18:51
R W Run
27.02 KB
2026-03-11 16:18:51
R W Run
8.65 KB
2026-03-11 16:18:51
R W Run
37.12 KB
2026-03-11 16:18:51
R W Run
15.13 KB
2026-03-11 16:18:51
R W Run
41.61 KB
2026-03-11 16:18:51
R W Run
13.14 KB
2026-03-11 16:18:51
R W Run
44 KB
2026-03-11 16:18:51
R W Run
12.78 KB
2026-03-11 16:18:51
R W Run
7.67 KB
2026-03-11 16:18:51
R W Run
5.41 KB
2026-03-11 16:18:51
R W Run
3.65 KB
2026-03-11 16:18:51
R W Run
39.98 KB
2026-03-11 16:18:51
R W Run
15.15 KB
2026-03-11 16:18:51
R W Run
20.17 KB
2026-03-11 16:18:51
R W Run
9.41 KB
2026-03-11 16:18:51
R W Run
7.61 KB
2026-03-11 16:18:51
R W Run
2.93 KB
2026-03-11 16:18:51
R W Run
23.09 KB
2026-03-11 16:18:51
R W Run
890 By
2026-03-11 16:18:51
R W Run
423 By
2026-03-11 16:18:51
R W Run
3.89 KB
2026-03-11 16:18:51
R W Run
1.7 KB
2026-03-11 16:18:51
R W Run
1.27 KB
2026-03-11 16:18:51
R W Run
611 By
2026-03-11 16:18:51
R W Run
3.38 KB
2026-03-11 16:18:51
R W Run
1.13 KB
2026-03-11 16:18:51
R W Run
6.61 KB
2026-03-11 16:18:51
R W Run
2.38 KB
2026-03-11 16:18:51
R W Run
61.15 KB
2026-03-11 16:18:51
R W Run
30.06 KB
2026-03-11 16:18:51
R W Run
4.14 KB
2026-03-11 16:18:51
R W Run
1.1 KB
2026-03-11 16:18:51
R W Run
1.31 KB
2026-03-11 16:18:51
R W Run
847 By
2026-03-11 16:18:51
R W Run
6.92 KB
2026-03-11 16:18:51
R W Run
2.35 KB
2026-03-11 16:18:51
R W Run
38.68 KB
2026-03-11 16:18:51
R W Run
18.4 KB
2026-03-11 16:18:51
R W Run
18.49 KB
2026-03-11 16:18:51
R W Run
6.6 KB
2026-03-11 16:18:51
R W Run
10.67 KB
2026-03-11 16:18:51
R W Run
5.03 KB
2026-03-11 16:18:51
R W Run
33.92 KB
2026-03-11 16:18:51
R W Run
17.97 KB
2026-03-11 16:18:51
R W Run
876 By
2026-03-11 16:18:51
R W Run
620 By
2026-03-11 16:18:51
R W Run
13.15 KB
2026-03-11 16:18:51
R W Run
6.13 KB
2026-03-11 16:18:51
R W Run
6.1 KB
2026-03-11 16:18:51
R W Run
2.2 KB
2026-03-11 16:18:51
R W Run
3.2 KB
2026-03-11 16:18:51
R W Run
1.53 KB
2026-03-11 16:18:51
R W Run
10.88 KB
2026-03-11 16:18:51
R W Run
3 KB
2026-03-11 16:18:51
R W Run
5.64 KB
2026-03-11 16:18:51
R W Run
2.22 KB
2026-03-11 16:18:51
R W Run
5.96 KB
2026-03-11 16:18:51
R W Run
2.41 KB
2026-03-11 16:18:51
R W Run
24.77 KB
2026-03-11 16:18:51
R W Run
11.43 KB
2026-03-11 16:18:51
R W Run
54.94 KB
2026-03-11 16:18:51
R W Run
26.51 KB
2026-03-11 16:18:51
R W Run
109.37 KB
2026-03-11 16:18:51
R W Run
47.31 KB
2026-03-11 16:18:51
R W Run
17.91 KB
2026-03-11 16:18:51
R W Run
7.81 KB
2026-03-11 16:18:51
R W Run
2.25 KB
2026-03-11 16:18:51
R W Run
676 By
2026-03-11 16:18:51
R W Run
22.56 KB
2026-03-11 16:18:51
R W Run
12.31 KB
2026-03-11 16:18:51
R W Run
7.52 KB
2026-03-11 16:18:51
R W Run
1.49 KB
2026-03-11 16:18:51
R W Run
740 By
2026-03-11 16:18:51
R W Run
458 By
2026-03-11 16:18:51
R W Run
error_log
📄svg-painter.js
1/**
2 * Attempt to re-color SVG icons used in the admin menu or the toolbar
3 *
4 * @output wp-admin/js/svg-painter.js
5 */
6
7window.wp = window.wp || {};
8
9wp.svgPainter = ( function( $, window, document, undefined ) {
10 'use strict';
11 var selector, painter,
12 colorscheme = {},
13 elements = [];
14
15 $( function() {
16 wp.svgPainter.init();
17 });
18
19 return {
20 init: function() {
21 painter = this;
22 selector = $( '#adminmenu .wp-menu-image, #wpadminbar .ab-item' );
23
24 painter.setColors();
25 painter.findElements();
26 painter.paint();
27 },
28
29 setColors: function( colors ) {
30 if ( typeof colors === 'undefined' && typeof window._wpColorScheme !== 'undefined' ) {
31 colors = window._wpColorScheme;
32 }
33
34 if ( colors && colors.icons && colors.icons.base && colors.icons.current && colors.icons.focus ) {
35 colorscheme = colors.icons;
36 }
37 },
38
39 findElements: function() {
40 selector.each( function() {
41 var $this = $(this), bgImage = $this.css( 'background-image' );
42
43 if ( bgImage && bgImage.indexOf( 'data:image/svg+xml;base64' ) != -1 ) {
44 elements.push( $this );
45 }
46 });
47 },
48
49 paint: function() {
50 // Loop through all elements.
51 $.each( elements, function( index, $element ) {
52 var $menuitem = $element.parent().parent();
53
54 if ( $menuitem.hasClass( 'current' ) || $menuitem.hasClass( 'wp-has-current-submenu' ) ) {
55 // Paint icon in 'current' color.
56 painter.paintElement( $element, 'current' );
57 } else {
58 // Paint icon in base color.
59 painter.paintElement( $element, 'base' );
60
61 // Set hover callbacks.
62 $menuitem.on( 'mouseenter', function() {
63 painter.paintElement( $element, 'focus' );
64 } ).on( 'mouseleave', function() {
65 // Match the delay from hoverIntent.
66 window.setTimeout( function() {
67 painter.paintElement( $element, 'base' );
68 }, 100 );
69 } );
70 }
71 });
72 },
73
74 paintElement: function( $element, colorType ) {
75 var xml, encoded, color;
76
77 if ( ! colorType || ! colorscheme.hasOwnProperty( colorType ) ) {
78 return;
79 }
80
81 color = colorscheme[ colorType ];
82
83 // Only accept hex colors: #101 or #101010.
84 if ( ! color.match( /^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i ) ) {
85 return;
86 }
87
88 xml = $element.data( 'wp-ui-svg-' + color );
89
90 if ( xml === 'none' ) {
91 return;
92 }
93
94 if ( ! xml ) {
95 encoded = $element.css( 'background-image' ).match( /.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/ );
96
97 if ( ! encoded || ! encoded[1] ) {
98 $element.data( 'wp-ui-svg-' + color, 'none' );
99 return;
100 }
101
102 try {
103 xml = window.atob( encoded[1] );
104 } catch ( error ) {}
105
106 if ( xml ) {
107 // Replace `fill` attributes.
108 xml = xml.replace( /fill="(.+?)"/g, 'fill="' + color + '"');
109
110 // Replace `style` attributes.
111 xml = xml.replace( /style="(.+?)"/g, 'style="fill:' + color + '"');
112
113 // Replace `fill` properties in `<style>` tags.
114 xml = xml.replace( /fill:.*?;/g, 'fill: ' + color + ';');
115
116 xml = window.btoa( xml );
117
118 $element.data( 'wp-ui-svg-' + color, xml );
119 } else {
120 $element.data( 'wp-ui-svg-' + color, 'none' );
121 return;
122 }
123 }
124
125 $element.attr( 'style', 'background-image: url("data:image/svg+xml;base64,' + xml + '") !important;' );
126 }
127 };
128
129})( jQuery, window, document );
130