PluginProbe
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI / 6.0.0
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI v6.0.0
6.0.3 6.0.2 6.0.1 6.0.0 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.7.9.2 5.7.9.1 5.7.8 5.7.9 5.7.6 5.7.7 5.7.5 5.7.4 5.7.3 5.7.2 5.7.1 trunk 5.6.0 5.6.1 All 34 releases
automatorwp / integrations / qsm / includes / functions.php

functions.php in AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI 6.0.0, at integrations/qsm/includes/functions.php

44 lines 863 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 AutomatorWP\QSM\Functions
6 * @since 1.0.0
7 */
8 // Exit if accessed directly
9 if( !defined( 'ABSPATH' ) ) exit;
10
11 /**
12 * Get the quiz post ID
13 *
14 * @since 1.0.0
15 *
16 * @param int $quiz_id
17 *
18 * @return int
19 */
20 function automatorwp_qsm_get_quiz_post_id( $quiz_id ) {
21
22 // False if no quiz ID provided
23 if( !isset( $quiz_id ) ) {
24 return false;
25 }
26
27 $post_id = get_posts( array(
28 'posts_per_page' => 1,
29 'post_type' => 'qsm_quiz',
30 'post_status' => array( 'publish' ),
31 'fields' => 'ids',
32 'meta_query' => array(
33 array(
34 'key' => 'quiz_id',
35 'value' => $quiz_id,
36 'compare' => '=',
37 ),
38 ),
39 ) );
40
41 return $post_id;
42
43 }
44