Plugin Directory

Changeset 2127595


Ignore:
Timestamp:
07/24/2019 02:55:42 AM (7 years ago)
Author:
awakensolutions
Message:

Update to 1.2.5

Location:
simple-restrict/tags/1.2.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simple-restrict/tags/1.2.5/README.txt

    r2026859 r2127595  
    44Donate link: https://www.awakensolutions.com/donation
    55Requires at least: 3.4
    6 Tested up to: 5.0.3
    7 Stable tag: 1.2.4
     6Tested up to: 5.2.2
     7Stable tag: 1.2.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    131131= 1.2.4 =
    132132* Changing the WordPress capability required for editing a user's permissions from manage_options to edit_users.
     133
     134= 1.2.5 =
     135* Fixes a bug that would erase user permissions when they edited their own profile.
  • simple-restrict/tags/1.2.5/admin/class-simple-restrict-admin.php

    r2026855 r2127595  
    193193
    194194    // Save checkboxes (user meta) to profile ($user_id is sent to this function from action that fires it)
    195     public function save_permission_checkboxes( $user_id )
    196     {
    197         foreach($this->taxonomy_terms_object_array as $taxonomy_object) {
    198             $taxonomy_slug = $taxonomy_object->slug;
    199             $taxonomy_slug_prefixed = 'simple-restrict-' . $taxonomy_slug;
    200             update_user_meta( $user_id, $taxonomy_slug_prefixed, sanitize_text_field( $_POST[$taxonomy_slug_prefixed] ) );
     195    public function save_permission_checkboxes( $user_id ) {
     196        if(current_user_can('edit_users')) {
     197            foreach($this->taxonomy_terms_object_array as $taxonomy_object) {
     198                $taxonomy_slug = $taxonomy_object->slug;
     199                $taxonomy_slug_prefixed = 'simple-restrict-' . $taxonomy_slug;
     200                update_user_meta( $user_id, $taxonomy_slug_prefixed, sanitize_text_field( $_POST[$taxonomy_slug_prefixed] ) );
     201            }
    201202        }
    202203    }
Note: See TracChangeset for help on using the changeset viewer.