| 1 |
<?php |
| 2 |
/** |
| 3 |
* Customizer Widget Blocks Section: WP_Customize_Widget_Blocks_Control class. |
| 4 |
* |
| 5 |
* @package gutenberg |
| 6 |
* @since 6.1.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* Class that renders the Customizer control for editing widgets with Gutenberg. |
| 11 |
* |
| 12 |
* @since 6.1.0 |
| 13 |
*/ |
| 14 |
class WP_Customize_Widget_Blocks_Control extends WP_Customize_Control { |
| 15 |
/** |
| 16 |
* Enqueue control related scripts/styles. |
| 17 |
* |
| 18 |
* @since 6.1.0 |
| 19 |
*/ |
| 20 |
public function enqueue() { |
| 21 |
gutenberg_widgets_init( 'gutenberg_customizer' ); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Render the control's content. |
| 26 |
* |
| 27 |
* @since 6.1.0 |
| 28 |
*/ |
| 29 |
public function render_content() { |
| 30 |
?> |
| 31 |
<input |
| 32 |
id="_customize-input-gutenberg_widget_blocks" |
| 33 |
type="hidden" |
| 34 |
value="<?php echo esc_attr( $this->value() ); ?>" |
| 35 |
<?php $this->link(); ?> |
| 36 |
/> |
| 37 |
<?php |
| 38 |
the_gutenberg_widgets( 'gutenberg_customizer' ); |
| 39 |
} |
| 40 |
} |
| 41 |
|