| 1 |
<?php |
| 2 |
|
| 3 |
use WPCoder\Dashboard\FieldHelper; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
?> |
| 8 |
|
| 9 |
<div class="wowp-snippets__header"> |
| 10 |
<h3 class="wowp-snippets__header-title">Admin Interface Tweaks</h3> |
| 11 |
<p class="wowp-snippets__header-description">Streamline the WordPress admin experience.</p> |
| 12 |
</div> |
| 13 |
|
| 14 |
<?php |
| 15 |
|
| 16 |
$snippets = [ |
| 17 |
'disable_screen_options' => [ |
| 18 |
'Disable ‘Screen Options’ Tab', |
| 19 |
'Remove the “Screen Options” tab from admin pages.', |
| 20 |
], |
| 21 |
|
| 22 |
'disable_welcome_panel' => [ |
| 23 |
'Disable Welcome Panel', |
| 24 |
'Hide the welcome panel on the dashboard for all users.', |
| 25 |
], |
| 26 |
'enable_duplication' => [ |
| 27 |
'Content Duplication', |
| 28 |
'Allow duplicating posts from the admin panel.', |
| 29 |
], |
| 30 |
]; |
| 31 |
|
| 32 |
self::create_options( $snippets ); |
| 33 |
|
| 34 |
?> |
| 35 |
<div class="wowp-snippet__list"> |
| 36 |
<div class="wowp-snippet__item"> |
| 37 |
<div class="wowp-snippet__item-header"> |
| 38 |
<label for="disable_admin_bar">Disable The WP Admin Bar</label> |
| 39 |
<p class="wowp-snippet__item-description">Hide the admin bar for all users on the frontend.</p> |
| 40 |
</div> |
| 41 |
<div class="wowp-field has-checkbox"> |
| 42 |
<label class="switch"> |
| 43 |
<?php self::field( 'checkbox', 'disable_admin_bar' ); ?> |
| 44 |
<span class="slider"></span> |
| 45 |
</label> |
| 46 |
</div> |
| 47 |
<div class="wowp-snippet__item-expand is-hidden"> |
| 48 |
<p class="wowp-snippet__expand-title">Show the sidebar for users:</p> |
| 49 |
<div class="wowp-fields__group"> |
| 50 |
<?php foreach ( FieldHelper::user_roles() as $key => $value ) : |
| 51 |
if ( $key === 'all' ) { |
| 52 |
continue; |
| 53 |
} |
| 54 |
?> |
| 55 |
<div class="wowp-field has-checkbox"> |
| 56 |
<span class="label"><?php echo esc_html( $value ); ?></span> |
| 57 |
<label class="switch"> |
| 58 |
<?php self::field( 'checkbox', 'disable_admin_bar_user_' . $key ); ?> |
| 59 |
<span class="slider"></span> |
| 60 |
</label> |
| 61 |
</div> |
| 62 |
<?php endforeach; ?> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
</div> |
| 67 |
|
| 68 |
<?php |
| 69 |
|