Created
July 23, 2022 10:09
-
-
Save alanef/494fc66f09361fcc70668a1b76ce7f40 to your computer and use it in GitHub Desktop.
Display QPP payments by form as shortcode
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
| /** | |
| * Example of how to get payment records from QPP in a simple shortcode [qpp_demo_payments form='name']. | |
| * Note this will not work after version 6 where CPTs will be used | |
| */ | |
| add_shortcode( 'qpp_demo_payments', function ( $atts ) { | |
| $atts = shortcode_atts( | |
| array( | |
| 'form' => '', | |
| ), $atts ); | |
| $payments = get_option( 'qpp_messages' . $atts['form'] ); | |
| return '<pre>' . print_r( $payments, true ) . '</pre>'; | |
| } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment