class-wc-meta-box-product-short-description.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Product Short Description
  4. *
  5. * Replaces the standard excerpt box.
  6. *
  7. * @package WooCommerce/Admin/Meta Boxes
  8. * @version 2.1.0
  9. */
  10. defined( 'ABSPATH' ) || exit;
  11. /**
  12. * WC_Meta_Box_Product_Short_Description Class.
  13. */
  14. class WC_Meta_Box_Product_Short_Description {
  15. /**
  16. * Output the metabox.
  17. *
  18. * @param WP_Post $post Post object.
  19. */
  20. public static function output( $post ) {
  21. $settings = array(
  22. 'textarea_name' => 'excerpt',
  23. 'quicktags' => array( 'buttons' => 'em,strong,link' ),
  24. 'tinymce' => array(
  25. 'theme_advanced_buttons1' => 'bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator',
  26. 'theme_advanced_buttons2' => '',
  27. ),
  28. 'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>',
  29. );
  30. wp_editor( htmlspecialchars_decode( $post->post_excerpt, ENT_QUOTES ), 'excerpt', apply_filters( 'woocommerce_product_short_description_editor_settings', $settings ) );
  31. }
  32. }