Example #1
0
 function section_opts()
 {
     $options = array();
     $options[] = array('title' => __('Config', 'pagelines'), 'type' => 'multi', 'opts' => array(array('key' => $this->id . '_format', 'type' => 'select', 'label' => __('Gallery Format', 'pagelines'), 'opts' => array('grid' => array('name' => __('Grid Mode', 'pagelines')), 'masonry' => array('name' => __('Image/Masonry', 'pagelines')))), array('key' => $this->id . '_post_type', 'type' => 'select', 'opts' => pl_get_thumb_post_types(), 'default' => 4, 'label' => __('Select Post Type', 'pagelines'), 'help' => __('<strong>Note</strong><br/> Post types for this section must have "featured images" enabled and be public.<br/><strong>Tip</strong><br/> Use a plugin to create custom post types for use.', 'pagelines')), array('key' => $this->id . '_sizes', 'type' => 'select_imagesizes', 'label' => __('Select Thumb Size', 'pagelines'), 'help' => __('For best results use large or full image sizes.', 'pagelines')), array('key' => $this->id . '_total', 'type' => 'count_select', 'count_start' => 5, 'count_number' => 20, 'default' => 10, 'label' => __('Total Posts Loaded', 'pagelines')), array('key' => $this->id . '_excerpt', 'type' => 'check', 'default' => false, 'label' => __('Display Post Excerpt In Grid Mode', 'pagelines'))));
     $options[] = array('title' => __('Masonic Content', 'pagelines'), 'type' => 'multi', 'col' => 3, 'help' => __('Options to control the text and link in the Masonic title.', 'pagelines'), 'opts' => array(array('key' => 'default_title', 'type' => 'text', 'label' => __('Default Title', 'pagelines')), array('key' => $this->id . '_meta', 'type' => 'text', 'label' => __('Masonic Meta', 'pagelines'), 'ref' => __('Use shortcodes to control the dynamic meta info. Example shortcodes you can use are: <ul><li><strong>[post_categories]</strong> - List of categories</li><li><strong>[post_edit]</strong> - Link for admins to edit the post</li><li><strong>[post_tags]</strong> - List of post tags</li><li><strong>[post_comments]</strong> - Link to post comments</li><li><strong>[post_author_posts_link]</strong> - Author and link to archive</li><li><strong>[post_author_link]</strong> - Link to author URL</li><li><strong>[post_author]</strong> - Post author with no link</li><li><strong>[post_time]</strong> - Time of post</li><li><strong>[post_date]</strong> - Date of post</li><li><strong>[post_type]</strong> - Type of post</li></ul>', 'pagelines'))));
     $options[] = array('key' => $this->id . '_post_sort', 'col' => 3, 'type' => 'select', 'label' => __('Sort elements by postdate', 'pagelines'), 'default' => 'DESC', 'opts' => array('DESC' => array('name' => __('Date Descending (default)', 'pagelines')), 'ASC' => array('name' => __('Date Ascending', 'pagelines')), 'rand' => array('name' => __('Random', 'pagelines'))));
     $selection_opts = array(array('key' => $this->id . '_meta_key', 'type' => 'text', 'label' => __('Meta Key', 'pagelines'), 'help' => __('Select only posts which have a certain meta key and corresponding meta value. Useful for featured posts, or similar.', 'pagelines')), array('key' => $this->id . '_meta_value', 'type' => 'text', 'label' => __('Meta Key Value', 'pagelines')));
     $selection_opts[] = array('label' => 'Post Category', 'key' => $this->id . '_category', 'type' => 'select_wp_tax', 'post_type' => $this->opt($this->id . '_post_type'), 'help' => __('Only applies for standard blog posts.', 'pagelines'));
     $options[] = array('title' => __('Additional Post Selection', 'pagelines'), 'type' => 'multi', 'col' => 3, 'opts' => $selection_opts);
     return $options;
 }
