Livro: Add 404 pattern (#5391)

* Livro: Add 404 pattern

* Make the search text translatable
This commit is contained in:
Ben Dwyer 2022-01-26 14:53:52 +00:00 committed by GitHub
parent e4d754d6c9
commit fec39b096a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -56,6 +56,7 @@ function livro_register_block_patterns() {
'header-left-right-logo',
'header-left-right-logo-title',
'header-title-tagline-social',
'hidden-404',
'page-about',
'page-contact',
);

View file

@ -0,0 +1,15 @@
<?php
/**
* 404 content.
*/
return array(
'title' => __( '404 content', 'livro' ),
'inserter' => false,
'content' => '<!-- wp:heading {"style":{"typography":{"fontSize":"clamp(4rem, 40vw, 20rem)","fontWeight":"200","lineHeight":"1"}},"className":"has-text-align-center"} -->
<h2 class="has-text-align-center" style="font-size:clamp(4rem, 40vw, 20rem);font-weight:200;line-height:1">' . esc_html( _x( '404', 'Error code for a webpage that is not found.', 'livro' ) ) . '</h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">' . esc_html__( 'This page could not be found. Maybe try a search?', 'livro' ) . '</p>
<!-- /wp:paragraph -->
<!-- wp:search {"label":"' . esc_html__( 'Search', 'livro' ) . '","showLabel":false,"width":50,"widthUnit":"%","buttonText":"' . esc_html__( 'Search', 'livro' ) . '","buttonUseIcon":true,"align":"center"} /-->',
);