function form($instance) { $this->store_data = $instance; $custom_fields = array(); foreach ($this->custom_fields as $field) { $tmp_field = clone $field; $tmp_field->load(); $field_id = $this->get_field_id($tmp_field->get_name()); $field_name = $this->get_field_name($tmp_field->get_name()); $tmp_field->set_name($field_name); $custom_fields[] = $tmp_field; } Resume_Container::factory('widget', $this->id)->add_fields($custom_fields)->init(); }
function rb_register_resume_meta_boxes() { Resume_Container::factory('custom_fields', __('Resume Builder'))->show_on_post_type('rb_resume')->add_fields(array(Resume_Field::factory('separator', 'rb_resume_shortcode_title', __('Resume Shortcodes', 'resume-builder')), Resume_Field::factory('html', 'rb_resume_shortcode')->set_html(rb_get_resume_shortcode_help_text()), Resume_Field::factory('separator', 'rb_resume_sections_title', __('The Resume Builder', 'resume-builder')), Resume_Field::factory('complex', 'rb_resume_sections', __('Resume Sections', 'resume-builder'))->setup_labels(array('singular_name' => __('Resume Section', 'resume-builder'), 'plural_name' => __('Resume Sections', 'resume-builder')))->add_fields('introduction_block', array(Resume_Field::factory('text', 'sectiontitle', __('Introduction Title', 'resume-builder')), Resume_Field::factory('text', 'sectionsubtitle', __('Introduction Subtitle', 'resume-builder')), Resume_Field::factory('attachment', 'sectionimage', __('Introduction Image', 'resume-builder'))->help_text(__('The image should be sized to 237 x 303 pixels.', 'resume-builder')), Resume_Field::factory('rich_text', 'sectiontext', __('Introduction Text', 'resume-builder')), Resume_Field::factory('complex', 'sectionbuttons', __('Introduction Buttons', 'resume-builder'))->setup_labels(array('singular_name' => __('Button', 'resume-builder'), 'plural_name' => __('Buttons', 'resume-builder')))->add_fields(array(Resume_Field::factory('text', 'label', __('Button Label', 'resume-builder'))->set_required(true), Resume_Field::factory('text', 'link', __('Button Link', 'resume-builder'))->set_required(true), Resume_Field::factory('select', 'type', __('Button Style', 'resume-builder'))->set_required(true)->add_options(array('filled' => __('Filled', 'resume-builder'), 'open' => __('Open', 'resume-builder')))))))->add_fields('default_block', array(Resume_Field::factory('text', 'sectiontitle', __('Section Title', 'resume-builder')), Resume_Field::factory('complex', 'sectioncontent', __('Section Content', 'resume-builder'))->setup_labels(array('singular_name' => __('Subsection', 'resume-builder'), 'plural_name' => __('Subsections', 'resume-builder')))->add_fields('text_block', array(Resume_Field::factory('rich_text', 'text', __('Text', 'resume-builder'))->set_required(true)))->add_fields('detailed_row', array(Resume_Field::factory('text', 'rowtitle', __('Row Title', 'resume-builder')), Resume_Field::factory('text', 'rowsubtitle', __('Row Subtitle', 'resume-builder')), Resume_Field::factory('text', 'rowsidetext', __('Row Side Text', 'resume-builder')), Resume_Field::factory('rich_text', 'rowtext', __('Row Text', 'resume-builder')))))), Resume_Field::factory('separator', 'rb_resume_widget', __('Resume Widgets', 'resume-builder')), Resume_Field::factory('text', 'rb_resume_widget_contacts_title', __('Contact Info Title', 'resume-builder')), Resume_Field::factory('text', 'rb_resume_widget_contacts_email', __('Email', 'resume-builder')), Resume_Field::factory('text', 'rb_resume_widget_contacts_phone', __('Phone', 'resume-builder')), Resume_Field::factory('text', 'rb_resume_widget_contacts_website', __('Website', 'resume-builder')), Resume_Field::factory('text', 'rb_resume_widget_contacts_address', __('Address', 'resume-builder')), Resume_Field::factory('text', 'rb_resume_widget_skills_title', __('Skills Title', 'resume-builder')), Resume_Field::factory('complex', 'rb_resume_widget_skills', __('Skills', 'resume-builder'))->setup_labels(array('singular_name' => __('Skill', 'resume-builder'), 'plural_name' => __('Skills', 'resume-builder')))->add_fields(array(Resume_Field::factory('text', 'title', __('Title', 'resume-builder')), Resume_Field::factory('select', 'rating', __('Star Rating', 'resume-builder'))->add_options(rb_generate_rating()), Resume_Field::factory('textarea', 'text', __('Description', 'resume-builder')))))); }