Created
April 18, 2017 18:58
-
-
Save gabrielmerovingi/6d290c86f1235f1123a731f7dd8264ea to your computer and use it in GitHub Desktop.
Add a custom scratch card template from your plugin.
This file contains 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
/** | |
* Add Custom Scratch Card Template | |
* @since 1.0 | |
* @version 1.0 | |
*/ | |
function mycred_add_custom_scratch_card_template( $templates ) { | |
$templates['mytemplate'] = array( | |
'label' => 'My Custom Template', | |
'minimum_scratch' => 75, | |
'brush_diameter' => 15, | |
'card_width' => 300, | |
'card_height' => 400, | |
'coin_image' => plugins_url( 'images/card/coin.png', __FILE__ ), | |
'cover_image' => plugins_url( 'images/card/cover-image.png', __FILE__ ), | |
'buy_log' => '', // optional | |
'win_log' => '', // optional | |
'win_message' => '', // optional | |
'setup' => array( | |
array( | |
'number' => 100, | |
'value' => 0, | |
'attachment_ids' => array( | |
plugins_url( '/images/card/nowin.png', __FILE__ ) | |
) | |
), | |
array( | |
'number' => 10, | |
'value' => 10, | |
'attachment_ids' => array( | |
plugins_url( '/images/card/10points.png', __FILE__ ) | |
) | |
) | |
) | |
); | |
return $templates; | |
} | |
add_filter( 'mycred_scratch_card_templates', 'mycred_add_custom_scratch_card_template' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment