I have to post a content as html in bellow code you can see that div <div class='pbg_info'
i want post as html using $post->post_content="
and any other way
The div class ‘pbg_info’ is script of pay by group payment gateway to display the pay group button.
If anybody have any idea how achieve this then let me know.
$post->post_content="
<div class='pbg_info'
data-purchase-image-url='http://example.com/picture.png'
data-purchase-name='Awesome Escape'
data-purchase-inventory-id='ESCAPE-23'
data-purchase-cost='"<?php echo $price;" ?>'
data-purchase-currency='CAD'
data-purchase-link-url='http://example.com/property'
data-purchase-description='Great rental for 3 people with lake view.' >
</div>
<script src='https://cdn.paybygroup.com/snippet/v2/loader.js?merchant_id=example'>
</script>";
with this code i am getting a output like this. i am expecting a button to display here using this code.
data-purchase-image-url=âhttp://example.com/picture.pngâ
data-purchase-name=âAwesome Escapeâ
data-purchase-inventory-id=âESCAPE-23â²
data-purchase-cost=â100â²
data-purchase-currency=âCADâ
data-purchase-link-url=âhttp://example.com/propertyâ
data-purchase-description=âGreat rental for 3 people with lake view.â >
I think you have to filter that content before outputting, that means you have to use the code like below :