Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
damiencarbery / search-for-htaccess-files.php
Created October 24, 2024 14:36
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.3.20241022
*/
@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
*/
@damiencarbery
damiencarbery / view-order-on-front-end.php
Last active July 19, 2024 16:21
View WooCommerce order on front end - Use an encrypted link to allow a customer view order details on the front end. https://www.damiencarbery.com/2024/01/view-woocommerce-order-on-front-end/
<?php
/*
Plugin Name: View WooCommerce order on front end
Plugin URI: https://www.damiencarbery.com/2024/01/view-woocommerce-order-on-front-end/
Description: Use an encrypted link to allow a customer view order details on the front end.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.3.20240719
WC tested to: 9.1.2
Requires Plugins: woocommerce
@damiencarbery
damiencarbery / add-class-on-ninja-forms-dropdowns.js
Last active January 9, 2024 10:23
Ninja Forms - add class to listselect element as element rendered
// This code attempts to add a .with-border class to dropdowns as they are rendered.
// Create a new object for custom validation of a custom field.
var dcwdCustomFieldController = Marionette.Object.extend( {
initialize: function() {
console.log( 'In initialize of new code 1154' );
// From: https://developer.ninjaforms.com/codex/field-view-rendering/
this.listenTo( nfRadio.channel( 'listselect' ), 'render:view', this.renderView );
},