Changeset 1942879
- Timestamp:
- 09/18/2018 05:43:20 AM (7 years ago)
- Location:
- kjm-admin-notices
- Files:
-
- 7 edited
- 13 copied
-
tags/1.0.8 (copied) (copied from kjm-admin-notices/trunk)
-
tags/1.0.8/README.txt (copied) (copied from kjm-admin-notices/trunk/README.txt)
-
tags/1.0.8/admin/class-kjm-admin-notices-admin.php (copied) (copied from kjm-admin-notices/trunk/admin/class-kjm-admin-notices-admin.php)
-
tags/1.0.8/admin/css/kjm-admin-notices-admin.css (copied) (copied from kjm-admin-notices/trunk/admin/css/kjm-admin-notices-admin.css)
-
tags/1.0.8/admin/images/banner-772x250.png (copied) (copied from kjm-admin-notices/trunk/admin/images/banner-772x250.png)
-
tags/1.0.8/admin/images/banner-940x305.png (copied) (copied from kjm-admin-notices/trunk/admin/images/banner-940x305.png)
-
tags/1.0.8/admin/images/icon-128x128.png (copied) (copied from kjm-admin-notices/trunk/admin/images/icon-128x128.png)
-
tags/1.0.8/admin/js/kjm-admin-notices-admin.js (copied) (copied from kjm-admin-notices/trunk/admin/js/kjm-admin-notices-admin.js)
-
tags/1.0.8/includes/class-kjm-admin-notices-shared.php (copied) (copied from kjm-admin-notices/trunk/includes/class-kjm-admin-notices-shared.php)
-
tags/1.0.8/includes/class-kjm-admin-notices.php (copied) (copied from kjm-admin-notices/trunk/includes/class-kjm-admin-notices.php)
-
tags/1.0.8/includes/models/local-settings.example.php (copied) (copied from kjm-admin-notices/trunk/includes/models/local-settings.example.php)
-
tags/1.0.8/kjm-admin-notices.php (copied) (copied from kjm-admin-notices/trunk/kjm-admin-notices.php)
-
tags/1.0.8/public (copied) (copied from kjm-admin-notices/trunk/public)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/admin/class-kjm-admin-notices-admin.php (modified) (2 diffs)
-
trunk/admin/css/kjm-admin-notices-admin.css (modified) (2 diffs)
-
trunk/admin/partials/kjm-admin-notices-admin-settings-display.php (modified) (1 diff)
-
trunk/includes/class-kjm-admin-notices.php (modified) (2 diffs)
-
trunk/includes/class-kjm-plugin-admin-base.php (modified) (1 diff)
-
trunk/kjm-admin-notices.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kjm-admin-notices/trunk/README.txt
r1942375 r1942879 2 2 Contributors: webmarka 3 3 Donate link: https://www.kajoom.ca 4 Tags: admin notice, admin notices, notices, dashboard, messages, dismissible, management tool, email notifications, maintenance, administration4 Tags: admin notice, admin notices, notices, dashboard, messages, dismissible, management tool, email notifications, email, maintenance, administration 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.9.8 … … 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Create, manage and display nice custom dismissible notices to admin users.11 Notify your WordPress users effortlessly! Create, manage and display nice custom dismissible notices to admin users. 12 12 13 13 == Description == … … 34 34 1. Upload `kjm-admin-notices` to the `/wp-content/plugins/` directory 35 35 1. Activate the plugin through the 'Plugins' menu in WordPress 36 1. Go to 'Settings -> KJM Admin Notices' and activate both 'KJM Admin Notices' and 'Notice Post Type'.36 1. Go to 'Settings -> KJM Admin Notices' to review the available global options. 37 37 1. Start creating your notices by going to 'Manage KJM Admin Notices' and have fun! 38 38 … … 75 75 76 76 == Changelog == 77 78 = 1.0.9 = 79 80 Two bugs fixes, one styling issue and one bug on checkboxes introduced in version 1.0.7. 81 82 * Improved custom fields save and update handling. 83 * Fixed post meta new value was not taken in account when un-checked checkboxes. 84 * Fixed some plugin styles that was not properly isolated. 77 85 78 86 = 1.0.8 = -
kjm-admin-notices/trunk/admin/class-kjm-admin-notices-admin.php
r1942375 r1942879 1158 1158 1159 1159 1160 public function save_metaboxes($post_id, $post ) {1160 public function save_metaboxes($post_id, $post, $update) { 1161 1161 1162 1162 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return; … … 1165 1165 if (!isset($post->post_type) || "kjm_notice" !== $post->post_type) return; 1166 1166 1167 /* Get the post type object. */ 1168 $post_type_object = get_post_type_object( $post->post_type ); 1169 1170 // Check if the current user has permission to edit the notice. 1171 if ( ! current_user_can( $post_type_object->cap->edit_post, $post_id ) ) return; 1172 1173 // Save global params once if not exists. 1174 if ( ! get_post_meta( $post_id, 'kjm_admin_notices_global_params', true ) ) { 1175 1176 $template = get_option('template'); 1177 $stylesheet = get_option('stylesheet'); 1178 $theme = wp_get_theme($template); 1179 $child_theme = wp_get_theme($stylesheet); 1180 1181 $params = array( 1182 'wordpress_version' => get_bloginfo('version'), 1183 'active_plugins' => $this->active_plugins(true), 1184 'theme' => $template.' ('.$theme->get('Version').')', 1185 'child_theme' => $template !== $stylesheet ? $stylesheet.' ('.$child_theme->get('Version').')': __('no'), 1186 ); 1187 update_post_meta($post_id, "kjm_admin_notices_global_params", $params); 1188 } 1189 1190 // Check if the POST array exists at all, else return here. 1191 if ( ! isset($_POST) || empty($_POST)) return; 1192 1193 $skip_list = array('kjm_admin_notices_global_params'); 1194 1167 1195 foreach($this->custom_fields['kjm_notice'] as $custom_field) { 1168 if ('kjm_admin_notices_global_params' === $custom_field) { 1169 if (!get_post_meta($post_id, 'kjm_admin_notices_global_params',true)) { 1170 1171 $template = get_option('template'); 1172 $stylesheet = get_option('stylesheet'); 1173 $theme = wp_get_theme($template); 1174 $child_theme = wp_get_theme($stylesheet); 1175 1176 $params = array( 1177 'wordpress_version' => get_bloginfo('version'), 1178 'active_plugins' => $this->active_plugins(true), 1179 'theme' => $template.' ('.$theme->get('Version').')', 1180 'child_theme' => $template !== $stylesheet ? $stylesheet.' ('.$child_theme->get('Version').')': __('no'), 1181 ); 1182 update_post_meta($post_id, "kjm_admin_notices_global_params", $params); 1183 } 1184 } else { 1185 if (!isset($_POST[$custom_field])) : 1186 #delete_post_meta($post_id, $custom_field); 1187 #$default_value = isset($this->custom_fields_defaults['kjm_notice'][$custom_field]) ? $this->custom_fields_defaults['kjm_notice'][$custom_field]: ''; 1188 #update_post_meta($post_id, $custom_field, $default_value); 1189 else : 1190 update_post_meta($post_id, $custom_field, $_POST[$custom_field]); 1191 endif; 1192 } 1196 1197 // Exclude these custom fields. 1198 if (in_array($custom_field, $skip_list)) continue; 1199 1200 if (!isset($_POST[$custom_field])) : 1201 $default_value = isset($this->custom_fields_defaults['kjm_notice'][$custom_field]) ? $this->custom_fields_defaults['kjm_notice'][$custom_field]: ''; 1202 update_post_meta($post_id, $custom_field, $default_value); 1203 else : 1204 update_post_meta($post_id, $custom_field, $_POST[$custom_field]); 1205 endif; 1193 1206 } 1194 1207 -
kjm-admin-notices/trunk/admin/css/kjm-admin-notices-admin.css
r1942373 r1942879 10 10 11 11 12 .kjm-admin-notices-wrap .container { 13 clear: both; 14 } 12 15 13 16 .wp-list-table td .fields_count, … … 54 57 /* SETTINGS PAGE */ 55 58 56 . form-table {59 .kjm-admin-notices-wrap .form-table { 57 60 border-right: 1px solid #ccc; 58 61 border-left: 1px solid #ccc; -
kjm-admin-notices/trunk/admin/partials/kjm-admin-notices-admin-settings-display.php
r1941604 r1942879 32 32 $cpt_active = $Kjm_Admin_Notices_Admin->get_option($Kjm_Admin_Notices_Admin->plugin_name.'_kjm_notice_active'); 33 33 ?> 34 <div class="wrap ">34 <div class="wrap kjm-admin-notices-wrap"> 35 35 36 36 <h2><?php _e('KJM Admin Notices Settings', 'kjm-admin-notices'); ?></h2> -
kjm-admin-notices/trunk/includes/class-kjm-admin-notices.php
r1942373 r1942879 104 104 105 105 $this->plugin_name = 'kjm-admin-notices'; 106 $this->version = '1.0. 8';106 $this->version = '1.0.9'; 107 107 $this->options = get_option('kjm_admin_notices_settings') ? get_option('kjm_admin_notices_settings') : array(); 108 108 … … 245 245 $this->loader->add_action( 'load-post.php', $plugin_admin, 'metaboxes_setup' ); 246 246 $this->loader->add_action( 'load-post-new.php', $plugin_admin, 'metaboxes_setup' ); 247 $this->loader->add_action( 'save_post', $plugin_admin, 'save_metaboxes', 10, 2);247 $this->loader->add_action( 'save_post', $plugin_admin, 'save_metaboxes', 10, 3 ); 248 248 249 249 $this->loader->add_action( 'transition_post_status', $plugin_admin, 'force_type_private', 10, 3 ); -
kjm-admin-notices/trunk/includes/class-kjm-plugin-admin-base.php
r1941604 r1942879 1710 1710 * 1711 1711 */ 1712 public function save_metaboxes($post_id, $post ) {}1712 public function save_metaboxes($post_id, $post, $update) {} 1713 1713 1714 1714 -
kjm-admin-notices/trunk/kjm-admin-notices.php
r1942373 r1942879 17 17 * Plugin URI: https://www.kajoom.ca/ 18 18 * Description: Create, manage and display nice custom dismissible notices to admin users. 19 * Version: 1.0. 819 * Version: 1.0.9 20 20 * Author: Marc-Antoine Minville 21 21 * Author URI: https://www.kajoom.ca/
Note: See TracChangeset
for help on using the changeset viewer.