Plugin Directory

Changeset 1709121


Ignore:
Timestamp:
08/06/2017 12:58:14 PM (9 years ago)
Author:
dangub86
Message:

Optimization and change version

Location:
admin-notices-for-team/trunk
Files:
4 edited

Legend:

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

    r1709116 r1709121  
    55Requires at least: 4.0
    66Tested up to: 4.8
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • admin-notices-for-team/trunk/admin/class-ant_admin_notices_team-admin.php

    r1709117 r1709121  
    212212        }
    213213    }
    214 
    215 
    216 
    217     /**
    218      * Retrieve Users by Role
    219      */
    220     public function get_users_by_role() {
    221 
    222         //ARGS
    223         $argsAdmin = array(
    224             'role'         => 'Administrator',
    225             'orderby'     => 'display_name',
    226             'order' => 'ASC'
    227             //'role__in'     => array(),
    228         );
    229         $argsEditor = array(
    230             'role'         => 'Editor',
    231             'orderby'     => 'display_name',
    232             'order' => 'ASC'
    233         );
    234         $argsAuthor = array(
    235             'role'         => 'Author',
    236             'orderby'     => 'display_name',
    237             'order' => 'ASC'
    238         );
    239         $argsContributor = array(
    240             'role'         => 'Contributor',
    241             'orderby'     => 'display_name',
    242             'order' => 'ASC'
    243         );
    244 
    245         $adminGroup = get_users($argsAdmin);
    246         $editorGroup = get_users($argsEditor);
    247         $authorGroup = get_users($argsAuthor);
    248         $contributorGroup = get_users($argsContributor);
    249 
    250 
    251         foreach ($adminGroup as $admin) {
    252             $admins[] = $admin->display_name;
    253             update_option('admin_groups', $admins );
    254         }
    255         foreach ($editorGroup as $editor) {
    256             $editors[] = $editor->display_name;
    257             update_option('editor_groups', $editors );
    258         }
    259         foreach ($authorGroup as $author) {
    260             $authors[] = $author->display_name;
    261             update_option('author_groups', $authors );
    262         }
    263         foreach ($contributorGroup as $contributor) {
    264             $contributors[] = $contributor->display_name;
    265             update_option('contributor_groups', $contributors );
    266         }
    267 
    268         $groups     = array(
    269             'Admin Users' => get_option('admin_groups'),
    270             'Editors' => get_option('editor_groups'),
    271             'Authors' => get_option('author_groups'),
    272             'Contributors' => get_option('contributor_groups')
    273         );
    274         update_option( 'ant_groups', $groups );
    275 
    276     }
    277 
    278214
    279215
  • admin-notices-for-team/trunk/ant_admin_notices_team.php

    r1692756 r1709121  
    1717 * Plugin URI:        http://plugwpress.com/ant-notice-documentation/
    1818 * Description:       It provides the capability for administrators and/or editors to create Notices and display it to all users, only to specific authors.
    19  * Version:           1.0.1
     19 * Version:           1.0.2
    2020 * Author:            PlugWPress
    2121 * Author URI:        http://plugwpress.com
  • admin-notices-for-team/trunk/includes/class-ant_admin_notices_team.php

    r1709116 r1709121  
    168168        $this->loader->add_action( 'admin_init', $plugin_admin, 'add_users_caps' );
    169169
    170         //$this->loader->add_action( 'admin_init', $plugin_admin, 'get_users_by_role' );
    171 
    172170        //Action -> Add and Save Meta Box
    173171        $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_author_meta_box' );
Note: See TracChangeset for help on using the changeset viewer.