block-patterns.php 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. 'text-list-with-button',
  21. 'full-width-image-with-aside-caption',
  22. 'testimonial',
  23. 'two-columns-of-text',
  24. 'paragraph-with-quote',
  25. 'columns-in-container',
  26. 'post-navigation-labeled',
  27. );
  28. foreach ( $block_patterns as $block_pattern ) {
  29. register_block_pattern(
  30. 'skatepark/' . $block_pattern,
  31. require __DIR__ . '/patterns/' . $block_pattern . '.php'
  32. );
  33. }
  34. }
  35. }
  36. endif;
  37. add_action( 'init', 'skatepark_register_block_patterns', 9 );