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 | |
class swDFPBaseModule | |
{ | |
private function parent_or_child($tax, $query_key) | |
{ | |
$slug = $wp_query->query_vars[$query_key] | |
$s = get_term_by('slug', $slug, $tax); | |
return ($s->parent>0) ? | |
'get_on_'.$tax.'_page' : 'get_on_child_'.$tax.'_page'; |
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
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |
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 | |
$x = function($bar, $foo="9") { | |
echo $foo, $bar, "\n"; | |
}; | |
class MissingArgumentException extends Exception { | |
} | |
function call_user_func_named_array($method, $arr){ |