[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentytwelve/inc/ -> block-patterns.php (source)

   1  <?php
   2  /**
   3   * Block Patterns
   4   *
   5   * @link https://developer.wordpress.org/reference/functions/register_block_pattern/
   6   * @link https://developer.wordpress.org/reference/functions/register_block_pattern_category/
   7   *
   8   * @package WordPress
   9   * @subpackage Twenty_Twelve
  10   * @since Twenty Twelve 3.4
  11   */
  12  
  13  /**
  14   * Register Block Pattern Category.
  15   */
  16  if ( function_exists( 'register_block_pattern_category' ) ) {
  17  
  18      register_block_pattern_category(
  19          'twentytwelve',
  20          array( 'label' => esc_html__( 'Twenty Twelve', 'twentytwelve' ) )
  21      );
  22  }
  23  
  24  /**
  25   * Register Block Patterns.
  26   */
  27  if ( function_exists( 'register_block_pattern' ) ) {
  28  
  29      // Images and spacer blocks inside of columns.
  30      register_block_pattern(
  31          'twentytwelve/floating-images',
  32          array(
  33              'title'         => esc_html__( 'Floating Images Gallery', 'twentytwelve' ),
  34              'categories'    => array( 'twentytwelve' ),
  35              'viewportWidth' => 700,
  36              'content'       => '<!-- wp:group -->
  37                  <div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:columns -->
  38                  <div class="wp-block-columns"><!-- wp:column -->
  39                  <div class="wp-block-column"><!-- wp:spacer -->
  40                  <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
  41                  <!-- /wp:spacer -->
  42                  <!-- wp:image {"align":"center","sizeSlug":"large","linkDestination":"none"} -->
  43                  <div class="wp-block-image"><figure class="aligncenter size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern-jumble-2.jpg" alt="' . esc_attr__( 'Close up of a yellow and green leaf.', 'twentytwelve' ) . '" /></figure></div>
  44                  <!-- /wp:image --></div>
  45                  <!-- /wp:column -->
  46                  <!-- wp:column {"width":"29%"} -->
  47                  <div class="wp-block-column" style="flex-basis:29%"><!-- wp:image {"align":"center","sizeSlug":"large","linkDestination":"none"} -->
  48                  <div class="wp-block-image"><figure class="aligncenter size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern-jumble-3.jpg" alt="' . esc_attr__( 'Close up of a yellow leaf.', 'twentytwelve' ) . '" /></figure></div>
  49                  <!-- /wp:image -->
  50                  <!-- wp:spacer {"height":25} -->
  51                  <div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>
  52                  <!-- /wp:spacer -->
  53                  <!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
  54                  <figure class="wp-block-image size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern-jumble-4.jpg" alt="' . esc_attr__( 'Close up of a yellow and green leaf.', 'twentytwelve' ) . '" /></figure>
  55                  <!-- /wp:image --></div>
  56                  <!-- /wp:column -->
  57                  <!-- wp:column {"width":"43%"} -->
  58                  <div class="wp-block-column" style="flex-basis:43%"><!-- wp:spacer {"height":37} -->
  59                  <div style="height:37px" aria-hidden="true" class="wp-block-spacer"></div>
  60                  <!-- /wp:spacer -->
  61                  <!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
  62                  <figure class="wp-block-image size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern-jumble-1.jpg" alt="' . esc_attr__( 'Close up of a yellow and green leaf.', 'twentytwelve' ) . '" /></figure>
  63                  <!-- /wp:image --></div>
  64                  <!-- /wp:column --></div>
  65                  <!-- /wp:columns --></div></div>
  66                  <!-- /wp:group -->',
  67          )
  68      );
  69  
  70      // Heading and paragraph arranged as a large quote.
  71      register_block_pattern(
  72          'twentytwelve/large-quote',
  73          array(
  74              'title'         => esc_html__( 'Left-aligned Large Quote', 'twentytwelve' ),
  75              'categories'    => array( 'twentytwelve' ),
  76              'viewportWidth' => 700,
  77              'content'       => '<!-- wp:paragraph {"style":{"typography":{"fontSize":"40px","lineHeight":1.5}}} -->
  78                  <p style="font-size:40px;line-height:1.5"><strong><em>' . esc_html__( '"Few people are capable of expressing with equanimity opinions which differ from the prejudices of their social eznvironment. Most people are even incapable of forming such opinions."', 'twentytwelve' ) . '</em></strong></p>
  79                  <!-- /wp:paragraph --><!-- wp:paragraph -->
  80                  <p><em>' . esc_html__( '—  Albert Einstein', 'twentytwelve' ) . '</em></p>
  81                  <!-- /wp:paragraph -->',
  82          )
  83      );
  84  
  85      // Columns block with image in the first column and paragraphs with a drop cap in the second.
  86      register_block_pattern(
  87          'twentytwelve/mixed-content-columns',
  88          array(
  89              'title'         => esc_html__( 'Left-aligned Image and Paragraph', 'twentytwelve' ),
  90              'categories'    => array( 'twentytwelve' ),
  91              'viewportWidth' => 700,
  92              'content'       => '<!-- wp:columns -->
  93                  <div class="wp-block-columns"><!-- wp:column -->
  94                  <div class="wp-block-column"><!-- wp:image {"sizeSlug":"large","linkDestination":"none","className":"is-style-default"} -->
  95                  <figure class="wp-block-image size-large is-style-default"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern-jumble-3.jpg" alt="' . esc_attr__( 'Close up of a yellow leaf.', 'twentytwelve' ) . '" /></figure>
  96                  <!-- /wp:image --></div>
  97                  <!-- /wp:column -->
  98                  <!-- wp:column -->
  99                  <div class="wp-block-column"><!-- wp:paragraph {"dropCap":true} -->
 100                  <p class="has-drop-cap">' . esc_html__( 'Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.', 'twentytwelve' ) . '</p>
 101                  <!-- /wp:paragraph -->
 102                  <!-- wp:paragraph -->
 103                  <p>' . esc_html__( 'The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn&#8217;t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then.', 'twentytwelve' ) . '</p>
 104                  <!-- /wp:paragraph -->
 105                  <!-- wp:paragraph -->
 106                  <p>' . esc_html__( 'It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.', 'twentytwelve' ) . '</p>
 107                  <!-- /wp:paragraph --></div>
 108                  <!-- /wp:column --></div>
 109                  <!-- /wp:columns -->',
 110          )
 111      );
 112  
 113  }


Generated: Sun Aug 1 01:00:05 2021 Cross-referenced by PHPXref 0.7.1