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 ) { // Gather Customer data. // @link https://docs.stripe.com/api/customers/object $customer = $payment_confirmation_data[‘customer’]; //…Continue reading

Exclude a Specific Term from the Sitemap

add_filter( ‘aioseo_sitemap_exclude_terms’, ‘aioseo_sitemap_filter_excluded_terms’, 10, 2 ); function aioseo_sitemap_filter_excluded_terms( $ids, $type ) { if ( ‘general’ === $type ) { $ids[] = 412; } return $ids; }Continue reading

Exclude a Specific Post from the Sitemap

add_filter( ‘aioseo_sitemap_exclude_posts’, ‘aioseo_sitemap_filter_excluded_posts’, 10, 2 ); function aioseo_sitemap_filter_excluded_posts( $ids, $type ) { if ( ‘general’ === $type ) { $ids[] = 614; } return $ids; }Continue reading

Append a Page to the Additional Pages Sitemap

add_filter( ‘aioseo_sitemap_additional_pages’, ‘aioseo_sitemap_add_additional_pages’ ); function aioseo_sitemap_add_additional_pages( $pages ) { $pages[] = [ ‘loc’ => ‘https://example.com/additional-page’, ‘lastmod’ => ‘2020-12-11 11:11’, ‘changefreq’ => ‘always’, ‘priority’ => (float) 1.0 ]; return $pages; }Continue reading

Dynamically Add Article Schema to Posts

add_filter( ‘aioseo_schema_graphs’, ‘aioseo_filter_schema_graphs’ ); function aioseo_filter_schema_graphs( $graphs ) { if ( is_singular( ‘post’ ) && ! in_array( ‘Article’, $graphs, true ) ) { $graphs[] = ‘Article’; } return $graphs; }Continue reading

Disable Schema Output for WooCommerce products

add_filter( ‘aioseo_schema_disable’, ‘aioseo_disable_schema_products’ ); function aioseo_disable_schema_products( $disabled ) { if ( is_singular( ‘product’ ) && aioseo()->helpers->isWooCommerceActive() ) { return true; } return $disabled; }Continue reading