Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
damiencarbery / hide-shipping-method-id-category.php
Last active Sep 30, 2022
Hide shipping method by product id or category - Exclude a shipping method if the cart contains certain products or product categories. https://www.damiencarbery.com/2022/10/hide-shipping-method-by-product-id-or-category
View hide-shipping-method-id-category.php
<?php
/*
Plugin Name: Hide shipping method by product id or category
Plugin URI: https://www.damiencarbery.com/2022/10/hide-shipping-method-by-product-id-or-category
Description: Exclude a shipping method if the cart contains certain products or product categories.
Author: Damien Carbery
Version: 0.1
*/
// Filter shipping methods in the checkout - do not show An Post if a Craft item is in the cart.
@damiencarbery
damiencarbery / log-get-post-request-data.php
Created Jul 18, 2022
Log $_GET, $_POST, $_REQUEST and $_SERVER data to help with development of new code.
View log-get-post-request-data.php
<?php
/*
Plugin Name: Log $_GET, $_POST and $_REQUEST data
Plugin URI: https://www.damiencarbery.com/
Description: Log $_GET, $_POST, $_REQUEST and $_SERVER data to help with development of new code.
Author: Damien Carbery
Version: 0.1
*/
@damiencarbery
damiencarbery / wc-remove-settings-tab.php
Created Jul 16, 2022
Remove WooCommerce Settings tab
View wc-remove-settings-tab.php
<?php
/*
Plugin Name: Remove WooCommerce Settings tab
Plugin URI: https://www.damiencarbery.com/
Description: Remove a tab from the WooCommerce/Settings area.
Author: Damien Carbery
Version: 0.1
*/
@damiencarbery
damiencarbery / wc-remove-edit-product-tab.php
Created Jul 16, 2022
Remove tab from Product Data area of Edit Product page
View wc-remove-edit-product-tab.php
<?php
/*
Plugin Name: Remove tab from Product Data area of Edit Product page
Plugin URI: https://www.damiencarbery.com/
Description: Remove a tab from the Edit Product page.
Author: Damien Carbery
Version: 0.1
*/
@damiencarbery
damiencarbery / conditional-section-display-elementor.php
Created May 1, 2022
Conditionally show an Elementor section - A demo of how to conditionally show an Elementor section using the section ID and class. https://www.damiencarbery.com/2022/05/conditionally-show-an-elementor-section/
View conditional-section-display-elementor.php
<?php
/*
Plugin Name: Conditionally show an Elementor section
Plugin URI: https://www.damiencarbery.com/2022/05/conditionally-show-an-elementor-section/
Description: A demo of how to conditionally show an Elementor section using the section ID and class.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@damiencarbery
damiencarbery / dcwd-custom-block-styles.css
Last active Aug 17, 2022
Add custom block styles - Easily enhance the block editor with custom block styles. https://www.damiencarbery.com/2022/04/add-custom-block-styles/
View dcwd-custom-block-styles.css
/* Highlight paragraph style. */
p.is-style-highlight, .editor-styles-wrapper p.is-style-highlight { font-size: 180%; }
/* Rotated image style. */
.is-style-rotated img { transform: rotate(180deg); }
/* Group block Info and Warning styles. */
.is-style-group-info, .is-style-group-warning { margin: 0 0 10px; }
.is-style-group-info, .is-style-group-warning { padding: 2em; min-height: 35px; }
.is-style-group-info strong, .is-style-group-warning strong { color: #000000; font-weight: bold; }
@damiencarbery
damiencarbery / disable-login-language-dropdown.php
Created Jan 26, 2022
Disable language dropdown on login page - Disable the language dropdown on the login page as it may confuse some users/admins. Introduced in WordPress 5.9. https://www.damiencarbery.com/2022/01/disable-language-dropdown-on-login-page/
View disable-login-language-dropdown.php
<?php
/*
Plugin Name: Disable language dropdown on login page
Plugin URI: https://www.damiencarbery.com/2022/01/disable-language-dropdown-on-login-page/
Description: Disable the language dropdown on the login page as it may confuse some users/admins. Introduced in WordPress 5.9.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@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 / acf-date-time-picker-start-end-date-twinned.php
Last active Feb 23, 2022
ACF Date Time Picker – set end date to after start date - With two related Date Time Picker fields limit the end date to be after the start date. https://www.damiencarbery.com/2021/10/acf-date-time-picker-set-end-date-to-after-start-date/
View acf-date-time-picker-start-end-date-twinned.php
<?php
/*
Plugin Name: ACF Date Time Picker - set end date to after start date
Plugin URI: https://www.damiencarbery.com/2021/10/acf-date-time-picker-set-end-date-to-after-start-date/
Description: With two related Date Time Picker fields limit the end date to be after the start date.
Author: Damien Carbery
Version: 0.2
*/
View wc-sale-price-first-google-merchant.php
<?php
/*
Plugin Name: WooCommerce Sale Price First
Plugin URI: https://www.damiencarbery.com/
Description: Move the Sale Price to be before the Normal Price in the html but display as Normal-then-Sale. This is because Google Merchant is not reading the sale price.
Author: Damien Carbery
Version: 0.1
*/