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
##-- ACF WYSIWYG Editor add underline option | |
add_filter( 'acf/fields/wysiwyg/toolbars', 'my_toolbars' ); | |
function my_toolbars( $toolbars ) { | |
$toolbars['Full'][1][3] = 'underline'; | |
return $toolbars; | |
} |
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 isMobileDevice2() { | |
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]); | |
} | |
if( isMobileDevice2() === 1 || isMobileDevice2() === false) { | |
// Magic | |
} |
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
.btn-gradient-2 { | |
background: linear-gradient(white, white) padding-box, | |
linear-gradient(to right, darkblue, darkorchid) border-box; | |
border-radius: 30px; | |
border: 4px solid transparent; | |
} |
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 | |
// In this example we are adding <div> with class Figure around <img> | |
// If you want to remove <div> just simple delete open/close tag and leave $1 between '' | |
function img_unautop($pee) { | |
$pee = preg_replace('/<p>\\s*?(<a .*?><img.*?><\\/a>|<img.*?>)?\\s*<\\/p>/s', '<div class="figure">$1</div>', $pee); | |
return $pee; | |
} | |
add_filter( 'acf_the_content', 'img_unautop', 30 ); |
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
/* | |
+append will put images side by side, i.e. horizontally instead of vertically (with -append) | |
*/ | |
// Terminal part | |
convert in.pdf +append out%d.png |
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
// Most important thing is to enter full path to the file from root directory path | |
git update-index --assume-unchanged rootFullPathToTheFile/file.extension |
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 | |
const CYR = array('а','б','в','г','д','ђ','е','ж','з','и','ј','к','л','љ','м','н','њ','о','п','р','с','т','ћ','у','ф','х','ц','ч','џ','ш','А','Б','В','Г','Д','Ђ','Е','Ж','З','И','Ј','К','Л','Љ','М','Н','Њ','О','П','Р','С','Т','Ћ','У','Ф','Х','Ц','Ч','Џ','Ш'); | |
const LAT = array('a','b','v','g','d','đ','e','ž','z','i','j','k','l','lj','m','n','nj','o','p','r','s','t','ć','u','f','h','c','č','dž','š','A','B','V','G','D','Đ','E','Ž','Z','I','J','K','L','LJ','M','N','NJ','O','P','R','S','T','Ć','U','F','H','C','Č','DŽ','Š'); | |
function cyr_to_latin( $string ) { | |
return str_replace(CYR, LAT, $string); | |
} | |
function latin_to_cyr( $string ) { |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"max_zip": 99403, | |
"state_code": "WA", | |
"name": "Washington", | |
"cities": [ | |
{ | |
"zips": [ | |
98360, | |
98321, |
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
[ | |
{ | |
"name": "New York", | |
"state_code": "NY", | |
"min_zip": 10001, | |
"max_zip": 14692, | |
"cities": [ | |
{ | |
"name": "New York city", | |
"zips": [ |
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 wpex_remove_cpt_slug( $post_link, $post, $leavename ) { | |
if ( 'yourCustomPostSlug' != $post->post_type || 'publish' != $post->post_status ) { | |
return $post_link; | |
} | |
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link ); | |
return $post_link; | |
} | |
add_filter( 'post_type_link', 'wpex_remove_cpt_slug', 10, 3 ); |
NewerOlder