|
1 | | -import { Section, Row, Col, Table, List, Code, Tag, PackageInstallGuide, PropSection, CommonPropsNotice } from '@wpmudev/sui-docs'; |
| 1 | +import { Section, Row, Col, Table, List, Code, Tag, PackageInstallGuide, PropSection, CommonPropsNotice, Snippet } from '@wpmudev/sui-docs'; |
2 | 2 |
|
3 | 3 | <PackageInstallGuide packageName="@wpmudev/sui-tag" /> |
4 | 4 |
|
@@ -64,4 +64,75 @@ import { Section, Row, Col, Table, List, Code, Tag, PackageInstallGuide, PropSec |
64 | 64 |
|
65 | 65 | </Section> |
66 | 66 |
|
| 67 | +<Section title="Function to add tags in plugin menu." border={true}> |
| 68 | + <p>Use this function to use tags in plugin menu.</p> |
| 69 | + <List> |
| 70 | + <span label={"Replace plugin_id with the unique id of the plugin in the body tag."} /> |
| 71 | + <span label={<><Code small={true}>li:nth-child(3)</Code> the number should be the item number in the list which to target. </>} /> |
| 72 | + </List> |
| 73 | +<Snippet language="console" hideToggle={true}> |
| 74 | +{`<?php |
| 75 | +public function print_menu_styles() { |
| 76 | +?> |
| 77 | +<style> |
| 78 | +#adminmenu #plugin_id li span.menu-tag { |
| 79 | + background-color: #737373; |
| 80 | + border-radius: 12px; |
| 81 | + color: #ffffff; |
| 82 | + font-size: 10px; |
| 83 | + font-style: normal; |
| 84 | + font-weight: 700; |
| 85 | + height: 16px; |
| 86 | + letter-spacing: -0.1px; |
| 87 | + line-height: 12px; |
| 88 | + padding: 2px 8px; |
| 89 | + text-align: center; |
| 90 | + width: 38px; |
| 91 | +} |
| 92 | +
|
| 93 | +#adminmenu #plugin_id li span.menu-tag.menu-tag--green { |
| 94 | + background-color: #138639; |
| 95 | +} |
| 96 | +
|
| 97 | +#adminmenu #plugin_id li span.menu-tag.menu-tag--blue { |
| 98 | + background-color: #0059ff; |
| 99 | +} |
| 100 | +
|
| 101 | +#adminmenu #plugin_id li span.menu-tag.menu-tag--navy { |
| 102 | + background-color: #0045c4; |
| 103 | +} |
| 104 | +
|
| 105 | +#adminmenu #plugin_id li span.menu-tag.menu-tag--yellow { |
| 106 | + background-color: #ffcc20; |
| 107 | + color: #1a1a1a; |
| 108 | +} |
| 109 | +
|
| 110 | +#adminmenu #plugin_id li span.menu-tag.menu-tag--red { |
| 111 | + background-color: #f45c59; |
| 112 | +} |
| 113 | +
|
| 114 | +#adminmenu #plugin_id li span.menu-tag.menu-tag--black { |
| 115 | + background-color: #1a1a1a; |
| 116 | +} |
| 117 | +
|
| 118 | +#adminmenu #plugin_id li span.menu-tag.menu-tag--white { |
| 119 | + background-color: #ffffff; |
| 120 | + color: #1a1a1a; |
| 121 | +} |
| 122 | +
|
| 123 | +#adminmenu #plugin_id ul.wp-submenu li:nth-child(3) a { |
| 124 | + color: #138639; |
| 125 | +} |
| 126 | +</style> |
| 127 | +<?php |
| 128 | +} |
| 129 | +?>`} |
| 130 | +</Snippet> |
| 131 | +<Snippet language="php" hideToggle={true}> |
| 132 | +{`public static function get_menu_title() { |
| 133 | + return esc_html__( 'Reseller', 'thc' ) . ' <span class="menu-tag menu-tag--green">' . esc_html__( 'NEW', 'plugin-name' ) . '</span>'; |
| 134 | +}`} |
| 135 | +</Snippet> |
| 136 | +</Section> |
| 137 | + |
67 | 138 | <CommonPropsNotice /> |
0 commit comments