PluginProbe
NETSENSAI Shield / 1.4
NETSENSAI Shield v1.4
1.6.1 trunk 1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.6.0
netsensai-shield / includes / disable_file_editor.php

disable_file_editor.php in NETSENSAI Shield 1.4, at includes/disable_file_editor.php

25 lines 708 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly.
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 /**
8 * Disable the built-in file editor in WordPress.
9 *
10 * This function disables the theme and plugin file editors in the WordPress dashboard
11 * if the 'ns_shield_file_editor' option is enabled. Note that installing and deleting plugins remain allowed.
12 *
13 * @return void
14 */
15 function ns_shield_disable_file_editor() {
16 if ( get_option( 'ns_shield_file_editor' ) ) {
17 // Disable file editing if not already defined.
18 if ( ! defined( 'DISALLOW_FILE_EDIT' ) ) {
19 define( 'DISALLOW_FILE_EDIT', true );
20 }
21 }
22 }
23 add_action( 'init', 'ns_shield_disable_file_editor' );
24
25