From 6475d329643949925a9a34138f93fc2914c36276 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 27 Jul 2020 15:12:13 +0000 Subject: [PATCH] Block Editor: Update the Core Block Patterns. Backport the latest block patterns from the Gutenberg plugin. The new patterns adapt properly to Core themes. Props nrqsnchz. Fixes #50550, #50594. git-svn-id: https://develop.svn.wordpress.org/trunk@48639 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-patterns.php | 3 ++- .../block-patterns/heading-paragraph.php | 14 ++++++++++++++ .../block-patterns/large-header-button.php | 14 ++++++++++++++ .../block-patterns/large-header-paragraph.php | 13 ------------- src/wp-includes/block-patterns/large-header.php | 5 +++-- src/wp-includes/block-patterns/quote.php | 3 ++- .../block-patterns/text-three-columns-buttons.php | 5 +++-- .../text-two-columns-with-images.php | 7 ++++--- .../block-patterns/text-two-columns.php | 7 ++++--- src/wp-includes/block-patterns/three-buttons.php | 5 +++-- src/wp-includes/block-patterns/two-buttons.php | 3 ++- src/wp-includes/block-patterns/two-images.php | 7 ++++--- 12 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 src/wp-includes/block-patterns/heading-paragraph.php create mode 100644 src/wp-includes/block-patterns/large-header-button.php delete mode 100644 src/wp-includes/block-patterns/large-header-paragraph.php diff --git a/src/wp-includes/block-patterns.php b/src/wp-includes/block-patterns.php index 29e6298d27..f5e7ee4e16 100644 --- a/src/wp-includes/block-patterns.php +++ b/src/wp-includes/block-patterns.php @@ -25,8 +25,9 @@ function _register_core_block_patterns_and_categories() { 'text-two-columns-with-images', 'text-three-columns-buttons', 'large-header', - 'large-header-paragraph', + 'large-header-button', 'three-buttons', + 'heading-paragraph', 'quote', ); diff --git a/src/wp-includes/block-patterns/heading-paragraph.php b/src/wp-includes/block-patterns/heading-paragraph.php new file mode 100644 index 0000000000..75d3c0cd69 --- /dev/null +++ b/src/wp-includes/block-patterns/heading-paragraph.php @@ -0,0 +1,14 @@ + __( 'Heading and paragraph' ), + 'content' => "\n
\n

2.
" . __( 'Which treats of the first sally the ingenious Don Quixote made from home' ) . "

\n\n\n\n

" . __( 'These preliminaries settled, he did not care to put off any longer the execution of his design, urged on to it by the thought of all the world was losing by his delay, seeing what wrongs he intended to right, grievances to redress, injustices to repair, abuses to remove, and duties to discharge.' ) . "

\n
\n", + 'viewportWidth' => 1000, + 'categories' => array( 'text' ), + 'description' => _x( 'A heading preceded by a chapter number, and followed by a paragraph.', 'Block pattern description' ), +); diff --git a/src/wp-includes/block-patterns/large-header-button.php b/src/wp-includes/block-patterns/large-header-button.php new file mode 100644 index 0000000000..0dde847e40 --- /dev/null +++ b/src/wp-includes/block-patterns/large-header-button.php @@ -0,0 +1,14 @@ + __( 'Large header with a heading and a button ' ), + 'content' => "\n
\n
\n
\n
\n
\n\n\n\n
\n
\n\n\n\n

" . __( 'Thou hast seen' ) . '
' . __( 'nothing yet' ) . "

\n\n\n\n\n\n\n\n
\n
\n\n\n\n
\n
\n
\n
\n
\n", + 'viewportWidth' => 1000, + 'categories' => array( 'header' ), + 'description' => _x( 'A large hero section with a bright gradient background, a big heading and a filled button.', 'Block pattern description' ), +); diff --git a/src/wp-includes/block-patterns/large-header-paragraph.php b/src/wp-includes/block-patterns/large-header-paragraph.php deleted file mode 100644 index c6e520ac33..0000000000 --- a/src/wp-includes/block-patterns/large-header-paragraph.php +++ /dev/null @@ -1,13 +0,0 @@ - __( 'Large header and a paragraph' ), - 'content' => "\n
\n
\n

" . __( '"Sir Knight"' ) . "

\n\n\n\n

" . __( 'If your worship be disposed to alight, you will fail of nothing here but of a bed as for all other accommodations, you may be supplied to your mind.' ) . "

\n
\n
\n", - 'viewportWidth' => 1000, - 'categories' => array( 'header' ), -); diff --git a/src/wp-includes/block-patterns/large-header.php b/src/wp-includes/block-patterns/large-header.php index 3e2a0199e8..dd2132d213 100644 --- a/src/wp-includes/block-patterns/large-header.php +++ b/src/wp-includes/block-patterns/large-header.php @@ -6,8 +6,9 @@ */ return array( - 'title' => __( 'Large header' ), - 'content' => "\n
\n
\n

