documentation before changing these settings.', 'ai-writing-assistant'); ?>
' . __("DALL-E", "ai-writing-assistant") .'.', 'ai-writing-assistant'); ?>
';
$html .= '';
$html .= '';
$html .= '';
$html .= '';
if ($echo){
echo $html;
}
else{
return $html;
}
}
function aiwa_category_selectbox($id="exportable-cat", $selectedCat="", $echo=true, $isDisabled=false){
ob_start();
$disabled = $isDisabled ? "disabled" : "";
aiwa_get_terms_hierarchical($id, $selectedCat, $disabled);
if ($echo){
echo ob_get_clean();
}
else{
return ob_get_clean();
}
}
function aiwa_get_terms_hierarchical($id="aiwa-single-category", $selectedCat="", $disabled=false) {
$terms = get_terms('category', array( 'hide_empty' => false, 'parent'=> 0));
//get_term_link($term->slug, 'species')
if (!empty($terms)) {
echo '';
}
}
function aiwa_get_terms_data_with_hierarchical($terms, $level = 1, $selectedCat=""){
$dash = "";
for ($i=1; $i < $level; $i++){
$dash .= "-";
}
if (!empty($terms)) {
foreach ($terms as $key => $term) {
printf( '',
esc_attr( $term->term_id ),
esc_html( $term->name )
);
$child_cats = get_terms('category', array( 'hide_empty' => false, 'parent'=> $term->term_id));
if (!empty($child_cats)) {
aiwa_get_terms_data_with_hierarchical($child_cats, $level+1, $selectedCat);
}
}
}
}