// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
//Enable display of errors and warnings
define('WP_DEBUG_DISPLAY', true);
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define('SCRIPT_DEBUG', true);
@echo on
setlocal enabledelayedexpansion
rem Set variable for network interface name
set interface_name=Ethernet
rem Get the local IP address of the computer
for /f "tokens=13 delims=: " %%i in ('ipconfig ^| find /i "IPv4-Адрес" ') do (
if "%%i" neq "" (
set ip_adress=%%i
)
)
rem Set variables for other IPv4 settings
set subnet_mask=255.255.252.0
set gateway=192.168.1.252
rem Set variables for DNS settings
set dns1=192.168.0.100
set dns2=192.168.0.42
rem Execute netsh commands to change the settings
netsh interface ip set address name="%interface_name%" source=static address=%ip_adress% mask=%subnet_mask% gateway=%gateway%
netsh interface ip set dns name="%interface_name%" static %dns1%
netsh interface ip add dns name="%interface_name%" %dns2% index=2
echo Successfully configured IP Address: %ip_adress%, Subnet Mask: %subnet_mask%, Gateway: %gateway%, DNS1: %dns1%, DNS2: %dns2%
pause
add_filter( 'woocommerce_variation_default_selection', 'custom_variation_default_selection', 10, 3 );
function custom_variation_default_selection( $selected, $variation, $product ) {
if ( ! $selected ) {
// Здесь замените 'attribute_slug' на слаг атрибута, который вы хотите использовать по умолчанию
$attribute_slug = 'color';
$args = array(
'attribute' => $attribute_slug,
'value' => $variation->$attribute_slug,
'is_visible' => true,
'is_variation' => true,
'is_taxonomy' => true,
);
$term = get_term_by( 'slug', $variation->$attribute_slug, $attribute_slug );
if ( $term && ! is_wp_error( $term ) ) {
$selected = $term->name;
}
}
return $selected;
}
1. Написать слайдер самому (времени дали мало);
valid_referers
в блоке location
. nginx
server {
listen 80;
server_name example.com;
location /path/to/file {
valid_referers none blocked example.com;
if ($invalid_referer) {
return 403;
}
# Дополнительная конфигурация для доступа к файлу
}
# Другая конфигурация сервера
}
example.com
является разрешенным доменом, с которого разрешены запросы к файлу по указанному пути /path/to/file.
Если запрос идет с другого домена или напрямую, то сервер возвращает код состояния 403 "Forbidden".ngx_http_referer_module
при сборке NGINX, так как эта директива зависит от него.