PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 8.0.5
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v8.0.5
8.0.5 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 All 47 releases
← All changes | integrations/jetengine/includes/functions.php +42 -0 7.9.2 → 8.0.5 View file →
@@ -1,0 +1,42 @@
1 +<?php
2 +/**
3 + * Functions
4 + *
5 + * @package GamiPress\JetEngine\Functions
6 + * @since 1.0.0
7 + */
8 +// Exit if accessed directly
9 +if( !defined( 'ABSPATH' ) ) exit;
10 +
11 +/**
12 + * Check JetEngine post type
13 + *
14 + * @since 1.0.0
15 + *
16 + * @param object $post Post data
17 + *
18 + * @return bool
19 + */
20 +function gamipress_jetengine_check_type( $post ) {
21 +
22 + $array_types = array();
23 +
24 + if( ! class_exists( 'Jet_Engine_CPT' ) ) {
25 + return false;
26 + }
27 +
28 + // Get JetEngine post types
29 + $post_types_obj = jet_engine()->cpt;
30 + $post_types = $post_types_obj->get_items();
31 +
32 + foreach( $post_types as $post_type ) {
33 + $array_types[] = $post_type['slug'];
34 + }
35 +
36 + // Bail if the post is not a JetEngine type
37 + if ( !in_array( $post->post_type, $array_types ) ){
38 + return false;
39 + }
40 +
41 + return true;
42 +}