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
//Remove os campos invalidos do checkout | |
add_action('wp_footer', 'fixInvalidCheckoutFields', 999); | |
function fixInvalidCheckoutFields() { | |
if(is_checkout()){ | |
?> | |
<script> | |
jQuery(window).load(function(){ | |
jQuery('.form-row').removeClass('woocommerce-invalid woocommerce-invalid-required-field woocommerce-validated'); | |
}) | |
</script> |
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
// Remove WooCommerce Updater | |
remove_action('admin_notices', 'woothemes_updater_notice'); |
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 | |
//Adiciona as informacoes bancarias na pag do pedido | |
add_action('woocommerce_view_order',function($order_id){ | |
//echo '<hr style="border-top:1px solid #ccc;margin-top:10px;margin-bottom:30px" />'; | |
$order=new WC_Order( $order_id ); | |
if ( $order->payment_method !== 'bacs') return; | |
$bacs = new WC_Gateway_BACS(); | |
$bacs->thankyou_page( $order_id); | |
}); |
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
#COMMIT AND PUSH ALL SUBMODULES | |
#In Main project | |
git submodule foreach 'git add .' #recursively add files in submodules | |
git submodule foreach 'git commit -a -m "Altered submodule" || :' | |
git add --all :/ | |
git commit -am "Altered submodule" | |
git push --recurse-submodules=on-demand |
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 | |
//Converts content in Contact Details fields. Ex: {{email}} | |
add_filter( 'the_content', function($content){ | |
$contactDetails = get_option('contact'); | |
foreach ( $contactDetails as $key => $detail ) { | |
if ( !empty($detail) ) { | |
if(strpos($detail, '@')!==false){ | |
$content = str_replace('{{'.$key.'}}', '<a href="mailto:' . $detail . '">' . $detail . '</a>', $content); | |
}else if(strpos($detail, 'http://')!==false){ | |
$content = str_replace('{{'.$key.'}}', '<a target="_blank" href="' . $detail . '">' . $detail . '</a>', $content); |
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
#TEST1 | |
SELECT wp_posts.post_title, t.name | |
FROM wp_posts | |
LEFT JOIN wp_term_relationships tr ON tr.object_id=wp_posts.ID | |
LEFT JOIN wp_term_taxonomy tt ON tt.term_taxonomy_id=tr.term_taxonomy_id AND tt.taxonomy='shopping_list_tax' | |
LEFT JOIN wp_terms t ON t.term_id=tt.term_id | |
WHERE 1=1 AND wp_posts.post_type = 'shopping_list_sg' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') | |
ORDER BY wp_posts.post_date DESC | |
#TEST 2 |
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 | |
/* | |
$terms = | |
Array | |
( | |
[2] => WP_Term Object | |
( | |
[term_id] => 6 | |
) |
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 | |
//Add default contact details fields | |
add_filter('contact_details', function( $details ) { | |
unset($details['phone']); | |
unset($details['fax']); | |
unset($details['email']); | |
unset($details['mobile']); | |
unset($details['address']); |
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
//Colocar na opcao Additional JavaScript, dentro do admin | |
a2a_config.icon_color = "#B93437"; |
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
{ | |
"http-basic": { | |
"bitbucket.org": { | |
"username": "email@origgami.com.br", | |
"password": "senhanobitbucket" | |
} | |
} | |
} |