<?php
/**
 * Block Patterns integration.
 * Register WAWP block patterns for Gutenberg.
 *
 * @package automation-web-platform
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Register WAWP block patterns for Gutenberg.
 */
function wawp_register_block_patterns() {
	if ( function_exists( 'register_block_pattern_category' ) ) {
		register_block_pattern_category( 'automation-web-platform', array( 'label' => esc_html__( 'Wawp', 'automation-web-platform' ) ) );
	}

	if ( function_exists( 'register_block_pattern' ) ) {
		register_block_pattern(
			'wawp/wawp-fast-login-form',
			array(
				'title'       => esc_html__( 'Wawp Login/Signup Form', 'automation-web-platform' ),
				'description' => esc_html__( 'A combined login and signup form for Wawp.', 'automation-web-platform' ),
				'content'     => '<!-- wp:shortcode -->[wawp-fast-login]<!-- /wp:shortcode -->',
				'categories'  => array( 'automation-web-platform' ),
				'keywords'    => array( 'wawp', 'login', 'signup' ),
			)
		);

		register_block_pattern(
			'wawp/wawp-login-form',
			array(
				'title'       => esc_html__( 'Wawp Login Form', 'automation-web-platform' ),
				'description' => esc_html__( 'A dedicated login form for Wawp.', 'automation-web-platform' ),
				'content'     => '<!-- wp:shortcode -->[wawp_otp_login]<!-- /wp:shortcode -->',
				'categories'  => array( 'automation-web-platform' ),
				'keywords'    => array( 'wawp', 'login', 'form' ),
			)
		);

		register_block_pattern(
			'wawp/wawp-signup-form',
			array(
				'title'       => esc_html__( 'Wawp Signup Form', 'automation-web-platform' ),
				'description' => esc_html__( 'A dedicated signup form for Wawp.', 'automation-web-platform' ),
				'content'     => '<!-- wp:shortcode -->[wawp_signup_form]<!-- /wp:shortcode -->',
				'categories'  => array( 'automation-web-platform' ),
				'keywords'    => array( 'wawp', 'signup', 'form' ),
			)
		);
	}
}

add_action( 'init', 'wawp_register_block_patterns' );
