Make WordPress Core

Ticket #51105: 51105.diff

File 51105.diff, 10.3 KB (added by melchoyce, 4 years ago)
  • src/wp-content/themes/twentytwelve/functions.php

     
    133133require get_template_directory() . '/inc/custom-header.php';
    134134
    135135/**
     136 * Add support for block patterns.
     137 */
     138require get_template_directory() . '/inc/block-patterns.php';
     139
     140/**
    136141 * Return the Google font stylesheet URL if available.
    137142 *
    138143 * The use of Open Sans by default is localized. For languages that use
  • src/wp-content/themes/twentytwelve/inc/block-patterns.php

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: src/wp-content/themes/twentytwelve/images/pattern-jumble-1.jpg
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +application/octet-stream
    \ No newline at end of property
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: src/wp-content/themes/twentytwelve/images/pattern-jumble-2.jpg
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +application/octet-stream
    \ No newline at end of property
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: src/wp-content/themes/twentytwelve/images/pattern-jumble-3.jpg
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +application/octet-stream
    \ No newline at end of property
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: src/wp-content/themes/twentytwelve/images/pattern-jumble-4.jpg
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +application/octet-stream
    \ No newline at end of property
     
     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 1.0
     11 */
     12
     13 /**
     14 * Register Block Pattern Category.
     15 */
     16if ( 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 */
     27if ( 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="' . get_stylesheet_directory_uri() . '/images/pattern-jumble-2.jpg" alt="' . __( '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="' . get_stylesheet_directory_uri() . '/images/pattern-jumble-3.jpg" alt="' . __( '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="' . get_stylesheet_directory_uri() . '/images/pattern-jumble-4.jpg" alt="' . __( '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="' . get_stylesheet_directory_uri() . '/images/pattern-jumble-1.jpg" alt="' . __( '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:heading {"style":{"typography":{"fontSize":40}}} -->
     78                                <h2 style="font-size:40px"><em>"Few people are capable of expressing with equanimity opinions which differ from the prejudices of their social environment. Most people are even incapable of forming such opinions.</em>"</h2>
     79                                <!-- /wp:heading -->
     80                                <!-- wp:paragraph -->
     81                                <p><em>—  Albert Einstein</em></p>
     82                                <!-- /wp:paragraph -->',
     83                )
     84        );
     85
     86        // Columns block with image in the first column and paragraphs with a drop cap in the second.
     87        register_block_pattern(
     88                'twentytwelve/mixed-content-columns',
     89                array(
     90                        'title'         => esc_html__( 'Left-aligned Image and Paragraph', 'twentytwelve' ),
     91                        'categories'    => array( 'twentytwelve' ),
     92                        'viewportWidth' => 700,
     93                        'content'       => '<!-- wp:columns -->
     94                                <div class="wp-block-columns"><!-- wp:column -->
     95                                <div class="wp-block-column"><!-- wp:image {"sizeSlug":"large","linkDestination":"none","className":"is-style-default"} -->
     96                                <figure class="wp-block-image size-large is-style-default"><img src="' . get_stylesheet_directory_uri() . '/images/pattern-jumble-3.jpg" alt="' . __( 'Close up of a yellow leaf.', 'twentytwelve' ) . '" /></figure>
     97                                <!-- /wp:image --></div>
     98                                <!-- /wp:column -->
     99                                <!-- wp:column -->
     100                                <div class="wp-block-column"><!-- wp:paragraph {"dropCap":true} -->
     101                                <p class="has-drop-cap" id="block-7c652501-a304-4234-9e20-21a017178a7f">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.</p>
     102                                <!-- /wp:paragraph -->
     103                                <!-- wp:paragraph -->
     104                                <p id="block-7c652501-a304-4234-9e20-21a017178a7f">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.</p>
     105                                <!-- /wp:paragraph -->
     106                                <!-- wp:paragraph -->
     107                                <p>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.</p>
     108                                <!-- /wp:paragraph --></div>
     109                                <!-- /wp:column --></div>
     110                                <!-- /wp:columns -->',
     111                )
     112        );
     113
     114}
  • src/wp-content/themes/twentytwelve/readme.txt

    Property changes on: src/wp-content/themes/twentytwelve/inc/block-patterns.php
    ___________________________________________________________________
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
     
    4040Licenses: MIT/GPL2
    4141Source: https://github.com/aFarkas/html5shiv
    4242
     43"Fall Leaf Photo" by Tim Sullivan. CC0. https://stocksnap.io/photo/fall-leaf-ZBK0NLVP2B
     44"Fall Leaf Photo" by Tim Sullivan. CC0. https://stocksnap.io/photo/fall-leaf-EEGO4GCPQD
     45"Autumn City Photo" by Oleg Prokopenko. CC0. https://stocksnap.io/photo/autumn-city-PZP8EWR5MR
     46
    4347== Changelog ==
    4448
    4549= 3.3 =