Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Plugin Name: Custom Scratch Card Templates
- * Description: Adds custom templates to the myCRED Scratch Card add-on.
- * Version: 1.0
- * Tags: mycred, scratch card, template
- * Author: Author Name
- * Author URI: http://www.authorswebsite.com
- * Requires at least: WP 3.8
- * Tested up to: WP 4.4.1
- * License: Copyrighted
- *
- * Copyright © 2016 Author Name
- *
- * Permission is hereby granted, to the licensed domain to install and run this
- * software and associated documentation files (the "Software") for an unlimited
- * time with the followning restrictions:
- *
- * - This software is only used under the domain name registered with the purchased
- * license though the myCRED website (mycred.me). Exception is given for localhost
- * installations or test enviroments.
- *
- * - This software can not be copied and installed on a website not licensed.
- *
- * - This software is supported only if no changes are made to the software files
- * or documentation. All support is voided as soon as any changes are made.
- *
- * - This software is not copied and re-sold under the current brand or any other
- * branding in any medium or format.
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
- define( 'CUSTOM_SCRATCH_TEMPLATE_VERSION', '1.0' );
- define( 'CUSTOM_SCRATCH_TEMPLATE', __FILE__ );
- /**
- * Add Templates
- * Note that values marked as "optional" must still be defined but left empty is not used.
- * @since 1.0
- * @version 1.0
- */
- if ( ! function_exists( 'mycredpro_add_custom_scratch_template' ) ) :
- function mycredpro_add_custom_scratch_template( $templates ) {
- $templates['my_template'] = array(
- 'label' => 'My Template Name',
- 'minimum_scratch' => 75,
- 'brush_diameter' => 15,
- 'card_width' => 300,
- 'card_height' => 400,
- 'cover_image' => plugins_url( 'templates/name/name-cover.png', CUSTOM_SCRATCH_TEMPLATE ),
- 'coin_image' => '', // optional
- 'buy_log' => '', // optional
- 'win_log' => '', // optional
- 'win_message' => '', // optional
- 'setup' => array(
- array(
- 'number' => 100,
- 'value' => 0,
- 'attachment_ids' => array(
- plugins_url( 'templates/name/name-nowin.png', CUSTOM_SCRATCH_TEMPLATE )
- )
- ),
- array(
- 'number' => 10,
- 'value' => 10,
- 'attachment_ids' => array(
- plugins_url( 'templates/name/name-win.png', CUSTOM_SCRATCH_TEMPLATE )
- )
- )
- )
- );
- return $templates;
- }
- endif;
- add_filter( 'mycred_scratch_card_templates', 'mycredpro_add_custom_scratch_template' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement