Make WordPress Core


Ignore:
Timestamp:
02/23/2016 06:13:30 PM (10 years ago)
Author:
westonruter
Message:

Customize: Skip exporting partials to client and handling rendering requests if user can't modify associated settings.

Introduces WP_Customize_Partial::check_capabilities() for parity with WP_Customize_Control::check_capabilities().

See #27355.
Fixes #35914.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-selective-refresh.php

    r36624 r36643  
    173173
    174174        foreach ( $this->partials() as $partial ) {
    175             $partials[ $partial->id ] = $partial->json();
     175            if ( $partial->check_capabilities() ) {
     176                $partials[ $partial->id ] = $partial->json();
     177            }
    176178        }
    177179
     
    357359            $partial = $this->get_partial( $partial_id );
    358360
    359             if ( ! $partial ) {
     361            if ( ! $partial || ! $partial->check_capabilities() ) {
    360362                $contents[ $partial_id ] = null;
    361363                continue;
Note: See TracChangeset for help on using the changeset viewer.