LLMS_Question::get_quizzes()

Retrieve quizzes this quiz is assigned to


Description Description


Return Return

(array) array of WP_Post IDs (quiz post types)


Top ↑

Source Source

File: includes/models/model.llms.question.php

	public function get_quizzes() {

		$id = absint( $this->get( 'id' ) );
		$len = strlen( strval( $id ) );

		$str_like = '%' . sprintf( 's:2:"id";s:%1$d:"%2$s";', $len, $id ) . '%';
		$int_like = '%' . sprintf( 's:2:"id";i:%1$s;', $id ) . '%';

		global $wpdb;
		$query = $wpdb->get_col(
			"SELECT post_id
			 FROM {$wpdb->postmeta}
			 WHERE meta_key = '_llms_questions'
			   AND (
			   	      meta_value LIKE '{$str_like}'
			   	   OR meta_value LIKE '{$int_like}'
			   );"
		);

		return $query;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.12.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.





Permalink: