Skip to content

Instantly share code, notes, and snippets.

@pentatonicfunk
Last active February 23, 2023 02:46
Show Gist options
  • Save pentatonicfunk/183f6296532d3f420b3100e6a58896f6 to your computer and use it in GitHub Desktop.
Save pentatonicfunk/183f6296532d3f420b3100e6a58896f6 to your computer and use it in GitHub Desktop.

Description

Add one or more entries to existing quiz.

Parameters

$quiz_id int
The ID of the quiz.
$entry_metas array
Array of entry.

Return

int[]|WP_Error Array of entry id on success otherwise WP_Error.

Usage

Forminator_API::add_quiz_entries( $quiz_id, $entry_metas );

Example

$quiz_id = 7;
$entry_metas = array(
	array(
		'name'  => 'text-1',
		'value' => 'Text Input Value',
	),
	array(
		'name'  => 'text-1',
		'value' => 'Text Input Value',
	),
);
Forminator_API::add_quiz_entries( $quiz_id, $entry_metas );

Source

File: /library/class-api.php

Description

Add one or more entries to existing quiz.

Parameters

$quiz_id int
The ID of the quiz.
$entry_metas array
Array of entry.

Return

int[]|WP_Error Array of entry id on success otherwise WP_Error.

Usage

Forminator_API::add_quiz_entries( $quiz_id, $entry_metas );

Example

$quiz_id = 7;
$entry_metas = array(
	array(
		'name'  => 'text-1',
		'value' => 'Text Input Value',
	),
	array(
		'name'  => 'text-1',
		'value' => 'Text Input Value',
	),
);
Forminator_API::add_quiz_entries( $quiz_id, $entry_metas );

Source

File: /library/class-api.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment