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); |
| <?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'); |
| <?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/ | |
| */ | |
| add_action('wp_ajax_wswp_refresh_dates','wswp_refresh_dates'); | |
| add_action('wp_ajax_nopriv_wswp_refresh_dates','wswp_refresh_dates'); |
| <?php | |
| /** | |
| * Plugin Name: Woocommerce Vendors Bookings Management | |
| * Description: Allows vendors to manage their bookings in the frontend | |
| * Version: 1.0.0 | |
| * Author: Liam Bailey | |
| * Author URI: http://webbyscots.com/ | |
| * License: GNU General Public License v3.0 | |
| * License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
| */ |
| 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 |
| 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)"; |
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
| 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' ); ?> |