This page is still under development and documentation is still being created.
// add a custom tab to the question settings
function hdq_add_custom_tabs_to_quiz($tabs)
{
$tab = array();
$tab["slug"] = "custom-slug";
$tab["title"] = "Tab Title";
array_push($tabs, $tab);
return $tabs;
}
add_filter('hdq_add_question_tab', 'hdq_add_custom_tabs_to_quiz', 1);
// add custom meta to questions
function hdq_add_custom_fields_to_quiz($fields)
{
// slug of the tab you want to add the field to
$tab = "custom-slug";
// Set the tab (used in case this is a non default tab)
if (!isset($fields[$tab]) || !is_array($fields[$tab])) {
$fields[$tab] = array();
}
// set field settings
$field = array();
$field["name"] = "test"; // should be slug format and unique
$field["label"] = "Hello world";
$field["type"] = "text";
$field["placeholder"] = "enter something";
$field["required"] = true;
array_push($fields[$tab], $field);
return $fields;
}
add_filter('hdq_add_question_meta', 'hdq_add_custom_fields_to_quiz', 1);