Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
damiencarbery / gp-elements-filter-by-date-range.php
Created October 4, 2022 15:33
Show GP Premium Elements by date range - Add CMB2 metabox to show a GP Premium Element in a chosen date range.
<?php
/*
Plugin Name: Show GP Premium Elements by date range
Plugin URI: https://www.damiencarbery.com/2022/10/show-gp-premium-elements-by-date-range/
Description: Add CMB2 metabox to show a GP Premium Element in a chosen date range.
Author: Damien Carbery
Version: 0.1
*/
@damiencarbery
damiencarbery / hide-shipping-method-id-category.php
Last active September 30, 2022 13:34
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
<?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 July 18, 2022 15:18
Log $_GET, $_POST, $_REQUEST and $_SERVER data to help with development of new code.
<?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 July 16, 2022 15:47
Remove WooCommerce Settings tab
<?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 July 16, 2022 15:33
Remove tab from Product Data area of Edit Product page
<?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
Last active April 24, 2023 09:53
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/
<?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.2
*/
@damiencarbery
damiencarbery / dcwd-custom-block-styles.css
Last active August 17, 2022 10:02
Add custom block styles - Easily enhance the block editor with custom block styles. https://www.damiencarbery.com/2022/04/add-custom-block-styles/
/* 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 January 26, 2022 14:14
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/
<?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 January 3, 2022 19:51
Adjust how Genesis search results are displayed
<?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-norwegian.php
Last active January 14, 2023 20:55
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/
<?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.3
*/