Example #1
0
 /**
  * Returns form fields in boxes in columns
  *
  * @return array $columns Array of form fields.
  */
 protected static function get_form_fields()
 {
     $pt_obj = get_post_type_object(ThemeMix_Featured_Content::$widget_instance['post_type']);
     $box = array('widget_title_link' => array('label' => __('Would you like to link the Widget title to a URL?', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => ''), 'widget_title_link_href' => array('label' => __('Link', 'thememix-pro-genesis'), 'description' => __('Please include the entire link.', 'thememix-pro-genesis'), 'type' => 'text', 'requires' => array('widget_title_link', '', true)));
     $box_1 = array('post_type' => array('label' => __('Content Type', 'thememix-pro-genesis'), 'description' => '', 'type' => 'post_type_select', 'requires' => ''), 'page_id' => array('label' => __('Page', 'thememix-pro-genesis'), 'description' => '', 'type' => 'page_select', 'requires' => array('post_type', 'page', false)), 'posts_term' => array('label' => __('Taxonomy and Terms', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select_taxonomy', 'requires' => array('post_type', 'page', true)), 'exclude_terms' => array('label' => sprintf(__('Exclude Terms by ID %s (comma separated list)', 'thememix-pro-genesis'), '<br />'), 'description' => '', 'type' => 'text', 'requires' => array('post_type', 'page', true)), 'include_exclude' => array('label' => __('Include/Exclude', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('' => __('Select', 'thememix-pro-genesis'), 'include' => __('Include', 'thememix-pro-genesis'), 'exclude' => __('Exclude', 'thememix-pro-genesis')), 'requires' => array('post_type', 'page', true)), 'post_id' => array('label' => sprintf('<span class="gs-post-type-label">%s</span>', $pt_obj->name) . ' ' . __('ID', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('include_exclude', '', true)), 'posts_num' => array('label' => sprintf('%s %s %s', __('Number of', 'thememix-pro-genesis'), $pt_obj->label, __('to Show', 'thememix-pro-genesis')), 'description' => '', 'type' => 'text_small', 'requires' => array('post_type', 'page', true)), 'posts_offset' => array('label' => sprintf('%s %s %s', __('Number of', 'thememix-pro-genesis'), $pt_obj->label, __('to Offset', 'thememix-pro-genesis')), 'description' => '', 'type' => 'text_small', 'requires' => array('post_type', 'page', true)), 'orderby' => array('label' => __('Order By', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('date' => __('Date', 'thememix-pro-genesis'), 'title' => __('Title', 'thememix-pro-genesis'), 'parent' => __('Parent', 'thememix-pro-genesis'), 'ID' => __('ID', 'thememix-pro-genesis'), 'comment_count' => __('Comment Count', 'thememix-pro-genesis'), 'rand' => __('Random', 'thememix-pro-genesis'), 'meta_value' => __('Meta Value', 'thememix-pro-genesis'), 'meta_value_num' => __('Numeric Meta Value', 'thememix-pro-genesis')), 'requires' => array('post_type', 'page', true)), 'order' => array('label' => __('Sort Order', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('DESC' => __('Descending (3, 2, 1)', 'thememix-pro-genesis'), 'ASC' => __('Ascending (1, 2, 3)', 'thememix-pro-genesis')), 'requires' => array('post_type', 'page', true)), 'meta_key' => array('label' => __('Meta Key', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('orderby', array('meta_value', 'meta_value_num'), false)), 'paged' => array('label' => __('Work with Pagination', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => array('post_type', 'page', true)), 'show_paged' => array('label' => __('Show Page Navigation', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => array('post_type', 'page', true)), 'exclude_displayed' => array('label' => __('Exclude Previously Displayed Posts?', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => ''));
     $box_2 = array('show_gravatar' => array('label' => __('Show Author Gravatar', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => ''), 'gravatar_size' => array('label' => __('Gravatar Size', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('45' => __('Small (45px)', 'thememix-pro-genesis'), '65' => __('Medium (65px)', 'thememix-pro-genesis'), '85' => __('Large (85px)', 'thememix-pro-genesis'), '125' => __('Extra Large (125px)', 'thememix-pro-genesis')), 'requires' => array('show_gravatar', '', true)), 'link_gravatar' => array('label' => __('Link Gravatar', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('' => __('Do not link gravatar', 'thememix-pro-genesis'), 'archive' => __('Link to author archive', 'thememix-pro-genesis'), 'website' => __('Link to author website', 'thememix-pro-genesis')), 'requires' => array('show_gravatar', '', true)), 'gravatar_alignment' => array('label' => __('Gravatar Alignment', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('' => __('None', 'thememix-pro-genesis'), 'alignleft' => __('Left', 'thememix-pro-genesis'), 'alignright' => __('Right', 'thememix-pro-genesis')), 'requires' => array('show_gravatar', '', true)));
     $box_3 = array('column-grid' => array('label' => __('Number of columns', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array(1 => 1, 2 => 2, 3 => 3, 4 => 4)));
     $box_4 = array('optimize' => array('label' => __('Optimize?', 'thememix-pro-genesis'), 'description' => 'Check to optimize WP_Query & enable site transients for the query results. Instance Identification Field must be filled in, which will be auto-populated based on your widget title.', 'type' => 'checkbox', 'requires' => ''), 'optimize_more_1' => array('description' => 'Your main widget transient id: thememix_featured_content_main_' . ThemeMix_Featured_Content::$widget_instance['custom_field'], 'type' => 'description', 'requires' => array('optimize', '', true)), 'optimize_more_2' => array('description' => 'Your extra posts transient id: thememix_featured_content_extra_' . ThemeMix_Featured_Content::$widget_instance['custom_field'], 'type' => 'description', 'requires' => array('optimize', '', true)), 'delete_transients' => array('label' => __('Delete Transients?', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => array('optimize', '', true)), 'transients_time' => array('label' => __('Set Transients Expiration (seconds)', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('optimize', '', true)), 'custom_field' => array('label' => __('Instance Identification Field', 'thememix-pro-genesis'), 'description' => __('Fill in this field if you need to test against an $instance value not included in the form', 'thememix-pro-genesis'), 'type' => 'text', 'requires' => array('optimize', '', true)));
     $box_5 = array('font-awesome' => array('label' => __('Display Font Awesome icon', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox'), 'fontawesome-icon' => array('label' => __('Icon', 'thememix-pro-genesis'), 'description' => '', 'type' => 'fontawesome', 'requires' => array('font-awesome', '', true)), 'fontawesome-colour' => array('label' => __('Color', 'thememix-pro-genesis'), 'description' => '', 'type' => 'colour_picker', 'requires' => array('font-awesome', '', true)), 'fontawesome-size' => array('label' => __('Size', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('10px' => '10px', '20px' => '20px', '30px' => '30px', '40px' => '40px', '50px' => '50px'), 'requires' => array('font-awesome', '', true)), 'fontawesome-position' => array('label' => __('Position', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('before_title' => __('Before title (centered)', 'thememix-pro-genesis'), 'inline_before_title' => __('Inline before title', 'thememix-pro-genesis'), 'inline_after_title' => __('Inline after title', 'thememix-pro-genesis'), 'after_title' => __('After title (centered)', 'thememix-pro-genesis')), 'requires' => array('font-awesome', '', true)));
     $box_6 = array('show_image' => array('label' => __('Show Featured Image', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => ''), 'link_image' => array('label' => __('Image Link', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('1' => __('Link Image to Post', 'thememix-pro-genesis'), '2' => __('Don\'t Link Image', 'thememix-pro-genesis')), 'requires' => array('show_image', '', true)), 'link_image_field' => array('label' => __('Link ( Defaults to Permalink )'), 'description' => '', 'type' => 'text', 'requires' => array('link_image', '1', false)), 'image_size' => array('label' => __('Image Size', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => ThemeMix_Featured_Content::get_image_size_options(), 'requires' => array('show_image', '', true)), 'image_position' => array('label' => __('Image Placement', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('before-title' => __('Before Title', 'thememix-pro-genesis'), 'after-title' => __('After Title', 'thememix-pro-genesis'), 'after-content' => __('After Content', 'thememix-pro-genesis')), 'requires' => array('show_image', '', true)), 'image_alignment' => array('label' => __('Image Alignment', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('' => __('None', 'thememix-pro-genesis'), 'alignleft' => __('Left', 'thememix-pro-genesis'), 'alignright' => __('Right', 'thememix-pro-genesis'), 'aligncenter' => __('Center', 'thememix-pro-genesis')), 'requires' => array('show_image', '', true)));
     //* Box 2
     $box_7 = array('show_title' => array('label' => __('Show Post Title', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => ''), 'title_limit' => array('label' => __('Limit title to', 'thememix-pro-genesis'), 'description' => __(' characters', 'thememix-pro-genesis'), 'type' => 'text_small', 'requires' => array('show_title', '', true)), 'title_cutoff' => array('label' => __('Title Cutoff Symbol', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text_small', 'requires' => array('show_title', '', true)), 'link_title' => array('label' => __('Link Title', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('1' => __('Link Title to Post', 'thememix-pro-genesis'), '2' => __('Don\'t Link Title', 'thememix-pro-genesis')), 'requires' => array('show_title', '', true)), 'link_title_field' => array('label' => __('Link (Defaults to Permalink)', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('link_title', '1', false)), 'show_byline' => array('label' => __('Show Post Info', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => ''), 'byline_position' => array('label' => __('Post Info Placement', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('before-title' => __('Before Title', 'thememix-pro-genesis'), 'after-title' => __('After Title', 'thememix-pro-genesis')), 'requires' => array('show_byline', '', true)), 'post_info' => array('label' => __('Post Info', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('show_byline', '', true)), 'show_content' => array('label' => __('Content Type', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('content' => __('Show Content', 'thememix-pro-genesis'), 'excerpt' => __('Show Excerpt', 'thememix-pro-genesis'), 'content-limit' => __('Show Content Limit', 'thememix-pro-genesis'), '' => __('No Content', 'thememix-pro-genesis')), 'requires' => ''), 'content_limit' => array('label' => __('Limit content to', 'thememix-pro-genesis'), 'description' => __(' characters', 'thememix-pro-genesis'), 'type' => 'text_small', 'requires' => array('show_content', 'content-limit', false)), 'excerpt_limit' => array('label' => __('Limit excerpt to', 'thememix-pro-genesis'), 'description' => __(' words', 'thememix-pro-genesis'), 'type' => 'text_small', 'requires' => array('show_content', 'excerpt', false)), 'excerpt_cutoff' => array('label' => __('Title Cutoff Symbol', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text_small', 'requires' => array('show_content', 'excerpt', false)), 'show_archive_line' => array('label' => __('Show Post Meta', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => array('post_type', 'page', true)), 'post_meta' => array('label' => __('Post Meta', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('show_archive_line', '', true)), 'more_text' => array('label' => __('More Text (if applicable)', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => ''));
     $box_8 = array('extra_posts' => array('label' => __('Display List of Additional Posts', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => array('page_id', '', false)), 'extra_title' => array('label' => __('Title', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('extra_posts', '', true)), 'extra_num' => array('label' => __('Number of Posts to Show', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text_small', 'requires' => array('extra_posts', '', true)), 'extra_format' => array('label' => __('Extra Post Format', 'thememix-pro-genesis'), 'description' => '', 'type' => 'select', 'options' => array('ul' => __('Unordered List', 'thememix-pro-genesis'), 'ol' => __('Ordered List', 'thememix-pro-genesis'), 'drop_down' => __('Drop Down', 'thememix-pro-genesis')), 'requires' => array('extra_posts', '', true)), 'more_from_category' => array('label' => __('Show Category Archive Link', 'thememix-pro-genesis'), 'description' => '', 'type' => 'checkbox', 'requires' => array('posts_term', '', true)), 'more_from_category_text' => array('label' => __('Link Text', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('more_from_category', '', true)), 'archive_link' => array('label' => __('Fill in this value with a URL if you wish to display an archive link when showing all terms or to override the normal archive link to another URL', 'thememix-pro-genesis'), 'description' => '', 'type' => 'text', 'requires' => array('more_from_category', '', true)));
     $columns = array('col' => array($box), 'col1' => array($box_1, $box_2, $box_3, $box_4), 'col2' => array($box_5, $box_6, $box_7, $box_8));
     return apply_filters('thememix_featured_content_form_fields', $columns, ThemeMix_Featured_Content::$widget_instance, compact("box_1", "box_2", "box_3", "box_4", "box_5", "box_6", "box_7"));
 }