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
/** | |
* Auto Complete all WooCommerce orders. | |
*/ | |
add_filter( 'woocommerce_payment_complete_order_status', 'cg_update_order_status', 10, 2 ); | |
function cg_update_order_status( $order_status, $order_id ) { | |
$order = new WC_Order( $order_id ); | |
if ( 'processing' == $order_status && ( 'on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status ) ) { |
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 filter_cars_by_taxonomies( $post_type, $which ) { | |
// Apply this only on a specific post type | |
if ( 'car' !== $post_type ) | |
return; | |
// A list of taxonomy slugs to filter by | |
$taxonomies = array( 'manufacturer', 'model', 'transmission', 'doors', 'color' ); | |
foreach ( $taxonomies as $taxonomy_slug ) { |
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
/** | |
* Event On Modificacitons for Columns | |
*/ | |
// Remove the Default WordPress Columns | |
add_filter('manage_ajde_events_posts_columns', function ( $columns ) | |
{ | |
unset($columns['author'], $columns['tags']); | |
return $columns; | |
} ); | |
// Remove the EventOn Event Type 2 column |
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 | |
/* | |
Plugin Name: eventON single custom field | |
Plugin URI: https://eventon.com | |
Description: A text field for eventON submit event form | |
Author: Basilis Kanonidis | |
Version: 2.0 | |
License: GPLv2 or later | |
*/ |
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('init', 'cg_init'); | |
function cg_init() { | |
add_action('woocommerce_cart_calculate_fees', 'cg_add_fee'); | |
add_action('wp_footer', 'cg_footer', 9999); | |
} | |
function cg_footer() { | |
?> | |
<script type="text/javascript"> |
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 mk_convert_rgba($colour, $alpha) | |
{ | |
if (!empty($colour)) { | |
if ($alpha >= 0.95) { | |
return $colour; // If alpha is equal 1 no need to convert to RGBA, so we are ok with it. :) | |
} else { | |
if ($colour[0] == '#') { | |
$colour = substr($colour, 1); | |
} | |
if (strlen($colour) == 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
<form class="mk-searchform" method="get" id="searchform" action="<?php echo home_url(); ?>"> | |
<input type="text" class="text-input" value="<?php if(!empty($_GET['s'])) echo get_search_query(); ?>" name="s" id="s" /> | |
<input type="hidden" value="59" name="cat" id="scat" /> | |
<i class="mk-icon-search"><input value="" type="submit" class="search-button" type="submit" /></i> | |
</form> |
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_action( 'edd_complete_purchase', 'fes_add_buyers_as_vendors', 10, 1 ); | |
function fes_add_buyers_as_vendors( $payment_id ){ | |
$customer_id = edd_get_payment_customer_id( $payment_id ); | |
$db_user = new FES_DB_Vendors(); | |
if ( $db_user->exists( 'id', $customer_id ) { | |
return; | |
} |
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
/** | |
* Adds icons for any custom order statuses | |
* Tutorial: http://www.skyverge.com/blog/changing-woocommerce-custom-order-status-icons/ | |
**/ | |
add_action( 'wp_print_scripts', 'skyverge_add_custom_order_status_icon' ); | |
function skyverge_add_custom_order_status_icon() { | |
if( ! is_admin() ) { | |
return; | |
} |
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
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen and (min-width : 321px) { | |
/* Styles */ | |
} |