_x( 'Blockmason: Content', 'Block pattern category', 'blockmason-core' ) ) ); $patterns = array( 'services-grid' => array( 'title' => __( 'Services grid', 'blockmason-core' ), 'description' => __( 'All services with icon, title and short description.', 'blockmason-core' ), 'keywords' => array( 'services', 'grid', 'icons' ), ), 'projects-grid' => array( 'title' => __( 'Projects grid with categories', 'blockmason-core' ), 'description' => __( 'Category links and a grid of projects.', 'blockmason-core' ), 'keywords' => array( 'projects', 'portfolio', 'grid' ), ), 'team-grid' => array( 'title' => __( 'Team grid', 'blockmason-core' ), 'description' => __( 'Team members with photo, name and role.', 'blockmason-core' ), 'keywords' => array( 'team', 'staff', 'people' ), ), 'testimonials-grid' => array( 'title' => __( 'Testimonials with title', 'blockmason-core' ), 'description' => __( 'Section title and three testimonials with rating.', 'blockmason-core' ), 'keywords' => array( 'testimonials', 'reviews', 'clients' ), ), ); foreach ( $patterns as $slug => $pattern ) { $content = pattern_content( $slug ); if ( ! $content ) { continue; } register_block_pattern( 'blockmason-core/' . $slug, array_merge( $pattern, array( 'categories' => array( 'blockmason-content' ), 'viewportWidth' => 1400, 'content' => $content, ) ) ); } } /** * Builds a pattern's markup from its template file. * * @param string $slug Pattern slug. * @return string */ function pattern_content( $slug ) { $file = DIR . 'patterns/' . $slug . '.php'; if ( ! file_exists( $file ) ) { return ''; } ob_start(); include $file; return (string) ob_get_clean(); } /** * Section heading markup shared by the patterns. * * @param string $eyebrow Small label above the title. * @param string $title Section title. * @return string */ function pattern_heading( $eyebrow, $title ) { return sprintf( '
%1$s