Bladeren bron

Livro: Add 404 pattern (#5391)

* Livro: Add 404 pattern

* Make the search text translatable
Ben Dwyer 3 jaren geleden
bovenliggende
commit
fec39b096a
2 gewijzigde bestanden met toevoegingen van 16 en 0 verwijderingen
  1. 1 0
      livro/inc/block-patterns.php
  2. 15 0
      livro/inc/patterns/hidden-404.php

+ 1 - 0
livro/inc/block-patterns.php

@@ -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',
 	);

+ 15 - 0
livro/inc/patterns/hidden-404.php

@@ -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"} /-->',
+);