Created
March 10, 2026 14:37
-
-
Save xlplugins/e5531a6be73cf505ed69a96df54588b0 to your computer and use it in GitHub Desktop.
lebagol theme global checkout conflict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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