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
/* | |
// original snippet URL: https://gist.github.com/solaceten/7f03aed8c3b232742b1f6fb7777d8776 | |
// Author solaceten. You are free to do what you want with this but not sell it or make any money from its use. | |
// | |
// Explainer: | |
// Below is a custom function to add a custom variable into automate woo. | |
// This example enables the use of a new variable: order.billing_email - as a variable in the workflow ACTION section, email TO field. | |
// As at Dec 2024, in automatewoo, this variable is working after adding the following code. | |
// | |
// While this code allows you to use the new variable {{ order.billing_email }} in your Workflow, note that in the main queue admin table, |
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 | |
// WC_Checkout | |
/** | |
* Add coupon lines to the order. | |
* | |
* @param WC_Order $order Order instance. | |
* @param WC_Cart $cart Cart instance. | |
*/ |
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 | |
/** | |
* Redirect posts with old permalink structure to new links. | |
* | |
* If you change your posts permalink structure you should redirect all | |
* trafic from old permalink to new one. This script will redirect posts | |
* from /%postname%/ to current post link using 301 status. | |
* | |
* This script is working only for /%postname%/ => current link |
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 is_user_logged_in() { | |
$loggedin = false; | |
foreach ( (array) $_COOKIE as $cookie => $value ) { | |
if ( stristr( $cookie, 'wordpress_logged_in_' ) ) { | |
$loggedin = true; | |
} | |
} | |
return $loggedin; | |
} |
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 | |
// Remove the Tax Line item from the cart. | |
function wc_remove_cart_tax_totals( $tax_totals, $instance ) { | |
if( is_cart() ) { | |
$tax_totals = array(); | |
} | |
return $tax_totals; | |
} |
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 | |
/** | |
* @package Food_example_plugin | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Food example plugin | |
Plugin URI: http://wordpress.org/extend/plugins/# | |
Description: This is an example plugin for WPMU DEV readers | |
Author: Carlo Daniele |
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 | |
if( function_exists('acf_add_local_field_group') ): | |
acf_add_local_field_group(array ( | |
'key' => 'acf_product_options', | |
'title' => 'Product Options', | |
'fields' => array ( | |
array ( | |
'key' => 'acf_product_options_tabbedcontent_label', | |
'label' => 'Tabbed Content', |
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
// For Yoast SEO Plugin Version: 14.1+ add to your Wordpress Theme's functions.php... | |
// Remove All Yoast HTML Comments | |
// https://gist.github.com/paulcollett/4c81c4f6eb85334ba076 | |
// Credit @devendrabhandari (https://gist.github.com/paulcollett/4c81c4f6eb85334ba076#gistcomment-3303423) | |
add_filter( 'wpseo_debug_markers', '__return_false' ); | |
// For Yoast SEO Plugin Version: < 14.1 add to your Wordpress Theme's functions.php... |
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
DELETE FROM wp_postmeta | |
WHERE post_id IN(SELECT ID FROM wp_posts WHERE post_type = 'shop_order'); | |
DELETE FROM wp_posts WHERE post_type = 'shop_order'; |
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 | |
/* | |
Plugin Name: Pancake v. 1.1 | |
Plugin URI: http://phpmaps.github.io/me/ | |
Description: Hides wordpress categories that Johnny finds annoying when working in the admin! | |
Version: 1.1 rev 1 (Sea Gull) | |
Author: Doogs | |
Author URI: http://phpmaps.github.io/me/ | |
*/ | |
NewerOlder