PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 8.0.2
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v8.0.2
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 7.8.5 All 44 releases
gamipress / integrations / jetengine / includes / functions.php

functions.php in GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI 8.0.2, at integrations/jetengine/includes/functions.php

42 lines 845 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 }