Make WordPress Core

Ticket #51107: 51107.3.diff

File 51107.3.diff, 8.6 KB (added by melchoyce, 5 years ago)
  • src/wp-content/themes/twentyten/block-patterns.php

     
     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_Ten
     10 * @since Twenty Ten 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                'twentyten',
     20                array( 'label' => esc_html__( 'Twenty Ten', 'twentyten' ) )
     21        );
     22}
     23
     24/**
     25 * Register Block Patterns.
     26 */
     27if ( function_exists( 'register_block_pattern' ) ) {
     28
     29        // Image with large heading and paragraphs.
     30        register_block_pattern(
     31                'twentyten/intro',
     32                array(
     33                        'title'         => esc_html__( 'Introduction', 'twentyten' ),
     34                        'categories'    => array( 'twentyten' ),
     35                        'viewportWidth' => 700,
     36                        'content'       => '<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
     37                                <figure class="wp-block-image size-large"><img src="' . get_stylesheet_directory_uri() . '/images/patterns/pattern-barn.jpg" alt="' . __( 'A red barn with a white roof in a field.', 'twentyten' ) . '" /><figcaption><em>An old barn we passed on the drive</em></figcaption></figure>
     38                                <!-- /wp:image -->
     39                                <!-- wp:heading {"style":{"typography":{"fontSize":60}}} -->
     40                                <h2 style="font-size:60px">A Weekend Away</h2>
     41                                <!-- /wp:heading -->
     42                                <!-- wp:paragraph -->
     43                                <p>It’s amazing what a good weekend can do. After a tough couple weeks at work, I knew I needed to get away and be in nature. My partner and I decided to take a long weekend and stay in a cabin in the woods. We packed up after work on Friday and drove out into the country, passing through fields full of horses, old farms, and quaint little town squares. It was an idyllic drive. Eventually, we reached our destination and unpacked the car. We couldn’t wait to cook up a simple dinner and then relax by the fireplace.</p>
     44                                <!-- /wp:paragraph -->',
     45                )
     46        );
     47
     48        // Cover block with a pullquote.
     49        register_block_pattern(
     50                'twentyten/highlighted-quote',
     51                array(
     52                        'title'         => esc_html__( 'Highlighted Quote', 'twentyten' ),
     53                        'categories'    => array( 'twentyten' ),
     54                        'viewportWidth' => 700,
     55                        'content'       => '<!-- wp:cover {"overlayColor":"light-gray"} -->
     56                                <div class="wp-block-cover has-light-gray-background-color has-background-dim"><div class="wp-block-cover__inner-container"><!-- wp:pullquote {"textColor":"black","className":"is-style-solid-color"} -->
     57                                <figure class="wp-block-pullquote is-style-solid-color"><blockquote class="has-text-color has-black-color"><p><em>"Take time off&hellip; The world will not fall apart without you."</em></p><cite>— Malebo Sephodi</cite></blockquote></figure>
     58                                <!-- /wp:pullquote --></div></div>
     59                                <!-- /wp:cover -->',
     60                )
     61        );
     62
     63        // Column blocks featuring two images with text on the side.
     64        register_block_pattern(
     65                'twentyten/alternating-images',
     66                array(
     67                        'title'         => esc_html__( 'Alternating Images', 'twentyten' ),
     68                        'categories'    => array( 'twentyten' ),
     69                        'viewportWidth' => 700,
     70                        'content'       => '<!-- wp:columns {"verticalAlignment":"center"} -->
     71                                <div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"66.66%"} -->
     72                                <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:66.66%"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
     73                                <figure class="wp-block-image size-large"><img src="' . get_stylesheet_directory_uri() . '/images/patterns/pattern-dock.jpg" alt="' . __( 'A lake with several boats docked. The sun is rising behind mountains in the background.', 'twentyten' ) . '" /><figcaption><em>The lake at 6:54 AM</em></figcaption></figure>
     74                                <!-- /wp:image --></div>
     75                                <!-- /wp:column -->
     76                                <!-- wp:column {"verticalAlignment":"top","width":"33.33%"} -->
     77                                <div class="wp-block-column is-vertically-aligned-top" style="flex-basis:33.33%">
     78                                <!-- wp:paragraph -->
     79                                <p><em>Nearby our cabin was a lake. The sunrise looked beautiful as it rose over the hills beyond the water, reflecting down onto the gentle morning waves. I sat on the dock and drank a cup of coffee, enjoying the cool air on my skin. The coffee kept me warm inside.</em></p>
     80                                <!-- /wp:paragraph --></div>
     81                                <!-- /wp:column --></div>
     82                                <!-- /wp:columns -->
     83                                <!-- wp:columns -->
     84                                <div class="wp-block-columns"><!-- wp:column {"width":"33.33%"} -->
     85                                <div class="wp-block-column" style="flex-basis:33.33%">
     86                                <!-- wp:paragraph -->
     87                                <p><em>Later that night, we went back to the lake and sat by the shore. It felt different at night; quieter, as if all of nature had gone to sleep for  a little while. The only noises were the chirp of crickets and the soft splash of the waves lapping at the shore. What a beautiful way to end the day.</em></p>
     88                                <!-- /wp:paragraph --></div>
     89                                <!-- /wp:column -->
     90                                <!-- wp:column {"width":"66.66%"} -->
     91                                <div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
     92                                <figure class="wp-block-image size-large"><img src="' . get_stylesheet_directory_uri() . '/images/patterns/pattern-lake.jpg" alt="' . __( 'A lake at night, with Adirondack chairs in the foreground. The sun sets in the background.', 'twentyten' ) . '" /><figcaption><em>Relaxing at the lake after dinner</em></figcaption></figure>
     93                                <!-- /wp:image --></div>
     94                                <!-- /wp:column --></div>
     95                                <!-- /wp:columns -->',
     96                )
     97        );
     98
     99}
  • src/wp-content/themes/twentyten/functions.php

    Property changes on: src/wp-content/themes/twentyten/block-patterns.php
    ___________________________________________________________________
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
     
    739739}
    740740add_action( 'enqueue_block_editor_assets', 'twentyten_block_editor_styles' );
    741741
     742// Block Patterns.
     743require get_stylesheet_directory() . '/block-patterns.php';
     744
    742745if ( ! function_exists( 'wp_body_open' ) ) :
    743746        /**
    744747         * Fire the wp_body_open action.
  • src/wp-content/themes/twentyten/readme.txt

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: src/wp-content/themes/twentyten/images/patterns/pattern-barn.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/twentyten/images/patterns/pattern-dock.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/twentyten/images/patterns/pattern-lake.jpg
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +application/octet-stream
    \ No newline at end of property
     
    3434MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    3535GNU General Public License for more details.
    3636
     37Images
     38
     39“Boats Water Photo” by Bonnie Moreland. CC0. https://stocksnap.io/photo/boats-water-JZETH8NO7I
     40“Lake Sunset Photo” by Bonnie Moreland. CC0. https://stocksnap.io/photo/lake-sunset-XYK6WMBSOJ
     41“Old Barn Photo” by Bonnie Moreland. CC0. https://stocksnap.io/photo/old-barn-4HMJ2KQVX9
     42
    3743== Changelog ==
    3844
    3945= 3.2 =