block-patterns.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. 'full-width-homepage',
  25. 'footer',
  26. 'description',
  27. 'header-description-and-grid-of-projects',
  28. 'header-names-list-and-grid',
  29. 'pattern-grid',
  30. 'pattern-offset-project-grid',
  31. 'pattern-two-posts-with-excerpt',
  32. 'post-i-love-you',
  33. 'reviews',
  34. );
  35. foreach ( $block_patterns as $block_pattern ) {
  36. register_block_pattern(
  37. 'videomaker/' . $block_pattern,
  38. require __DIR__ . '/patterns/' . $block_pattern . '.php'
  39. );
  40. }
  41. }
  42. }
  43. endif;
  44. add_action( 'init', 'videomaker_register_block_patterns', 9 );