PluginProbe
WP Coder – Insert & Manage Code Snippets / 4.5.2
WP Coder – Insert & Manage Code Snippets v4.5.2
4.5.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 All 40 releases
← All changes | wp-coder.php +9 -1 4.5.1 → 4.5.2 View file →
@@ -2,9 +2,9 @@
2 2 /**
3 3 * Plugin Name: WP Coder
4 4 * Plugin URI: https://wordpress.org/plugins/wp-coder/
5 5 * Description: Adding custom HTML, CSS, JavaScript and PHP code to your WordPress site.
6 - * Version: 4.5.1
6 + * Version: 4.5.2
7 7 * Author: WPCoder
8 8 * Author URI: https://wpcoder.pro
9 9 * Author Email: [email protected]
10 10 * License: GPL-2.0+
@@ -88,8 +88,16 @@
88 88 public static function url(): string {
89 89 return plugin_dir_url( __FILE__ );
90 90 }
91 91
92 +
93 + // Capability required to access the plugin (it can execute PHP, so administrators only).
94 + public const CAPABILITY = 'manage_options';
95 +
96 + // Check if the current user can manage codes. On multisite, unfiltered_html is limited to super admins.
97 + public static function user_can_manage(): bool {
98 + return current_user_can( self::CAPABILITY ) && current_user_can( 'unfiltered_html' );
99 + }
92 100
93 101 // Get Plugin Info
94 102 public static function info( $show = '' ): string {
95 103 $data = [