" . __( 'Large header' ) . "

\n
\n
\n", + 'title' => __( 'Large header with a heading' ), + 'content' => "\n
\n

" . __( 'Don Quixote' ) . "

\n
\n", 'viewportWidth' => 1000, 'categories' => array( 'header' ), + 'description' => _x( 'A large hero section with an example background image and a heading in the center.', 'Block pattern description' ), ); diff --git a/src/wp-includes/block-patterns/quote.php b/src/wp-includes/block-patterns/quote.php index 33c54b5892..d7b142b354 100644 --- a/src/wp-includes/block-patterns/quote.php +++ b/src/wp-includes/block-patterns/quote.php @@ -7,7 +7,8 @@ return array( 'title' => __( 'Quote' ), - 'content' => "\n

" . __( '"Sir Knight, if your worship be disposed to alight, you will fail of nothing here but of a bed as for all other accommodations, you may be supplied to your mind."' ) . '

' . __( '— Don Quixote' ) . "
\n", + 'content' => "\n
\n
\"Pencil
\n\n\n\n

" . __( '"Do you see over yonder, friend Sancho, thirty or forty hulking giants? I intend to do battle with them and slay them."' ) . '

' . __( '— Don Quixote' ) . "
\n\n\n\n
\n
\n", 'viewportWidth' => 800, 'categories' => array( 'text' ), + 'description' => _x( 'A quote and citation with an image above, and a separator at the bottom.', 'Block pattern description' ), ); diff --git a/src/wp-includes/block-patterns/text-three-columns-buttons.php b/src/wp-includes/block-patterns/text-three-columns-buttons.php index 5b640eab45..ba63dfae4e 100644 --- a/src/wp-includes/block-patterns/text-three-columns-buttons.php +++ b/src/wp-includes/block-patterns/text-three-columns-buttons.php @@ -8,6 +8,7 @@ return array( 'title' => __( 'Three columns of text with buttons' ), 'categories' => array( 'columns' ), - 'content' => "\n
\n
\n
\n

" . __( 'With that he went and held Don Quixote\'s stirrup, who having ate nothing all that day, dismounted with no small trouble and difficulty.' ) . "

\n\n\n\n\n
\n\n\n\n
\n

" . __( 'In short, let if be what it will, so it comes quickly; for the weight of armour and the fatigue of travel are not to be supported without recruiting food.' ) . "

\n\n\n\n\n
\n\n\n\n
\n

" . __( 'Thereupon they laid the cloth at the inn-door for the benefit of the fresh air, and the landlord brought him a piece of the salt fish.' ) . "

\n\n\n\n\n
\n
\n
\n", - 'viewportWidth' => 800, + 'content' => "\n
\n
\n
\n

" . __( 'Which treats of the character and pursuits of the famous Don Quixote of La Mancha.' ) . "

\n\n\n\n\n
\n\n\n\n
\n

" . __( 'Which treats of the first sally the ingenious Don Quixote made from home.' ) . "

\n\n\n\n\n
\n\n\n\n
\n

" . __( 'Wherein is related the droll way in which Don Quixote had himself dubbed a knight.' ) . "

\n\n\n\n\n
\n
\n
\n", + 'viewportWidth' => 1000, + 'description' => _x( 'Three small columns of text, each with an outlined button with rounded corners at the bottom.', 'Block pattern description' ), ); diff --git a/src/wp-includes/block-patterns/text-two-columns-with-images.php b/src/wp-includes/block-patterns/text-two-columns-with-images.php index f5f1b1f8d3..8ad9131167 100644 --- a/src/wp-includes/block-patterns/text-two-columns-with-images.php +++ b/src/wp-includes/block-patterns/text-two-columns-with-images.php @@ -6,7 +6,8 @@ */ return array( - 'title' => __( 'Two columns of text with images' ), - 'categories' => array( 'columns' ), - 'content' => "\n
\n
\n
\n
\"\"
\n\n\n\n

" . __( 'This language, which they did not understand, and the extraordinary appearance of the knight, increased their laughter, which also increased his displeasure, and he would probably have shown it in a less civil way, but for the timely arrival of the innkeeper.' ) . "

\n
\n\n\n\n
\n
\"\"
\n\n\n\n

" . __( 'He was a man whose burden of fat inclined him to peace and quietness, yet when he observed such a strange disguise of human shape in his old armour and equipage, he could hardly forbear laughter; but having the fear of such a warlike appearance before his eyes, he resolved to give him good words, and therefore accosted him civilly.' ) . "

\n
\n
\n
\n", + 'title' => __( 'Two columns of text with images' ), + 'categories' => array( 'columns' ), + 'content' => "\n
\n
\n
\n
\"\"/
\n\n\n\n

