Browse: Home / Functions /

learndash_get_quiz_primary_shared

learndash_get_quiz_primary_shared( int $quiz_pro_id,  boolean $set_first = true )

Gets the primary quiz post ID from a pro quiz ID.


Description #

This function accepts a list of Quiz posts. It is assumed quiz posts all share the same ProQuiz Quiz ID. This function will determine which is the ‘primary’ quiz post. If one is not found the first in the array will be set as the primary.


Parameters #

$quiz_pro_id

(int) (Optional) The ProQuiz Quiz ID. Default 0.

$set_first

(boolean) (Optional) If true will take first quiz post found and used as primary.

Default value: true


Return #

(int) The primary quiz post ID.


Source #

File: includes/quiz/ld-quiz-functions.php


Changelog #

Changelog
Version Description
2.6.0 Introduced.