/** * Class constructor */ public function __construct() { if (gd_is_mt() || gd_is_reseller() || !gd_has_used_wpem()) { return; } add_action('wp_dashboard_setup', array($this, 'init')); }
/** * Add a "Flush Cache" button the admin menu * @param WP_Admin_Bar $admin_bar * @return void */ public function admin_bar_menu($admin_bar) { global $gd_system_config; $config = $gd_system_config->get_config(); $gateway_url = isset($config['gateway_url']) ? $config['gateway_url'] : ''; // Only show to admin users if (!current_user_can('activate_plugins')) { return; } switch (true) { case gd_is_mt(): $top_menu_label = __('Media Temple', 'gd_system'); $top_menu_icon_class = 'media-temple'; break; case gd_is_reseller(): $top_menu_label = __('Managed WordPress', 'gd_system'); $top_menu_icon_class = 'admin-generic'; break; default: $top_menu_label = __('GoDaddy', 'gd_system'); $top_menu_icon_class = 'godaddy-alt'; break; } $admin_bar->add_menu(['id' => static::ADMIN_MENU_SLUG, 'title' => sprintf('<span class="ab-icon dashicons dashicons-%s"></span><span class="ab-label">%s</span>', $top_menu_icon_class, $top_menu_label)]); // Settings menu $admin_bar->add_menu(['parent' => static::ADMIN_MENU_SLUG, 'id' => static::ADMIN_MENU_SLUG . '-control-panel', 'title' => sprintf('%s<span class="dashicons dashicons-external"></span>', __('Account Settings', 'gd_system')), 'href' => str_replace('%pl_id%', defined('GD_RESELLER') ? GD_RESELLER : '', $gateway_url), 'meta' => array('target' => '_blank')]); // Flush cache menu $admin_bar->add_menu(['parent' => static::ADMIN_MENU_SLUG, 'id' => static::ADMIN_MENU_SLUG . '-flush-cache', 'title' => __('Flush Cache', 'gd_system'), 'href' => esc_url(add_query_arg(['GD_COMMAND' => 'FLUSH_CACHE', 'GD_NONCE' => wp_create_nonce('GD_FLUSH_CACHE')]))]); }
/** * Class constructor */ public function __construct() { add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts')); add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts')); if (gd_is_mt() || gd_is_reseller()) { return; } /** * Filter the admin menu position * * Note: By default we will use a long decimal string to reduce the * chance of position conflicts with other menu items, see Codex. * * @return string */ $this->position = (string) apply_filters('gd_system_page_menu_position', $this->position); add_action('init', array($this, 'init')); add_action('admin_menu', array($this, 'register_menu_page')); add_action('admin_bar_menu', array($this, 'admin_bar_menu'), 110); add_filter('admin_body_class', array($this, 'admin_body_class')); }
return; } ?> <p> <input type="checkbox" id="wpem_pro_opt_in" name="wpem_pro_opt_in" value="1"> <label for="wpem_pro_opt_in"><?php _e('I would be interested in hiring a professional to help me with my WordPress site.', 'gd_system'); ?> </label> </p> <?php }); /** * Save setting for Web Pro opt-in */ add_filter('wpem_step_settings_options', function ($options) { if (!gd_is_reseller() && !gd_is_mt() && gd_is_english() && 'US' === gd_wpem_country_code()) { $options[] = array('name' => 'wpem_pro_opt_in', 'sanitizer' => 'absint', 'required' => false); } return $options; }); /** * Return the site created date * * @param string $format * * @return int|string */ function gd_site_created_date($format = 'U') { // Use when this constant was introduced as default (Tue, 22 Dec 2015 00:00:00 GMT) $time = defined('GD_SITE_CREATED') ? (int) GD_SITE_CREATED : 1450742400;