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 | |
/** | |
* Plugin Name: Disable Gutenberg | |
* Description: Uses filters to disable Gutenberg. | |
* Author: Mark Truitt | |
* License: GNU General Public License v3 or later | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ | |
// Basic security, prevents file from being loaded directly. |
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 | |
/* Setup custom query to get posts with ACF field for Author | |
* First we need to get the ID and pass this for the meta data | |
* Set the key to the name of the field then compare to like so we pull any that contain it | |
* Use Sprintf ti run through to check against that | |
*/ | |
$attorneyID = get_the_id(); | |
$args = array( | |
'post_type' => 'post', | |
'meta_query' => array( |
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 | |
// Lets remove the postcode | |
add_filter( 'woocommerce_checkout_fields' , 'custom_wc_checkout_fields' ); | |
function custom_wc_checkout_fields( $fields ) { | |
unset( $fields['billing']['billing_postcode']); | |
$fields['billing']['shipping_code'] = array( | |
'type' => 'select', |
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 | |
$message = array( 'text' => 'This is a test message via slack and curl' ); | |
$data_message = json_encode( $message ); | |
$ch = curl_init( 'slack webhook goes here' ); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_message); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array( | |
'Content-Type: application/json', |
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_admin_meta_boxes_variations_per_page', 'admin_increase_variations_per_page' ); | |
function admin_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
<?php | |
/** | |
* Plugin Name: WooCommerce Enable Free Shipping on a Per Product Basis | |
* Plugin URI: https://gist.github.com/BFTrick/d4a21524a8f7b25ec296 | |
* Description: Enable free shipping for certain products | |
* Author: Patrick Rauland & eugenf | |
* Author URI: http://speakinginbytes.com/ | |
* Version: 1.0.2 | |
* | |
* This program is free software: you can redistribute it and/or modify |
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 | |
function change_price($price) { | |
if ( $price == wc_price( 0 ) ) | |
return 'FREE'; | |
elseif ( $price == '' ) { | |
return 'Coming Soon'; |
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 | |
function woo_add_cart_fee() { | |
global $woocommerce; | |
$current_user = wp_get_current_user(); | |
if ( in_array( 'residential', $current_user->roles, true) ) { | |
$woocommerce->cart->add_fee( __( 'Custom', 'woocommerce' ), 5 ); |
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_shipping_package_name' , 'woocommerce_replace_text_shipping_to_delivery', 10, 3); | |
/** | |
* | |
* Function to replace shipping text to shipping & handling text | |
* | |
* @param $package_name | |
* @param $i | |
* @param $package |
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 | |
function remove_products_from_cart( $cart_item_key ) { | |
// Products allowed with gift sub | |
$allowed_products = array( 230973 , 231122, 230510 ); | |
// Gift Subscription Product ID | |
$gift_product_id = 230973; | |
// Lets get all the IDs in the cart |