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
# Local: | |
# https://stackoverflow.com/questions/21151178/shell-script-to-check-if-specified-git-branch-exists | |
# test if the branch is in the local repository. | |
# return 1 if the branch exists in the local, or 0 if not. | |
function is_in_local() { | |
local branch=${1} | |
local existed_in_local=$(git branch --list ${branch}) | |
if [[ -z ${existed_in_local} ]]; then | |
echo 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
<?php | |
/** | |
* Allow HTML Tags in Wordpress Excerpt | |
* | |
* @link http://wordpress.stackexchange.com/questions/141125/allow-html-in-excerpt/141136 | |
*/ | |
if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) : | |
function wpse_custom_wp_trim_excerpt( $wpse_excerpt ) { |
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 className { | |
function __construct() {} | |
} | |
function className() { | |
new className; |
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 | |
/** | |
* Muestra el contenido de una variable | |
* @param mixed $texto Variable a Mostrar | |
* @return n/a | |
*/ | |
function pre( $texto ) { | |
echo '<pre>'; | |
print_r( $texto ); | |
echo '</pre>'; |
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
<snippet> | |
<content><![CDATA[ | |
pre( \$${1:var} );${2} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>pr</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.php</scope> | |
</snippet> |
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 txl_my_orders_sc( $atts ) { | |
$atts = shortcode_atts( array( | |
'order_count' => -1, | |
), $atts )); | |
ob_start(); | |
wc_get_template( 'myaccount/my-orders.php', array( | |
'order_count' => $atts[ 'order_count' ], |