Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
<?php | |
$content = strip_tags($_POST['content'],"<p><br><a>"); | |
lib_xml_use_internal_errors(true); | |
$DOM = new DOMDocument($content); | |
foreach($dom->getElementsByTagName($tagname) as $tag) { | |
if ($tag->hasAttributes()) { | |
foreach($tag->attributes as $attribute) { | |
if ($attribute->nodeName !== "href") | |
$tag->removeAttribute($attribute->nodeName); |
jQuery(function($) { | |
$("a.add_to_cart_button").after("<span class='item_cost_holder'></span>"); | |
$(".single_add_to_cart_button").after("<span id='item_cost_holder'></span>"); | |
$(".summary form.cart .quantity").remove(); | |
$(".wswp_id_numbers_field").keypress(function(event) { | |
if ( $(this).closest('li').find(".add_to_cart_button").length > 0) { | |
$(this).closest('li').find(".add_to_cart_button").hide(); | |
} | |
if(event.which != 8 && event.which != 32 && isNaN(String.fromCharCode(event.which))){ | |
event.preventDefault(); //stop character from entering input |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
add_action('init','run_my_query'); | |
function run_my_query() { | |
$todays_date = date("Y-m-d"); | |
if (get_transient("_query_run_".$todays_date)) | |
return; | |
set_transient("_query_run_".$todays_date,24 * HOUR_IN_SECONDS); | |
global $wpdb; | |
$query = "UPDATE wp_2_posts SET menu_order = '9999999' where id in (SELECT DISTINCT tr.object_id FROM wp_2_terms t, wp_2_term_taxonomy tt, wp_2_term_relationships tr WHERE (t.term_id = tt.term_id) AND (tt.term_taxonomy_id = tr.term_taxonomy_id) AND t.term_id = 1440)"; |
jQuery(function($) { | |
var beforeButton = $("<i class='incr-button fa fa-minus-circle fa-2x' />"); | |
var beforeButtonClick = function() { | |
var input = $(this).next(); | |
input.val(new Number(input.val()) - 1); | |
} | |
var afterButton = $("<i class='incr-button fa fa-plus-circle fa-2x' />"); | |
var afterButtonClick = function() { | |
var input = $(this).prev(); | |
input.val(new Number(input.val()) + 1); |
<?php | |
add_filter( 'woocommerce_bookings_in_date_range_query', 'wswp_filter_check_in_cart', 100, 1); | |
function wswp_filter_check_in_cart( $booking_ids ) { | |
foreach( $booking_ids as $key => $booking_id ) { | |
$booking = get_wc_booking( $booking_id ); | |
if ( $booking->has_status( 'in-cart' ) ) { | |
unset( $booking_ids[$key] ); | |
} |
<div id="stat-wrapper"> | |
<?php if ( have_rows( 'stats' ) ) : ?> | |
<?php $showitems = 2; $i = 0;$maincount = 0; ?> | |
<div class="col"> | |
<?php while ( have_rows( 'stats' ) ) : the_row(); ?> | |
<div class="stat stat-<?php echo $maincount; ?>"> | |
<?php if ( get_sub_field( 'stat_icon' ) ) { ?> | |
<img src="<?php the_sub_field( 'stat_icon' ); ?>" /> | |
<?php } ?> | |
<?php the_sub_field( 'stat_headline' ); ?> |
<?php | |
add_action('admin_menu', 'add_custom_featured_product_link'); | |
function add_custom_featured_product_link() { | |
global $submenu; | |
$permalink = add_query_arg(array('post_type' => 'product','product_visibility' => 'featured'), admin_url('edit.php')); | |
$submenu['edit.php?post_type=product'][] = array( 'Featured Products', 'manage_options', $permalink ); | |
} |
protected function get_location_select_html( $object_id, $chosen_location = null, $product = null ) { | |
$object_type = $this->get_object_type(); | |
$enhanced_search = $this->use_enhanced_search(); | |
$field_name = wc_local_pickup_plus_shipping_method()->is_per_item_selection_enabled() ? '_pickup_location_id' : '_shipping_method_pickup_location_id'; | |
if ( $using_single_location = $this->get_product_pickup_location( $product ) ) { | |
$chosen_location = $using_single_location; | |
$using_single_location = true; | |
} elseif ( ! $chosen_location ) { |
<?php | |
/* | |
Plugin Name: Woocommerce Bookings Dropdown | |
Description: Swaps the date picker for a dropdown of dates | |
Version: 1.0.0 | |
Author: Webby Scots | |
Author URI: http://webbyscots.com/ | |
*/ | |
$wswp_dates_built = false; | |
add_filter('booking_form_fields','wswp_booking_form_fields'); |