Created
April 18, 2017 18:54
-
-
Save gabrielmerovingi/a1470b22e9cbc020f5e068b7c5401b27 to your computer and use it in GitHub Desktop.
Add a custom scratch card template from your theme.
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' => get_template_directory_uri() . '/images/card/coin.png', | |
'cover_image' => get_template_directory_uri() . '/images/card/cover-image.png', | |
'buy_log' => '', // optional | |
'win_log' => '', // optional | |
'win_message' => '', // optional | |
'setup' => array( | |
array( | |
'number' => 100, | |
'value' => 0, | |
'attachment_ids' => array( | |
get_template_directory_uri() . '/images/card/nowin.png' | |
) | |
), | |
array( | |
'number' => 10, | |
'value' => 10, | |
'attachment_ids' => array( | |
get_template_directory_uri() . '/images/card/10points.png' | |
) | |
) | |
) | |
); | |
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