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
// WSIS: Salonized scripts and styles | |
function wsis_salonized_scripts() { | |
wp_register_style( 'salonized', '//cdn.salonized.com/assets/booking/v2/booking.css', false, false, 'screen, projection' ); | |
wp_enqueue_style( 'salonized' ); | |
wp_register_script( 'salonized-v2-js', '//cdn.salonized.com/assets/booking/v2.js', false, false, true ); | |
wp_register_script( 'salonized-init', get_stylesheet_directory_uri() . '/js/salonized/wsis-salonized.js', array( 'salonized-v2-js' ), false, true ); | |
wp_enqueue_script( 'salonized-init' ); |
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
/** Disable file editing in WordPress, see https://gist.github.com/Willem-Siebe/cf166ec36b3f2e145903. */ | |
define('DISALLOW_FILE_EDIT', true); |
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 current user roles http://docs.appthemes.com/tutorials/wordpress-check-user-role-function/ | |
/** | |
* Checks if a particular user has a role. | |
* Returns true if a match was found. | |
* | |
* @param string $role Role name. | |
* @param int $user_id (Optional) The ID of a user. Defaults to the current user. | |
* @return bool | |
*/ |
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 parent page ID's to the thank you pages after form submission through CRED forms. More code needs to be added in CRED form itself, see https://gist.github.com/Willem-Siebe/a30f4ba5ff3607923ebc. | |
add_shortcode('wsis-sc-get-url-param', 'wsis_get_url_param'); | |
function wsis_get_url_param ($atts) { | |
$var = $atts["var"]; | |
return $_GET[$var]; | |
} | |
function wsis_add_parent_page_id_to_redirect_page($url, $post_id, $form_data) |
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 Purchase Order field from Wholesale checkout page, see https://gist.github.com/Willem-Siebe/f23e348d1165d7934868. | |
function wsis_remove_purchase_order_field($fields) { | |
if (isset($fields['order']['purchase_order'])) { | |
unset($fields['order']['purchase_order']); | |
} | |
return $fields; | |
} | |
add_filter( 'woocommerce_checkout_fields', 'wsis_remove_purchase_order_field', 15, 1); |
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
Changing heading element level from TablePress tables, see https://gist.github.com/Willem-Siebe/d0a2ba73cc3b980f1165. | |
add_filter( 'tablepress_print_name_html_tag', 'wsis_tablepress_change_table_name_h2_to_h4', 10, 2 ); | |
function wsis_tablepress_change_table_name_h2_to_h4( $tag, $table_id ) { | |
$tag = 'h4'; | |
return $tag; | |
} |
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 kill_defaults($tags) { | |
return array(); | |
} | |
add_filter( 'woocommerce_email_style_inline_tags', 'kill_defaults', 20 ); | |
add_filter( 'woocommerce_email_style_inline_h1_tag', 'kill_defaults', 20 ); | |
add_filter( 'woocommerce_email_style_inline_h2_tag', 'kill_defaults', 20 ); | |
add_filter( 'woocommerce_email_style_inline_h3_tag', 'kill_defaults', 20 ); | |
add_filter( 'woocommerce_email_style_inline_a_tag', 'kill_defaults', 20 ); | |
add_filter( 'woocommerce_email_style_inline_img_tag', 'kill_defaults', 20 ); |
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 CSS and/or JS for Select2 used by WooCommerce, see https://gist.github.com/Willem-Siebe/c6d798ccba249d5bf080. | |
add_action( 'wp_enqueue_scripts', 'wsis_dequeue_stylesandscripts_select2', 100 ); | |
function wsis_dequeue_stylesandscripts_select2() { | |
if ( class_exists( 'woocommerce' ) ) { | |
wp_dequeue_style( 'select2' ); | |
wp_deregister_style( 'select2' ); | |
wp_dequeue_script( 'select2'); |
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
// Disable e-mail subject encoding by Formidable, API Mandrill (if used) is taking care of this, see https://gist.github.com/Willem-Siebe/cbd36caca079859b2918 | |
add_filter('frm_encode_subject', 'wsis_frm_encode_subject'); | |
function wsis_frm_encode_subject(){ | |
return 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
// Change WooCommerce username to emailaddress, see https://gist.github.com/Willem-Siebe/9dfe4aaaaa24e1294da6. | |
add_filter('woocommerce_new_customer_data','wsis_change_wc_username'); | |
function wsis_change_wc_username($user_data) { | |
return array( | |
'user_login' => $user_data['user_email'], | |
'user_pass' => $user_data['user_pass'], | |
'user_email' => $user_data['user_email'], | |
'role' => 'customer'); |
NewerOlder