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 | |
| /** | |
| * Convert jSON object to XML | |
| */ | |
| // jSON object | |
| $json = '{"China":["Guangzhou","Fuzhou","Beijing","Baotou","Hohhot","Guiyang","Yinchuan","Nanjing","Changzhou","Chuzhou","Hefei","Jinan","Qingdao","Harbin","Zhaodong","Taiyuan","Xian","Xianyang","Shenzhen","Nanning","Zhengzhou","Xinxiang","Luohe","Luoyang","Chaoyang","Xingyi","Foshan","Haikou","Chengdu","Dongguan","Mingzhou","Chongqing","Zhuhai","Kunming","Wuhan","Xiling","Huizhou","Jiangmen","Shantou","Changxiacun","Zhongshan","Lhasa","Nanchang","Tianjin","Shanghai","Hebei","Shijiazhuang","Quanzhou","Putian","Xiamen","Chengyang","Zhangzhou","Sanming","Nanping","Baoding","Langfang","Yantai","Binzhou","Lanzhou","Yueqing","Zhongxin","Zhoushan","Hangzhou","Ningbo","Wenzhou","Changchun","Fuyang","Jieshou","Anqing","Wuhu","Shishi","Shishi","Weitang","Shenyang","Changsha","Yongjiawan","Lengshuijiang","Shijiazhuang","Xuchang","Suzhou","Xuzhou","Taizhou","Nanyang","Xinhua","Ürümqi","Yanan Beilu","Baotao","Macao","Wuxi","Yangzhou","Baiyin","Tongren","Kunshan |
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 | |
| /** | |
| * Retrieve remote image dimensions | |
| * - getimagesize alternative | |
| */ | |
| /** | |
| * Get Image Size | |
| * |
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
| /** | |
| * Array to CSV | |
| */ | |
| function array2csv( $array) { | |
| // Check input | |
| if ( !is_array( $array ) || count( $array ) == 0 ) { return null; } | |
| // Buffer output | |
| ob_start(); |
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
| // Contained within /inc/config.php. Modify default settings | |
| // Dequeue default v1 jQuery, requeue jquery-migrate, add external cdn reference to jQuery v2. Load in header (true) | |
| // Set up scripts - filterable array. See definitions for structure | |
| $ipress_scripts = [ | |
| // Core scripts: [ 'script-name', 'script-name2' ... ] | |
| 'undo' => [ 'jquery' ], | |
| // Core scripts: [ 'script-name', 'script-name2' ... ] |
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
| // Add to your theme's functions.php file. De-queues Select2 styles & scripts. Useful to keep Boostrap form control formatting | |
| /** | |
| * Remove Woocommerce Select2 - Pre WC 3.2.1-ish | |
| */ | |
| function woo_dequeue_select2() { | |
| if ( class_exists( 'woocommerce' ) ) { | |
| wp_dequeue_style( 'select2' ); | |
| wp_deregister_style( 'select2' ); |
OlderNewer