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 oo_custom_login_logo() { | |
?> | |
<style type="text/css"> | |
body.login{ | |
background: #1D1D1D; | |
} | |
body.login p#backtoblog{ | |
display: none; | |
} | |
body.login p#nav a, |
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 Name: List taxonomies by initial letter | |
* Snippet URL: http://www.wpcustoms.net/snippets/list-taxonomies-by-initial-letter/ | |
*/ | |
$list = ''; | |
$args = array( | |
'hide_empty' => true, | |
); | |
$tags = get_terms('CUSTOM-TAXONOMY',$args); |
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
//return thumbnail for youtube and vimeo | |
function video_image($url){ | |
$image_url = parse_url($url); | |
if($image_url['host'] == 'www.youtube.com' || $image_url['host'] == 'youtube.com'){ | |
$array = explode('&', $image_url['query']); | |
return 'http://img.youtube.com/vi/'.substr($array[0], 2).'/0.jpg'; | |
} else if($image_url['host'] == 'www.vimeo.com' || $image_url['host'] == 'vimeo.com'){ | |
$hash = unserialize(curl_get_file_contents('http://vimeo.com/api/v2/video/'.substr($image_url['path'], 1).'.php')); | |
return $hash[0]['thumbnail_small']; | |
} |
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
add_action( 'woocommerce_payment_complete_order_status', 'wc_auto_complete_paid_order', 10, 3 ); | |
function wc_auto_complete_paid_order( $status, $order_id, $order ) { | |
return 'completed'; | |
} |
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
add_filter( 'allowed_block_types', 'misha_allowed_block_types', 10, 2 ); | |
function misha_allowed_block_types( $allowed_blocks, $post ) { | |
$allowed_blocks = array( | |
'core/image', | |
'core/paragraph', | |
'core/heading', | |
'core/list' | |
); |
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
add_filter( 'woocommerce_available_payment_gateways', 'rudr_gateway_by_country' ); | |
function rudr_gateway_by_country( $gateways ) { | |
if( is_admin() ) { | |
return $gateways; | |
} | |
if( is_wc_endpoint_url( 'order-pay' ) ) { // Pay for order 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
billing_wcj_checkout_field_1 | |
<?php | |
add_action('woocommerce_after_checkout_form', function($checkout){ | |
?> | |
<script type="text/javascript"> | |
jQuery(function($){ | |
$(document).on('change','#billing_wcj_checkout_field_1',function(){ | |
$(document.body).trigger("update_checkout"); |
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
//https://css-tricks.com/how-to-write-loops-with-preprocessors/ | |
//for | |
@for $i from 1 through 15 { | |
div { | |
&:nth-child(#{$i}) { | |
&::after { | |
content: "#{$i}"; | |
} | |
} |
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
//source: https://www.cloudways.com/blog/how-to-edit-delete-fields-and-email-in-woocommerce-custom-checkout-fields/ | |
//remove first name and last name. | |
function woocommerce_remove_additional_information_checkout($fields){ | |
unset( $fields["billing_first_name"] ); | |
unset( $fields["billing_last_name"] ); | |
return $fields; | |
} | |
add_filter( 'woocommerce_billing_fields', 'woocommerce_remove_additional_information_checkout' ); |
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
//difine default theme | |
define( 'WP_DEFAULT_THEME', 'default-theme-folder-name' ); | |
//diable autoupdate | |
define( 'AUTOMATIC_UPDATER_DISABLED', true ); | |
//only disable core updates | |
define( 'WP_AUTO_UPDATE_CORE', false ) | |
//enable trash for media |
OlderNewer