This is dynamic data replacement for EDD wallet plugin which uses [edd_deposit]
shortcode called in post/page content.
define( 'TEST_EDD_DEPOSIT', '781e6e7d1d2735746aed85da550aac72' );
function test_dynamic_ob_test( &$cachedata ) {
ob_start();
do_shortcode( '[edd_deposit]' );
$text = ob_get_contents();
ob_end_clean();
return str_replace( TEST_EDD_DEPOSIT, $text, $cachedata );
}
add_cacheaction( 'wpsc_cachedata', 'test_dynamic_ob_test' );
function test_dynamic_ob_safety_test( $safety ) {
return 1;
}
add_cacheaction( 'wpsc_cachedata_safety', 'test_dynamic_ob_safety_test' );
Use the constant value 781e6e7d1d2735746aed85da550aac72
in your post/page content instead of shortcode [edd_deposit]
Note: The default shortcode definition of [edd_deposit]
uses Output buffer, you need remove_shortcode
and copy the same definition except the buffering part and add_shortcode
with same name edd_deposit
with new function definition.
Idea Source: