block-patterns.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Videomaker Theme: Block Patterns
  4. *
  5. * @package Videomaker
  6. * @since 1.0.0
  7. */
  8. if ( ! function_exists( 'videomaker_register_block_patterns' ) ) :
  9. function videomaker_register_block_patterns() {
  10. if ( function_exists( 'register_block_pattern_category' ) ) {
  11. register_block_pattern_category(
  12. 'videomaker',
  13. array( 'label' => __( 'Videomaker', 'videomaker' ) )
  14. );
  15. }
  16. if ( function_exists( 'register_block_pattern' ) ) {
  17. $block_patterns = array(
  18. 'about',
  19. 'awards',
  20. 'background-video',
  21. 'description',
  22. 'film-credits',
  23. 'film-poster',
  24. 'footer',
  25. 'full-width-homepage',
  26. 'header-description-and-grid-of-projects',
  27. 'header-names-list-and-grid',
  28. 'pattern-grid',
  29. 'pattern-offset-project-grid',
  30. 'pattern-two-posts-with-excerpt',
  31. 'post-i-love-you',
  32. 'reviews',
  33. );
  34. foreach ( $block_patterns as $block_pattern ) {
  35. register_block_pattern(
  36. 'videomaker/' . $block_pattern,
  37. require __DIR__ . '/patterns/' . $block_pattern . '.php'
  38. );
  39. }
  40. }
  41. }
  42. endif;
  43. add_action( 'init', 'videomaker_register_block_patterns', 9 );