date_default_timezone_set('America/Regina'); add_theme_support( 'post-thumbnails' ); add_theme_support( 'menus' ); add_theme_support( 'html5', array( 'search-form' ) ); define('ME_V', 1.44); define('ME_IMG', '/isl/themes/darksidedonuts/img/'); add_image_size( 'banner', 1600, 665, true ); add_image_size( 'square', 800, 600, true ); add_image_size( 'landscape', 600, 320, true ); add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); function isl_init() { $args = array( 'public' => true, 'has_archive' => false, 'label' => 'Updates', 'show_ui' => true, 'supports' => array('title', 'editor', 'thumbnail') ); register_post_type( 'isl_updates', $args ); $args = array( 'public' => true, 'has_archive' => false, 'label' => 'Testimonials', 'show_ui' => true, 'supports' => array('title', 'editor', 'thumbnail') ); register_post_type( 'isl_testimonials', $args ); } add_action( 'init', 'isl_init' ); function get_post_thumbnail_url($id, $size = 'large') { $thumb_url = false; if( has_post_thumbnail($id) ) { $thumb_id = get_post_thumbnail_id($id); $thumb_url_array = wp_get_attachment_image_src($thumb_id, $size, true); $thumb_url = $thumb_url_array[0]; } return $thumb_url; } function new_excerpt_more($more) { return '...'; } add_filter('excerpt_more', 'new_excerpt_more'); function pr($d) { echo '
'; var_dump($d); echo ''; } add_filter('embed_oembed_html','isl_oembed', 10, 2); function isl_oembed($return, $data) { return '
'.__('Pickup Date').': ' . get_post_meta( $order->get_id(), '_pickup_date', true ) . '
'; echo ''.__('Pickup Time').': ' . $pickup_time . '
'; } function social_content($content) { $content = nl2br(linkify($content)); return $content; } function linkify($value, $protocols = array('http', 'mail'), array $attributes = array('target' => '_blank')) { // Link attributes $attr = ''; foreach ($attributes as $key => $val) { $attr = ' ' . $key . '="' . htmlentities($val) . '"'; } $links = array(); // Extract existing links and tags $value = preg_replace_callback('~(.*?|<.*?>)~i', function ($match) use (&$links) { return '<' . array_push($links, $match[1]) . '>'; }, $value); // Extract text links for each protocol foreach ((array)$protocols as $protocol) { switch ($protocol) { case 'http': case 'https': $value = preg_replace_callback('~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?$link") . '>'; }, $value); break; case 'mail': $value = preg_replace_callback('~([^\s<]+?@[^\s<]+?\.[^\s<]+)(?{$match[1]}") . '>'; }, $value); break; case 'twitter': $value = preg_replace_callback('~(?{$match[0]}") . '>'; }, $value); break; default: $value = preg_replace_callback('~' . preg_quote($protocol, '~') . '://([^\s<]+?)(?{$match[1]}") . '>'; }, $value); break; } } // Insert all link return preg_replace_callback('/<(\d+)>/', function ($match) use (&$links) { return $links[$match[1] - 1]; }, $value); } require_once('functions/ajax.php'); require_once('functions/admin.php'); remove_action('woocommerce_proceed_to_checkout','woocommerce_button_proceed_to_checkout', 20); add_action( 'woocommerce_proceed_to_checkout', 'isl_button_proceed_to_checkout', 10 ); function isl_button_proceed_to_checkout() { $cart_total = WC()->cart->subtotal; echo 'Minimum order of $15 to order online.
'; } echo 'Pickup Date: ' . $pickup_date . '
'; echo 'Pickup Time: ' . $pickup_time . '
'; }; // add the action add_action( 'woocommerce_email_order_details', 'action_woocommerce_email_order_details', 10, 4 ); function isl_value_to_time($value) { $time_slots = [ '700' => '7:00am - 8:00am', '800' => '8:00am - 9:00am', '900' => '9:00am - 10:00am', '1000' => '10:00am - 11:00am', '1100' => '11:00am - 12:00pm', '1200' => '12:00pm - 1:00pm', '1300' => '1:00pm - 2:00pm', '1400' => '2:00pm - 3:00pm', '1500' => '3:00pm - 4:00pm', '1600' => '4:00pm - 5:00pm', '1700' => '5:00pm - 6:00pm' ]; return $time_slots[$value]; } ?> get_header(); ?> while ( have_posts() ) : the_post(); ?>