';
foreach($custom_page->fields as $field){
$required=isset($field['required'])?'required':'notrequired';
$html.='
';
switch($field['id']){
case 'title':
$html.=$post->post_title;
break;
case 'content':
$html.=$post->post_content;
break;
default:
$html.=get_post_meta($post->ID, $prefix.$field['id'], true);
break;
}
$html.='
';
}
$html.='
';
return $html;
}
/**
* Returns the HTML that is before each item custom section.
* @param $title the title of the item
*/
public function get_before_custom_section($title){
$html= '
';
return $html;
}
/**
* Returns the HTML that is after each item custom section.
*/
public function get_after_custom_section(){
return '
';
}
/**
* Builds the template for a custom page form with all the input fields needed.
* @param $title the title of the form
* @param $category the category that corresponds to the current instance (each instance represents a different category)
* @param $custom_page a custom page object that represents the custom page
* @param $prefix the prefix of the fields in the form
*/
public function get_custom_page_form_template($title, $category, $custom_page, $prefix){
$html='';
return $html;
}
}