I hereby claim:
- I am ihorvorotnov on github.
- I am ihorvorotnov (https://keybase.io/ihorvorotnov) on keybase.
- I have a public key whose fingerprint is A866 1403 6C25 E295 B6B4 CC47 C82E B589 1154 9391
To claim this, I am signing this object:
<?php | |
$countries = array(); | |
$countries[] = array("code"=>"AF","name"=>"Afghanistan","d_code"=>"+93"); | |
$countries[] = array("code"=>"AL","name"=>"Albania","d_code"=>"+355"); | |
$countries[] = array("code"=>"DZ","name"=>"Algeria","d_code"=>"+213"); | |
$countries[] = array("code"=>"AS","name"=>"American Samoa","d_code"=>"+1"); | |
$countries[] = array("code"=>"AD","name"=>"Andorra","d_code"=>"+376"); | |
$countries[] = array("code"=>"AO","name"=>"Angola","d_code"=>"+244"); | |
$countries[] = array("code"=>"AI","name"=>"Anguilla","d_code"=>"+1"); | |
$countries[] = array("code"=>"AG","name"=>"Antigua","d_code"=>"+1"); |
<?php | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
// disable :hover on touch devices | |
// based on https://gist.github.com/4404503 | |
// via https://twitter.com/javan/status/284873379062890496 | |
// + https://twitter.com/pennig/status/285790598642946048 | |
// re http://retrogamecrunch.com/tmp/hover | |
// NOTE: we should use .no-touch class on CSS | |
// instead of relying on this JS code | |
function removeHoverCSSRule() { | |
if ('createTouch' in document) { | |
try { |
<?php | |
/* WordPress Template Hierarchy as of WordPress 4.4 | |
is_404() ---------------------------------------------------------------------------------------------------> 404.php | |
is_search() ------------------------------------------------------------------------------------------------> search.php | |
is_front_page() --------------------------------------------------------------------------------------------> front-page.php | |
is_home() --------------------------------------------------------------------------------------------------> home.php |
[alias] | |
changelog = "!_() { t=$(git describe --abbrev=0 --tags); git log ${t}..HEAD --no-merges --pretty=format:'* %s'; }; _" |
/** | |
* Following script will render Taxonomy Tree attached with specified post type | |
* in following example post_type use: books | |
* output can be seen here: https://www.diigo.com/item/image/4xv00/xrhq | |
*/ | |
$posttype = 'books' | |
//getting all taxonomies with attached with $posttype | |
$taxonomy_names = get_object_taxonomies( $posttype ); |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/** | |
* Move image inside <p> tag above the <p> tag while preserving any link around image. | |
* Can be prevented by adding any attribute or whitespace to <p> tag, e.g. <p class="yolo"> or even <p > | |
*/ | |
function gc_remove_p_tags_around_images($content) | |
{ | |
$contentWithFixedPTags = preg_replace_callback('/<p>((?:.(?!p>))*?)(<a[^>]*>)?\s*(<img[^>]+>)(<\/a>)?(.*?)<\/p>/is', function($matches) | |
{ | |
/* |
/** | |
* Default Body Class Styles | |
*/ | |
.rtl {} | |
.home {} | |
.blog {} | |
.archive {} | |
.date {} | |
.search {} |
<?php | |
/** | |
* Simple debug trace to wp-content/debug.log | |
* | |
* @usage _log( $var ); | |
* | |
* @param $log mixed A string|array|object you want to dump into wp-content/debug.log | |
*/ | |
if ( ! function_exists( '_log' ) ) { |