diff --git a/readme.txt b/readme.txt index 53284a9..b16bc49 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,10 @@ === Send Email From Admin === Contributors: kojak711 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8HHLL6WRX9Z68 -Tags: email, send email, admin email, custom email, email tools +Tags: email, send email, admin email, custom email, email tools, email attachment Requires at least: 4.0 Tested up to: 4.3.1 -Stable tag: 0.9.1 +Stable tag: 0.9.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -12,7 +12,7 @@ Easily send a simple custom email with an attachment from the WordPress administ == Description == -Send Email From Admin gives you the ability to easily send a custom HTML email from the WordPress administration screen. You can send to existing users or add your own recipients. You can send to multiple recipients and choose to send group emails or individual emails. Emails can also have an attachment. A new menu item called 'Send Email' is added under the Tools menu. +Send Email From Admin gives you the ability to easily send a custom HTML email from the WordPress administration screen. You can send to existing users or add your own recipients. You can send to multiple recipients and choose to send group emails or individual emails. Emails can also have an attachment. A new menu item called 'Send Email' is added under the Tools menu. This plugin is also translatable. == Installation == @@ -43,6 +43,11 @@ Yes. You can upload and attach one attachment to the email message. == Changelog == += 0.9.2 = +* minor code cleanup +* added HTML5 'required' attribute to form fields +* js and css now only load on SEFA admin page + = 0.9.1 = * css and html cleanup * added mail dashicon diff --git a/send-email-from-admin.php b/send-email-from-admin.php index 98de645..76a9ffc 100644 --- a/send-email-from-admin.php +++ b/send-email-from-admin.php @@ -3,7 +3,7 @@ Plugin Name: Send Email From Admin Plugin URI: Description: Easily send a simple custom email with an attachment from the WordPress administration screen. Tools -> Send Email. -Version: 0.9.1 +Version: 0.9.2 Author: kojak711 Domain Path: /languages Text Domain: sefa @@ -28,28 +28,31 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -define('SEFA_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ )); +define( 'SEFA_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) ); +define( 'SEFA_PLUGIN_VER', '0.9.2' ); /** * Add our sub menu in the Tools menu * - * @since 0.9 + * @since 0.9.2 */ -function sefa_plugin_admin_menu() { - add_submenu_page( 'tools.php', 'Send Email From Admin', 'Send Email', 'manage_options', 'sefa_email', 'sefa_plugin_main' ); +function sefa_plugin_add_admin_page() { + // create sefa submenu page under the Tools menu + $sefa_page = add_submenu_page( 'tools.php', 'Send Email From Admin', 'Send Email', 'manage_options', 'sefa_email', 'sefa_plugin_main' ); + // load js and css on sefa page only + add_action( 'load-' . $sefa_page, 'sefa_plugin_scripts' ); } -add_action( 'admin_menu', 'sefa_plugin_admin_menu' ); +add_action( 'admin_menu', 'sefa_plugin_add_admin_page' ); /** * Load our css and js. * - * @since 0.9 + * @since 0.9.2 */ -function sefa_plugin_init() { - wp_enqueue_style( 'sefa_admin_css', SEFA_PLUGIN_DIR_URL . '/css/sefa.css' ); - wp_enqueue_script( 'sefa_admin_js', SEFA_PLUGIN_DIR_URL . '/js/sefa.js', array('jquery')); +function sefa_plugin_scripts() { + wp_enqueue_style( 'sefa_admin_css', SEFA_PLUGIN_DIR_URL . 'css/sefa.css', '', SEFA_PLUGIN_VER ); + wp_enqueue_script( 'sefa_admin_js', SEFA_PLUGIN_DIR_URL . 'js/sefa.js', array('jquery'), SEFA_PLUGIN_VER); } -add_action( 'admin_enqueue_scripts', 'sefa_plugin_init' ); /** * Register our text domain. @@ -175,11 +178,11 @@ function sefa_plugin_main() { ?> From: - ">
General.', 'sefa' ); ?>
+ " required>
General.', 'sefa' ); ?>
-
+
+   
- > + required>
- + @@ -229,7 +232,7 @@ function sefa_plugin_main() { - +