Skip to content

Instantly share code, notes, and snippets.

@vorvulev
vorvulev / php-punctuation.php
Created January 11, 2016 20:03
Висячая пунктуация PHP
$tiny = array('ни', 'не', 'и', 'но', 'а', 'или', 'да', 'как',
'из-за', 'про', 'по', 'за', 'для', 'на',
'до', 'при', 'меж', 'о', 'у', 'в', 'во',
'с', 'со', 'от', 'ото', 'из', 'без', 'безо',
'к', 'ко', 'об', 'обо', 'под', 'подо',
'над', 'перед', 'передо');
$text = preg_replace('~(\s)«~',
' <span class="hpquote">«</span>', $text);
$text = preg_replace('~[^&gt;]«~', '<span class="hpquote">«</span>', $text);
@vorvulev
vorvulev / wp_custom_menu.php
Created January 11, 2016 19:58
Custom text fields WordPress
<?php
//Custom Theme Settings add this to functions.php
add_action('admin_menu', 'add_gcf_interface');
function add_gcf_interface() {
add_menu_page('Дополнительная информация', 'Дополнительная информация', '5', 'functions', 'editglobalcustomfields','dashicons-phone',"3.1");
}
function editglobalcustomfields() { ?>