" . __( 'You must know, then, that the above-named gentleman whenever he was at leisure (which was mostly all the year round) gave himself up to reading books of chivalry with such ardour and avidity that he almost entirely neglected the pursuit of his field-sports, and even the management of his property; and to such a pitch did his eagerness and infatuation go that he sold many an acre of tillageland to buy books of chivalry to read, and brought home as many of them as he could get.' ) . "

\n
\n\n\n\n
\n
\"\"/
\n\n\n\n

" . __( 'But of all there were none he liked so well as those of the famous Feliciano de Silva\'s composition, for their lucidity of style and complicated conceits were as pearls in his sight, particularly when in his reading he came upon courtships and cartels, where he often found passages like "the reason of the unreason with which my reason is afflicted so weakens my reason that with reason I murmur at your beauty;" or again, "the high heavens render you deserving of the desert your greatness deserves."' ) . "

\n
\n
\n
\n", + 'description' => _x( 'Two columns of text, each with an image on top.', 'Block pattern description' ), ); diff --git a/src/wp-includes/block-patterns/text-two-columns.php b/src/wp-includes/block-patterns/text-two-columns.php index 0d2385fa69..76261e4685 100644 --- a/src/wp-includes/block-patterns/text-two-columns.php +++ b/src/wp-includes/block-patterns/text-two-columns.php @@ -6,7 +6,8 @@ */ return array( - 'title' => __( 'Two columns of text' ), - 'categories' => array( 'columns' ), - 'content' => "\n
\n
\n

" . __( 'CHAPTER 1. Loomings' ) . "

\n\n\n\n

" . __( 'Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation.' ) . "

\n
\n\n\n\n
\n

" . __( 'Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high time to get to sea as soon as I can.' ) . "

\n
\n
\n", + 'title' => __( 'Two columns of text' ), + 'categories' => array( 'columns' ), + 'content' => "\n
\n

" . __( 'Which treats of the character and pursuits of the famous gentleman Don Quixote of La Mancha' ) . "

\n\n\n\n
\n
\n

" . __( 'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing. An olla of rather more beef than mutton, a salad on most nights, scraps on Saturdays, lentils on Fridays, and a pigeon or so extra on Sundays, made away with three-quarters of his income.' ) . "

\n
\n\n\n\n
\n

" . __( 'The rest of it went in a doublet of fine cloth and velvet breeches and shoes to match for holidays, while on week-days he made a brave figure in his best homespun. He had in his house a housekeeper past forty, a niece under twenty, and a lad for the field and market-place, who used to saddle the hack as well as handle the bill-hook. The age of this gentleman of ours was bordering on fifty; he was of a hardy habit, spare, gaunt-featured, a very early riser and a great sportsman.' ) . "

\n
\n
\n
\n", + 'description' => _x( 'Two columns of text preceded by a long heading.', 'Block pattern description' ), ); diff --git a/src/wp-includes/block-patterns/three-buttons.php b/src/wp-includes/block-patterns/three-buttons.php index 84953401aa..96f750628b 100644 --- a/src/wp-includes/block-patterns/three-buttons.php +++ b/src/wp-includes/block-patterns/three-buttons.php @@ -7,7 +7,8 @@ return array( 'title' => __( 'Three buttons' ), - 'content' => "\n
\n\n\n\n\n\n\n\n\n\n
\n", - 'viewportWidth' => 500, + 'content' => "\n
\n\n\n\n\n\n\n\n\n\n
\n", + 'viewportWidth' => 600, 'categories' => array( 'buttons' ), + 'description' => _x( 'Three filled buttons with rounded corners, side by side.', 'Block pattern description' ), ); diff --git a/src/wp-includes/block-patterns/two-buttons.php b/src/wp-includes/block-patterns/two-buttons.php index b0db97a96b..e9e5fee439 100644 --- a/src/wp-includes/block-patterns/two-buttons.php +++ b/src/wp-includes/block-patterns/two-buttons.php @@ -7,7 +7,8 @@ return array( 'title' => __( 'Two buttons' ), - 'content' => "\n
\n\n\n\n\n\n
\n", + 'content' => "\n
\n\n\n\n\n\n
\n", 'viewportWidth' => 500, 'categories' => array( 'buttons' ), + 'description' => _x( 'Two buttons, one filled and one outlined, side by side.', 'Block pattern description' ), ); diff --git a/src/wp-includes/block-patterns/two-images.php b/src/wp-includes/block-patterns/two-images.php index 232c0b318e..2b4f0f1805 100644 --- a/src/wp-includes/block-patterns/two-images.php +++ b/src/wp-includes/block-patterns/two-images.php @@ -6,7 +6,8 @@ */ return array( - 'title' => __( 'Two images side by side' ), - 'categories' => array( 'gallery' ), - 'content' => "\n\n", + 'title' => __( 'Two images side by side' ), + 'categories' => array( 'gallery' ), + 'description' => _x( 'An image gallery with two example images.', 'Block pattern description' ), + 'content' => "\n\n", );