PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 8.0.3
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v8.0.3
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 7.8.6 All 45 releases
← All changes | integrations/surecart/includes/scripts.php +43 -0 7.9.28.0.3 View file →
@@ -1,0 +1,43 @@
1 +<?php
2 +/**
3 + * Scripts
4 + *
5 + * @package GamiPress\SureCart\Scripts
6 + * @since 1.0.0
7 + */
8 +// Exit if accessed directly
9 +if( !defined( 'ABSPATH' ) ) exit;
10 +
11 +/**
12 + * Register admin scripts
13 + *
14 + * @since 1.0.0
15 + * @return void
16 + */
17 +function gamipress_surecart_admin_register_scripts() {
18 +
19 + // Use minified libraries if SCRIPT_DEBUG is turned off
20 + $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
21 +
22 + // Scripts
23 + wp_register_script( 'gamipress-surecart-admin-js', GAMIPRESS_SURECART_URL . 'assets/js/gamipress-surecart-admin' . $suffix . '.js', array( 'jquery' ), GAMIPRESS_SURECART_VER, true );
24 +
25 +}
26 +add_action( 'admin_init', 'gamipress_surecart_admin_register_scripts' );
27 +
28 +/**
29 + * Enqueue admin scripts
30 + *
31 + * @since 1.0.0
32 + * @return void
33 + */
34 +function gamipress_surecart_admin_enqueue_scripts( $hook ) {
35 +
36 + global $post_type;
37 +
38 + // Requirements ui script
39 + if ( $post_type === 'points-type' || in_array( $post_type, gamipress_get_achievement_types_slugs() ) || in_array( $post_type, gamipress_get_rank_types_slugs() ) ) {
40 + wp_enqueue_script( 'gamipress-surecart-admin-js' );
41 + }
42 +}
43 +add_action( 'admin_enqueue_scripts', 'gamipress_surecart_admin_enqueue_scripts', 100 );