Add Image to Sitemap From an Image ACF Field

add_filter( ‘aioseo_sitemap_images’, ‘aioseo_filter_sitemap_images’, 10, 2 ); function aioseo_filter_sitemap_images( $images, $post ) { if ( ! function_exists( ‘get_field’ ) ) { return $images; } $customImage = get_field( ‘custom_image’, $post->ID ); if ( ! empty( $customImage ) ) { $images[] = wp_get_attachment_image_url(…Continue reading

Disable Gravatar Avatars

add_filter( ‘get_avatar’, function( $avatar, $id_or_email, $size, $default, $alt ) { return ”; // Return an empty string to disable the gravatar }, 10, 5 );Continue reading

Disable Categories and Tags

add_action(‘init’, function() { unregister_taxonomy_for_object_type(‘category’, ‘post’); unregister_taxonomy_for_object_type(‘post_tag’, ‘post’); });Continue reading

Template: After Order Actions

/* * Process non-critical tasks after an order has been completed. * * This runs ~30 seconds after a purchase is completed via WP_Cron. * * @param int $order_id The Order ID that was marked as completed. * @param \EDD\Orders\Order…Continue reading

WP Simple Pay: Google GA4 Payment Conversion Tracking

/** * @link https://library.wpcode.com/snippet/j57gxn45/ */ add_action( ‘simpay_payment_receipt_viewed’, /** * Runs the first time the payment confirmation page is viewed. * * @param array $payment_confirmation_data */ function( $payment_confirmation_data ) { // Payment customer data (not used in this example). $customer =…Continue reading