vk-admin
7 years ago
admin_bar.php
7 years ago
content-meta-box.php
7 years ago
customizer.php
7 years ago
disable_guide.php
7 years ago
vk-admin-config.php
7 years ago
disable_guide.php
38 lines
| 1 | <?php |
| 2 | /** |
| 3 | * VkExUnit disable_guide.php |
| 4 | * hide admin button. |
| 5 | * |
| 6 | * @package VkExUnit |
| 7 | * @author shoji imamura<imamura@vektor-inc.co.jp> |
| 8 | * @since 28/Aug/2015 |
| 9 | */ |
| 10 | |
| 11 | |
| 12 | add_action( 'admin_bar_menu', 'vkExUnit_adminbar_disable', 999 ); |
| 13 | function vkExUnit_adminbar_disable( $wp_admin_bar ) { |
| 14 | if ( is_user_logged_in() && ! is_admin() && current_user_can( 'administrator' ) || current_user_can( 'editor' ) ) { |
| 15 | $args = array( |
| 16 | 'id' => 'veu_disable_admin_edit', |
| 17 | 'title' => __( 'Edit Guide', 'vk-all-in-one-expansion-unit' ).' : <span class="_show">SHOW</span><span class="_hide">HIDE</span>', |
| 18 | 'meta' => array( 'class' => 'veu_admin_bar_disable_button' , 'onClick' => 'javascript:void(0);' ), |
| 19 | ); |
| 20 | $wp_admin_bar->add_node( $args ); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | |
| 25 | |
| 26 | add_action( 'wp_head','vkExUnit_adminbar_edit_header' ); |
| 27 | function vkExUnit_adminbar_edit_header() { |
| 28 | if ( is_user_logged_in() && ! is_admin() && current_user_can( 'administrator' ) || current_user_can( 'editor' ) ) { ?> |
| 29 | <style>#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item { background-color: #0085C8; cursor: pointer; } |
| 30 | #wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item ._hide { display: none; } |
| 31 | #wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item.active { background-color: #17A686; color: #555; } |
| 32 | #wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item.active ._show { display: none; } |
| 33 | #wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item.active ._hide { display: inline; } |
| 34 | #wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item:hover { background-color: #17A686; color: #555; } |
| 35 | #wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item.active:hover { background-color: #0085C8; color: #fff; }</style> |
| 36 | <?php } |
| 37 | } |
| 38 |