This file contains hidden or 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( 'job_manager_job_listing_data_fields', 'admin_add_hours_field' ); | |
function admin_add_hours_field( $fields ) { | |
$fields['_job_hours'] = array( | |
'label' => __( 'Job Hours', 'job_manager' ), | |
'type' => 'select', | |
'options' => array('Select hours', '0 - 5' => '0 - 5', '5 - 10' => '5 - 10', '10 - 15' => '10 - 15', '20 +' => '20 +', 'flexible hours' => 'flexible hours'), | |
'placeholder' => '', | |
'description' => '' | |
); |
This file contains hidden or 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 a WISIHLIST LINK in the WooCommerce MY ACOUNT sidebar tab area | |
**/ | |
add_filter ( 'woocommerce_account_menu_items', 'woo_my_wishlist' ); | |
function woo_my_wishlist( $menu_links ){ | |
// we will hook "my_wishlist" later | |
$new = array( 'my_wishlist' => 'My Wishlist' ); | |
// array_slice() is good when you want to add an element between the other ones |
This file contains hidden or 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 | |
function fs_custom_adjust_datepicker_range () { | |
// only adjust on Checkout page | |
if ( is_checkout() ) { | |
wp_enqueue_script( 'jquery' ); | |
?> | |
<!-- Checkout datepicker tweaks --> | |
<script type="text/javascript"> | |
jQuery( document ).ready( function ( e ) { |
This file contains hidden or 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
jQuery(window).load(function(){ | |
// target YouTube anchor links within this ID | |
jQuery('#fs-video-playlist a[href*="youtube.com/watch"]').magnificPopup({ | |
type: 'iframe', | |
iframe: { | |
markup: '<div class="mfp-iframe-scaler">'+ | |
'<div class="mfp-close"></div>'+ | |
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ | |
'</div>', // HTML markup of popup, `mfp-close` will be replaced by the close button |
This file contains hidden or 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_package_rates', 'change_shipping_method_name_based_on_shipping_class', 50, 2); | |
function change_shipping_method_name_based_on_shipping_class($rates, $package){ | |
// HERE set the shipping class for "Pickup" | |
$shipping_class_id = 125; | |
$pickup = false; | |
$deliver = false; | |
// Check for the "Pickup" shipping class in cart items |
This file contains hidden or 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
# Cloudways force HTTPS with WWW | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^example.com [NC] | |
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301,NC] | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On |
This file contains hidden or 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 | |
/** | |
* Auto Complete all WooCommerce orders. | |
*/ | |
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' ); | |
function custom_woocommerce_auto_complete_order( $order_id ) { | |
if ( ! $order_id ) { | |
return; | |
} |
This file contains hidden or 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 | |
// redirecting woocommerce pages to homepage for logged out users | |
add_action( 'template_redirect', 'fs_wc_redirect' ); | |
function fs_wc_redirect() { | |
if ( ! is_user_logged_in() && (is_woocommerce() || is_cart() || is_checkout()) ) { | |
wp_redirect( home_url() ); | |
exit; | |
} | |
} |
This file contains hidden or 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 | |
$n = ' | |
/** Custom Batcache settings for the end of wp-config.php **/ | |
global $batcache; | |
if ($batcache && WP_CACHE) { | |
$batcache->max_age = 86400; // Seconds the cached render of a page will be stored | |
$batcache->seconds = 3600; // The amount of time at least 2 people are required to visit your page for a cached render to be stored. | |
} | |
'; |
This file contains hidden or 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 the shipping class to the bottom of each item in the cart | |
*/ | |
add_filter( 'woocommerce_cart_item_name', 'shipping_class_in_item_name', 20, 3); | |
function shipping_class_in_item_name( $item_name, $cart_item, $cart_item_key ) { | |
// If the page is NOT the Shopping Cart or the Checkout, then return the product title (otherwise continue...) | |
if( ! ( is_cart() || is_checkout() ) ) { | |
return $item_name; |