Archives: Snippets
Territory Rulebook Chatbot GPT
Change Combined Date Format | Display Eventbrite Events
add_filter( ‘wfea_combined_date_time_date_format’, function ( $format ) { return ‘F j,Y @ H:i’; } , 999 );Continue reading
Automatically Delete Woocommerce Images After Deleting a Product
// Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, ‘delete_product_images’, 10, 1 ); function delete_product_images( $post_id ) { $product = wc_get_product( $post_id ); if ( !$product ) { return; } $featured_image_id = $product->get_image_id(); $image_galleries_id = $product->get_gallery_image_ids(); if( !empty(…Continue reading
Untitled Snippet
Tasty Pins – Remove the Pin button for an image by URL
(function(callback) { if (document.readyState !== “loading”) { callback(); } else { document.addEventListener(“DOMContentLoaded”, callback); } })(() => { let tp_exclusions = document.querySelectorAll(‘img[src=”https://example.com/wp-content/uploads/2023/12/logo.png”]’); if ( tp_exclusions.length === 0 ) { return; } for( const tp_exclusion of tp_exclusions ) { tp_exclusion.dataset.pinNopin = ‘nopin’;…Continue reading
Display WPForm Entries
/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading
How to Disable Comments on Event Posts? | Quick Event Manager
add_filter(‘comments_open’, function ($open, $post_id) { $post = get_post($post_id); if ($post->post_type == ‘event’) { return false; } return $open; }, 10, 2);Continue reading
Filter to change Custom Post Type settings | Quick Event Manager
add_filter( ‘qem_event_register’, /** * @param $args https://developer.wordpress.org/reference/functions/register_post_type/#parameters * * @return array */ function ( $args ) { $args[‘rewrite’] = array( ‘slug’ => ‘my_custom_event_slug’ ); return $args; }, 10, 1 );Continue reading
Filter to send admin confirms | Quick Event Manager
add_filter( /** * * Filter the decision to send an admin confirmation or not * * @param $bool * * @return bool overrides any logic if set to true, if set to false then standard rules apply */ ‘qem_registration_always_confirm_admin’, function…Continue reading