| @@ -9,15 +9,15 @@ | ||
| 9 | 9 | public function __construct() { |
| 10 | 10 | |
| 11 | 11 | |
| 12 | 12 | add_action( 'template_redirect', static function () { |
| 13 | - if ( is_user_logged_in() && current_user_can( 'unfiltered_html' ) ) { | |
| 13 | + if ( is_user_logged_in() && WPCoder::user_can_manage() ) { | |
| 14 | 14 | $GLOBALS['wpcoder_render_start'] = microtime( true ); |
| 15 | 15 | } |
| 16 | 16 | } ); |
| 17 | 17 | add_action( 'init', static function () { |
| 18 | 18 | if ( ! defined( 'SAVEQUERIES' ) ) { |
| 19 | - if ( is_user_logged_in() && current_user_can( 'unfiltered_html' ) ) { | |
| 19 | + if ( is_user_logged_in() && WPCoder::user_can_manage() ) { | |
| 20 | 20 | define( 'SAVEQUERIES', true ); |
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | } ); |
| @@ -24,9 +24,9 @@ | ||
| 24 | 24 | add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_template_info' ], 90 ); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function add_admin_bar_template_info( $wp_admin_bar ): void { |
| 28 | - if ( ! is_user_logged_in() || ! current_user_can( 'unfiltered_html' ) ) { | |
| 28 | + if ( ! is_user_logged_in() || ! WPCoder::user_can_manage() ) { | |
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | if ( is_admin() ) { |
| 32 | 32 | return; |