Esempio n. 1
0
 protected function onSetupOptions(\Drone\Options\Group\Shortcode $options)
 {
     $options->addOption('select', 'id', 0, __('Children of', 'everything'), __('Displays child portfolios of selected portfolio.', 'everything'), array('options' => function () {
         return array(0 => '(' . __('This', 'everything') . ')') + array_map(function ($s) {
             return Func::stringCut($s, 55);
         }, Func::wpPostsList(array('numberposts' => -1, 'post_type' => 'portfolio')));
     }));
     $options->addOption('select', 'columns', '4', __('Layout', 'everything'), '', array('options' => array('1' => __('One column', 'everything'), '1+' => __('One+ column', 'everything'), '2' => __('Two columns', 'everything'), '3' => __('Three columns', 'everything'), '4' => __('Four columns', 'everything'), '5' => __('Five columns', 'everything'), '6' => __('Six columns', 'everything'), '7' => __('Seven columns', 'everything'), '8' => __('Eight columns', 'everything'))));
     $options->addOption('select', 'filter', 'category', __('Filter', 'everything'), '', array('options' => array('' => '(' . __('None', 'everything') . ')', 'category' => __('Category', 'everything'), 'tag' => __('Tag', 'everything'))));
     $options->addOption('select', 'orderby', 'date', __('Sort by', 'everything'), '', array('options' => array('title' => __('Title', 'everything'), 'date' => __('Date', 'everything'), 'modified' => __('Modified date', 'everything'), 'comment_count' => __('Comment count', 'everything'), 'rand' => __('Random order', 'everything'), 'menu_order' => __('Custom order', 'everything'))));
     $options->addOption('select', 'order', 'desc', __('Sort order', 'everything'), '', array('options' => array('asc' => __('Ascending', 'everything'), 'desc' => __('Descending', 'everything'))));
     $options->addOption('number', 'count', '', __('Count', 'everything'), '', array('required' => false, 'min' => 1));
     $options->addOption('boolean', 'pagination', true, __('Pagination', 'everything'), '', array('caption' => __('Yes', 'everything')));
     $options->addOption('boolean', 'title', true, __('Title', 'everything'), '', array('caption' => __('Yes', 'everything')));
     $options->addOption('select', 'teaser', 'excerpt_content', __('Teaser', 'everything'), __('Regular content means everything before the "Read more" tag.', 'everything'), array('options' => array('' => '(' . __('None', 'everything') . ')', 'content' => __('Regular content', 'everything'), 'excerpt_content' => __('Excerpt or regular content', 'everything'), 'excerpt' => __('Excerpt', 'everything'))));
     //$options->addOption('number', 'excerpt_length', 55, __('Excerpt length', 'everything'), '', array('unit' => __('words', 'everything'), 'min' => 1, 'max' => 100));
     $options->addOption('select', 'taxonomy', 'tag', __('Taxonomy', 'everything'), '', array('options' => array('' => '(' . __('None', 'everything') . ')', 'category' => __('Category', 'everything'), 'tag' => __('Tag', 'everything'))));
     $options->addOption('select', 'image_hover', 'inherit', __('Hover effect', 'everything'), '', array('options' => array('inherit' => __('Inherit', 'everything'), '' => __('None', 'everything'), 'zoom' => __('Default', 'everything'), 'grayscale' => __('Grayscale', 'everything'))));
 }
Esempio n. 2
0
 protected function onSetupOptions(\Drone\Options\Group\Widget $options)
 {
     $options->addOption('text', 'title', '', __('Title', 'everything'));
     $options->addOption('select', 'id', 0, __('Children of', 'everything'), __('Displays child portfolios of selected portfolio.', 'everything'), array('required' => false, 'options' => function () {
         return array_map(function ($s) {
             return Func::stringCut($s, 55);
         }, Func::wpPostsList(array('numberposts' => -1, 'post_type' => 'portfolio')));
     }));
     $options->addOption('select', 'columns', '2', __('Layout', 'everything'), '', array('options' => array('1' => __('One column', 'everything'), '1+' => __('One+ column', 'everything'), '2' => __('Two columns', 'everything'), '3' => __('Three columns', 'everything'), '4' => __('Four columns', 'everything'))));
     $options->addOption('select', 'filter', '', __('Filter', 'everything'), '', array('options' => array('' => '(' . __('None', 'everything') . ')', 'category' => __('Category', 'everything'), 'tag' => __('Tag', 'everything'))));
     $options->addOption('select', 'orderby', 'date', __('Sort by', 'everything'), '', array('options' => array('title' => __('Title', 'everything'), 'date' => __('Date', 'everything'), 'modified' => __('Modified date', 'everything'), 'comment_count' => __('Comment count', 'everything'), 'rand' => __('Random order', 'everything'), 'menu_order' => __('Custom order', 'everything'))));
     $options->addOption('select', 'order', 'desc', __('Sort order', 'everything'), '', array('options' => array('asc' => __('Ascending', 'everything'), 'desc' => __('Descending', 'everything'))));
     $options->addOption('number', 'count', '', __('Count', 'everything'), '', array('required' => false, 'min' => 1));
     $options->addOption('boolean', 'show_title', true, '', '', array('caption' => __('Show title', 'everything')));
     $content = $options->addGroup('content', __('Content', 'everything'));
     $visible = $content->addOption('boolean', 'visible', false, '', '', array('caption' => __('Show content', 'everything')));
     $content->addOption('group', 'content', 'excerpt_content', '', __('Regular content means everything before the "Read more" tag.', 'everything'), array('options' => array('content' => __('Regular content', 'everything'), 'excerpt_content' => __('Excerpt or regular content', 'everything'), 'excerpt' => __('Excerpt', 'everything')), 'indent' => true, 'owner' => $visible));
     $taxonomy = $options->addGroup('taxonomy', __('Taxonomy', 'everything'));
     $visible = $taxonomy->addOption('boolean', 'visible', true, '', '', array('caption' => __('Show taxonomies', 'everything')));
     $taxonomy->addOption('select', 'taxonomy', 'tag', '', '', array('options' => array('category' => __('Categories', 'everything'), 'tag' => __('Tags', 'everything')), 'indent' => true, 'owner' => $visible));
     $options->addOption('select', 'image_hover', 'inherit', __('Hover effect', 'everything'), '', array('options' => array('inherit' => __('Inherit', 'everything'), '' => __('None', 'everything'), 'zoom' => __('Default', 'everything'), 'grayscale' => __('Grayscale', 'everything'))));
 }