Skip to content

Instantly share code, notes, and snippets.

@kovshenin
Created March 3, 2014 15:49
Show Gist options
  • Save kovshenin/9327833 to your computer and use it in GitHub Desktop.
Save kovshenin/9327833 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Reproduce #26533
*/
add_action( 'admin_bar_menu', function() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
'id' => 'foo',
'title' => '<span id="foo-icon" class="ab-item" style="height: 32px !important; width: 32px !important; display: block; background: red;"></span>',
'href' => '#',
) );
} );
add_action( 'admin_head', function() {
?>
<style>
#foo-icon {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyMHB4Ig0KCSBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjAgMjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGcgaWQ9IkxheWVyXzEiPg0KCQ0KCQk8aW1hZ2Ugb3ZlcmZsb3c9InZpc2libGUiIHdpZHRoPSI4OTIiIGhlaWdodD0iMjQwIiB4bGluazpocmVmPSJTY3JlZW4gU2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4zLDAuMTENCgkJYy0wLjE2MiwwLTAuMzUyLTAuMDA0LTAuNTU1LTAuMDFDNC4zMzUsMi45Miw2Ljk4NywxLjM3MywxMCwxLjM3M2MyLjI0NiwwLDQuMjkyLDAuODU5LDUuODI2LDIuMjY1DQoJCWMtMC4wMzctMC4wMDItMC4wNzMtMC4wMDgtMC4xMTItMC4wMDhjLTAuODQ3LDAtMS40NDksMC43MzktMS40NDksMS41MzFjMCwwLjcxMiwwLjQxMSwxLjMxMywwLjg0NywyLjAyNQ0KCQljMC4zMjksMC41NzQsMC43MTIsMS4zMTIsMC43MTIsMi4zNzljMCwwLjczNy0wLjI4NCwxLjU5Ni0wLjY1NywyLjc4OGwtMC44NjEsMi44NzVMMTEuMTg5LDUuOTU1eiBNMTcuNTcsNS44Ng0KCQlDMTguMjQ0LDcuMDksMTguNjI3LDguNSwxOC42MjcsMTBjMCwzLjE4Mi0xLjcyNSw1Ljk2MS00LjI5LDcuNDU2bDIuNjM1LTcuNjE3YzAuNDkyLTEuMjMxLDAuNjU3LTIuMjE2LDAuNjU3LTMuMDkxDQoJCUMxNy42MjksNi40MzEsMTcuNjA4LDYuMTM2LDE3LjU3LDUuODZ6Ii8+DQo8L2c+DQo8L3N2Zz4NCg==) !important;
background-position: 50% 50%;
background-repeat: no-repeat;
width: 32px;
height: 32px;
display: inline-block;
}
</style>
<?php
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment