This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Replace GF {admin_email} tag with website email | |
| add_filter( 'gform_notification', 'bww_change_from_email', 10, 3 ); | |
| function bww_change_from_email( $notification, $form, $entry ) { | |
| // Get the site's domain dynamically | |
| $site_url = parse_url( get_site_url(), PHP_URL_HOST ); | |
| $custom_admin_email = 'website@' . $site_url; | |
| // Check if the notification 'from' email is using {admin_email} | |
| if ( isset( $notification['from'] ) && $notification['from'] === '{admin_email}' ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'admin_bar_menu', function( $wp_admin_bar ) { | |
| if ( is_object( $wp_admin_bar ) && $wp_admin_bar->get_node( 'woocommerce-site-visibility-badge' ) ) { | |
| $wp_admin_bar->remove_node( 'woocommerce-site-visibility-badge' ); | |
| } | |
| }, 100 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: BWW - Event Status Updater | |
| Description: Automatically updates event status from Upcoming to Past based on the event end datetime. Verifies Action Scheduler functionality is available. | |
| Version: 2024.03 | |
| Plugin URI: https://brilliantly.net | |
| Author: Brilliant Web Works, Inc. | |
| Author URI: https://brilliantly.net | |
| License: GPL2 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'kadence_blocks_pro_posts_grid_query_args', 'sort_by_date_post_grid_order',10, 2 ); | |
| function sort_by_date_post_grid_order( $args, $attributes ) { | |
| if ( 'POST_TYPE_SLUG_HERE' === $args['post_type'] && isset($attributes['className']) && strpos($attributes['className'], 'BLOCK_CLASS_HERE') !== false ) { | |
| $args['meta_key'] = 'start_date'; | |
| $args['orderby'] = 'meta_value'; | |
| $args['order'] = 'ASC'; | |
| } | |
| return $args; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Custom Security Functions | |
| Plugin URI: https://nathaningram.com | |
| Description: Security Hardening for Core WordPress | |
| Version: 2023.11 | |
| Author: Nathan Ingram | |
| Author URI: https://nathaningram.com | |
| License: GPL2 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ADD SKUS | |
| // Runs on update - use Quick Edit | |
| function ni_append_sku_to_short_description($post_id) { | |
| if ('product' !== get_post_type($post_id)) { | |
| return; | |
| } | |
| $product = wc_get_product($post_id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Removes empty lines in Woo Product Long + Short Descr when 2 or more occur together | |
| // Removes empty spaces at beginning or end of descriptions | |
| // Fires on Post Update (works with Quick Edit) | |
| add_action('save_post_product', 'ni_clean_up_product_content', 10, 3); | |
| function ni_clean_up_product_content($post_ID, $post, $update) { | |
| // Check if it's an update | |
| if ($update) { | |
| // Get the content and short description |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* looped archive pages align elements */ | |
| .custom-archive-loop-item {display: flex; flex-direction: column; background-color:#fff;} | |
| .custom-archive-loop-item .kb-row-layout-wrap {flex: 1; display: flex; flex-direction: column;} | |
| .custom-archive-loop-item .wp-block-kadence-accordion, .custom-archive-loop-item .wp-block-kadence-advancedbtn {margin-top: auto;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function find_next_third_tuesday() { | |
| $date = new DateTime(); | |
| $date->modify('first day of this month'); | |
| while ($date->format('D') != 'Tue') { | |
| $date->modify('next day'); | |
| } | |
| $date->modify('+2 weeks'); | |
| if($date < new DateTime()) { | |
| $date->modify('first day of next month'); | |
| while ($date->format('D') != 'Tue') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sanitizes HMTL from Woocommerce Product Descriptions upon post Update | |
| function sanitize_product_description( $post_id ) { | |
| // check if post is a product | |
| if ( 'product' === get_post_type( $post_id ) ) { | |
| // get the post object | |
| $product = wc_get_product( $post_id ); | |
| // sanitize the descriptions | |
| foreach ( ['description', 'short_description'] as $desc_type ) { |