Changeset 1635318
- Timestamp:
- 04/11/2017 12:42:54 PM (9 years ago)
- Location:
- woo-product-image-gallery-options/trunk
- Files:
-
- 3 edited
-
changelog.txt (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
woocommerce-product-image-gallery-options.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-product-image-gallery-options/trunk/changelog.txt
r1635203 r1635318 3 3 2017.04.10 - version 1.0.0 4 4 * Initial release 5 6 2017.04.11 - version 1.0.1 7 * Fixed some basic errors for admin notices when WooCommerce is not active -
woo-product-image-gallery-options/trunk/readme.txt
r1635216 r1635318 16 16 == Installation == 17 17 18 1. Upload `woo -product-image-gallery-options` to the `/wp-content/plugins/` directory18 1. Upload `woocommerce-product-image-gallery-options` to the `/wp-content/plugins/` directory 19 19 2. Activate the plugin through the 'Plugins' menu in WordPress 20 20 3. Done! … … 35 35 Initial release. 36 36 37 = 1.0.1 - 04.11.2017 = 38 Fixed some basic errors for admin notices when WooCommerce is not active 39 37 40 38 41 == Upgrade Notice == -
woo-product-image-gallery-options/trunk/woocommerce-product-image-gallery-options.php
r1635216 r1635318 11 11 * Plugin URI: https://createandcode.com/plugins/woocommerce-product-image-gallery-options 12 12 * Description: Switch on/off WooCommerce 3.0+ Product Image Gallery options on a per product basis. 13 * Version: 1.0. 014 * Author: Create andCode13 * Version: 1.0.1 14 * Author: Create and Code 15 15 * Author URI: https://createandcode.com 16 16 * Requires at least: 4.7 … … 49 49 * @var string 50 50 */ 51 const VERSION = '1.0.0'; 51 const VERSION = '1.0.1'; 52 53 /** 54 * Notices (array) 55 * @var array 56 */ 57 public $notices = array(); 52 58 53 59 public function __construct() { 54 60 add_action( 'admin_init', array( $this, 'check_environment' ) ); 61 add_action( 'admin_notices', array( $this, 'admin_notices' ), 15 ); 55 62 add_action( 'plugins_loaded', array( $this, 'init' ) ); 56 63 add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); … … 113 120 114 121 /** 122 * Display any notices we've collected thus far 123 */ 124 public function admin_notices() { 125 foreach ( (array) $this->notices as $notice_key => $notice ) { 126 echo "<div class='" . esc_attr( $notice['class'] ) . "'><p>"; 127 echo wp_kses( $notice['message'], array( 'a' => array( 'href' => array() ) ) ); 128 echo "</p></div>"; 129 } 130 } 131 132 /** 133 * Allow this class and other classes to add slug keyed notices (to avoid duplication) 134 */ 135 public function add_admin_notice( $slug, $class, $message ) { 136 $this->notices[ $slug ] = array( 137 'class' => $class, 138 'message' => $message 139 ); 140 } 141 142 /** 115 143 * Load the plugin text domain for translation. 116 144 *
Note: See TracChangeset
for help on using the changeset viewer.