Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
damiencarbery / wc-schedule-hide-products.php
Last active January 8, 2025 16:30
WooCommerce - Schedule showing and hiding of products - Add the ability to show and hide a product on specified dates. https://www.damiencarbery.com/2025/01/schedule-showing-and-hiding-of-woocommerce-products/
<?php
/*
Plugin Name: WooCommerce - Schedule showing and hiding of products
Plugin URI: https://www.damiencarbery.com/2025/01/schedule-showing-and-hiding-of-woocommerce-products/
Description: Add the ability to show and hide a product on specified dates.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1.20250108
Requires Plugins: woocommerce
*/
<?php
/*
Plugin Name: Doing it wrong silencer
Plugin URI: http://www.damiencarbery.com
Description: Silence the warning about _load_textdomain_just_in_time.
Author: Damien Carbery
Version: 0.1
*/
// Solution from: https://developer.woocommerce.com/2024/11/11/developer-advisory-translation-loading-changes-in-wordpress-6-7/
@damiencarbery
damiencarbery / search-for-htaccess-files.php
Last active December 25, 2024 15:20
Search for .htaccess files - Quickly find hacker files - get a list of .htaccess files in wp-includes and wp-content and php files in wp-content. https://www.damiencarbery.com/2024/10/search-for-htaccess-files/
<?php
/*
Plugin Name: Search for .htaccess files
Plugin URI: https://www.damiencarbery.com/2024/10/search-for-htaccess-files/
Description: Quickly find hacker files - get a list of .htaccess files in wp-includes and wp-content and php files in wp-content.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com/
Version: 0.4.20241225
*/
@damiencarbery
damiencarbery / download-link-to-audio-playlist.php
Created August 5, 2024 15:22
Add Download link to WordPress audio playlist player - Initially an intimidating prospect, a few shortcuts got a Download button for each track in the playlist. https://www.damiencarbery.com/2024/08/add-download-link-to-wordpress-audio-playlist-player/
@damiencarbery
damiencarbery / wc-add-custom-product-note-to-details-table.php
Created May 24, 2024 15:15
Add extra product info to WooCommerce details table - Use a custom metabox for extra product information that will be added to the details table. https://www.damiencarbery.com/2024/05/add-extra-product-info-to-woocommerce-details-table/
<?php
/*
Plugin Name: WooCommerce - Add extra product info to details table
Plugin URI: https://www.damiencarbery.com/2024/05/add-extra-product-info-to-woocommerce-details-table/
Description: Use a custom metabox for extra product information that will be added to the details table.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1.20240524
WC tested to: 8.9.1
Requires Plugins: woocommerce
@damiencarbery
damiencarbery / wc-add-custom-order-note-to-details-table.php
Created May 22, 2024 17:37
Add extra order info to WooCommerce details table - Use a custom metabox for extra order information that will be added to the end of the details table. https://www.damiencarbery.com/2024/05/add-extra-order-info-to-woocommerce-details-table/
<?php
/*
Plugin Name: WooCommerce - Add extra order info to details table
Plugin URI: https://www.damiencarbery.com/2024/05/add-extra-order-info-to-woocommerce-details-table/
Description: Use a custom metabox for extra order information that will be added to the end of the details table.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1.20240521
WC tested to: 8.9.1
Requires Plugins: woocommerce
@damiencarbery
damiencarbery / wc-products-shortcode-ids-order.php
Last active May 19, 2024 03:18
Change WooCommerce [products] shortcode display order - Change the order of products in [products] shortcode to order in ids parameter if 'orderby' is set to 'ids'. https://www.damiencarbery.com/2024/05/change-woocommerce-products-shortcode-display-order/
<?php
/*
Plugin Name: WooCommerce - Change [products] shortcode display order
Plugin URI: https://www.damiencarbery.com/
Description: Change the order of products in [products] shortcode to order in ids parameter if 'orderby' is set to 'ids'. Example: [products ids="1,5,2,4" orderby="ids"]
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1.20240517
*/
@damiencarbery
damiencarbery / monochrome-pro-remove-hero-avatar.php
Last active May 2, 2024 10:58
Remove the hero image and avatar from single posts in Monochrome Pro theme.
<?php
/*
Plugin Name: Monochrome Pro - remove hero and avatar
Plugin URI: https://www.facebook.com/groups/genesiswp/posts/8077692698948523/
Description: Remove the hero image and avatar from single posts in Monochrome Pro theme.
Author: Damien Carbery
Version: 0.1
*/
@damiencarbery
damiencarbery / tabs.php
Created April 17, 2024 15:20
Change WooCommerce product tabs to accordion - Modify tabs.php template to use the <details> element for accordion like behaviour for product information. https://www.damiencarbery.com/2024/04/change-woocommerce-product-tabs-to-accordion/
<?php
/**
* Single Product tabs
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.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
@damiencarbery
damiencarbery / wc-export-order-csv.php
Last active April 5, 2024 16:10
A quick proof of concept of using an order ID to generate a CSV of order details.
<?php
/*
Plugin Name: WooCommerce - Export order details as CSV
Plugin URI: https://www.damiencarbery.com/
Description: Allow exporting the details .
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/