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 | |
function custom_extension_directory() { | |
$directories = array( | |
get_stylesheet_directory() . '/extensions', | |
); | |
return $directories; | |
} | |
add_filter( 'builder_get_extension_directories', 'custom_extension_directory' ); |
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 | |
/** | |
* Rename 'posts' to 'articles' | |
*/ | |
function posts_to_articles( $translated ) { | |
$words = array( | |
// 'word to translate' = > 'translation' | |
'Posts' => 'Articles', | |
'Post' => 'Article', |
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 | |
function list_directory_files( $directory ) { | |
$files = array_diff( scandir( $directory ), array( '.', '..', 'list-files.php', '.DS_Store' ) ); | |
foreach ( $files as $file ) { | |
if ( dirname( __FILE__ ) == $directory ) { | |
if ( is_dir( $directory . '/' . $file ) ) { | |
$folder = $file . '.php'; | |
} | |
if ( $folder != $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
<?php | |
header('Content-Type: text/plain'); | |
// $file = $argv[1]; | |
$file = ''; | |
$hook_pattern = "|" . preg_quote( '<?php do_action(', '/') . "(.*?);|"; | |
$api_pattern = "|" . preg_quote( '<?php it_exchange(' ) . "(.*?);|"; | |
$contents = file_get_contents( dirname( __FILE__ ) . '/' . $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
body.with-eyebrow > #global-nav { | |
top: 0 !important; | |
} | |
body.with-eyebrow > #main > .subnav-refresh { | |
margin-top: 0 !important; | |
} | |
body.with-eyebrow > #eyebrow { | |
display: none !important; | |
} |
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 | |
$GLOBALS['hooks'] = array(); | |
$GLOBALS['duplicates'] = array(); | |
function list_theme_hooks( $directory ) { | |
global $hooks, $duplicates; | |
$files = array_diff( scandir( $directory ), array( '.', '..', '_list-files.php', '_list-hooks.php', '_get-contents.php', '.DS_Store', 'nonce.php', '_list-hooks-duplicates.php' ) ); | |
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 | |
$GLOBALS['functions'] = array(); | |
function list_theme_functions( $directory ) { | |
global $functions; | |
$files = array_diff( scandir( $directory ), array( '.', '..', '_list-files.php', '_list-hooks.php', '_get-contents.php', '.DS_Store', 'nonce.php', '_list-hooks-duplicates.php', '_list-functions.php' ) ); | |
foreach ( $files as $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 compile-less() { | |
lessc style.less | sed -E 's/\ (.*): (.*);/ \1: \2;/;s/(\/\*\* -)/\ | |
\1/' > style.css | |
} |
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 | |
function draw_names_from_hat( $names = array(), $couples = false ) { | |
$hat = $names; | |
foreach ( $names as $key => $name ) { | |
$pick = array_rand( $hat ); | |
if ( $name == $hat[$pick] ) { | |
unset( $hat[$pick] ); |