function wdeb_supporter_themes_not_enabled() { if (class_exists('ProSites')) { $ps_modules = ProSites::get_setting('modules_enabled'); $ps_modules = $ps_modules ? $ps_modules : array(); $has_themes = in_array('ProSites_Module_PremiumThemes', $ps_modules); } else { $has_themes = function_exists('supporter_themes_page'); } return !(function_exists('is_supporter') && is_supporter() && $has_themes); }
function wdeb_supporter_themes_not_enabled() { if (class_exists('ProSites')) { global $psts; if ($psts && !empty($psts->version) && version_compare($psts->version, '3.3.3', '>=')) { $has_themes = false; } else { $ps_modules = ProSites::get_setting('modules_enabled'); $ps_modules = $ps_modules ? $ps_modules : array(); $has_themes = in_array('ProSites_Module_PremiumThemes', $ps_modules); } } else { $has_themes = function_exists('supporter_themes_page'); } return !(function_exists('is_supporter') && is_supporter() && $has_themes); }
/** * This is where the default menu items are set. * Menu items are set as an array of menu items. * Each item is an associative array, with these values: * - "check_callback" - Custom PHP callback that will be called prior * to rendering the item, in order to determine if the item * should be displayed at all. * - "capability" - Minimum required user capability to display the * menu item. This will be checked prior to "check_callback". * - "url" - Administrative page url (e.g. edit.php). * - "icon" - Full menu icon URL. * - "title" - Main text for the menu item. * - "help" - Will be shown as tooltip and (optionally) transient * help text screen for the menu item. * * Plugins can register their own menu items by hooking into * "wdeb_menu_items" filter. */ function easy_mode_menu() { $pro_href = $pro_title = false; if (class_exists('ProSites')) { // Official $pro_href = 'admin.php?page=psts-checkout'; $pro_title = ProSites::get_setting('rebrand'); } else { if (class_exists('ProBlogs')) { // Beta $pro_href = 'admin.php?page=pblgs-checkout'; $pro_title = ProBlogs::get_setting('rebrand'); } else { if (function_exists('is_supporter')) { // Old $pro_href = 'supporter.php'; $pro_title = __('Supporter', 'wdeb'); } } } return array(array('check_callback' => false, 'capability' => false, 'url' => 'index.php', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/home.png', 'title' => __('Dashboard', 'wdeb'), 'help' => __('Your start page', 'wdeb')), array('check_callback' => false, 'capability' => 'edit_posts', 'url' => 'post-new.php', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/new-post.png', 'title' => __('New Post', 'wdeb'), 'help' => __('Create a new post', 'wdeb')), array('check_callback' => false, 'capability' => 'edit_posts', 'url' => 'edit.php', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/posts.png', 'title' => __('My Posts', 'wdeb'), 'help' => __('Edit your posts', 'wdeb')), array('check_callback' => false, 'capability' => 'edit_pages', 'url' => 'post-new.php?post_type=page', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/new-page.png', 'title' => __('New Page', 'wdeb'), 'help' => __('Create a new page', 'wdeb')), array('check_callback' => false, 'capability' => 'edit_pages', 'url' => 'edit.php?post_type=page', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/pages.png', 'title' => __('My Pages', 'wdeb'), 'help' => __('Edit your pages', 'wdeb')), array('check_callback' => false, 'capability' => 'edit_posts', 'url' => 'edit-comments.php', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/comments.png', 'title' => __('Comments', 'wdeb'), 'help' => __('Moderate your comments', 'wdeb')), array('check_callback' => 'wdeb_supporter_themes_enabled', 'capability' => 'switch_themes', 'url' => 'themes.php', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/free-themes.png', 'title' => __('Free Themes', 'wdeb'), 'help' => __('Change your site appearance', 'wdeb')), array('check_callback' => 'wdeb_supporter_themes_enabled', 'capability' => 'switch_themes', 'url' => 'themes.php?page=premium-themes', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/premium-themes.png', 'title' => __('Premium Themes', 'wdeb'), 'help' => __('Change your site appearance', 'wdeb')), array('check_callback' => 'wdeb_supporter_themes_not_enabled', 'capability' => 'switch_themes', 'url' => 'themes.php', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/free-themes.png', 'title' => __('Manage Themes', 'wdeb'), 'help' => __('Change your site appearance', 'wdeb')), array('check_callback' => false, 'capability' => 'edit_theme_options', 'url' => 'widgets.php', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/edit-themes.png', 'title' => __('Customize Design', 'wdeb'), 'help' => __('Personalize your site', 'wdeb')), array('check_callback' => 'wdeb_not_supporter', 'capability' => 'manage_options', 'url' => $pro_href, 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/supporter.png', 'title' => $pro_title, 'help' => __('Support us!', 'wdeb')), array('check_callback' => false, 'capability' => false, 'url' => 'profile.php', 'icon' => WDEB_PLUGIN_THEME_URL . '/assets/icons/theme_icons/profiles.png', 'title' => __('Profile', 'wdeb'), 'help' => __('Edit your profile information', 'wdeb'))); }