<?php
/**
 * Functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package nova-photography-portfolio
 * @since 1.0.0
 */

/**
 * Enqueue the CSS files.
 *
 * @since 1.0.0
 *
 * @return void
 */
function nova_photography_portfolio_styles() {
	wp_enqueue_style(
		'nova-photography-portfolio-style',
		get_stylesheet_uri(),
		[],
		wp_get_theme()->get( 'Version' )
	);
	wp_enqueue_style( 'dashicons' );

	wp_enqueue_style(
		'owl.carousel-css',
		get_template_directory_uri() . '/assets/css/owl.carousel.css',
		array(),
		'2.3.4'
	);

	wp_enqueue_script(
		'owl-carousel-js',
		get_template_directory_uri() . '/assets/js/owl.carousel.js',
		array('jquery'),
		'2.3.4',
		true
	);
	wp_enqueue_script('nova-photography-portfolio-js',
	get_template_directory_uri() . '/assets/js/effects.js',array(),
	wp_get_theme()->get('Version'),true 
	);
	wp_style_add_data( 'nova-photography-portfolio-style', 'rtl', 'replace' );
}
add_action( 'wp_enqueue_scripts', 'nova_photography_portfolio_styles' );


function nova_photography_portfolio_register_block_pattern_categories(){
    register_block_pattern_category(
        'nova-photography-portfolio',
		array( 'label' => esc_html__( 'Theme Patterns', 'nova-photography-portfolio' ) )
    );

}
add_action('init', 'nova_photography_portfolio_register_block_pattern_categories');

function nova_photography_portfolio_setup() {

	load_theme_textdomain( 'nova-photography-portfolio', get_template_directory() . '/languages' );

}
add_action( 'after_setup_theme', 'nova_photography_portfolio_setup' );

function nova_photography_portfolio_enqueue_block_editor_styles() {
    wp_enqueue_style(
        'nova-photography-portfolio-block-editor-style',
        get_theme_file_uri( '/assets/css/block-editor.css' ), 
        array(),
        filemtime( get_theme_file_path( '/assets/css/block-editor.css' ) )
    );
}
add_action( 'enqueue_block_editor_assets', 'nova_photography_portfolio_enqueue_block_editor_styles' );


/* Getstarted */
require get_template_directory() . '/getstart/getstart.php';

//LINKS
function nova_photography_portfolio_setup_theme() {
	if ( ! defined( 'NOVA_PHOTOGRAPHY_PORTFOLIO_PREMIUM_PAGE' ) ) {
		define('NOVA_PHOTOGRAPHY_PORTFOLIO_PREMIUM_PAGE',__('https://www.novathemes.net/products/photography-wordpress-theme','nova-photography-portfolio'));
	}
	if ( ! defined( 'NOVA_PHOTOGRAPHY_PORTFOLIO_THEME_PAGE' ) ) {
		define('NOVA_PHOTOGRAPHY_PORTFOLIO_THEME_PAGE',__('https://www.novathemes.net/products/nova-photography-portfolio/','nova-photography-portfolio'));
	}
	if ( ! defined( 'NOVA_PHOTOGRAPHY_PORTFOLIO_SUPPORT' ) ) {
		define('NOVA_PHOTOGRAPHY_PORTFOLIO_SUPPORT',__('https://wordpress.org/support/theme/nova-photography-portfolio/','nova-photography-portfolio'));
	}
	if ( ! defined( 'NOVA_PHOTOGRAPHY_PORTFOLIO_REVIEW' ) ) {
		define('NOVA_PHOTOGRAPHY_PORTFOLIO_REVIEW',__('https://wordpress.org/support/theme/nova-photography-portfolio/reviews/','nova-photography-portfolio'));
	}
	if ( ! defined( 'NOVA_PHOTOGRAPHY_PORTFOLIO_PRO_DEMO' ) ) {
		define('NOVA_PHOTOGRAPHY_PORTFOLIO_PRO_DEMO',__('https://sample.novathemes.net/nova-photography-portfolio/','nova-photography-portfolio'));
	}
	if ( ! defined( 'NOVA_PHOTOGRAPHY_PORTFOLIO_THEME_DOCUMENTATION' ) ) {
		define('NOVA_PHOTOGRAPHY_PORTFOLIO_THEME_DOCUMENTATION',__('https://sample.novathemes.net/documentation/nova-photography-portfolio-free/','nova-photography-portfolio'));
	}
	if ( ! defined( 'NOVA_PHOTOGRAPHY_PORTFOLIO_BUNDLE_PAGE' ) ) {
		define('NOVA_PHOTOGRAPHY_PORTFOLIO_BUNDLE_PAGE',__('https://www.novathemes.net/products/wordpress-theme-bundle/','nova-photography-portfolio'));
	}
	if ( ! defined( 'NOVA_PHOTOGRAPHY_PORTFOLIO_COLLECTION_PAGE' ) ) {
		define('NOVA_PHOTOGRAPHY_PORTFOLIO_COLLECTION_PAGE',__('https://www.novathemes.net/collections/premium-wordpress-themes/','nova-photography-portfolio'));
	}
}
add_action('after_setup_theme', 'nova_photography_portfolio_setup_theme');

/**
 * Customizer
 */
require get_template_directory() . '/inc/customizer.php';