[wp-trac] [WordPress Trac] #61765: Twenty Twelve: The large quote pattern does not use a quote block

WordPress Trac noreply at wordpress.org
Wed Jul 31 15:23:28 UTC 2024


#61765: Twenty Twelve: The large quote pattern does not use a quote block
-------------------------------------------------+-------------------------
 Reporter:  poena                                |       Owner:  (none)
     Type:  enhancement                          |      Status:  assigned
 Priority:  low                                  |   Milestone:  6.7
Component:  Bundled Theme                        |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch changes-    |     Focuses:
  requested                                      |
-------------------------------------------------+-------------------------
Changes (by sabernhardt):

 * keywords:  good-first-bug has-patch needs-testing => good-first-bug has-
     patch changes-requested


Comment:

 To replace blocks in a theme's pattern:
 1. Copy the `content` value from the block pattern PHP.
 2. Activate the theme.
 3. Go to the editor and insert that pattern.
 4. Transform the block(s) to another block.
 5. Adjust block settings and/or markup, if appropriate. (With the Quote
 block in Twenty Twelve, the `em` tags are unnecessary because both the
 paragraph and citation are italicized.)
 6. Switch to Code view, and copy the new block(s).
 7. Paste that into the block pattern PHP, in the `content` value.
 8. Indent any new lines (with tabs).
 9. Replace any text with the translatable strings you copied in step 1.
 10. Return to the editor, and insert the updated pattern.
 11. Switch to Code view, and verify that the pattern matches what you made
 in steps 4 and 5.

 {{{
                         'content'       => '<!-- wp:quote -->
                                 <blockquote class="wp-block-quote"><!--
 wp:paragraph {"style":{"typography":{"fontSize":"40px","lineHeight":1.5}}}
 -->
                                 <p style="font-size:40px;line-
 height:1.5"><strong>' . esc_html__( '"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."',
 'twentytwelve' ) . '</strong></p>
                                 <!-- /wp:paragraph --><cite>' .
 esc_html__( '—  Albert Einstein', 'twentytwelve' ) . '</cite></blockquote>
                                 <!-- /wp:quote -->',
 }}}

 The nested Paragraph block above could produce invalid/unexpected content
 errors in older versions of WordPress, though I think that is the best
 option.
 - Block patterns were introduced in WordPress 5.5.
 - Twenty Twelve added its patterns in #51105, at the same time as
 WordPress 5.8.
 - The Quote block started nesting a Paragraph block inside it in WordPress
 6.1.

 The comment also needs updating because the pattern does not have a
 heading. Suggestion:
 {{{
 // Quote with large paragraph text.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61765#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list