Plugin Directory

Changeset 1942879


Ignore:
Timestamp:
09/18/2018 05:43:20 AM (7 years ago)
Author:
webmarka
Message:

New plugin version 1.0.9.

Location:
kjm-admin-notices
Files:
7 edited
13 copied

Legend:

Unmodified
Added
Removed
  • kjm-admin-notices/trunk/README.txt

    r1942375 r1942879  
    22Contributors: webmarka
    33Donate link: https://www.kajoom.ca
    4 Tags: admin notice, admin notices, notices, dashboard, messages, dismissible, management tool, email notifications, maintenance, administration
     4Tags: admin notice, admin notices, notices, dashboard, messages, dismissible, management tool, email notifications, email, maintenance, administration
    55Requires at least: 3.0.1
    66Tested up to: 4.9.8
     
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Create, manage and display nice custom dismissible notices to admin users.
     11Notify your WordPress users effortlessly! Create, manage and display nice custom dismissible notices to admin users.
    1212
    1313== Description ==
     
    34341. Upload `kjm-admin-notices` to the `/wp-content/plugins/` directory
    35351. 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'.
     361. Go to 'Settings -> KJM Admin Notices' to review the available global options.
    37371. Start creating your notices by going to 'Manage KJM Admin Notices' and have fun!
    3838
     
    7575
    7676== Changelog ==
     77
     78= 1.0.9 =
     79
     80Two 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.
    7785
    7886= 1.0.8 =
  • kjm-admin-notices/trunk/admin/class-kjm-admin-notices-admin.php

    r1942375 r1942879  
    11581158       
    11591159       
    1160         public function save_metaboxes($post_id, $post) {
     1160        public function save_metaboxes($post_id, $post, $update) {
    11611161           
    11621162            if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
     
    11651165            if (!isset($post->post_type) || "kjm_notice" !== $post->post_type) return;
    11661166           
     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           
    11671195            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;
    11931206            }
    11941207           
  • kjm-admin-notices/trunk/admin/css/kjm-admin-notices-admin.css

    r1942373 r1942879  
    1010
    1111
     12.kjm-admin-notices-wrap .container {
     13    clear: both;
     14}
    1215
    1316.wp-list-table td .fields_count,
     
    5457/* SETTINGS PAGE */
    5558
    56 .form-table {
     59.kjm-admin-notices-wrap .form-table {
    5760    border-right: 1px solid #ccc;
    5861    border-left: 1px solid #ccc;
  • kjm-admin-notices/trunk/admin/partials/kjm-admin-notices-admin-settings-display.php

    r1941604 r1942879  
    3232$cpt_active = $Kjm_Admin_Notices_Admin->get_option($Kjm_Admin_Notices_Admin->plugin_name.'_kjm_notice_active');
    3333?>
    34 <div class="wrap">
     34<div class="wrap kjm-admin-notices-wrap">
    3535   
    3636    <h2><?php _e('KJM Admin Notices Settings', 'kjm-admin-notices'); ?></h2>
  • kjm-admin-notices/trunk/includes/class-kjm-admin-notices.php

    r1942373 r1942879  
    104104
    105105        $this->plugin_name = 'kjm-admin-notices';
    106         $this->version = '1.0.8';
     106        $this->version = '1.0.9';
    107107        $this->options = get_option('kjm_admin_notices_settings') ? get_option('kjm_admin_notices_settings') : array();
    108108       
     
    245245        $this->loader->add_action( 'load-post.php', $plugin_admin, 'metaboxes_setup' );
    246246        $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 );
    248248       
    249249        $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  
    17101710     *
    17111711     */
    1712     public function save_metaboxes($post_id, $post) {}
     1712    public function save_metaboxes($post_id, $post, $update) {}
    17131713   
    17141714   
  • kjm-admin-notices/trunk/kjm-admin-notices.php

    r1942373 r1942879  
    1717 * Plugin URI:        https://www.kajoom.ca/
    1818 * Description:       Create, manage and display nice custom dismissible notices to admin users.
    19  * Version:           1.0.8
     19 * Version:           1.0.9
    2020 * Author:            Marc-Antoine Minville
    2121 * Author URI:        https://www.kajoom.ca/
Note: See TracChangeset for help on using the changeset viewer.