block-patterns.php 1019 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Skatepark Theme: Block Patterns
  4. *
  5. * @package Skatepark
  6. * @since 1.0.0
  7. */
  8. if ( ! function_exists( 'skatepark_register_block_patterns' ) ) :
  9. function skatepark_register_block_patterns() {
  10. if ( function_exists( 'register_block_pattern_category' ) ) {
  11. register_block_pattern_category(
  12. 'skatepark',
  13. array( 'label' => __( 'Skatepark', 'skatepark' ) )
  14. );
  15. }
  16. if ( function_exists( 'register_block_pattern' ) ) {
  17. $block_patterns = array(
  18. 'blog-posts',
  19. 'mixed-media-in-container',
  20. 'pre-footer',
  21. 'text-list-with-button',
  22. 'full-width-image-with-aside-caption',
  23. 'testimonial',
  24. 'two-columns-of-text',
  25. 'paragraph-with-quote',
  26. 'columns-in-container',
  27. 'post-navigation-labeled'
  28. );
  29. foreach ( $block_patterns as $block_pattern ) {
  30. register_block_pattern(
  31. 'skatepark/' . $block_pattern,
  32. require __DIR__ . '/patterns/' . $block_pattern . '.php'
  33. );
  34. }
  35. }
  36. }
  37. endif;
  38. add_action( 'init', 'skatepark_register_block_patterns', 9 );