block-patterns.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <?php
  2. /**
  3. * Block Patterns
  4. *
  5. * @package Blank Canvas
  6. * @since 1.0
  7. */
  8. if ( ! function_exists( 'blank_canvas_register_block_patterns' ) ) :
  9. /**
  10. * Sets up support for block patterns and unregisters Seedlet's.
  11. */
  12. function blank_canvas_register_block_patterns() {
  13. /**
  14. * Register Block Pattern Category.
  15. */
  16. if ( function_exists( 'register_block_pattern_category' ) ) {
  17. register_block_pattern_category(
  18. 'blank-canvas',
  19. array( 'label' => __( 'Blank Canvas', 'blank-canvas' ) )
  20. );
  21. }
  22. /**
  23. * Register Block Patterns.
  24. */
  25. if ( function_exists( 'register_block_pattern' ) ) {
  26. register_block_pattern(
  27. 'blank-canvas/about-me',
  28. array(
  29. 'title' => __( 'About Me', 'blank-canvas' ),
  30. 'categories' => array( 'blank-canvas' ),
  31. 'content' => '<!-- wp:spacer {"height":20} -->
  32. <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
  33. <!-- /wp:spacer -->
  34. <!-- wp:media-text {"mediaPosition":"right","mediaId":1752,"mediaLink":"' . get_stylesheet_directory_uri() . '/assets/pattern-tattoo.jpg","mediaType":"image","imageFill":true} -->
  35. <div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-image-fill"><figure class="wp-block-media-text__media" style="background-image:url(' . get_stylesheet_directory_uri() . '/assets/pattern-tattoo.jpg);background-position:50% 50%"><img src="' . get_stylesheet_directory_uri() . '/assets/pattern-tattoo.jpg" alt="' . __( 'A photo of a tattooed hand, giving the "I love you" sign.', 'blank-canvas' ) . '" class="wp-image-1752 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"32px"}}} -->
  36. <h1 class="alignwide" style="font-size:32px"><strong>' . __( 'Hi! I’m a tattooist based in Florida City.', 'blank-canvas' ) . '</strong></h1>
  37. <!-- /wp:heading -->
  38. <!-- wp:paragraph -->
  39. <p>' . __( 'Specializing in fine line tattoos with a single needle. With over 10 years of experience, I can make your tattoo dreams come true.', 'blank-canvas' ) . '</p>
  40. <!-- /wp:paragraph -->
  41. <!-- wp:buttons -->
  42. <div class="wp-block-buttons"><!-- wp:button {"style":{"color":{"background":"#d35069"}},"textColor":"background"} -->
  43. <div class="wp-block-button"><a class="wp-block-button__link has-background-color has-text-color has-background" style="background-color:#d35069">' . __( 'Get in touch', 'blank-canvas' ) . '</a></div>
  44. <!-- /wp:button --></div>
  45. <!-- /wp:buttons -->
  46. <!-- wp:social-links {"className":"is-style-default"} -->
  47. <ul class="wp-block-social-links is-style-default"><!-- wp:social-link {"url":"https://facebook.com/","service":"facebook"} /-->
  48. <!-- wp:social-link {"url":"https://instagram.com/","service":"instagram"} /-->
  49. <!-- wp:social-link {"url":"https://twitter.com/","service":"twitter"} /--></ul>
  50. <!-- /wp:social-links -->
  51. <!-- wp:spacer -->
  52. <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
  53. <!-- /wp:spacer --></div></div>
  54. <!-- /wp:media-text -->',
  55. )
  56. );
  57. register_block_pattern(
  58. 'blank-canvas/links',
  59. array(
  60. 'title' => __( 'Links', 'blank-canvas' ),
  61. 'categories' => array( 'blank-canvas' ),
  62. 'content' => '<!-- wp:spacer {"height":20} -->
  63. <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
  64. <!-- /wp:spacer -->
  65. <!-- wp:image {"align":"center","id":20,"width":98,"height":95,"sizeSlug":"large","linkDestination":"none","className":"is-style-rounded"} -->
  66. <div class="wp-block-image is-style-rounded"><figure class="aligncenter size-large is-resized"><img src="' . get_stylesheet_directory_uri() . '/assets/pattern-hat.jpg" alt="' . __( 'Photo of a man wearing a hat.', 'blank-canvas' ) . '" class="wp-image-20" width="98" height="95"/></figure></div>
  67. <!-- /wp:image -->
  68. <!-- wp:heading {"textAlign":"center","level":1,"style":{"typography":{"fontSize":"32px"}}} -->
  69. <h1 class="has-text-align-center" style="font-size:32px"><strong>' . __( 'Alex Fredrickson', 'blank-canvas' ) . '</strong></h1>
  70. <!-- /wp:heading -->
  71. <!-- wp:social-links {"align":"center","className":"is-style-default"} -->
  72. <ul class="wp-block-social-links aligncenter is-style-default"><!-- wp:social-link {"url":"https://linkedin.com/","service":"linkedin"} /-->
  73. <!-- wp:social-link {"url":"https://twitter.com/","service":"twitter"} /-->
  74. <!-- wp:social-link {"url":"https://instagram.com/","service":"instagram"} /--></ul>
  75. <!-- /wp:social-links -->
  76. <!-- wp:paragraph {"align":"center","style":{"typography":{"fontSize":"20px","lineHeight":"1.65"}}} -->
  77. <p class="has-text-align-center" style="font-size:20px;line-height:1.65">' . __( 'My latest and greatest tips, resources, and reads.<br>So much goodness all in one place!', 'blank-canvas' ) . '</p>
  78. <!-- /wp:paragraph -->
  79. <!-- wp:buttons {"contentJustification":"center"} -->
  80. <div class="wp-block-buttons is-content-justification-center"><!-- wp:button {"borderRadius":"","width":100,"className":"is-style-fill"} -->
  81. <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link">' . __( 'Must read: The Place That Made Me', 'blank-canvas' ) . '</a></div>
  82. <!-- /wp:button -->
  83. <!-- wp:button {"width":100,"className":"is-style-fill"} -->
  84. <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link">' . __( 'Rain Journal by Richard Johnson', 'blank-canvas' ) . '</a></div>
  85. <!-- /wp:button -->
  86. <!-- wp:button {"width":100,"className":"is-style-fill"} -->
  87. <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link">' . __( '10th Day of Rain', 'blank-canvas' ) . '</a></div>
  88. <!-- /wp:button -->
  89. <!-- wp:button {"width":100,"className":"is-style-fill"} -->
  90. <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link">' . __( 'Blurring the Lines Between Architecture and Nature', 'blank-canvas' ) . '</a></div>
  91. <!-- /wp:button -->
  92. <!-- wp:button {"width":100,"className":"is-style-fill"} -->
  93. <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link">' . __( 'Instant Classic: A story of Persistence', 'blank-canvas' ) . '</a></div>
  94. <!-- /wp:button --></div>
  95. <!-- /wp:buttons -->',
  96. )
  97. );
  98. register_block_pattern(
  99. 'blank-canvas/invitation',
  100. array(
  101. 'title' => __( 'Invitation', 'blank-canvas' ),
  102. 'categories' => array( 'blank-canvas' ),
  103. 'content' => '<!-- wp:media-text {"mediaId":2207,"mediaLink":"' . get_stylesheet_directory_uri() . '/assets/pattern-drink.jpg","mediaType":"image","verticalAlignment":"center","imageFill":true,"style":{"color":{"background":"#f5fff4"}}} -->
  104. <div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-center is-image-fill has-background" style="background-color:#f5fff4"><figure class="wp-block-media-text__media" style="background-image:url(' . get_stylesheet_directory_uri() . '/assets/pattern-drink.jpg);background-position:50% 50%"><img src="' . get_stylesheet_directory_uri() . '/assets/pattern-drink.jpg" alt="Photo of two drinks." class="wp-image-2207 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:spacer {"height":30} -->
  105. <div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>
  106. <!-- /wp:spacer -->
  107. <!-- wp:heading {"level":1,"style":{"color":{"text":"#c61aa7"}}} -->
  108. <h1 class="has-text-color" style="color:#c61aa7"><strong>' . __( 'You&rsquo;re Invited', 'blank-canvas' ) . '</strong></h1>
  109. <!-- /wp:heading -->
  110. <!-- wp:columns -->
  111. <div class="wp-block-columns"><!-- wp:column -->
  112. <div class="wp-block-column"><!-- wp:paragraph {"fontSize":"small"} -->
  113. <p class="has-small-font-size">' . __( 'Pier 38<br>San Francisco, CA', 'blank-canvas' ) . '</p>
  114. <!-- /wp:paragraph --></div>
  115. <!-- /wp:column -->
  116. <!-- wp:column -->
  117. <div class="wp-block-column"><!-- wp:paragraph {"fontSize":"small"} -->
  118. <p class="has-small-font-size">' . __( '8pm–12am<br>April 16th', 'blank-canvas' ) . '</p>
  119. <!-- /wp:paragraph --></div>
  120. <!-- /wp:column --></div>
  121. <!-- /wp:columns -->
  122. <!-- wp:separator {"customColor":"#e343cd","className":"is-style-wide"} -->
  123. <hr class="wp-block-separator has-text-color has-background is-style-wide" style="background-color:#e343cd;color:#e343cd"/>
  124. <!-- /wp:separator -->
  125. <!-- wp:paragraph -->
  126. <p>' . __( 'Join us for a celebratory party featuring creative cocktails and mocktails, seasonal chef-crafted snacks and appetizers, and a range of desserts and pastries from local bakeries.', 'blank-canvas' ) . '</p>
  127. <!-- /wp:paragraph -->
  128. <!-- wp:buttons -->
  129. <div class="wp-block-buttons"><!-- wp:button {"style":{"color":{"background":"#c61aa7"}},"textColor":"background","className":"is-style-fill"} -->
  130. <div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-background-color has-text-color has-background" style="background-color:#c61aa7">' . __( 'RSVP', 'blank-canvas' ) . '</a></div>
  131. <!-- /wp:button --></div>
  132. <!-- /wp:buttons -->
  133. <!-- wp:spacer {"height":30} -->
  134. <div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>
  135. <!-- /wp:spacer --></div></div>
  136. <!-- /wp:media-text -->',
  137. )
  138. );
  139. register_block_pattern(
  140. 'blank-canvas/split-screen',
  141. array(
  142. 'title' => __( 'Split Screen', 'blank-canvas' ),
  143. 'categories' => array( 'blank-canvas' ),
  144. 'content' => '<!-- wp:media-text {"align":"full","mediaId":598,"mediaLink":"' . get_stylesheet_directory_uri() . '/assets/pattern-camera.jpg","mediaType":"image","imageFill":true} -->
  145. <div class="wp-block-media-text alignfull is-stacked-on-mobile is-image-fill"><figure class="wp-block-media-text__media" style="background-image:url(' . get_stylesheet_directory_uri() . '/assets/pattern-camera.jpg);background-position:50% 50%"><img src="' . get_stylesheet_directory_uri() . '/assets/pattern-camera.jpg" alt="' . __( 'Photo of a vintage camera.', 'blank-canvas' ) . '" class="wp-image-598 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:cover {"overlayColor":"background","minHeight":95,"minHeightUnit":"vh"} -->
  146. <div class="wp-block-cover has-background-background-color has-background-dim" style="min-height:95vh"><div class="wp-block-cover__inner-container"><!-- wp:image {"align":"center","id":624,"width":200,"height":200,"sizeSlug":"large","linkDestination":"none","className":"is-style-rounded"} -->
  147. <div class="wp-block-image is-style-rounded"><figure class="aligncenter size-large is-resized"><img src="' . get_stylesheet_directory_uri() . '/assets/pattern-woman.jpg" alt="' . __( 'Photo of a woman.', 'blank-canvas' ) . '" class="wp-image-624" width="200" height="200"/></figure></div>
  148. <!-- /wp:image -->
  149. <!-- wp:heading {"textAlign":"center","level":1} -->
  150. <h1 class="has-text-align-center"><strong>' . __( 'Jasmine Baker', 'blank-canvas' ) . '</strong></h1>
  151. <!-- /wp:heading -->
  152. <!-- wp:paragraph {"align":"center","backgroundColor":"background"} -->
  153. <p class="has-text-align-center has-background-background-color has-background">' . __( 'Hello! I am a photographer and designer living near Portland, Maine. When I am not posting to Instagram, you can find me shooting weddings and portraits.', 'blank-canvas' ) . '</p>
  154. <!-- /wp:paragraph -->
  155. <!-- wp:social-links {"align":"center","className":"is-style-default"} -->
  156. <ul class="wp-block-social-links aligncenter is-style-default"><!-- wp:social-link {"url":"https://instagram.com","service":"instagram"} /-->
  157. <!-- wp:social-link {"url":"https://www.tiktok.com","service":"tiktok"} /-->
  158. <!-- wp:social-link {"url":"https://twitter.com","service":"twitter"} /-->
  159. <!-- wp:social-link {"url":"https://youtube.com","service":"youtube"} /--></ul>
  160. <!-- /wp:social-links --></div></div>
  161. <!-- /wp:cover --></div></div>
  162. <!-- /wp:media-text -->',
  163. )
  164. );
  165. }
  166. /**
  167. * Unregister Seedlet Block Pattern Category.
  168. */
  169. if ( function_exists( 'unregister_block_pattern_category' ) ) {
  170. unregister_block_pattern_category( 'seedlet' );
  171. }
  172. /**
  173. * Unregister Block Patterns from Seedlet.
  174. */
  175. if ( function_exists( 'unregister_block_pattern' ) ) {
  176. unregister_block_pattern( 'seedlet/group-split-background' );
  177. unregister_block_pattern( 'seedlet/group-image-overlap' );
  178. unregister_block_pattern( 'seedlet/latest-posts-alternating-grid' );
  179. }
  180. }
  181. endif;
  182. add_action( 'after_setup_theme', 'blank_canvas_register_block_patterns', 12 );