PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 7.9.8
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v7.9.8
8.0.4 8.0.3 8.0.1 8.0.2 8.0.0 7.9.9.7 7.9.9.6 7.9.9.5 7.9.9.4 7.9.9.3 7.9.9.2 7.9.9.1 7.9.9 7.9.8 7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 7.9.0 7.8.9 7.8.8 7.8.7 All 46 releases
gamipress / integrations / easy-digital-downloads / includes / admin.php

admin.php in GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI 7.9.8, at integrations/easy-digital-downloads/includes/admin.php

76 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin
4 *
5 * @package GamiPress\Easy_Digital_Downloads\Admin
6 * @since 1.0.0
7 */
8 // Exit if accessed directly
9 if( !defined( 'ABSPATH' ) ) exit;
10
11 require_once GAMIPRESS_EDD_DIR . 'includes/admin/recount-activity.php';
12
13 function gamipress_edd_meta_boxes() {
14
15 // Start with an underscore to hide fields from custom fields list
16 $prefix = '_gamipress_edd_';
17
18 // Grab our points types as an array
19 $points_types_options = array(
20 '' => 'Default'
21 );
22
23 foreach( gamipress_get_points_types() as $slug => $data ) {
24 $points_types_options[$slug] = $data['plural_name'];
25 }
26
27 // Download Points
28 new_cmb2_box(array(
29 'id' => 'gamipress-edd-download-points',
30 'title' => __( 'Award points', 'gamipress' ),
31 'object_types' => array( 'download' ),
32 'context' => 'side',
33 'priority' => 'default',
34 'fields' => apply_filters( 'gamipress_edd_download_points_defaults_meta_box_fields', array(
35 array(
36 'name' => __( 'Award points to users that purchase this download?', 'gamipress' ),
37 'desc' => '',
38 'id' => $prefix . 'award_points',
39 'type' => 'checkbox',
40 'classes' => 'gamipress-switch',
41 ),
42 array(
43 'name' => __( 'Points', 'gamipress' ),
44 'desc' => ' '.__( 'Points awarded for purchasing this download.', 'gamipress' ),
45 'id' => $prefix . 'points',
46 'type' => 'text_small',
47 ),
48 array(
49 'name' => __( 'Points Type', 'gamipress' ),
50 'desc' => ' '.__( 'Points type to award for purchasing this download.', 'gamipress' ),
51 'id' => $prefix . 'points_type',
52 'type' => 'select',
53 'options' => $points_types_options
54 ),
55 ), $prefix )
56 ));
57
58 }
59 add_action( 'cmb2_admin_init', 'gamipress_edd_meta_boxes' );
60
61 /**
62 * Easy Digital Downloads automatic updates
63 *
64 * @since 1.0.1
65 *
66 * @param array $automatic_updates_plugins
67 *
68 * @return array
69 */
70 function gamipress_edd_automatic_updates( $automatic_updates_plugins ) {
71
72 $automatic_updates_plugins['gamipress'] = __( 'Easy Digital Downloads integration', 'gamipress' );
73
74 return $automatic_updates_plugins;
75 }
76 add_filter( 'gamipress_automatic_updates_plugins', 'gamipress_edd_automatic_updates' );