Skip to content

Instantly share code, notes, and snippets.

View limit-lower-cart-weight.php
<?php
/*
Plugin Name: Limit Cart Weight
Plugin URI: https://www.damiencarbery.com/
Description: Prevent checkout unless cart is above a certain weight.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@damiencarbery
damiencarbery / ninja-forms-submissions.php
Last active Jan 14, 2022
Display Ninja Forms Submissions - Demonstrate viewing form submission data outside of the admin area. https://www.damiencarbery.com/2019/06/display-ninja-forms-submissions/
View ninja-forms-submissions.php
<?php
header('HTTP/1.1 200 OK');
define('WP_USE_THEMES', false);
/** Loads the WordPress Environment */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
$id = 3;
@damiencarbery
damiencarbery / genesis-search-result-display-changes.php
Last active Jan 3, 2022
Adjust how Genesis search results are displayed
View genesis-search-result-display-changes.php
<?php
/*
Plugin Name: Genesis Search changes
Plugin URI: https://www.damiencarbery.com
Description: Experimenting with changing Genesis search result display.
Author: Damien Carbery
Version: 10.1
Author URI: https://www.damiencarbery.com/
*/
@damiencarbery
damiencarbery / flash-animation.css
Last active Dec 10, 2021
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
View flash-animation.css
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; }
}
@damiencarbery
damiencarbery / attach-files-to-wc-order-email.php
Last active Dec 8, 2021
Conditionally attach files to WooCommerce order email - Attach a file to the WooCommerce Order Completed email if a specific product or variation is in the order. https://www.damiencarbery.com/2020/02/conditionally-attach-files-to-woocommerce-order-email/
View attach-files-to-wc-order-email.php
<?php
/*
Plugin Name: Conditionally attach files to WooCommerce order email
Plugin URI: https://www.damiencarbery.com/2020/02/conditionally-attach-files-to-woocommerce-order-email/
Description: Attach a file to the WooCommerce Order Completed email if a specific product or variation is in the order.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@damiencarbery
damiencarbery / send-emails-via-smtp.php
Last active Dec 6, 2021
Sent WordPress emails with SMTP - Deliver emails reliably by using SMTP. Use a tiny streamlined plugin to keep things fast. https://www.damiencarbery.com/2019/01/send-wordpress-emails-with-smtp/
View send-emails-via-smtp.php
<?php
/*
Plugin Name: Send email via SMTP
Plugin URI: https://www.damiencarbery.com/2019/01/send-wordpress-emails-with-smtp/
Description: Send emails via SMTP.
Author: Damien Carbery
Version: 0.1
*/
@damiencarbery
damiencarbery / htaccess-root.txt
Last active Dec 2, 2021
Hardening and Caching WordPress - A few .htaccess and wp-config.php changes to harden and speed up your website. These are simple changes that can help protect you - https://www.damiencarbery.com/2019/03/hardening-and-caching-wordpress/
View htaccess-root.txt
# Block WordPress xmlrpc.php requests.
<Files xmlrpc.php>
deny from all
</Files>
# Block direct access to wp-config.php.
<Files wp-config.php>
Deny from all
</Files>
@damiencarbery
damiencarbery / woocommerce-stock-info.php
Created Oct 13, 2019
List stock levels in WooCommerce - List the stock level for each product and variation. https://www.damiencarbery.com/2019/10/list-stock-levels-in-woocommerce/
View woocommerce-stock-info.php
<?php
/*
Plugin Name: WooCommerce Stock Info
Plugin URI: https://www.damiencarbery.com/2019/10/list-stock-levels-in-woocommerce/
Description: List the stock level for each product and variation.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@damiencarbery
damiencarbery / recovery-mode-email.php
Last active Dec 2, 2021
Set recovery mode email address - Change the recovery mode email address to which the fatal error emails are sent to, instead of bothering and potentially confusing the site admin. https://www.damiencarbery.com/2020/08/set-recovery-mode-email-address/
View recovery-mode-email.php
<?php
/*
Plugin Name: Change Recovery Mode Email
Plugin URI: https://www.damiencarbery.com/2020/08/set-recovery-mode-email-address/
Description: Set the recovery mode email address to which the fatal error emails are sent to, instead of bothering and potentially confusing the site admin. From: https://developer.wordpress.org/reference/hooks/recovery_mode_email/#comment-3265
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version 0.1
*/
@damiencarbery
damiencarbery / email-order-details.php
Created Oct 18, 2020
Add column to WooCommerce order email - Add an extra column to the WooCommerce order email. https://www.damiencarbery.com/2020/10/add-column-to-woocommerce-order-email/
View email-order-details.php
<?php
/**
* Order details table shown in emails.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-details.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and