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_shop_order_search_fields', 'woocommerce_shop_order_search_order_total' ); | |
function woocommerce_shop_order_search_order_total( $search_fields ) { | |
$search_fields[] = '_order_total'; | |
return $search_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
add_filter( 'woocommerce_admin_meta_boxes_variations_per_page', 'override_increase_variations_per_page' ); | |
function override_increase_variations_per_page() { | |
return 50; | |
} |
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 _remove_script_version( $src ){ | |
$parts = explode( '?', $src ); | |
return $parts[0]; | |
} | |
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); | |
add_filter( 'style_loader_src', '_remove_script_version', 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
//Instead of WP default | |
//<link rel='stylesheet' id='child-theme-css' href='http://mysite.com/wp-content/themes/child/css/styles.min.css?ver=4.3.1' type='text/css' media='all' /> | |
//You get this every time the minified CSS is saved and compressed: | |
//<link rel='stylesheet' id='child-theme-css' href='http://mysite.com/wp-content/themes/child/css/styles.min.css?ver=1447781986' type='text/css' media='all' /> | |
<?php | |
$themecsspath = get_stylesheet_directory() . '/css/styles.min.css'; | |
wp_enqueue_style( | |
'child-theme', |
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
-webkit-tap-highlight-color: rgba(0,0,0,0); // remove default hightlight color on links | |
-webkit-user-select: none; //prevent user from selecting | |
-webkit-text-size-adjust: none; //don't allow zooming of text (probaly not wise to use) | |
-webkit-font-smoothing: antialiased; // (Nice display of custom fonts on webkit, also don't use font-weight: bold; use the weight of the font eg: font-weight: 400; | |
-webkit-appearance: none; //remove native styling added by ios to form elements | |
-webkit-backface-visibility: hidden; //fix flickering in ios when animated element is larger than the screen width | |
/* Fix html5 datepicker arrow when using twitter bootstrap and chrome */ | |
input[type=date]::-webkit-calendar-picker-indicator { | |
display: inline-block; |
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
/* MOBILE SAFARI RESET INPUTS */ | |
input[type="text"], | |
input[type="password"], | |
input[type="email"] { | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
} |
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_filter( 'woocommerce_email_attachments', 'attach_terms_conditions_pdf_to_email', 10, 3); | |
function attach_terms_conditions_pdf_to_email ( $attachments , $id, $object ) { | |
$your_pdf_path = get_template_directory() . '/terms.pdf'; | |
$attachments[] = $your_pdf_path; | |
return $attachments; | |
} |
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 | |
global $post, $product, $woocommerce; | |
if(get_field('documents', $post->ID)) { | |
echo '<table class="shop_table shop_table_responsive shop_documents"><thead><th>Filnamn</th><th>Filtyp</th><th>Storlek</th></thead>'; | |
while(has_sub_field('documents')) | |
{ | |
$attachment_id = get_sub_field('document_file'); | |
$url = wp_get_attachment_url( $attachment_id ); | |
$title = get_the_title( $attachment_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
/* | |
Plugin Name: Stop long comments | |
Description: A security precaution to stop comments that are too long. | |
Version: 0.0.4 | |
Author: WPEngine | |
Author URI: wpengine.com | |
License: GPLv2 | |
*/ | |
add_filter( 'pre_comment_content', 'wpengine_die_on_long_comment', 9999 ); |
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( 'wp_footer', 'wds_debug' ); | |
/* | |
* Show me some dev info during development! DELETE ME BEFORE GOING LIVE!!! | |
* | |
*/ | |
function wds_debug() { | |
global $template; ?><br /> | |
<?php echo $template; ?><br /> | |
<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds<br /> | |
Server load: <?php $load = sys_getloadavg(); echo $load[0]; ?>%<br /> |