开发者 | damchtlv |
---|---|
更新时间 | 2022年3月20日 03:41 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 5.8 |
版权: | GPL v2 or later |
版权网址: | 版权信息 |
plugin-tags
folder to the /wp-content/plugins/
directoryYes, there is one filter: ptags/option
which contains all the data saved by the plugin in an array which is stored in a single option.
You can use the code below to preset your favorite configuration (used "Hello Dolly" plugin as example):
`
// Change plugin tags config
add_filter( 'ptags/option', 'my_ptags_option' );
function my_ptags_option( $option ) {
// Get current plugins & tags data
$plugins = isset( $option['plugins'] ) ? $option['plugins'] : array();
$tags = isset( $option['tags'] ) ? $option['tags'] : array();
// Edit plugins data
$plugins = wp_parse_args(
$plugins,
array(
// Plugin slug
'hello-dolly' => array(
'tag' => __( 'To delete' ), // Tag text displayed next to the plugin version
'color' => 1, // User preference schematic colors, from 1 to 4+
),
// ... add more by duplicating lines above
)
);
// Edit tags data
$tags = wp_parse_args(
$tags,
array(
// Filter text (should be same tag text as above)
'To delete' => array(
'view' => 1, // Boolean setting to display filter above plugins list
),
// ... add more by duplicating lines above
)
);
// We merge it with current data
$new_option = wp_parse_args( array( 'plugins' => $plugins, 'tags' => $tags ), $option );
// Return the new option
return $new_option;
}
`
💡 If you have no idea where to put this code, add it at the end of your functions.php
which is in your theme folder.
Yes you can and it's fairly simple because this plugin CSS stylesheet use CSS variables. Just add the code below in a CSS stylesheet loaded in the admin & customize values as you pleased: ` :root { --plugin-tag-color: #fff; // Tag text color --plugin-tag-pad: 0 7px; // Tag padding --plugin-tag-rad: 3px; // Tag border radius --plugin-tag-fs: .75rem; // Tag font-size --plugin-tag-bg: #bbb; // Tag background color } `