<?php
/**
 * Block Patterns
 * 
 * @link https://developer.wordpress.org/reference/functions/register_block_pattern/
 * @link https://developer.wordpress.org/reference/functions/register_block_pattern_category/
 *
 * @package bigwigs
 * @since   0.7.0
 */

/**
 * Register Block Pattern Category.
 */
if ( function_exists( 'register_block_pattern_category' ) ) {
	register_block_pattern_category(
		'bigwigs',
		array( 'label' => __( 'Bigwigs Patterns', 'bigwigs' ) )
	);
}

/**
 * Register Block Patterns.
 */
if ( function_exists( 'register_block_pattern' ) ) {

	// Post Grid
	register_block_pattern(
		'bigwigs/post-grid',
		array(
			'title'         => esc_html__( 'Post Grid', 'bigwigs' ),
			'categories'    => array( 'bigwigs' ),
			'viewportWidth' => 1440,
			'content'       => 
								'<!-- wp:query {"queryId":65,"query":{"perPage":6,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false},"displayLayout":{"type":"flex","columns":3}} -->
								<div class="wp-block-query"><!-- wp:post-template -->
								<!-- wp:group -->
								<div class="wp-block-group"><!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->
								<!-- wp:group {"className":"card-body"} -->
								<div class="wp-block-group card-body"><!-- wp:post-title {"isLink":true} /-->
								<!-- wp:post-excerpt /-->
								<!-- wp:post-date /--></div>
								<!-- /wp:group --></div>
								<!-- /wp:group -->
								<!-- /wp:post-template --></div>
								<!-- /wp:query -->',
		)
	);

	// Team member or Author box
	register_block_pattern(
		'bigwigs/author-box',
		array(
			'title'         => esc_html__( 'Author / Team member', 'bigwigs' ),
			'categories'    => array( 'bigwigs' ),
			'viewportWidth' => 1440,
			'content'       => '<!-- wp:media-text {"mediaId":1978,"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/images/man-person.jpg","mediaType":"image","imageFill":true,"focalPoint":{"x":"0.50","y":"0.02"},"className":"border mt-4"} --><div class="wp-block-media-text alignwide is-stacked-on-mobile is-image-fill border mt-4"><figure class="wp-block-media-text__media" style="background-image:url('. esc_url( get_template_directory_uri() ) . '/images/man-person.jpg);background-position:50% 2%"><img src="'. esc_url( get_template_directory_uri() ) . '/images/man-person.jpg" alt="" class="wp-image-1978"/></figure>
				<div class="wp-block-media-text__content">
				<!-- wp:paragraph {"className":"badge badge-info mt-4"} -->
				<p class="badge badge-info mt-4">'. esc_html__( 'Manager', 'bigwigs' ) .'</p>
				<!-- /wp:paragraph -->
				<!-- wp:paragraph {"placeholder":"Content…","style":{"typography":{"fontSize":24}}} -->
				<p style="font-size:24px"><strong>'. esc_html__( 'George McDonnell', 'bigwigs' ) .'</strong></p>
				<!-- /wp:paragraph -->
				<!-- wp:paragraph -->
				<p>'. esc_html__( 'Ralesuada tempus risus, ut ullamcorper risus elementum.', 'bigwigs' ) .'</p>
				<!-- /wp:paragraph -->
				<!-- wp:social-links {"className":"is-style-logos-only"} -->
				<ul class="wp-block-social-links is-style-logos-only"><!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
				<!-- wp:social-link {"url":"#","service":"facebook"} /-->
				<!-- wp:social-link {"url":"#","service":"twitter"} /-->
				<!-- wp:social-link {"service":"instagram"} /-->
				<!-- wp:social-link {"service":"linkedin"} /-->
				<!-- wp:social-link {"service":"youtube"} /--></ul>
				<!-- /wp:social-links -->
				</div></div>
				<!-- /wp:media-text -->',
		)
	);

}