Skip to content

Instantly share code, notes, and snippets.

@alanef
Created July 23, 2022 10:09
Show Gist options
  • Select an option

  • Save alanef/494fc66f09361fcc70668a1b76ce7f40 to your computer and use it in GitHub Desktop.

Select an option

Save alanef/494fc66f09361fcc70668a1b76ce7f40 to your computer and use it in GitHub Desktop.
Display QPP payments by form as shortcode
/**
* 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