Example #2
0
 function section_opts()
 {
     $options = array();
     $options[] = array('title' => __('Config', 'pagelines'), 'type' => 'multi', 'col' => 1, 'opts' => array(array('key' => 'flipper_post_type', 'type' => 'select', 'opts' => pl_get_thumb_post_types(), 'default' => 4, 'label' => __('Which post type should Flipper use?', 'pagelines'), 'help' => __('<strong>Note</strong><br/> Post types for this section must have "featured images" enabled and be public.<br/><strong>Tip</strong><br/> Use a plugin to create custom post types for use with Flipper.', 'pagelines')), array('key' => $this->id . '_format', 'type' => 'select', 'label' => __('Layout Format', 'pagelines'), 'opts' => array('grid' => array('name' => __('Grid', 'pagelines')), 'masonry' => array('name' => __('Image Only', 'pagelines')))), array('key' => 'flipper_shown', 'type' => 'count_select', 'count_start' => 1, 'count_number' => 6, 'default' => 3, 'label' => __('Max Number of Posts Shown', 'pagelines'), 'help' => __('This controls the maximum number of posts shown. A smaller amount may be shown based on layout width.', 'pagelines')), array('key' => 'flipper_sizes', 'type' => 'select_imagesizes', 'label' => __('Select Thumb Size', 'pagelines')), array('key' => 'flipper_total', 'type' => 'count_select', 'count_start' => 5, 'count_number' => 20, 'default' => 10, 'label' => __('Total Posts Loaded', 'pagelines')), array('key' => $this->id . '_hide_nav', 'type' => 'check', 'label' => __('Hide Nav?', 'pagelines'))));
     $options[] = array('title' => __('Flipper Content', 'pagelines'), 'col' => 2, 'type' => 'multi', 'help' => __('Options to control the text and link in the Flipper title.', 'pagelines'), 'opts' => array(array('key' => 'flipper_title', 'type' => 'text', 'label' => __('Flipper Title Text', 'pagelines')), array('key' => 'flipper_hide_title_link', 'type' => 'check', 'label' => __('Hide Title Link?', 'pagelines')), array('key' => 'flipper_meta', 'type' => 'text', 'label' => __('Flipper Meta', 'pagelines'), 'ref' => __('Use shortcodes to control the dynamic meta info. Example shortcodes you can use are: <ul><li><strong>[post_categories]</strong> - List of categories</li><li><strong>[post_edit]</strong> - Link for admins to edit the post</li><li><strong>[post_tags]</strong> - List of post tags</li><li><strong>[post_comments]</strong> - Link to post comments</li><li><strong>[post_author_posts_link]</strong> - Author and link to archive</li><li><strong>[post_author_link]</strong> - Link to author URL</li><li><strong>[post_author]</strong> - Post author with no link</li><li><strong>[post_time]</strong> - Time of post</li><li><strong>[post_date]</strong> - Date of post</li><li><strong>[post_type]</strong> - Type of post</li></ul>', 'pagelines')), array('key' => 'flipper_show_excerpt', 'type' => 'check', 'label' => __('Show excerpt?', 'pagelines')), array('key' => 'disable_flipper_show_love', 'type' => 'check', 'label' => __('Disable social button/count?', 'pagelines'))));
     $options[] = array('key' => 'flipper_post_sort', 'type' => 'select', 'label' => __('Sort elements by postdate', 'pagelines'), 'default' => 'DESC', 'opts' => array('DESC' => array('name' => __('Date Descending (default)', 'pagelines')), 'ASC' => array('name' => __('Date Ascending', 'pagelines')), 'rand' => array('name' => __('Random', 'pagelines'))));
     $selection_opts = array(array('key' => 'flipper_meta_key', 'type' => 'text', 'label' => __('Meta Key', 'pagelines'), 'help' => __('Select only posts which have a certain meta key and corresponding meta value. Useful for featured posts, or similar.', 'pagelines')), array('key' => 'flipper_meta_value', 'type' => 'text', 'label' => __('Meta Key Value', 'pagelines')));
     if ($this->opt('flipper_post_type') == 'post') {
         $selection_opts[] = array('label' => 'Post Category', 'key' => 'flipper_category', 'type' => 'select_taxonomy', 'post_type' => 'post', 'help' => __('Only applies for standard blog posts.', 'pagelines'));
     }
     $options[] = array('col' => 1, 'title' => __('Advanced Post Selection', 'pagelines'), 'type' => 'multi', 'opts' => $selection_opts);
     return $options;
 }
