PluginProbe
WP Coder – Insert & Manage Code Snippets / trunk
WP Coder – Insert & Manage Code Snippets vtrunk
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
wp-coder / classes / Snippets / pages / admin.php

admin.php in WP Coder – Insert & Manage Code Snippets trunk, at classes/Snippets/pages/admin.php

69 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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