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 the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="custom_checkout_fields"><h3>'.__('Member Listing Profile').'</h3>'; | |
/** |
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
/* | |
* Change zip to postal code for canada | |
*/ | |
add_filter( 'woocommerce_get_country_locale', 'fs_custom_checkout_locale' ); | |
function fs_custom_checkout_locale( $locale ) { | |
$locale['CA']['postcode']['label'] = __( 'Postal Code', 'woocommerce' ); | |
$locale['CA']['postcode']['placeholder'] = __( 'Postal Code', 'woocommerce' ); | |
return $locale; |
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
<ul class="events"> | |
<?php | |
$events_args = array( | |
'title' => NULL, | |
'limit' => 100, | |
'css_class' => NULL, | |
'show_expired' => FALSE, | |
'month' => NULL, | |
'category_slug' => NULL, | |
'order_by' => 'start_date', |
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 | |
// This code is basically taken out of the product_brand_thumbnails shortcode and then we add in some shuffling of the order | |
$brands = get_terms( 'product_brand', array( 'hide_empty' => 0, 'orderby' => 'name', 'exclude' => '', 'number' => 5, 'order' => 'ASC' ) ); | |
if ($brands ): | |
$columns = 5; | |
// Randomly order the brands | |
shuffle($brands); | |
?> |
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 | |
// Drupal User Migration Class | |
class UserMigrate{ | |
// Things that can be overridden by GET variables | |
public $users_start = 0; | |
public $users_limit = 5; | |
public $mode = 'preview'; | |
public $confirm_cleanup = false; |
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 my_custom_nav_class( $classes, $item ) { | |
// The $item->object_id is the actual post id that the menu $item is referencing. | |
// You could also compare the $item->title but it could change and then the class wouldn't be applied anymore | |
if ( 11 == $item->object_id ) : | |
// Blog | |
if ( is_singular( 'post' ) ) : |
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 custom_disable_woocommerce_billing_checkout_fields( $fields ) { | |
foreach ($fields['billing'] as $key => $billing_field){ | |
$fields['billing'][$key]['custom_attributes'] = array('disabled' => 'disabled') ; | |
} | |
return $fields; | |
} | |
add_filter( 'woocommerce_checkout_fields' , 'custom_disable_woocommerce_billing_checkout_fields' ); |
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
global $wpdb; | |
$sql = "SELECT order_id FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_id IN ( SELECT order_item_id FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE meta_key = '_product_id' AND meta_value = $product_id ) AND order_item_type = 'line_item'"; | |
$order_ids = $wpdb->get_col( $sql ); |
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
echo get_field_object( 'select_field' )['choices'][ get_field( 'select_field' ) ]; |
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 custom_email_replace($old_replacements, $user_id){ | |
// Generate the new url we need for this user | |
$enrollment_form_url = 'special-url-'.$user_id; | |
// An array of our replacement variables and their values | |
$new_replacements = array( | |
'%enrollmentform%'=> $enrollment_form_url, | |
); | |
// Merge our two arrays together |
OlderNewer