Untitled Snippet

jQuery(“.elementor-search-form__submit”).click(function(){ var search_keyword = jQuery(“input[class=’elementor-search-form__input’]”).attr(‘value’); } // Make the request to the ChatGPT 3.5 Turbo model (replace with your own implementation) jQuery.ajax({ url: ’80nq7y2YnI1hikzzB52KT3BlbkFJ916qLHptkxZcRoUShGGA’, type: ‘POST’, data: { search_query: search_keyword }, success: function(response) { // Handle the response from the…Continue reading

Display the Last Updated Date

$u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); // Only display modified date if 24hrs have passed since the post was published. if ( $u_modified_time >= $u_time + 86400 ) { $updated_date = get_the_modified_time( ‘F jS, Y’ );…Continue reading

TOC before first heading

/** * TOC After First Heading */ function cwp_toc_after_first_heading( $output, $block ) { if ( ‘core/heading’ !== $block[‘blockName’] ) { return $output; } global $wp_query; if ( ! $wp_query->in_the_loop ) { return $output; } // Only run once. remove_filter( ‘render_block’,…Continue reading

CWP – MailChimp RSS email ID

/** * RSS feed, add MailChimp email query string */ function cwp_rss_mailchimp_email( $url ) { return add_query_arg( ‘adt_ei’, ‘*|EMAIL|*’, $url ); } add_filter( ‘the_permalink_rss’, ‘cwp_rss_mailchimp_email’ );Continue reading

CWP – ConvertKit RSS email ID

/** * RSS feed, add ConvertKit email query string (Part 1) */ function cwp_rss_convertkit_email( $url ) { return add_query_arg( ‘adt_ei’, ‘subscriber.email_address’, $url ); } add_filter( ‘the_permalink_rss’, ‘cwp_rss_convertkit_email’ ); /** * Modify ConvertKit email string (Part 2) * esc_url will remove…Continue reading

Disable Automatic Updates Emails (copy)

// Disable auto-update emails. add_filter( ‘auto_core_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for plugins. add_filter( ‘auto_plugin_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for themes. add_filter( ‘auto_theme_update_send_email’, ‘__return_false’ );Continue reading

Disable Automatic Updates Emails (copy)

// Disable auto-update emails. add_filter( ‘auto_core_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for plugins. add_filter( ‘auto_plugin_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for themes. add_filter( ‘auto_theme_update_send_email’, ‘__return_false’ );Continue reading

Convert Customers to Users

function eddccu_add_tools_tab( $tabs ) { $tabs[‘eddccu_customers’] = __( ‘Customers’, ‘edd-convert-customers-to-users’ ); return $tabs; } add_filter( ‘edd_tools_tabs’, ‘eddccu_add_tools_tab’ ); /** * Display the Customers tab content in Downloads > Tools */ function eddccu_display_tools_tab() { if ( !current_user_can( ‘manage_shop_settings’ ) ) {…Continue reading

Removing Fields from WooCommerce Checkout

function g9_remove_woocommerce_checkout_fields($fields) { // Remove billing fields unset($fields[‘billing’][‘billing_first_name’]); unset($fields[‘billing’][‘billing_last_name’]); unset($fields[‘billing’][‘billing_company’]); unset($fields[‘billing’][‘billing_address_1’]); unset($fields[‘billing’][‘billing_address_2’]); unset($fields[‘billing’][‘billing_city’]); unset($fields[‘billing’][‘billing_postcode’]); unset($fields[‘billing’][‘billing_country’]); unset($fields[‘billing’][‘billing_state’]); unset($fields[‘billing’][‘billing_phone’]); unset($fields[‘billing’][‘billing_email’]); // Remove shipping fields unset($fields[‘shipping’][‘shipping_first_name’]); unset($fields[‘shipping’][‘shipping_last_name’]); unset($fields[‘shipping’][‘shipping_company’]); unset($fields[‘shipping’][‘shipping_address_1’]); unset($fields[‘shipping’][‘shipping_address_2’]); unset($fields[‘shipping’][‘shipping_city’]); unset($fields[‘shipping’][‘shipping_postcode’]); unset($fields[‘shipping’][‘shipping_country’]); unset($fields[‘shipping’][‘shipping_state’]); // Remove order comment fields unset($fields[‘order’][‘order_comments’]); return $fields; }…Continue reading