PluginProbe
WP Coder – Insert & Manage Code Snippets / 4.2
WP Coder – Insert & Manage Code Snippets v4.2
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 / disable.php

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

170 lines 4.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 $disabled_snippets = [
8 'disable_gutenberg' => [
9 'Disable Gutenberg Editor',
10 'Disable Gutenberg Editor and Return to the Familiar Classic Editor',
11 ],
12
13 'disable_gutenberg_css' => [
14 'Remove Gutenberg Block CSS',
15 'Remove Gutenberg Block Library CSS from loading on the frontend',
16 ],
17
18 'disable_widget_blocks' => [
19 'Disable Widget Blocks',
20 'Use the classic interface instead of Blocks to manage Widgets.',
21 ],
22 'remove_wp_version' => [
23 'Remove WordPress Version Number',
24 'Hide the WordPress version number from your site\'s frontend and feeds.',
25 ],
26 'disable_XML_RPC' => [
27 'Disable XML-RPC',
28 'On sites running WordPress 3.5+, disable XML-RPC completely.',
29 ],
30
31 'disable_automatic_updates_emails' => [
32 'Disable Automatic Updates Emails',
33 'Stop getting emails about automatic updates on your WordPress site.',
34 ],
35
36 'disable_automatic_updates' => [
37 'Disable Automatic Updates',
38 'Completely disable automatic updates on your website.',
39 ],
40
41 'disable_attachment_pages' => [
42 'Disable Attachment Pages',
43 'Hide the Attachment/Attachments pages on the frontend from all visitors.',
44 ],
45
46 'disable_rest_api' => [
47 'Disable WordPress REST API',
48 'Disable the WP REST API on your website.',
49 ],
50
51 'disable_comments' => [
52 'Disable Comments',
53 'Disable comments for all post types, in the admin and the frontend.',
54 ],
55
56 'disable_automatic_trash' => [
57 'Disable Automatic Trash Emptying',
58 'Prevent WordPress from automatically deleting trashed posts after 30 days.',
59 ],
60
61 'disable_emojis' => [
62 'Disable Emojis',
63 'Disable the emojis in WordPress.',
64 ],
65
66 'disable_screen_options' => [
67 'Disable ‘Screen Options’ Tab',
68 'Remove the Screen Options menu at the top of admin pages.',
69 ],
70
71 'disable_welcome_panel' => [
72 'Disable Welcome Panel',
73 'Hide the Welcome Panel on the WordPress dashboard for all users.',
74 ],
75
76 'disable_rss_feeds' => [
77 'Disable RSS Feeds',
78 'Turn off the WordPress RSS Feeds for your website.',
79 ],
80
81 'disable_search' => [
82 'Disable Search',
83 'Completely disable search on your WordPress website.',
84 ],
85
86 'disable_login_language_dropdown' => [
87 'Disable Login Page Language Switcher',
88 'Disable the Language Switcher on the default WordPress login page.',
89 ],
90
91 'disable_login_by_email' => [
92 'Disable Login by Email',
93 'Force your users to login only using their username.',
94 ],
95
96 'disable_comment_from_website_url' => [
97 'Disable Comment Form Website URL',
98 'Remove the Website URL field from the Comments form.',
99 ],
100
101 'disable_self_pingbacks' => [
102 'Disable Self Pingbacks',
103 'Prevent WordPress from automatically creating pingbacks from your own site.',
104 ],
105
106 'disable_wlwmanifest_link' => [
107 'Disable wlwmanifest link',
108 'Prevent WordPress from adding the Windows Live Writer manifest link to your pages.',
109 ],
110
111 'disable_embeds' => [
112 'Disable Embeds',
113 'Remove an extra request and prevent others from adding embeds in your site.',
114 ],
115
116 'disable_lazy_load' => [
117 'Disable Lazy Load',
118 'Prevent WordPress from adding the lazy-load attribute to all images and iframes.',
119 ],
120
121 'disable_wp_shortlink' => [
122 'Disable the WordPress Shortlink',
123 'Remove link rel shortlink from your site head area.',
124 ],
125
126 'disable_admin_pass_reset_email' => [
127 'Disable Admin Password Reset Emails',
128 'Don\'t send an email to the administrator of the site after a user resets their password.',
129 ],
130
131 ];
132
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
170