Skip to content

Instantly share code, notes, and snippets.

<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by [email protected] on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@kloon
kloon / functions.php
Last active October 27, 2021 04:47
WooCommerce 3.2: Add resend admin order email option that was removed
<?php
/**
* This adds back an option to resend the admin new order email from the order edit screen that was removed in WooCommerce 3.2
*/
/**
* Filter to add a new menu to the dropdown
*
* @param array $actions
* @return array
@orvigas
orvigas / arraySum.php
Created January 31, 2018 21:47
Function to sum two arrays in php
<?php
/**
* Function to sum two arrays
*
* @param array $a First array to merge
* @param array $b Second array to merge which gonna be returned by function
*
* @author Orlando Villegas Galán <[email protected]>
* @return $b
*/
@em-piguet
em-piguet / woocommerce_script_cleaner.php
Last active October 28, 2019 18:07
Manage WooCommerce styles and scripts
<?php
////////////////////////////////////////////
// Manage WooCommerce styles and scripts. //
////////////////////////////////////////////
function woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
// remove definitly, no need of this one
///////////////////////////////////////////////////
@froger-me
froger-me / wp-specific-auto-updates.php
Last active November 19, 2021 10:19
WordPress auto updates for specific plugins and themes
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
function auto_update_specific_plugins( $update, $item ) {
// Array of plugin slugs to always auto-update
$plugins = array(
'dummy-plugin',
@carasmo
carasmo / dequeue-woocommerce-js-css-on-non-woo-pages.php
Last active November 26, 2024 15:58
Dequeue WooCommerce CSS and JS on non-WooCommerce pages for 3.6.4
<?php
//don't add above twice if it already exists
/**
* Check if WooCommerce Page of all kinds (not just cart and shop)
* @thanks: https://faish.al/2014/01/06/check-if-it-is-woocommerce-page/
* Checked IDS with WooCommerce Repo 1 June 2019
*/
function ca_is_really_woocommerce_page() {
@damiencarbery
damiencarbery / flash-animation.css
Last active December 10, 2021 14:03
Edit stock levels in WooCommerce - Add editing capability to the List stock levels in WooCommerce plugin - https://www.damiencarbery.com/2019/10/edit-stock-levels-in-woocommerce
table.wp-list-table tr.updated { animation: highlight 3s ease 2; }
@keyframes highlight {
0% { background-color: inherit; }
50% { background-color: #d1fa88; }
100% { background-color: inherit; }
}