/** * Add options page */ public function add_pages() { $admin_page = add_options_page(__('TYPO3 Importer Settings', 'typo3-importer'), __('TYPO3 Importer', 'typo3-importer'), 'manage_options', 't3i-options', array(&$this, 'display_page')); add_action('admin_print_scripts-' . $admin_page, array(&$this, 'scripts')); add_action('admin_print_styles-' . $admin_page, array(&$this, 'styles')); add_screen_meta_link('typo3-importer-link', __('TYPO3 Importer', 'typo3-importer'), admin_url('tools.php?page=typo3-importer'), $admin_page, array('style' => 'font-weight: bold;')); }
/** * Add options page */ public function add_pages() { $admin_page = add_options_page(__('ACF Migration Cleanup Settings', 'acf-migrator'), __('ACF Migration', 'acf-migrator'), 'manage_options', 'acf-migrator-options', array(&$this, 'display_page')); add_action('admin_print_scripts-' . $admin_page, array(&$this, 'scripts')); add_action('admin_print_styles-' . $admin_page, array(&$this, 'styles')); add_screen_meta_link('acf-migrator-link', __('ACF Migration Cleanup', 'acf-migrator'), admin_url('tools.php?page=acf-migrator'), $admin_page, array('style' => 'font-weight: bold;')); }
public static function admin_menu() { self::$menu_id = add_management_page(esc_html__('WordPress Starter Processor', 'wordpress-starter'), esc_html__('WordPress Starter Processor', 'wordpress-starter'), 'manage_options', self::ID, array(__CLASS__, 'user_interface')); add_action('admin_print_scripts-' . self::$menu_id, array(__CLASS__, 'scripts')); add_action('admin_print_styles-' . self::$menu_id, array(__CLASS__, 'styles')); add_screen_meta_link('wps_settings_link', esc_html__('WordPress Starter Settings', 'wordpress-starter'), admin_url('options-general.php?page=' . WordPress_Starter_Settings::ID), self::$menu_id, array('style' => 'font-weight: bold;')); }
public static function admin_menu() { self::$admin_page = add_options_page(esc_html__('WordPress Starter Settings', 'wordpress-starter'), esc_html__('WordPress Starter', 'wordpress-starter'), 'manage_options', self::ID, array(__CLASS__, 'display_page')); add_action('admin_print_scripts-' . self::$admin_page, array(__CLASS__, 'scripts')); add_action('admin_print_styles-' . self::$admin_page, array(__CLASS__, 'styles')); add_action('load-' . self::$admin_page, array(__CLASS__, 'settings_add_help_tabs')); add_screen_meta_link('wsp_importer_link', esc_html__('WordPress Starter Processor', 'wordpress-starter'), admin_url('tools.php?page=' . WordPress_Starter::ID), self::$admin_page, array('style' => 'font-weight: bold;')); }
function add_admin_menu() { $this->menu_id = add_management_page(__('TYPO3 tt_news Importer', 'typo3-importer'), __('TYPO3 tt_news Importer', 'typo3-importer'), 'manage_options', 'typo3-importer', array(&$this, 'user_interface')); add_action('admin_print_styles-' . $this->menu_id, array(&$this, 'styles')); add_screen_meta_link('t3i-options-link', __('TYPO3 tt_news Importer Settings', 'typo3-importer'), admin_url('options-general.php?page=t3i-options'), $this->menu_id, array('style' => 'font-weight: bold;')); }
/** * Create the plugin's menu items and enqueue their scripts and CSS. * Callback for the 'admin_menu' action. * * @return void */ function admin_menu() { if (current_user_can('manage_options')) { add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2); } $options_page_hook = add_options_page(__('Link Checker Settings', 'broken-link-checker'), __('Link Checker', 'broken-link-checker'), 'manage_options', 'link-checker-settings', array(&$this, 'options_page')); $menu_title = __('Broken Links', 'broken-link-checker'); if ($this->conf->options['show_link_count_bubble']) { //To make it easier to notice when broken links appear, display the current number of //broken links in a little bubble notification in the "Broken Links" menu. //(Similar to how the number of plugin updates and unmoderated comments is displayed). $blc_link_query = blcLinkQuery::getInstance(); $broken_links = $blc_link_query->get_filter_links('broken', array('count_only' => true)); if ($broken_links > 0) { //TODO: Appropriating existing CSS classes for my own purposes is hacky. Fix eventually. $menu_title .= sprintf(' <span class="update-plugins"><span class="update-count blc-menu-bubble">%d</span></span>', $broken_links); } } $links_page_hook = add_management_page(__('View Broken Links', 'broken-link-checker'), $menu_title, 'edit_others_posts', 'view-broken-links', array(&$this, 'links_page')); //Add plugin-specific scripts and CSS only to the it's own pages add_action('admin_print_styles-' . $options_page_hook, array(&$this, 'options_page_css')); add_action('admin_print_styles-' . $links_page_hook, array(&$this, 'links_page_css')); add_action('admin_print_scripts-' . $options_page_hook, array(&$this, 'enqueue_settings_scripts')); add_action('admin_print_scripts-' . $links_page_hook, array(&$this, 'enqueue_link_page_scripts')); //Add a "Feedback" button that links to the plugin's UserVoice forum add_screen_meta_link('blc-feedback-widget', __('Feedback', 'broken-link-checker'), 'http://whiteshadow.uservoice.com/forums/58400-broken-link-checker', array($options_page_hook, $links_page_hook)); //Add a link to the Admin Menu Editor site to the "Broken Links" page. if (!$this->conf->get('user_has_donated')) { //Choose anchor text randomly. $possible_anchor_texts = array('Organize WordPress admin menu', 'Simplify WordPress Admin Menu', 'Customize WP Admin Menu', 'Organize WP Admin: use Admin Menu Editor', 'Web Developer? Check out Admin Menu Editor', 'Admin Menu Editor for WP', 'Organize, Hide And Customize Admin Menus'); $index = $this->conf->get('view-broken-links-meta-ad', null); if ($index === null) { $index = rand(0, count($possible_anchor_texts) - 1); $this->conf->set('view-broken-links-meta-ad', $index); $this->conf->save_options(); } add_screen_meta_link('blc-more-plugins-link', $possible_anchor_texts[$index], sprintf('http://w-shadow.com/admin-menu-editor-pro/?utm_source=broken_link_checker&utm_medium=Broken_Links_meta_link&utm_campaign=Plugins&utm_content=copy-a%s', urlencode($index)), $links_page_hook, array('style' => 'font-weight: bold;')); } //Make the Settings page link to the link list add_screen_meta_link('blc-links-page-link', __('Go to Broken Links', 'broken-link-checker'), admin_url('tools.php?page=view-broken-links'), $options_page_hook, array('style' => 'font-weight: bold;')); //Add a link to the latest blog post/whatever about this plugin, if any. if (isset($this->conf->options['plugin_news']) && !empty($this->conf->options['plugin_news'])) { $news = $this->conf->options['plugin_news']; add_screen_meta_link('blc-plugin-news-link', $news[0], $news[1], array($options_page_hook, $links_page_hook)); } }
public function add_admin_menu() { $this->menu_id = add_management_page(__('ACF Migration', 'acf-migrator'), __('ACF Migration', 'acf-migrator'), 'manage_options', 'acf-migrator', array(&$this, 'user_interface')); add_action('admin_print_styles-' . $this->menu_id, array(&$this, 'styles')); add_screen_meta_link('acf-migrator-options-link', __('ACF Migration Settings', 'acf-migrator'), admin_url('options-general.php?page=acf-migrator-options'), $this->menu_id, array('style' => 'font-weight: bold;')); }
/** * Create the plugin's menu items and enqueue their scripts and CSS. * Callback for the 'admin_menu' action. * * @return void */ function admin_menu() { if (current_user_can('manage_options')) { add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2); } $options_page_hook = add_options_page(__('Link Checker Settings', 'broken-link-checker'), __('Link Checker', 'broken-link-checker'), 'manage_options', 'link-checker-settings', array($this, 'options_page')); $menu_title = __('Broken Links', 'broken-link-checker'); if ($this->conf->options['show_link_count_bubble']) { //To make it easier to notice when broken links appear, display the current number of //broken links in a little bubble notification in the "Broken Links" menu. //(Similar to how the number of plugin updates and unmoderated comments is displayed). $blc_link_query = blcLinkQuery::getInstance(); $broken_links = $blc_link_query->get_filter_links('broken', array('count_only' => true)); if ($broken_links > 0) { //TODO: Appropriating existing CSS classes for my own purposes is hacky. Fix eventually. $menu_title .= sprintf(' <span class="update-plugins"><span class="update-count blc-menu-bubble">%d</span></span>', $broken_links); } } $links_page_hook = add_management_page(__('View Broken Links', 'broken-link-checker'), $menu_title, 'edit_others_posts', 'view-broken-links', array($this, 'links_page')); //Add plugin-specific scripts and CSS only to the it's own pages add_action('admin_print_styles-' . $options_page_hook, array($this, 'options_page_css')); add_action('admin_print_styles-' . $links_page_hook, array($this, 'links_page_css')); add_action('admin_print_scripts-' . $options_page_hook, array($this, 'enqueue_settings_scripts')); add_action('admin_print_scripts-' . $links_page_hook, array($this, 'enqueue_link_page_scripts')); //Make the Settings page link to the link list add_screen_meta_link('blc-links-page-link', __('Go to Broken Links', 'broken-link-checker'), admin_url('tools.php?page=view-broken-links'), $options_page_hook, array('style' => 'font-weight: bold;')); }
/** * Create the plugin's menu items and enqueue their scripts and CSS. * Callback for the 'admin_menu' action. * * @return void */ function admin_menu() { if (current_user_can('manage_options')) { add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2); } $options_page_hook = add_options_page(__('Link Checker Settings', 'broken-link-checker'), __('Link Checker', 'broken-link-checker'), 'manage_options', 'link-checker-settings', array(&$this, 'options_page')); $menu_title = __('Broken Links', 'broken-link-checker'); if ($this->conf->options['show_link_count_bubble']) { //To make it easier to notice when broken links appear, display the current number of //broken links in a little bubble notification in the "Broken Links" menu. //(Similar to how the number of plugin updates and unmoderated comments is displayed). $blc_link_query =& blcLinkQuery::getInstance(); $broken_links = $blc_link_query->get_filter_links('broken', array('count_only' => true)); if ($broken_links > 0) { //TODO: Appropriating existing CSS classes for my own purposes is hacky. Fix eventually. $menu_title .= sprintf(' <span class="update-plugins"><span class="update-count blc-menu-bubble">%d</span></span>', $broken_links); } } $links_page_hook = add_management_page(__('View Broken Links', 'broken-link-checker'), $menu_title, 'edit_others_posts', 'view-broken-links', array(&$this, 'links_page')); //Add plugin-specific scripts and CSS only to the it's own pages add_action('admin_print_styles-' . $options_page_hook, array(&$this, 'options_page_css')); add_action('admin_print_styles-' . $links_page_hook, array(&$this, 'links_page_css')); add_action('admin_print_scripts-' . $options_page_hook, array(&$this, 'enqueue_settings_scripts')); add_action('admin_print_scripts-' . $links_page_hook, array(&$this, 'enqueue_link_page_scripts')); //Add a "Feedback" button that links to the plugin's UserVoice forum add_screen_meta_link('blc-feedback-widget', __('Feedback', 'broken-link-checker'), '#', array($options_page_hook, $links_page_hook)); //Add the supporting UserVoice-invocation code add_action('admin_footer-' . $options_page_hook, array(&$this, 'uservoice_widget')); add_action('admin_footer-' . $links_page_hook, array(&$this, 'uservoice_widget')); //Make the Settings page link to the link list, and vice versa add_screen_meta_link('blc-settings-link', __('Go to Settings', 'broken-link-checker'), admin_url('options-general.php?page=link-checker-settings'), $links_page_hook, array('style' => 'font-weight: bold;')); add_screen_meta_link('blc-links-page-link', __('Go to Broken Links', 'broken-link-checker'), admin_url('tools.php?page=view-broken-links'), $options_page_hook, array('style' => 'font-weight: bold;')); //Add a link to the latest blog post/whatever about this plugin, if any. if (isset($this->conf->options['plugin_news']) && !empty($this->conf->options['plugin_news'])) { $news = $this->conf->options['plugin_news']; add_screen_meta_link('blc-plugin-news-link', $news[0], $news[1], array($options_page_hook, $links_page_hook)); } }
function add_meta_button($id, $text, $url, $link, $options = null) { global $gantry; $ds = DIRECTORY_SEPARATOR; include_once dirname(__FILE__) . '/admin/screen-meta-links.php'; add_screen_meta_link($id, $text, $url, $link, $options); }