<?php
function swp_painting_enqueue_assets() {
    // Theme main stylesheet
    wp_enqueue_style(
        'swp-painting-style',
        get_theme_file_uri('style.css'),
        array(),
        wp_get_theme()->get('Version')
    );

}
add_action('wp_enqueue_scripts', 'swp_painting_enqueue_assets');

add_action('after_setup_theme', function () {
    add_editor_style( array( 'editor-style.css', 'style.css' ) );
});

// Menus in Admin menu
function swp_painting_setup() {
    add_theme_support( 'menus' );

    register_nav_menus( array(
        'primary' => __( 'Primary Menu', 'swp-painting' ),
    ) );
}
add_action( 'after_setup_theme', 'swp_painting_setup' );

// Register Custom Pattern Category
function swp_painting_register_custom_pattern_cat() {
	register_block_pattern_category(
		'swp-painting',
		array( 'label' => __( 'SWP Painting', 'swp-painting' ) )
	);
}
add_action( 'init', 'swp_painting_register_custom_pattern_cat' );

// Admin promo banner for pro theme.
require_once get_theme_file_path( '/include/admin-promo-banner.php' );

// Register custom block styles for core blocks.
function swp_painting_register_block_styles() {
	if ( ! function_exists( 'register_block_style' ) ) {
		return;
	}

	register_block_style(
		'core/button',
		array(
			'name'         => 'swp-painting-soft-outline',
			'label'        => __( 'Soft Outline', 'swp-painting' ),
			'inline_style' => '.wp-block-button.is-style-swp-painting-soft-outline .wp-block-button__link{border:1px solid #1111d4;background:transparent;color:#1111d4;border-radius:8px;}',
		)
	);
}
add_action( 'init', 'swp_painting_register_block_styles' );
