class-wp-widget-text.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <?php
  2. /**
  3. * Widget API: WP_Widget_Text class
  4. *
  5. * @package WordPress
  6. * @subpackage Widgets
  7. * @since 4.4.0
  8. */
  9. /**
  10. * Core class used to implement a Text widget.
  11. *
  12. * @since 2.8.0
  13. *
  14. * @see WP_Widget
  15. */
  16. class WP_Widget_Text extends WP_Widget {
  17. /**
  18. * Whether or not the widget has been registered yet.
  19. *
  20. * @since 4.8.1
  21. * @var bool
  22. */
  23. protected $registered = false;
  24. /**
  25. * Sets up a new Text widget instance.
  26. *
  27. * @since 2.8.0
  28. */
  29. public function __construct() {
  30. $widget_ops = array(
  31. 'classname' => 'widget_text',
  32. 'description' => __( 'Arbitrary text.' ),
  33. 'customize_selective_refresh' => true,
  34. );
  35. $control_ops = array(
  36. 'width' => 400,
  37. 'height' => 350,
  38. );
  39. parent::__construct( 'text', __( 'Text' ), $widget_ops, $control_ops );
  40. }
  41. /**
  42. * Add hooks for enqueueing assets when registering all widget instances of this widget class.
  43. *
  44. * @param integer $number Optional. The unique order number of this widget instance
  45. * compared to other instances of the same class. Default -1.
  46. */
  47. public function _register_one( $number = -1 ) {
  48. parent::_register_one( $number );
  49. if ( $this->registered ) {
  50. return;
  51. }
  52. $this->registered = true;
  53. wp_add_inline_script( 'text-widgets', sprintf( 'wp.textWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) );
  54. if ( $this->is_preview() ) {
  55. add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) );
  56. }
  57. // Note that the widgets component in the customizer will also do the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts().
  58. add_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) );
  59. // Note that the widgets component in the customizer will also do the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts().
  60. add_action( 'admin_footer-widgets.php', array( 'WP_Widget_Text', 'render_control_template_scripts' ) );
  61. }
  62. /**
  63. * Determines whether a given instance is legacy and should bypass using TinyMCE.
  64. *
  65. * @since 4.8.1
  66. *
  67. * @param array $instance {
  68. * Instance data.
  69. *
  70. * @type string $text Content.
  71. * @type bool|string $filter Whether autop or content filters should apply.
  72. * @type bool $legacy Whether widget is in legacy mode.
  73. * }
  74. * @return bool Whether Text widget instance contains legacy data.
  75. */
  76. public function is_legacy_instance( $instance ) {
  77. // Legacy mode when not in visual mode.
  78. if ( isset( $instance['visual'] ) ) {
  79. return ! $instance['visual'];
  80. }
  81. // Or, the widget has been added/updated in 4.8.0 then filter prop is 'content' and it is no longer legacy.
  82. if ( isset( $instance['filter'] ) && 'content' === $instance['filter'] ) {
  83. return false;
  84. }
  85. // If the text is empty, then nothing is preventing migration to TinyMCE.
  86. if ( empty( $instance['text'] ) ) {
  87. return false;
  88. }
  89. $wpautop = ! empty( $instance['filter'] );
  90. $has_line_breaks = ( false !== strpos( trim( $instance['text'] ), "\n" ) );
  91. // If auto-paragraphs are not enabled and there are line breaks, then ensure legacy mode.
  92. if ( ! $wpautop && $has_line_breaks ) {
  93. return true;
  94. }
  95. // If an HTML comment is present, assume legacy mode.
  96. if ( false !== strpos( $instance['text'], '<!--' ) ) {
  97. return true;
  98. }
  99. // In the rare case that DOMDocument is not available we cannot reliably sniff content and so we assume legacy.
  100. if ( ! class_exists( 'DOMDocument' ) ) {
  101. // @codeCoverageIgnoreStart
  102. return true;
  103. // @codeCoverageIgnoreEnd
  104. }
  105. $doc = new DOMDocument();
  106. @$doc->loadHTML( sprintf(
  107. '<!DOCTYPE html><html><head><meta charset="%s"></head><body>%s</body></html>',
  108. esc_attr( get_bloginfo( 'charset' ) ),
  109. $instance['text']
  110. ) );
  111. $body = $doc->getElementsByTagName( 'body' )->item( 0 );
  112. // See $allowedposttags.
  113. $safe_elements_attributes = array(
  114. 'strong' => array(),
  115. 'em' => array(),
  116. 'b' => array(),
  117. 'i' => array(),
  118. 'u' => array(),
  119. 's' => array(),
  120. 'ul' => array(),
  121. 'ol' => array(),
  122. 'li' => array(),
  123. 'hr' => array(),
  124. 'abbr' => array(),
  125. 'acronym' => array(),
  126. 'code' => array(),
  127. 'dfn' => array(),
  128. 'a' => array(
  129. 'href' => true,
  130. ),
  131. 'img' => array(
  132. 'src' => true,
  133. 'alt' => true,
  134. ),
  135. );
  136. $safe_empty_elements = array( 'img', 'hr', 'iframe' );
  137. foreach ( $body->getElementsByTagName( '*' ) as $element ) {
  138. /** @var DOMElement $element */
  139. $tag_name = strtolower( $element->nodeName );
  140. // If the element is not safe, then the instance is legacy.
  141. if ( ! isset( $safe_elements_attributes[ $tag_name ] ) ) {
  142. return true;
  143. }
  144. // If the element is not safely empty and it has empty contents, then legacy mode.
  145. if ( ! in_array( $tag_name, $safe_empty_elements, true ) && '' === trim( $element->textContent ) ) {
  146. return true;
  147. }
  148. // If an attribute is not recognized as safe, then the instance is legacy.
  149. foreach ( $element->attributes as $attribute ) {
  150. /** @var DOMAttr $attribute */
  151. $attribute_name = strtolower( $attribute->nodeName );
  152. if ( ! isset( $safe_elements_attributes[ $tag_name ][ $attribute_name ] ) ) {
  153. return true;
  154. }
  155. }
  156. }
  157. // Otherwise, the text contains no elements/attributes that TinyMCE could drop, and therefore the widget does not need legacy mode.
  158. return false;
  159. }
  160. /**
  161. * Filter gallery shortcode attributes.
  162. *
  163. * Prevents all of a site's attachments from being shown in a gallery displayed on a
  164. * non-singular template where a $post context is not available.
  165. *
  166. * @since 4.9.0
  167. *
  168. * @param array $attrs Attributes.
  169. * @return array Attributes.
  170. */
  171. public function _filter_gallery_shortcode_attrs( $attrs ) {
  172. if ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) {
  173. $attrs['id'] = -1;
  174. }
  175. return $attrs;
  176. }
  177. /**
  178. * Outputs the content for the current Text widget instance.
  179. *
  180. * @since 2.8.0
  181. *
  182. * @global WP_Post $post
  183. *
  184. * @param array $args Display arguments including 'before_title', 'after_title',
  185. * 'before_widget', and 'after_widget'.
  186. * @param array $instance Settings for the current Text widget instance.
  187. */
  188. public function widget( $args, $instance ) {
  189. global $post;
  190. $title = ! empty( $instance['title'] ) ? $instance['title'] : '';
  191. /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
  192. $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
  193. $text = ! empty( $instance['text'] ) ? $instance['text'] : '';
  194. $is_visual_text_widget = ( ! empty( $instance['visual'] ) && ! empty( $instance['filter'] ) );
  195. // In 4.8.0 only, visual Text widgets get filter=content, without visual prop; upgrade instance props just-in-time.
  196. if ( ! $is_visual_text_widget ) {
  197. $is_visual_text_widget = ( isset( $instance['filter'] ) && 'content' === $instance['filter'] );
  198. }
  199. if ( $is_visual_text_widget ) {
  200. $instance['filter'] = true;
  201. $instance['visual'] = true;
  202. }
  203. /*
  204. * Suspend legacy plugin-supplied do_shortcode() for 'widget_text' filter for the visual Text widget to prevent
  205. * shortcodes being processed twice. Now do_shortcode() is added to the 'widget_text_content' filter in core itself
  206. * and it applies after wpautop() to prevent corrupting HTML output added by the shortcode. When do_shortcode() is
  207. * added to 'widget_text_content' then do_shortcode() will be manually called when in legacy mode as well.
  208. */
  209. $widget_text_do_shortcode_priority = has_filter( 'widget_text', 'do_shortcode' );
  210. $should_suspend_legacy_shortcode_support = ( $is_visual_text_widget && false !== $widget_text_do_shortcode_priority );
  211. if ( $should_suspend_legacy_shortcode_support ) {
  212. remove_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
  213. }
  214. // Override global $post so filters (and shortcodes) apply in a consistent context.
  215. $original_post = $post;
  216. if ( is_singular() ) {
  217. // Make sure post is always the queried object on singular queries (not from another sub-query that failed to clean up the global $post).
  218. $post = get_queried_object();
  219. } else {
  220. // Nullify the $post global during widget rendering to prevent shortcodes from running with the unexpected context on archive queries.
  221. $post = null;
  222. }
  223. // Prevent dumping out all attachments from the media library.
  224. add_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
  225. /**
  226. * Filters the content of the Text widget.
  227. *
  228. * @since 2.3.0
  229. * @since 4.4.0 Added the `$this` parameter.
  230. * @since 4.8.1 The `$this` param may now be a `WP_Widget_Custom_HTML` object in addition to a `WP_Widget_Text` object.
  231. *
  232. * @param string $text The widget content.
  233. * @param array $instance Array of settings for the current widget.
  234. * @param WP_Widget_Text|WP_Widget_Custom_HTML $this Current Text widget instance.
  235. */
  236. $text = apply_filters( 'widget_text', $text, $instance, $this );
  237. if ( $is_visual_text_widget ) {
  238. /**
  239. * Filters the content of the Text widget to apply changes expected from the visual (TinyMCE) editor.
  240. *
  241. * By default a subset of the_content filters are applied, including wpautop and wptexturize.
  242. *
  243. * @since 4.8.0
  244. *
  245. * @param string $text The widget content.
  246. * @param array $instance Array of settings for the current widget.
  247. * @param WP_Widget_Text $this Current Text widget instance.
  248. */
  249. $text = apply_filters( 'widget_text_content', $text, $instance, $this );
  250. } else {
  251. // Now in legacy mode, add paragraphs and line breaks when checkbox is checked.
  252. if ( ! empty( $instance['filter'] ) ) {
  253. $text = wpautop( $text );
  254. }
  255. /*
  256. * Manually do shortcodes on the content when the core-added filter is present. It is added by default
  257. * in core by adding do_shortcode() to the 'widget_text_content' filter to apply after wpautop().
  258. * Since the legacy Text widget runs wpautop() after 'widget_text' filters are applied, the widget in
  259. * legacy mode here manually applies do_shortcode() on the content unless the default
  260. * core filter for 'widget_text_content' has been removed, or if do_shortcode() has already
  261. * been applied via a plugin adding do_shortcode() to 'widget_text' filters.
  262. */
  263. if ( has_filter( 'widget_text_content', 'do_shortcode' ) && ! $widget_text_do_shortcode_priority ) {
  264. if ( ! empty( $instance['filter'] ) ) {
  265. $text = shortcode_unautop( $text );
  266. }
  267. $text = do_shortcode( $text );
  268. }
  269. }
  270. // Restore post global.
  271. $post = $original_post;
  272. remove_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
  273. // Undo suspension of legacy plugin-supplied shortcode handling.
  274. if ( $should_suspend_legacy_shortcode_support ) {
  275. add_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
  276. }
  277. echo $args['before_widget'];
  278. if ( ! empty( $title ) ) {
  279. echo $args['before_title'] . $title . $args['after_title'];
  280. }
  281. $text = preg_replace_callback( '#<(video|iframe|object|embed)\s[^>]*>#i', array( $this, 'inject_video_max_width_style' ), $text );
  282. ?>
  283. <div class="textwidget"><?php echo $text; ?></div>
  284. <?php
  285. echo $args['after_widget'];
  286. }
  287. /**
  288. * Inject max-width and remove height for videos too constrained to fit inside sidebars on frontend.
  289. *
  290. * @since 4.9.0
  291. *
  292. * @see WP_Widget_Media_Video::inject_video_max_width_style()
  293. * @param array $matches Pattern matches from preg_replace_callback.
  294. * @return string HTML Output.
  295. */
  296. public function inject_video_max_width_style( $matches ) {
  297. $html = $matches[0];
  298. $html = preg_replace( '/\sheight="\d+"/', '', $html );
  299. $html = preg_replace( '/\swidth="\d+"/', '', $html );
  300. $html = preg_replace( '/(?<=width:)\s*\d+px(?=;?)/', '100%', $html );
  301. return $html;
  302. }
  303. /**
  304. * Handles updating settings for the current Text widget instance.
  305. *
  306. * @since 2.8.0
  307. *
  308. * @param array $new_instance New settings for this instance as input by the user via
  309. * WP_Widget::form().
  310. * @param array $old_instance Old settings for this instance.
  311. * @return array Settings to save or bool false to cancel saving.
  312. */
  313. public function update( $new_instance, $old_instance ) {
  314. $new_instance = wp_parse_args( $new_instance, array(
  315. 'title' => '',
  316. 'text' => '',
  317. 'filter' => false, // For back-compat.
  318. 'visual' => null, // Must be explicitly defined.
  319. ) );
  320. $instance = $old_instance;
  321. $instance['title'] = sanitize_text_field( $new_instance['title'] );
  322. if ( current_user_can( 'unfiltered_html' ) ) {
  323. $instance['text'] = $new_instance['text'];
  324. } else {
  325. $instance['text'] = wp_kses_post( $new_instance['text'] );
  326. }
  327. $instance['filter'] = ! empty( $new_instance['filter'] );
  328. // Upgrade 4.8.0 format.
  329. if ( isset( $old_instance['filter'] ) && 'content' === $old_instance['filter'] ) {
  330. $instance['visual'] = true;
  331. }
  332. if ( 'content' === $new_instance['filter'] ) {
  333. $instance['visual'] = true;
  334. }
  335. if ( isset( $new_instance['visual'] ) ) {
  336. $instance['visual'] = ! empty( $new_instance['visual'] );
  337. }
  338. // Filter is always true in visual mode.
  339. if ( ! empty( $instance['visual'] ) ) {
  340. $instance['filter'] = true;
  341. }
  342. return $instance;
  343. }
  344. /**
  345. * Enqueue preview scripts.
  346. *
  347. * These scripts normally are enqueued just-in-time when a playlist shortcode is used.
  348. * However, in the customizer, a playlist shortcode may be used in a text widget and
  349. * dynamically added via selective refresh, so it is important to unconditionally enqueue them.
  350. *
  351. * @since 4.9.3
  352. */
  353. public function enqueue_preview_scripts() {
  354. require_once dirname( dirname( __FILE__ ) ) . '/media.php';
  355. wp_playlist_scripts( 'audio' );
  356. wp_playlist_scripts( 'video' );
  357. }
  358. /**
  359. * Loads the required scripts and styles for the widget control.
  360. *
  361. * @since 4.8.0
  362. */
  363. public function enqueue_admin_scripts() {
  364. wp_enqueue_editor();
  365. wp_enqueue_media();
  366. wp_enqueue_script( 'text-widgets' );
  367. wp_add_inline_script( 'text-widgets', 'wp.textWidgets.init();', 'after' );
  368. }
  369. /**
  370. * Outputs the Text widget settings form.
  371. *
  372. * @since 2.8.0
  373. * @since 4.8.0 Form only contains hidden inputs which are synced with JS template.
  374. * @since 4.8.1 Restored original form to be displayed when in legacy mode.
  375. * @see WP_Widget_Visual_Text::render_control_template_scripts()
  376. * @see _WP_Editors::editor()
  377. *
  378. * @param array $instance Current settings.
  379. * @return void
  380. */
  381. public function form( $instance ) {
  382. $instance = wp_parse_args(
  383. (array) $instance,
  384. array(
  385. 'title' => '',
  386. 'text' => '',
  387. )
  388. );
  389. ?>
  390. <?php if ( ! $this->is_legacy_instance( $instance ) ) : ?>
  391. <?php
  392. if ( user_can_richedit() ) {
  393. add_filter( 'the_editor_content', 'format_for_editor', 10, 2 );
  394. $default_editor = 'tinymce';
  395. } else {
  396. $default_editor = 'html';
  397. }
  398. /** This filter is documented in wp-includes/class-wp-editor.php */
  399. $text = apply_filters( 'the_editor_content', $instance['text'], $default_editor );
  400. // Reset filter addition.
  401. if ( user_can_richedit() ) {
  402. remove_filter( 'the_editor_content', 'format_for_editor' );
  403. }
  404. // Prevent premature closing of textarea in case format_for_editor() didn't apply or the_editor_content filter did a wrong thing.
  405. $escaped_text = preg_replace( '#</textarea#i', '&lt;/textarea', $text );
  406. ?>
  407. <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" class="title sync-input" type="hidden" value="<?php echo esc_attr( $instance['title'] ); ?>">
  408. <textarea id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>" class="text sync-input" hidden><?php echo $escaped_text; ?></textarea>
  409. <input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" class="filter sync-input" type="hidden" value="on">
  410. <input id="<?php echo $this->get_field_id( 'visual' ); ?>" name="<?php echo $this->get_field_name( 'visual' ); ?>" class="visual sync-input" type="hidden" value="on">
  411. <?php else : ?>
  412. <input id="<?php echo $this->get_field_id( 'visual' ); ?>" name="<?php echo $this->get_field_name( 'visual' ); ?>" class="visual" type="hidden" value="">
  413. <p>
  414. <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
  415. <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>"/>
  416. </p>
  417. <div class="notice inline notice-info notice-alt">
  418. <?php if ( ! isset( $instance['visual'] ) ) : ?>
  419. <p><?php _e( 'This widget may contain code that may work better in the &#8220;Custom HTML&#8221; widget. How about trying that widget instead?' ); ?></p>
  420. <?php else : ?>
  421. <p><?php _e( 'This widget may have contained code that may work better in the &#8220;Custom HTML&#8221; widget. If you haven&#8217;t yet, how about trying that widget instead?' ); ?></p>
  422. <?php endif; ?>
  423. </div>
  424. <p>
  425. <label for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Content:' ); ?></label>
  426. <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>"><?php echo esc_textarea( $instance['text'] ); ?></textarea>
  427. </p>
  428. <p>
  429. <input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" type="checkbox"<?php checked( ! empty( $instance['filter'] ) ); ?> />&nbsp;<label for="<?php echo $this->get_field_id( 'filter' ); ?>"><?php _e( 'Automatically add paragraphs' ); ?></label>
  430. </p>
  431. <?php
  432. endif;
  433. }
  434. /**
  435. * Render form template scripts.
  436. *
  437. * @since 4.8.0
  438. * @since 4.9.0 The method is now static.
  439. */
  440. public static function render_control_template_scripts() {
  441. $dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
  442. ?>
  443. <script type="text/html" id="tmpl-widget-text-control-fields">
  444. <# var elementIdPrefix = 'el' + String( Math.random() ).replace( /\D/g, '' ) + '_' #>
  445. <p>
  446. <label for="{{ elementIdPrefix }}title"><?php esc_html_e( 'Title:' ); ?></label>
  447. <input id="{{ elementIdPrefix }}title" type="text" class="widefat title">
  448. </p>
  449. <?php if ( ! in_array( 'text_widget_custom_html', $dismissed_pointers, true ) ) : ?>
  450. <div hidden class="wp-pointer custom-html-widget-pointer wp-pointer-top">
  451. <div class="wp-pointer-content">
  452. <h3><?php _e( 'New Custom HTML Widget' ); ?></h3>
  453. <?php if ( is_customize_preview() ) : ?>
  454. <p><?php _e( 'Did you know there is a &#8220;Custom HTML&#8221; widget now? You can find it by pressing the &#8220;<a class="add-widget" href="#">Add a Widget</a>&#8221; button and searching for &#8220;HTML&#8221;. Check it out to add some custom code to your site!' ); ?></p>
  455. <?php else : ?>
  456. <p><?php _e( 'Did you know there is a &#8220;Custom HTML&#8221; widget now? You can find it by scanning the list of available widgets on this screen. Check it out to add some custom code to your site!' ); ?></p>
  457. <?php endif; ?>
  458. <div class="wp-pointer-buttons">
  459. <a class="close" href="#"><?php _e( 'Dismiss' ); ?></a>
  460. </div>
  461. </div>
  462. <div class="wp-pointer-arrow">
  463. <div class="wp-pointer-arrow-inner"></div>
  464. </div>
  465. </div>
  466. <?php endif; ?>
  467. <?php if ( ! in_array( 'text_widget_paste_html', $dismissed_pointers, true ) ) : ?>
  468. <div hidden class="wp-pointer paste-html-pointer wp-pointer-top">
  469. <div class="wp-pointer-content">
  470. <h3><?php _e( 'Did you just paste HTML?' ); ?></h3>
  471. <p><?php _e( 'Hey there, looks like you just pasted HTML into the &#8220;Visual&#8221; tab of the Text widget. You may want to paste your code into the &#8220;Text&#8221; tab instead. Alternately, try out the new &#8220;Custom HTML&#8221; widget!' ); ?></p>
  472. <div class="wp-pointer-buttons">
  473. <a class="close" href="#"><?php _e( 'Dismiss' ); ?></a>
  474. </div>
  475. </div>
  476. <div class="wp-pointer-arrow">
  477. <div class="wp-pointer-arrow-inner"></div>
  478. </div>
  479. </div>
  480. <?php endif; ?>
  481. <p>
  482. <label for="{{ elementIdPrefix }}text" class="screen-reader-text"><?php esc_html_e( 'Content:' ); ?></label>
  483. <textarea id="{{ elementIdPrefix }}text" class="widefat text wp-editor-area" style="height: 200px" rows="16" cols="20"></textarea>
  484. </p>
  485. </script>
  486. <?php
  487. }
  488. }