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 | |
// include all PHP files in ./lib/ directory: | |
foreach ( glob( dirname( __FILE__ ) . '/lib/*.php' ) as $file ) | |
include $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
function countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
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 my_child_theme_locale() { | |
load_child_theme_textdomain( 'my_child_theme', get_stylesheet_directory() . '/languages' ); | |
} | |
add_action( 'after_setup_theme', 'my_child_theme_locale' ); |
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 | |
/* | |
Check if protocol is https | |
Nb: port 443 does not guarantee connection is encrypted | |
http://stackoverflow.com/questions/1175096/how-to-find-out-if-you-are-using-https-without-serverhttps#answer-2886224 | |
*/ | |
function isSecure() { | |
return | |
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') | |
|| $_SERVER['SERVER_PORT'] == 443; |
NewerOlder