示例#1
0
 protected function onSetupOptions(\Drone\Options\Group\Shortcode $options)
 {
     $options->addOption('select', 'category', 0, __('Category', 'everything'), __('Only for posts.', 'everything'), array('options' => function () {
         return array(0 => __('All categories', 'everything')) + Func::wpTermsList('category', array('hide_empty' => false));
     }));
     $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', get_option('posts_per_page'), __('Posts per page', 'everything'), '', array('min' => 1));
     $options->addOption('boolean', 'exclude_previous', false, __('Duplicates', 'everything'), '', array('caption' => __('Exclude already displayed posts', 'everything')));
     $options->addOption('boolean', 'pagination', true, __('Pagination', 'everything'), '', array('caption' => __('Yes', 'everything')));
     $options->addOption('boolean', 'ignore_sticky_posts', false, __('Sticky posts', 'everything'), '', array('caption' => __('Ignore', 'everything')));
     $options->addOption('select', 'style', 'classic', __('Style', 'everything'), '', array('options' => array('classic' => __('Classic', 'everything'), 'bricks' => __('Columns', 'everything'))));
     $options->addOption('number', 'columns', 2, __('Columns', 'everything'), __('Only for columns style.', 'everything'), array('min' => 1, 'max' => 8));
     $options->addOption('select', 'filter', '', __('Filter', 'everything'), __('Only for columns style.', 'everything'), array('options' => array('' => '(' . __('None', 'everything') . ')', 'category' => __('Category', 'everything'), 'post_tag' => __('Tag', 'everything'))));
 }
示例#2
0
 protected function onSetupOptions(\Drone\Options\Group\Shortcode $options)
 {
     $options->addOption('text', 'tag', 'pre', __('HTML tag', $this->domain), '', array('required' => true));
     $options->addOption('text', 'class', '', __('CSS class', $this->domain));
 }