public function load_admin_toolbar() { if (current_user_can('manage_options') || current_user_can('edit_others_pages')) { include_once plugin_dir_path(__FILE__) . "admin-toolbar.php"; add_action('wp_ajax_wpfc_delete_cache', array($this, "deleteCacheToolbar")); add_action('wp_ajax_wpfc_delete_cache_and_minified', array($this, "deleteCssAndJsCacheToolbar")); $toolbar = new WpFastestCacheAdminToolbar(); $toolbar->add(); } }
public function load_admin_toolbar() { $show = false; // Admin $show = current_user_can('manage_options') || current_user_can('edit_others_pages') ? true : false; // Author if (defined('WPFC_TOOLBAR_FOR_AUTHOR') && WPFC_TOOLBAR_FOR_AUTHOR) { if (current_user_can('delete_published_posts') || current_user_can('edit_published_posts')) { $show = true; } } if ($show) { include_once plugin_dir_path(__FILE__) . "admin-toolbar.php"; add_action('wp_ajax_wpfc_delete_cache', array($this, "deleteCacheToolbar")); add_action('wp_ajax_wpfc_delete_cache_and_minified', array($this, "deleteCssAndJsCacheToolbar")); $toolbar = new WpFastestCacheAdminToolbar(); $toolbar->add(); } }