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
/* Функция вывода постов по месяцу. | |
---------- | |
* Параметры: | |
* $show_comment_count(0) - показывать ли колличество комментариев. 1 - показывать. | |
* $before ('<h4>') - HTML тег до заголовка (названия месяца). | |
* $after ('</h4>') - HTML тег после заголовка. | |
* $year (0) - огриничить вывод годом. Если указать 2009, будут выведены записи за 2009 год по месяцам | |
* $post_type ('post') - тип поста. Если нужно вывести нестандартный тип постов (отличный от post) | |
* $limit(100) - ограничение количества выводиммых постов для каждого месяца. При большой базе, создается сильная нагрузка. Укажите 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
// | |
// | |
// | |
// | |
/** | |
* Создаю галереи | |
*/ | |
$.fn.createGallery = function() | |
{ |
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
#!/bin/bash | |
echo -n "compile styles? 1 = NO / 2 = Yes" | |
read compile_style | |
if [ "$compile_style" = "1" ] | |
then | |
####false | |
echo "styles not compiled" |
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
$url = apply_filters( 'add_to_cart_redirect', $url, $product_id ); | |
// If has custom URL redirect there | |
if ( $url ) { | |
wp_safe_redirect( $url ); | |
exit; | |
} | |
// Redirect to cart option | |
elseif ( get_option('woocommerce_cart_redirect_after_add') == 'yes' && $woocommerce->error_count() == 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
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return |
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
preg_replace('/<span[^>]*>(.*)<\/span>/Ui', '\\1', $fieldsFormatted['field_town']); |
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
if ( current_user_can( 'administrator' ) ) { | |
global $wpdb; | |
echo 'Всего: ' . count($wpdb->queries); | |
echo "<pre>"; | |
print_r( $wpdb->queries ); | |
echo "</pre>"; | |
} |
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 closeTr = function(arr) | |
{ | |
for(var i=0; i<arr.length;i++){ | |
var items = $(arr[i]).find('td[style*="visibility:hidden"]'); | |
if(items.length < 2) continue; | |
arr[i].style.display = 'none'; | |
} |
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 tmpRegex = new RegExp("(&page=)[0-9]+", 'ig'); | |
var url = document.location.href; | |
newVal = ''; | |
substrurl = url.replace(tmpRegex, ''); | |
console.log(substrurl); |
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 | |
$uEmail = $_POST['user']['email']; | |
$mEmail = get_option('manager_email'); | |
$headers = 'From: ' . $_POST['user']['name'] . ' <' . $uEmail . '>' . "\r\n"; | |
add_filter('wp_mail_content_type',create_function('', 'return "text/html";')); | |
OlderNewer