Make WordPress Core

Changeset 24597


Ignore:
Timestamp:
07/09/2013 02:22:57 AM (13 years ago)
Author:
nacin
Message:

XML-RPC: For wp.getOptions, set readonly to true for writable options that the user does not have permission to edit.

props westi.
fixes #20201.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r24593 r24597  
    32003200        function _getOptions($options) {
    32013201                $data = array();
     3202                $can_manage = current_user_can( 'manage_options' );
    32023203                foreach ( $options as $option ) {
    32033204                        if ( array_key_exists( $option, $this->blog_options ) ) {
    … …  
    32083209                                        unset($data[$option]['option']);
    32093210                                }
     3211
     3212                                if ( ! $can_manage )
     3213                                        $data[$option]['readonly'] = true;
    32103214                        }
    32113215                }
Note: See TracChangeset for help on using the changeset viewer.