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
Using FTP/SSH & Database | |
This method allows you to delete all items in your media library at once. Be sure to backup your database prior to doing this. | |
Each file in your media library has one row in the `wp_posts` table and two rows in the `wp_postmeta` table. Learn more about how WordPress stores media library entries in the database here. You can delete them all in bulk using these commands: | |
DELETE FROM `wp_posts` WHERE `post_type` = "attachment"; | |
DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attached_file"; | |
DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attachment_metadata"; |
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
<!-- IMPORTANT!!! If you want to use OEmbed like this your Instagram profile MUST BE PUBLIC --> | |
<?php | |
// Using curl because if you use file_get_contents() it need more then 10s page to be loaded... | |
function curl_get_contents($url) { | |
// Initiate the curl session | |
$ch = curl_init(); | |
// Set the URL | |
curl_setopt($ch, CURLOPT_URL, $url); | |
// Removes the headers from the output | |
curl_setopt($ch, CURLOPT_HEADER, 0); |
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, |
NewerOlder