/** * WP action callback */ public function actionAdminMenu() { if ($this->settings['mainMenu']) { // create main menu item $pageHook = add_menu_page($this->settings['pageTitle'], $this->settings['pageTitle'], 'manage_options', $this->settings['pageKey'], array($this, 'showPage'), WPML::url($this->settings['menuIcon'])); } else { // create submenu item under "Settings" $pageHook = add_submenu_page('options-general.php', $this->settings['pageTitle'], $this->settings['pageTitle'], 'manage_options', $this->settings['pageKey'], array($this, 'showPage')); } // load plugin page add_action('load-' . $pageHook, array($this, 'loadPage')); }
/** * WP filter callbacks */ public function filterWpHead() { $icon = $this->optionValues['icon']; $class_name = $this->optionValues['class_name']; // add style to <head> echo '<style type="text/css" media="all">' . "\n"; echo '/* WP Mailto Links Plugin */' . "\n"; echo '.wpml-nodis { display:none; }'; echo '.wpml-rtl { unicode-bidi:bidi-override; direction:rtl; }'; // add nowrap style if ($class_name) { echo '.' . $class_name . ' { white-space:nowrap; }'; } // add icon styling if ($icon) { $padding = $icon < 19 ? 15 : 17; echo '.mail-icon-' . $icon . ' { background:url(' . WPML::url('/images/mail-icon-' . $icon . '.png') . ') no-repeat 100% 75%; padding-right:' . $padding . 'px; }'; } echo '</style>' . "\n"; }
<div class="wrap wpml-admin"> <div class="icon32" id="icon-options-custom" style="background:url(<?php echo WPML::url('images/icon-wp-mailto-links.png'); ?> ) no-repeat 50% 50%"><br></div> <h2><?php echo get_admin_page_title(); ?> - <em><small><?php WPML::_e('Manage Email Links'); ?> </small></em></h2> <?php if (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' && $values['own_admin_menu']) { ?> <div class="updated settings-error" id="setting-error-settings_updated"> <p><strong><?php _e('Settings saved.'); ?> </strong></p> </div> <?php } ?> <form method="post" action="options.php"> <?php settings_fields(WPML::get('key')); ?>
/wp-admin/plugin-install.php?tab=search&type=term&s=WP+External+Links+freelancephp&plugin-search-input=Search+Plugins"><?php WPML::_e('Get this plugin'); ?> </a> <?php } ?> </h4> <p><?php WPML::_e('Open external links in a new window or tab, adding "nofollow", set link icon, styling, SEO friendly options and more. Easy install and go.'); ?> <br /><a href="http://wordpress.org/extend/plugins/wp-external-links/" target="_blank">WordPress.org</a> | <a href="http://www.freelancephp.net/wp-external-links-plugin/" target="_blank">FreelancePHP.net</a> </p> <h4><img src="<?php echo WPML::url('images/icon-email-encoder-bundle.png'); ?> " width="16" height="16" /> <?php WPML::_e('Email Encoder Bundle'); ?> - <?php if (is_plugin_active('email-encoder-bundle/email-encoder-bundle.php')) { ?> <a href="<?php echo get_bloginfo('url'); ?> /wp-admin/admin.php?page=email-encoder-bundle/email-encoder-bundle.php"><?php _e('Settings'); ?> </a>
?> </div> <div style="width:12%;float:left"> <?php } ?> <?php } ?> </div> <div style="width:29%;float:left;"><span class="description"><?php WPML::_e('Example:'); ?> </span> <br/><img src="<?php echo WPML::url('images/link-icon-example.png'); ?> " /> </div> <br style="clear:both" /> </div> </td> </tr> <tr> <th><?php WPML::_e('Skip images'); ?> </th> <td><label><input type="checkbox" name="<?php echo WPML::get('optionName'); ?>
/** * WP action callback */ public function loadPage() { parent::loadPage(); // add plugin script wp_enqueue_script('WPML_admin', WPML::url('js/wp-mailto-links-admin.js'), array('jquery'), WPML::get('version')); }