| @@ -13,8 +13,9 @@ | ||
| 13 | 13 | use ContentControl\Base\Controller; |
| 14 | 14 | |
| 15 | 15 | use WP_Customize_Manager; |
| 16 | 16 | |
| 17 | +use function ContentControl\is_rest; | |
| 17 | 18 | use function ContentControl\protection_is_disabled; |
| 18 | 19 | use function ContentControl\user_meets_requirements; |
| 19 | 20 | use function ContentControl\Widgets\get_options as get_widget_options; |
| 20 | 21 | |
| @@ -37,9 +38,9 @@ | ||
| 37 | 38 | * |
| 38 | 39 | * @return array<string,array<string>> The modified $widget_area array. |
| 39 | 40 | */ |
| 40 | 41 | public function exclude_widgets( $widget_areas ) { |
| 41 | - if ( protection_is_disabled() || $this->is_customize_preview() ) { | |
| 42 | + if ( is_rest() || protection_is_disabled() || $this->is_customize_preview() ) { | |
| 42 | 43 | return $widget_areas; |
| 43 | 44 | } |
| 44 | 45 | |
| 45 | 46 | foreach ( $widget_areas as $widget_area => $widgets ) { |