This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wrapURLs = function (text, new_window) { | |
var url_pattern = /(?:(?:https?|ftp):\/\/)?(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}\-\x{ffff}0-9]+-?)*[a-z\x{00a1}\-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}\-\x{ffff}0-9]+-?)*[a-z\x{00a1}\-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}\-\x{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?/ig; | |
var target = (new_window === true || new_window == null) ? '_blank' : ''; | |
return text.replace(url_pattern, function (url) { | |
var protocol_pattern = /^(?:(?:https?|ftp):\/\/)/i; | |
var href = protocol_pattern.test(url) ? url : 'http://' + url; | |
return '<a href="' + href + '" target="' + target + '">' + url + '</a>'; | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Вариант 1 | |
RewriteCond %{HTTP:X-HTTPS} !1 | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
#Вариант 2 | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function art_social_icons($item_url) { | |
$social_icons = apply_filters( 'art_social_icons', array( | |
'codepen.io' => 'codepen', | |
'digg.com' => 'digg', | |
'dribbble.com' => 'dribbble', | |
'dropbox.com' => 'dropbox', | |
'facebook.com' => 'facebook', | |
'flickr.com' => 'flickr', | |
'foursquare.com' => 'foursquare', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XXXXXXX - номер счетчика | |
TARGET_NAME - идентификатор цели | |
<script> | |
jQuery(document).ready(function ($) { | |
$('#buy').click(function () { | |
yaCounterXXXXXXX.reachGoal('TARGET_NAME '); | |
console.log('цель 1'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*================================================================================= | |
* Сообщения | |
*================================================================================= */ | |
add_action( 'wp_head', 'artabr_notice_shop' ); | |
function artabr_notice_shop() { | |
?> | |
<style> | |
.shop-notice { | |
position: fixed; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Checkout terms and conditions checkbox | |
* | |
* @author WooThemes | |
* @package WooCommerce/Templates | |
* @version 3.1.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'comment_form_after_fields', 'add_consent_personal_data_comment' ); | |
function add_consent_personal_data_comment(){ | |
?> | |
<small style="font-size: 12px;line-height: 1.1;margin: 10px 0;display: block;"> Нажимая на кнопку отправить, я принимаю условия <a href="#" target="_blank">пользовательского соглашения</a> , а также ознакомлен и согласен с <a href="#" target="_blank">политикой конфиденциальности</a> и даю согласие на обработку моих персональных данных</small> | |
<?php | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode( 'art_related_posts', 'related_posts_function' ); | |
function related_posts_function ($atts){ | |
$atts = shortcode_atts( array( | |
'id' => '', | |
'count' => 3 | |
), $atts ); | |
$args = array( | |
'post_type' => 'post', | |
'post_status' => 'publish', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'the_title', 'kld_title_order_received', 10, 2 ); | |
function kld_title_order_received( $title, $id ) { | |
if ( is_order_received_page() && get_the_ID() === $id ) { | |
$order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) ); | |
$order_id = isset( $_GET ) ? wc_get_order_id_by_order_key( $_GET ) : ''; | |
if ( $order_id > 0 ) { | |
$order = wc_get_order( $order_id ); | |
if ( ! $order || $order->get_order_key() !== $order_key ) { | |
$order = false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'widget_nav_menu_args', 'artabr_widget_menu_category' ); | |
function artabr_widget_menu_category ($arg) { | |
$arg['container'] = 'div'; | |
$arg['container_class'] = 'rubric__list side__menu'; | |
$arg['menu_class'] = ''; | |
return $arg; | |
} |