ension-elements', 'registered' ) ) { $style_deps[] = 'flextension-elements'; } /** * Filters an array of registered style handles this style depends on. * * @since 0.2.0 * * @param string[] $style_deps An array of registered style handles this style depends on. */ $style_deps = apply_filters( 'tripp_style_deps', $style_deps ); // Main CSS. wp_register_style( 'tripp', get_template_directory_uri() . '/style.css', $style_deps, $theme_version ); wp_style_add_data( 'tripp', 'rtl', 'replace' ); /** * JavaScrips */ // ScrollMagic. wp_register_script( 'scrollmagic', get_theme_file_uri( 'assets/js/vendor/ScrollMagic.min.js' ), array(), '2.0.7', true ); $script_deps = array( 'scrollmagic' ); if ( wp_script_is( 'flextension', 'registered' ) ) { $style_deps[] = 'flextension'; } /** * Filters an array of registered script handles this script depends on. * * @since 0.2.0 * * @param string[] $script_deps An array of registered script handles this script depends on. */ $script_deps = apply_filters( 'tripp_script_deps', $script_deps ); // Main App. wp_register_script( 'tripp', get_theme_file_uri( 'assets/js/main.js' ), $script_deps, $theme_version, true ); // Admin App. wp_register_script( 'tripp-editor', get_theme_file_uri( 'assets/js/editor.js' ), array( 'wp-data' ), $theme_version, true ); } add_action( 'init', 'tripp_register_assets' ); /** * Enqueues styles and scripts. */ function tripp_enqueue_assets() { wp_enqueue_style( 'tripp' ); tripp_add_custom_styles( 'tripp' ); $settings = array( 'ajaxUrl' => esc_url_raw( admin_url( 'admin-ajax.php' ) ), 'ajaxNonce' => wp_create_nonce( 'tripp_ajax' ), 'desktopMenuBreakpoint' => tripp_menu_breakpoint(), ); /** * Filters the theme settings. * * @param array $settings The current settings for the theme. */ $settings = apply_filters( 'tripp_settings', $settings ); wp_localize_script( 'tripp', 'trippSettings', $settings ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_script( 'tripp' ); } add_action( 'wp_enqueue_scripts', 'tripp_enqueue_assets' ); /** * Enqueues admin scripts and styles. */ function tripp_login_enqueue_assets() { $theme_version = wp_get_theme()->get( 'Version' ); // Admin CSS. wp_enqueue_style( 'tripp-login-page', get_theme_file_uri( 'assets/css/login-page.css' ), array(), $theme_version ); wp_style_add_data( 'tripp-login-page', 'rtl', 'replace' ); tripp_add_custom_styles( 'tripp-login-page' ); wp_enqueue_script( 'tripp-login-page', get_theme_file_uri( 'assets/js/login-page.js' ), array(), $theme_version, true ); } add_action( 'login_enqueue_scripts', 'tripp_login_enqueue_assets' ); /** * Enqueues block editor scripts and styles. */ function tripp_enqueue_block_editor_assets() { // Block Editor CSS. wp_enqueue_style( 'tripp-editor', get_theme_file_uri( 'assets/css/block-editor.css' ), array( 'wp-block-editor' ), wp_get_theme()->get( 'Version' ) ); wp_style_add_data( 'tripp-editor', 'rtl', 'replace' ); tripp_add_custom_styles( 'tripp-editor' ); // Admin App. wp_enqueue_script( 'tripp-editor' ); } add_action( 'enqueue_block_editor_assets', 'tripp_enqueue_block_editor_assets' ); /** * Walker Destination class. */ require get_parent_theme_file_path( 'inc/class-tripp-walker-destination.php' ); /** * Additional template functions. */ require get_parent_theme_file_path( 'inc/template-functions.php' ); /** * Loads co-authors template tags if the Co-Authors Plus plugin is active. */ if ( function_exists( 'get_coauthors' ) ) { require get_parent_theme_file_path( 'inc/co-authors-template-tags.php' ); } /** * Custom template tags for this theme. */ require get_parent_theme_file_path( 'inc/template-tags.php' ); /** * Custom template tags for coupons, promo codes, discounts & deals. */ require get_parent_theme_file_path( 'inc/coupon-template-tags.php' ); /** * Custom template tags for reviews. */ require get_parent_theme_file_path( 'inc/review-template-tags.php' ); /** * Template hooks. */ require get_parent_theme_file_path( 'inc/template-hooks.php' ); /** * WooCommerce template functions and hooks. */ if ( class_exists( 'WooCommerce', false ) ) { require get_parent_theme_file_path( 'inc/wc-template-functions.php' ); } /** * Breadcrumb Generator. */ require get_parent_theme_file_path( 'inc/class-tripp-breadcrumb-generator.php' ); /** * Theme Customizer. */ require get_parent_theme_file_path( 'inc/customizer/customizer.php' ); /** * TGM Plugin Activation */ require get_parent_theme_file_path( 'inc/vendor/class-tgm-plugin-activation.php' ); /** * Registers the recommended plugins for this theme. */ function tripp_register_plugins() { // Recommended plugins. $plugins = array( array( 'name' => esc_html__( 'Flextension', 'tripp' ), 'slug' => 'flextension', 'version' => '1.3.2', 'source' => 'https://wydethemes.com/plugins/flextension/flextension.1.3.2.zip', ), array( 'name' => esc_html__( 'Tripp XT', 'tripp' ), 'slug' => 'tripp-xt', 'version' => '1.1.2', 'source' => 'https://wydethemes.com/plugins/tripp-xt/tripp-xt.1.1.2.zip', ), ); /** * Filters the recommended plugins for the theme. * * @param array $plugins An array list of the recommended plugins. */ $plugins = apply_filters( 'tripp_plugins', $plugins ); // Configuration settings. $config = array( 'id' => 'tripp-1.3.0', 'menu' => 'install-plugins', 'strings' => array( 'page_title' => esc_html__( 'Install Plugins', 'tripp' ), ), ); tgmpa( $plugins, $config ); } add_action( 'tgmpa_register', 'tripp_register_plugins' ); /** * Note: Do not add any custom code here. Please use a Child theme or a custom plugin so that your customizations aren't lost during updates. * https://developer.wordpress.org/themes/advanced-topics/child-themes/ */