<?php
/**
 * Journy functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package Journy
 * @since 1.0
 */


if (! function_exists('journy_support')) :

	/**
	 * Sets up theme defaults and registers support for various WordPress features.
	 *
	 * @since 1.0
	 *
	 * @return void
	 */
	function journy_support() {

		// Add support for block styles.
		// Kept for 1.2.0; revisit in PLAN.md Phase 4 (theme.json styles.blocks instead).
		add_theme_support( 'wp-block-styles' );

		// Enqueue editor styles.
		add_editor_style( 'dist/css/main.css' );
        global $pagenow;
        if ( is_admin() && ('themes.php' == $pagenow) && isset( $_GET['activated'] ) ) {
            wp_safe_redirect( admin_url("themes.php?page=journy-guide-page") );
        }
	}
endif;
add_action( 'after_setup_theme', 'journy_support' );


/* Theme Credit link */
define( 'JOURNY_FAQ', 'https://journy.webhelpagency.com/documentation/' );
define( 'JOURNY_DEMO', 'https://journy.webhelpagency.com/' );
define( 'JOURNY_SUPPORT', 'https://wordpress.org/support/theme/journy/' );
define( 'JOURNY_REVIEW', 'https://wordpress.org/support/theme/journy/reviews/#new-post' );
define( 'JOURNY_FREE_CALL', 'https://calendly.com/aleksandrchumak/30min' );

// Enqueue Styles
require_once get_template_directory() . '/inc/theme-enqueue.php';

// Theme info Page
require_once get_template_directory() . '/inc/theme-info.php';

// Registers a new pattern categories
require_once get_template_directory() . '/inc/patterns.php';

// Recommended plugins card on the Get Started page.
require_once get_template_directory() . '/inc/recommended-plugins.php';

// register block styles
require_once get_template_directory() . '/inc/block_styles.php';

// Get Started.
require get_template_directory() . '/inc/get-started/get-started.php';
