block-patterns.php 927 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Seedlet Theme: Block Patterns
  4. *
  5. * @package Seedlet
  6. * @since 1.0.0
  7. */
  8. if ( ! function_exists( 'seedlet_blocks_register_block_patterns' ) ) :
  9. function seedlet_blocks_register_block_patterns() {
  10. if ( function_exists( 'register_block_pattern_category' ) ) {
  11. register_block_pattern_category(
  12. 'seedlet-blocks',
  13. array( 'label' => __( 'Seedlet', 'seedlet-blocks' ) )
  14. );
  15. }
  16. if ( function_exists( 'register_block_pattern' ) ) {
  17. register_block_pattern(
  18. 'seedlet-blocks/latest-posts-alternating-grid',
  19. array(
  20. 'title' => __( 'Alternating Grid of Latest Posts', 'seedlet-blocks' ),
  21. 'categories' => array( 'seedlet-blocks' ),
  22. 'content' => '<!-- wp:latest-posts {"displayPostContent":true,"columns":5,"className":"is-style-seedlet-alternating-grid"} /-->',
  23. )
  24. );
  25. }
  26. }
  27. endif;
  28. add_action( 'after_setup_theme', 'seedlet_blocks_register_block_patterns', 12 );