<?php
//Error reporting
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);

//Define constants
define('SITE_URL', home_url().'/');
define('AJAX_URL', admin_url('admin-ajax.php'));
define('THEME_PATH', get_template_directory().'/');
define('CHILD_PATH', get_stylesheet_directory().'/');
define('THEME_URI', get_template_directory_uri().'/');
define('CHILD_URI', get_stylesheet_directory_uri().'/');
define('THEMEX_PATH', THEME_PATH.'framework/');
define('THEMEX_URI', THEME_URI.'framework/');
define('THEMEX_PREFIX', 'themex_');

//Set content width
$content_width=940;

//Load language files
load_theme_textdomain('lovestory', THEME_PATH.'languages');

//Include theme functions
include(THEMEX_PATH.'functions.php');

//Include configuration
include(THEMEX_PATH.'config.php');

//Include core class
include(THEMEX_PATH.'classes/themex.core.php');

//Create theme instance
$themex=new ThemexCore($config);

register_nav_menus( array(
		'final-mobile' => __( 'Mobile Menu',      'lovestory' ),
	) );
    
    register_sidebar( array(
		'name'          => __( 'Profile Search', 'lovestory' ),
		'id'            => 'profile-search',
		'description'   => __( 'Add widgets here to appear in your profile search.', 'lovestory' ),
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
    
    // Change the "My Account" welcome text
function sv_change_wc_account_welcome( $translated_text, $original_text, $domain ) {
    
    // bail if we're in the admin or not using a WooCommerce string
    if ( is_admin() || 'woocommerce' !== $domain ) {
        return $translated_text;
    }
    
    $text = 'From your account dashboard you can view your recent orders, manage your shipping and billing addresses and <a href="%s">edit your password and account details</a>.';

    if ( $text === $original_text ) {
        $translated_text = 'From your account dashboard, you can view your recent orders, shipping and billing addresses, and <a href="%s">edit your password and account details</a>.';
    }

    return $translated_text;
}
add_filter( 'gettext', 'sv_change_wc_account_welcome', 10, 3 );