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 | |
| preg_replace('/\D+/', '', $phone_string); | |
| //or | |
| $str = 'In My Cart : 11 items'; | |
| $int = abs((int) filter_var($str, FILTER_SANITIZE_NUMBER_INT)); | |
| //or | |
| $str = '(111) 111-1111'; | |
| $str = preg_replace('/\D/', '', $str); |
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
| $('.comp-addr').each(function () { | |
| var link = "<a href='http://maps.google.com/maps?q=" + encodeURIComponent($(this).text()) + "' target='_blank'>" + $(this).text() + "</a>"; | |
| $(this).html(link); | |
| }); |
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
| .fixclone { | |
| position: fixed; | |
| top: 0; | |
| z-index: 10000; | |
| } |
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
| define('FS_METHOD', 'direct'); |
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 | |
| remove_filter( 'the_content', 'wpautop' ); // Отключаем автоформатирование в полном посте | |
| remove_filter( 'the_excerpt', 'wpautop' ); // Отключаем автоформатирование в кратком(анонсе) посте | |
| remove_filter('comment_text', 'wpautop'); // Отключаем автоформатирование в комментариях |
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 remove_toolbar_items($wp_adminbar) { | |
| $wp_adminbar->remove_node('updates'); | |
| $wp_adminbar->remove_node('site-name'); | |
| $wp_adminbar->remove_node('comments'); | |
| $wp_adminbar->remove_node('new-content'); | |
| $wp_adminbar->remove_node('edit'); | |
| } |
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 isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); | |
| if (isSafari) { | |
| alert("Browser is Safari"); | |
| } else { | |
| } |
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 themeName_customize_register( $wp_customize ) { | |
| $blog_id = get_current_blog_id(); | |
| $blog_images_count = [1, 4, 4]; | |
| $wp_customize->remove_section('title_tagline'); | |
| $wp_customize->remove_section('colors'); | |
| $wp_customize->remove_section('header_image'); |
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
| jQuery(document).ready(function ($) { | |
| $(document).on('click', '.js-image-upload', function (e) { | |
| e.preventDefault(); | |
| var $button = $(this); | |
| var file_frame = wp.media.frames.file_frame = wp.media({ | |
| title: 'Select or Upload an Image', | |
| library: { | |
| type: 'image' // mime type | |
| }, |
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
| $ sudo a2enmod rewrite | |
| sudo nano /etc/apache2/apache2.conf | |
| <Directory /var/www/> | |
| Options Indexes FollowSymLinks | |
| AllowOverride All | |
| </Directory> | |
| # service apache2 restart |