| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +use WPCoder\Dashboard\FieldHelper; | |
| 4 | + | |
| 3 | 5 | defined( 'ABSPATH' ) || exit; |
| 4 | 6 | |
| 5 | 7 | $disabled_snippets = [ |
| 6 | 8 | 'disable_gutenberg' => [ |
| @@ -16,13 +18,13 @@ | ||
| 16 | 18 | 'disable_widget_blocks' => [ |
| 17 | 19 | 'Disable Widget Blocks', |
| 18 | 20 | 'Use the classic interface instead of Blocks to manage Widgets.', |
| 19 | 21 | ], |
| 20 | - 'remove_wp_version' => [ | |
| 22 | + 'remove_wp_version' => [ | |
| 21 | 23 | 'Remove WordPress Version Number', |
| 22 | 24 | 'Hide the WordPress version number from your site\'s frontend and feeds.', |
| 23 | 25 | ], |
| 24 | - 'disable_XML_RPC' => [ | |
| 26 | + 'disable_XML_RPC' => [ | |
| 25 | 27 | 'Disable XML-RPC', |
| 26 | 28 | 'On sites running WordPress 3.5+, disable XML-RPC completely.', |
| 27 | 29 | ], |
| 28 | 30 | |
| @@ -35,13 +37,8 @@ | ||
| 35 | 37 | 'Disable Automatic Updates', |
| 36 | 38 | 'Completely disable automatic updates on your website.', |
| 37 | 39 | ], |
| 38 | 40 | |
| 39 | - 'disable_admin_bar' => [ | |
| 40 | - 'Disable The WP Admin Bar', | |
| 41 | - 'Disable the WordPress Admin Bar for all users in the frontend.', | |
| 42 | - ], | |
| 43 | - | |
| 44 | 41 | 'disable_attachment_pages' => [ |
| 45 | 42 | 'Disable Attachment Pages', |
| 46 | 43 | 'Hide the Attachment/Attachments pages on the frontend from all visitors.', |
| 47 | 44 | ], |
| @@ -132,5 +129,41 @@ | ||
| 132 | 129 | ], |
| 133 | 130 | |
| 134 | 131 | ]; |
| 135 | 132 | |
| 136 | -self::create_options($disabled_snippets); | |
| 133 | +self::create_options( $disabled_snippets ); | |
| 134 | + | |
| 135 | +?> | |
| 136 | +<div class="wowp-snippet__list"> | |
| 137 | + <div class="wowp-snippet__item"> | |
| 138 | + <div class="wowp-snippet__item-header"> | |
| 139 | + <label for="disable_admin_bar">Disable The WP Admin Bar</label> | |
| 140 | + <p class="wowp-snippet__item-description">Disable the WordPress Admin Bar for all users in the frontend.</p> | |
| 141 | + </div> | |
| 142 | + <div class="wowp-field has-checkbox"> | |
| 143 | + <label class="switch"> | |
| 144 | + <?php self::field( 'checkbox', 'disable_admin_bar' ); ?> | |
| 145 | + <span class="slider"></span> | |
| 146 | + </label> | |
| 147 | + </div> | |
| 148 | + <div class="wowp-snippet__item-expand is-hidden"> | |
| 149 | + <p class="wowp-snippet__expand-title">Show the sidebar for users:</p> | |
| 150 | + <div class="wowp-fields__group"> | |
| 151 | + <?php foreach ( FieldHelper::user_roles() as $key => $value ) : | |
| 152 | + if ( $key === 'all' ) { | |
| 153 | + continue; | |
| 154 | + } | |
| 155 | + ?> | |
| 156 | + <div class="wowp-field has-checkbox"> | |
| 157 | + <span class="label"><?php echo esc_html( $value ); ?></span> | |
| 158 | + <label class="switch"> | |
| 159 | + <?php self::field( 'checkbox', 'disable_admin_bar_user_' . $key ); ?> | |
| 160 | + <span class="slider"></span> | |
| 161 | + </label> | |
| 162 | + </div> | |
| 163 | + <?php endforeach; ?> | |
| 164 | + </div> | |
| 165 | + </div> | |
| 166 | + </div> | |
| 167 | +</div> | |
| 168 | + | |
| 169 | +<?php | |