mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@36643 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -172,7 +172,9 @@ final class WP_Customize_Selective_Refresh {
|
||||
$partials = array();
|
||||
|
||||
foreach ( $this->partials() as $partial ) {
|
||||
$partials[ $partial->id ] = $partial->json();
|
||||
if ( $partial->check_capabilities() ) {
|
||||
$partials[ $partial->id ] = $partial->json();
|
||||
}
|
||||
}
|
||||
|
||||
$exports = array(
|
||||
@@ -356,7 +358,7 @@ final class WP_Customize_Selective_Refresh {
|
||||
|
||||
$partial = $this->get_partial( $partial_id );
|
||||
|
||||
if ( ! $partial ) {
|
||||
if ( ! $partial || ! $partial->check_capabilities() ) {
|
||||
$contents[ $partial_id ] = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user