This file contains 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
// On Document Ready... | |
jQuery(document).ready(function ($) { | |
if (typeof Marionette !== 'undefined') { | |
var myCustomFieldController = Marionette.Object.extend({ | |
initialize: function () { | |
var submitChannel = Backbone.Radio.channel('submit'); | |
this.listenTo(submitChannel, 'validate:field', this.validateRequired); | |
var fieldsChannel = Backbone.Radio.channel('fields'); |
This file contains 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 | |
add_filter('autoptimize_filter_imgopt_lazyload_cssoutput', function($string) { | |
ob_start(); | |
?> | |
<script>document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend","<?= $string ?>");</script> | |
<?php | |
return ob_get_clean(); | |
}); |
This file contains 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
export default function cf_7() { | |
console.info('cf-7'); | |
let cf_7 = document.querySelectorAll('.wpcf7-form'); | |
if (cf_7 && cf_7.length > 0) { | |
cf_7.forEach(function (cf_7_form) { | |
const submit_button = cf_7_form.querySelector('.wpcf7-submit'); | |
if (submit_button) { | |
cf_7_form.addEventListener('submit', function (event) { | |
submit_button.setAttribute('disabled', ''); |
This file contains 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
//Change label for file | |
jQuery(document).ready(function ($) { | |
let $file_container = $('.file-upload'); | |
if ($file_container.length > 0) { | |
$file_container.each(function () { | |
let $container = $(this); | |
let $file_input = $container.find('.wpcf7-file'); | |
let $label = $container.find('.file-label__text'); | |
$file_input.change(function () { |
This file contains 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 | |
add_filter('override_load_textdomain', function ($result, $domain, $mofile ) { | |
$url = urldecode($_SERVER["REQUEST_URI"]); | |
if ( | |
(function_exists('is_ajax') && is_ajax()) | |
|| str_contains($url, 'wp-json/') | |
|| str_contains($url, 'ap-api/') | |
) { | |
$result = true; | |
//error_log('отключаем переводы' .' ' . $domain ); |
This file contains 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 | |
add_action('init', function () { | |
add_rewrite_rule('insights/([^/]+)/([^/]+)/?$', 'index.php?category_name=$matches[1]&name=$matches[2]&post_type=post', 'top'); | |
add_rewrite_rule('lp/([^/]+)/?$', 'index.php?name=$matches[1]&post_type=e-landing-page', 'top'); | |
}); | |
add_filter('pre_post_link', function ($permalink, $post, $leavename) { | |
if ($post->post_type === 'post') { | |
$permalink = '/insights' . $permalink; |
This file contains 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 | |
add_action('woocommerce_add_to_cart_fragments', function($fragments){ | |
$count = WC()->cart->get_cart_contents_count(); | |
ob_start(); ?> | |
<span class="cart-value" <?php echo ($count == 0) ? 'style="display:none;"' : ''; ?>><?php echo $count ?></span> | |
<?php $fragments['span.cart-value'] = ob_get_clean(); | |
return $fragments; |
This file contains 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
<a class="adress-link" href="<?php echo add_query_arg(['q' => strip_tags($adress)], 'https://maps.google.com/') ?>" target="_blank"> | |
<?php echo $adress; ?> | |
</a> |
This file contains 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 | |
class Theme_Rewrite_Rules | |
{ | |
public function __construct() | |
{ | |
add_action('wp_loaded', [$this, '_maybe_rewrite_rules']); | |
add_action('init', [$this, '_change_term_struct']); | |
} |
This file contains 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
main .alignfull { | |
margin: 2rem calc(50% - (50vw - var(--scrollbar-width) / 2)) !important; | |
max-width: calc(100vw - var(--scrollbar-width)) !important; | |
width: calc(100vw - var(--scrollbar-width)); | |
} |
NewerOlder