Changeset 885568 – WordPress Plugin Repository (original) (raw)
Timestamp:
04/01/2014 11:29:09 AM (12 years ago)
aniketpant
Message:
Add shortcode
File:
Legend:
Unmodified
Added
Removed
| r883557 | r885568 | |
|---|---|---|
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | add_shortcode('instamojo', 'instamojo_button'); | |
| 8 | ||
| 9 | function instamojo_button($attributes, $content = null) | |
| 10 | { | |
| 11 | extract(shortcode_atts(array( | |
| 12 | 'offer' => null, | |
| 13 | 'style' => 'none', | |
| 14 | 'text' => 'Checkout with Instamojo' | |
| 15 | ), $attributes)); | |
| 16 | ||
| 17 | $instamojo_credentials = get_option('instamojo_credentials'); | |
| 18 | ||
| 19 | wp_register_script('widgetjs', 'https://d2xwmjc4uy2hr5.cloudfront.net/im-embed/im-embed.min.js', 'jquery', null, true); | |
| 20 | wp_enqueue_script('widgetjs'); | |
| 21 | ||
| 22 | if ($offer) | |
| 23 | { | |
| 24 | return ''; | |
| 25 | } | |
| 26 | } | |
| 27 | ||
| 7 | 28 | ?> |
Note: See TracChangeset for help on using the changeset viewer.