Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Created March 10, 2026 14:37
Show Gist options
  • Select an option

  • Save xlplugins/e5531a6be73cf505ed69a96df54588b0 to your computer and use it in GitHub Desktop.

Select an option

Save xlplugins/e5531a6be73cf505ed69a96df54588b0 to your computer and use it in GitHub Desktop.
lebagol theme global checkout conflict
/**
* FunnelKit checkout: replace post in theme loop so FunnelKit checkout content is used.
* When template is "theme", page.php runs have_posts/the_post with the default WooCommerce checkout page.
* This replaces $post with the FunnelKit checkout post so the_content() outputs the correct form.
*/
add_action( 'lebagol_page', function() {
if ( ! function_exists( 'is_checkout' ) || ! is_checkout() ) {
return;
}
if ( ! class_exists( 'WFACP_Common' ) ) {
return;
}
$checkout_page_id = WFACP_Common::get_id();
if ( absint( $checkout_page_id ) <= 0 ) {
return;
}
global $post;
if ( $post && (int) $post->ID === (int) $checkout_page_id ) {
return;
}
$checkout_post = get_post( $checkout_page_id );
if ( ! $checkout_post instanceof WP_Post || 'publish' !== $checkout_post->post_status ) {
return;
}
$post = $checkout_post;
setup_postdata( $post );
}, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment