__( 'Endpaper', 'endpaper' ), 'description' => __( 'Books from your Hardcover library.', 'endpaper' ), ) ); $patterns = array( 'currently-reading' => array( 'title' => __( 'Currently reading', 'endpaper' ), 'description' => __( 'A heading and the books you are reading now, with how far you have read.', 'endpaper' ), 'heading' => __( 'Currently reading', 'endpaper' ), 'list' => array( 'status' => 2, 'count' => 3, 'titleLevel' => 3, ), ), 'recently-read' => array( 'title' => __( 'Recently read', 'endpaper' ), 'description' => __( 'A heading and the books you last finished, with your ratings.', 'endpaper' ), 'heading' => __( 'Recently read', 'endpaper' ), 'list' => array( 'status' => 3, 'count' => 3, 'titleLevel' => 3, ), ), ); foreach ( $patterns as $name => $pattern ) { register_block_pattern( 'endpaper/' . $name, array( 'title' => $pattern['title'], 'description' => $pattern['description'], 'categories' => array( 'endpaper' ), 'keywords' => array( 'hardcover', 'books', 'reading' ), 'viewportWidth' => 600, 'content' => '

' . esc_html( $pattern['heading'] ) . '

' . "\n\n" . '
', ) ); } } add_action( 'init', __NAMESPACE__ . '\register_patterns' );