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 | |
function tk_add_user_role_to_body_classes($classes) | |
{ | |
global $current_user; | |
foreach ($current_user->roles as $user_role) { | |
if (is_admin()) { | |
$classes .= ' role-' . $user_role; | |
} else { | |
$classes[] = 'role-' . $user_role; |
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 SortableDirectoryIterator implements IteratorAggregate | |
{ | |
private $storage; | |
public function __construct($path) | |
{ | |
$this->storage = new ArrayObject(); | |
$files = new DirectoryIterator($path); |
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 | |
/** | |
* Google reCAPTCHA for WordPress HappyForms | |
* | |
* @author Tomas Kavalek <[email protected]> | |
* @version 1.0.0 | |
*/ | |
class HappyForms_Recaptcha | |
{ |
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
// CZ | |
function plural(n) | |
{ | |
return arguments[(n === 1) ? 1 : ((n >= 2 && n <= 4) ? 2 : 3)]; | |
} | |
// Examples | |
plural(1, 'uživatel', 'uživatelé', 'uživatelů') | |
"uživatel" |
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
(function ($) { | |
'use strict'; | |
// CF7 + reCAPTCHA | |
if($('.ajax-loader').length > 1) { | |
if($('input[type=submit].wpcf7-form-control.wpcf7-submit').is(":hidden")) { | |
if ($('input[type=submit].wpcf7-form-control.wpcf7-submit + span.ajax-loader').length) { | |
$('input[type=submit].wpcf7-form-control.wpcf7-submit + span.ajax-loader').remove(); | |
} | |
} |
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
#!/bin/bash | |
# Get random number 0–5 | |
local RANDOM_NUMBER=$(grep -m1 -ao '[0-5]' /dev/urandom | head -n1) |
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
select | |
p.ID as order_id, | |
p.post_date, | |
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email, | |
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name, | |
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name, | |
max( CASE WHEN pm.meta_key = '_billing_address_1' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_1, | |
max( CASE WHEN pm.meta_key = '_billing_address_2' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_2, | |
max( CASE WHEN pm.meta_key = '_billing_city' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_city, | |
max( CASE WHEN pm.meta_key = '_billing_state' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_state, |
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
<script src="{$basePath}/path/to/bootstrap-datepicker.cs.js"></script> |
NewerOlder