# automatorwp/6.0.1/integrations/qsm/includes/functions.php

AutomatorWP – No-Code Workflow Automation, Integration &amp; Webhooks Plugin, now with AI, version 6.0.1. 44 lines.

- Page: https://pluginprobe.com/plugins/automatorwp/6.0.1/code/integrations/qsm/includes/functions.php
- Raw: https://pluginprobe.com/plugins/automatorwp/6.0.1/raw/integrations/qsm/includes/functions.php
- Modified: 2026-09-02T08:56:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/automatorwp/6.0.1/code/integrations/qsm/includes/functions.php#L10-L20`.

```php
<?php
/**
 * Functions
 *
 * @package     AutomatorWP\QSM\Functions
 * @since       1.0.0
 */
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;

/**
 * Get the quiz post ID
 *
 * @since 1.0.0
 *
 * @param int $quiz_id
 *
 * @return int
 */
function automatorwp_qsm_get_quiz_post_id( $quiz_id ) {

    // False if no quiz ID provided
    if( !isset( $quiz_id ) ) {
        return false;
    }

    $post_id = get_posts( array(
        'posts_per_page' => 1,
        'post_type'      => 'qsm_quiz',
        'post_status'    => array( 'publish' ),
        'fields'         => 'ids',
        'meta_query'     => array(
            array(
                'key'     => 'quiz_id',
                'value'   => $quiz_id,
                'compare' => '=',
            ),
        ),
    ) );

    return $post_id;

}

```
