Last active
March 5, 2026 14:09
-
-
Save xlplugins/476ea8a8ddde50891541418b4d8d045a to your computer and use it in GitHub Desktop.
global order bump according to checkout id
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
| /** | |
| * Plugin Name: Order Bump - Show by Page ID | |
| * Description: Bump 1576 on page 10, bump 2910 on page 2906. | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; | |
| } | |
| add_filter( 'wfob_filter_final_bumps', function( $final_bumps, $posted_data ) { | |
| $page_id = 0; | |
| if ( function_exists( 'wc_get_page_id' ) && function_exists( 'is_checkout' )) { | |
| $page_id = wc_get_page_id( 'checkout' ); | |
| } | |
| $map = array( | |
| 4346 => 7076386, | |
| 7025804 => 7076112, | |
| ); | |
| if ( $page_id > 0 && isset( $map[ $page_id ] ) ) { | |
| $allowed = $map[ $page_id ]; | |
| return isset( $final_bumps[ $allowed ] ) ? array( $allowed => $allowed ) : array(); | |
| } | |
| return $final_bumps; | |
| }, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment