class-wp-fake-block-type.php 575 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * WP_Fake_Block_Type for testing
  4. *
  5. * @package WordPress
  6. * @subpackage Blocks
  7. * @since 5.0.0
  8. */
  9. /**
  10. * Test class extending WP_Block_Type
  11. *
  12. * @since 5.0.0
  13. */
  14. class WP_Fake_Block_Type extends WP_Block_Type {
  15. /**
  16. * Render the fake block.
  17. *
  18. * @param array $attributes Optional. Block attributes. Default empty array.
  19. * @param string $content Optional. Block content. Default empty string.
  20. * @return string Rendered block HTML.
  21. */
  22. public function render( $attributes = array(), $content = '' ) {
  23. return '<div>' . $content . '</div>';
  24. }
  25. }