Example #3
0
function pl_get_post_type_options()
{
    $opts = array(array('key' => 'post_type', 'type' => 'select', 'opts' => pl_get_thumb_post_types(false), 'label' => __('Select Post Type', 'pagelines')), array('key' => 'post_total', 'type' => 'count_select', 'count_start' => 5, 'count_number' => 20, 'default' => 10, 'label' => __('Total Posts Loaded', 'pagelines')), array('key' => 'post_sort', 'type' => 'select', 'label' => __('Element Sorting', 'pagelines'), 'default' => 'DESC', 'opts' => array('DESC' => array('name' => __('Date Descending (default)', 'pagelines')), 'ASC' => array('name' => __('Date Ascending', 'pagelines')), 'rand' => array('name' => __('Random', 'pagelines')))), array('key' => 'meta_key', 'type' => 'text_small', 'label' => __('Meta Key', 'pagelines')), array('key' => 'meta_value', 'type' => 'text_small', 'label' => __('Meta Key Value', 'pagelines'), 'help' => __('Select only posts which have a certain meta key and corresponding meta value. Useful for featured posts, or similar.', 'pagelines')));
    return $opts;
}
 function section_opts()
 {
     $options = array();
     $options[] = array('title' => __('Slider Settings', 'traypostslider'), 'type' => 'multi', 'col' => 1, 'opts' => array(array('key' => 'tps_background_size', 'type' => 'select', 'label' => __('Featured Image <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-size" target="_blank">Background Size</a>', 'traypostslider'), 'default' => 'cover', 'opts' => array('cover' => array('name' => __('Cover (Default)', 'traypostslider')), 'contain' => array('name' => __('Contain', 'traypostslider')), 'auto' => array('name' => __('Auto', 'traypostslider')))), array('key' => 'tps_background_position', 'type' => 'select', 'label' => __('Featured Image <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-position" target="_blank">Background Position</a>', 'traypostslider'), 'default' => 'center', 'opts' => array('center top' => array('name' => __('Center Top', 'traypostslider')), 'center' => array('name' => __('Center Center (Default)', 'traypostslider')), 'center bottom' => array('name' => __('Center Bottom', 'traypostslider')), 'left top' => array('name' => __('Left Top', 'traypostslider')), 'left' => array('name' => __('Left Center', 'traypostslider')), 'left bottom' => array('name' => __('Left Bottom', 'traypostslider')), 'right top' => array('name' => __('Right Top', 'traypostslider')), 'right' => array('name' => __('Right Center', 'traypostslider')), 'right bottom' => array('name' => __('Right Bottom', 'traypostslider')))), array('key' => 'tps_sizes', 'type' => 'select_imagesizes', 'default' => 'landscape-thumb', 'label' => __('Select Featured Image Size<br><em>Tip: <a href="http://www.pagelinestheme.com/stop-cropping-featured-images/" target="_blank">This Article</a> may be helpful.</em>', 'traypostslider')), array('key' => 'tps_total', 'type' => 'count_select', 'count_start' => 1, 'count_number' => 20, 'default' => 10, 'label' => __('Total Posts Loaded', 'traypostslider')), array('key' => 'tps_slider_height', 'type' => 'text_small', 'label' => __('Height of Slider (in pixels)<br>Default: 300', 'traypostslider')), array('key' => 'tps_slider_animation', 'type' => 'select', 'label' => __('Slider Animation Type<br>Default: Slide', 'traypostslider'), 'default' => 'slide', 'opts' => array('slide' => array('name' => __('Slide (Default)', 'traypostslider')), 'fade' => array('name' => __('Fade', 'traypostslider')))), array('key' => 'tps_slider_direction', 'type' => 'select', 'label' => __('Slider Direction<br>Default: Horizontal<br>No effect when using Fade animation', 'traypostslider'), 'help' => __('<strong>Warning:</strong> Choosing <em>Vertical</em> will make it so that mobile/touch devices cannot scroll if the Tray content exceeds the Tray size (only applicable if the CSS Overflow option is not <em>Hidden</em>).', 'traypostslider'), 'default' => 'horizontal', 'opts' => array('horizontal' => array('name' => __('Horizontal (Default)', 'traypostslider')), 'vertical' => array('name' => __('Vertical', 'traypostslider')))), array('key' => 'tps_slider_reverse', 'type' => 'check', 'label' => __('Reverse sliding direction?<br>', 'traypostslider')), array('key' => 'tps_slider_speed', 'type' => 'text_small', 'label' => __('Slider speed (in milliseconds)<br>Default: 600', 'traypostslider')), array('key' => 'tps_slider_autoplay', 'type' => 'check', 'label' => __('Disable Autoplay?', 'traypostslider')), array('key' => 'tps_slider_arrows_off', 'type' => 'check', 'label' => __('Disable Arrows Navigation?', 'traypostslider')), array('key' => 'tps_slider_dots_off', 'type' => 'check', 'label' => __('Hide Dots Navigation?', 'traypostslider')), array('key' => 'tps_slider_loop', 'type' => 'check', 'label' => __('Disable Infinite Loop after last slide?', 'traypostslider')), array('key' => 'tps_slider_hover_pause', 'type' => 'check', 'label' => __('Disable Pause on Hover?<br><strong>(Not recommended unless <em>Tray CSS Overflow</em> is set to <em>Hidden</em>)</strong>', 'traypostslider')), array('key' => 'tps_slider_easing', 'type' => 'select', 'label' => __('Slider Easing<br>Default: Swing<br>For a clue on which transition to pick, check out <a href="http://easings.net/" target="_blank">Easings.net</a>.)', 'traypostslider'), 'opts' => $this->tps_easing_options())));
     $options[] = array('title' => __('Tray Settings', 'traypostslider'), 'type' => 'multi', 'col' => 2, 'opts' => array(array('key' => 'tps_tray_position', 'type' => 'select', 'label' => __('Tray Position', 'traypostslider'), 'default' => 'right', 'opts' => array('right' => array('name' => __('Right (Default)', 'traypostslider')), 'left' => array('name' => __('Left', 'traypostslider')))), array('key' => 'tps_tray_overflow', 'type' => 'select', 'label' => __('Tray <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/overflow" target="_blank">CSS Overflow</a> Setting<br>Default: Auto (i.e. Scroll Bars shown if necessary to view all of the Tray content)', 'traypostslider'), 'help' => __('<strong>Alternatives:</strong> Set CSS Overflow to <em>Hidden</em> and increase slider height, decrease Title HTML tag (e.g. h6) or word limit, and/or decrease Excerpt word limit</strong>', 'traypostslider'), 'default' => 'auto', 'opts' => array('hidden' => array('name' => __('Hidden', 'traypostslider')), 'auto' => array('name' => __('Auto (Default)', 'traypostslider')))), array('key' => 'tps_tray_cols', 'type' => 'count_select', 'count_start' => 1, 'count_number' => 11, 'default' => 4, 'label' => __('Grid Columns for Width of Tray Area (Default: 4)<br>(12 Column Grid with Featured Image taking up the remainder.)', 'traypostslider')), array('key' => 'tps_tray_custom_class', 'type' => 'check', 'label' => __('Disable Tray Image Frame<br>(i.e. remove <em>.pl-imageframe</em>)', 'traypostslider')), array('key' => 'tps_tray_image_meta_key', 'type' => 'text', 'label' => __('Name of Custom Field containing Tray Image<br>(Field value should consist of ONLY what should be in <em>img src</em>.)', 'traypostslider'), 'help' => __('<strong>For example:</strong> <em>http://site.com/wp-content/uploads/my-image.jpg</em>', 'traypostslider')), array('key' => 'tps_tray_image_fallback', 'type' => 'image_upload', 'has_alt' => false, 'label' => __('Tray Image Fallback<br>(Only used if a post does not have a valid Custom Field value)', 'traypostslider'), 'help' => __('If you do not enter a Custom Field Name <strong>OR</strong> a Fallback Image, no Tray Image will be displayed.<br><br>If you make a typo on the Custom Field Name (or do not enter one at all), the Fallback Image, if set, will be displayed for all posts.', 'traypostslider')), array('key' => 'tps_title_off', 'type' => 'check', 'label' => __('Turn off Title?', 'traypostslider')), array('type' => 'select', 'key' => 'tps_title_tag', 'label' => __('Title Text HTML Tag<br>Default: h5', 'traypostslider'), 'opts' => array('h1' => array('name' => 'h1'), 'h2' => array('name' => 'h2'), 'h3' => array('name' => 'h3'), 'h4' => array('name' => 'h4'), 'h5' => array('name' => 'h5'), 'h6' => array('name' => 'h6'), 'p' => array('name' => 'p'))), array('key' => 'tps_title_meta_key', 'type' => 'text', 'label' => __('Custom Field for Title<br>(Pull this Custom Field value instead of using Post Title)<br>Will use Post Title if does not have value for this Custom Field', 'traypostslider')), array('key' => 'tps_title_limit', 'type' => 'count_select', 'count_start' => 0, 'count_number' => 50, 'default' => 10, 'label' => __('Title Word Limit (Default: 10, Zero = No Limit)<br>If set, will add an elipse <span style="color:blue;">&hellip;</span> if too long.', 'traypostslider')), array('key' => 'tps_excerpt_off', 'type' => 'check', 'label' => __('Turn off Excerpt?', 'traypostslider')), array('key' => 'tps_excerpt_meta_key', 'type' => 'text', 'label' => __('Custom Field for Excerpt<br>(Pull this Custom Field value instead of using Excerpt)<br>Will use Excerpt if does not have value for this Custom Field', 'traypostslider')), array('key' => 'tps_excerpt_limit', 'type' => 'count_select', 'count_start' => 0, 'count_number' => 50, 'default' => 15, 'label' => __('Excerpt Word Limit (Default: 15, Zero = No Limit)<br>If set, will add an elipse <span style="color:blue;">&hellip;</span> if too long.', 'traypostslider')), array('key' => 'tps_more_link_off', 'type' => 'check', 'label' => __('Turn off More Link?<br>(More Link only displays if Excerpt is displayed.)', 'traypostslider')), array('key' => 'tps_more_link_text', 'type' => 'text', 'label' => __('More Link Text (Default: <span style="color:blue;">More <i class="fa fa-caret-right"></i></span>)', 'traypostslider'))));
     $selection_opts = array();
     $selection_opts[] = array('key' => 'tps_post_type', 'type' => 'select', 'opts' => pl_get_thumb_post_types(), 'default' => 'post', 'label' => __('Which post type should Tray Post Slider use?', 'traypostslider'), 'help' => __('<strong>Required:</strong> This section can only display post types that have <em>Featured Images</em> enabled and are public.<br><span style="color:darkred; font-style:italic;"><strong>Note: Only posts that have Featured Images assigned will show up in this section.</strong></span><br><strong>Tip:</strong> You can use a plugin (e.g. <a href="https://wordpress.org/plugins/types/" target="_blank">Types</a>) or a <a href="http://generatewp.com/post-type/" target="_blank">generator</a> to create custom post types for use with this section.', 'traypostslider'));
     if ($this->tps_get_post_type() == 'post') {
         $selection_opts[] = array('label' => sprintf(__('Post Taxonomy<br>Only include posts assigned this Taxonomy<br>Make sure it is attached to the <span style="color:blue; font-style:italic;">%s</span> post type!<br>Or you need to change the Post Type option, above.', 'traypostslider'), $this->tps_get_post_type_label()), 'key' => 'tps_taxonomy_post', 'type' => 'select', 'opts' => $this->tps_pttaxpicker());
     } else {
         $selection_opts[] = array('label' => sprintf(__('Custom Post Type Taxonomy<br>Only include posts assigned this Taxonomy<br>Make sure it is attached to the <span style="color:blue; font-style:italic;">%s</span> post type!<br>Or you need to change the Post Type option, above.', 'traypostslider'), $this->tps_get_post_type_label()), 'key' => 'tps_taxonomy', 'type' => 'select', 'opts' => $this->tps_pttaxpicker());
     }
     if ($this->tps_taxtermpickernames()) {
         $selection_opts[] = array('label' => __('Specific Term within chosen Taxonomy<br>Only include posts assigned this term<br><em>If you choose a parent category, its children will be included</em>', 'traypostslider'), 'key' => 'tps_term', 'type' => 'select_multi', 'opts' => $this->tps_taxtermpickernames());
     } else {
         $selection_opts[] = array('label' => __('(Must first select a Taxonomy, above, then Refresh)', 'traypostslider'), 'key' => 'tps_term', 'type' => 'select', 'opts' => '');
     }
     $selection_opts[] = array('key' => 'tps_filter_meta_key', 'type' => 'text', 'label' => __('Name of Custom Field to Require<br><a href="http://codex.wordpress.org/Custom_Fields#Usage" target="_blank">What are WordPress Custom Fields?</a>', 'traypostslider'), 'help' => __('Select only posts which have the Value set below for the Custom Field set above. Useful for manually filtering for certain posts.', 'traypostslider'));
     $selection_opts[] = array('key' => 'tps_filter_meta_value', 'type' => 'text', 'label' => __('Custom Field Value to Require', 'traypostslider'));
     $selection_opts[] = array('key' => 'tps_post_orderby', 'type' => 'select', 'label' => __('Order posts by', 'traypostslider'), 'default' => 'date', 'opts' => array('date' => array('name' => __('Date Published (Default)', 'traypostslider')), 'modified' => array('name' => __('Date Last Modified', 'traypostslider')), 'ID' => array('name' => __('Post ID#', 'traypostslider')), 'title' => array('name' => __('Title/Alphabetical', 'traypostslider')), 'name' => array('name' => __('Post Slug', 'traypostslider')), 'parent' => array('name' => __('Post/Page Parent ID#', 'traypostslider')), 'rand' => array('name' => __('Random', 'traypostslider')), 'comment_count' => array('name' => __('Number of Comments', 'traypostslider')), 'menu_order' => array('name' => __('Menu Order#', 'traypostslider'))));
     $selection_opts[] = array('key' => 'tps_post_sort', 'type' => 'select', 'label' => __('Sort posts by', 'traypostslider'), 'default' => 'DESC', 'opts' => array('DESC' => array('name' => __('Descending (Default)', 'traypostslider')), 'ASC' => array('name' => __('Ascending', 'traypostslider'))));
     $options[] = array('col' => 1, 'title' => __('Post Selection', 'traypostslider'), 'type' => 'multi', 'opts' => $selection_opts);
     return $options;
 }