示例#1
0
        function form($instance)
        {
            $defaults = array('limit' => '4', 'title' => 'Team', 'members' => '');
            $limit_options = array();
            for ($i = 0; $i < 25; $i++) {
                $limit_options[$i] = $i;
            }
            $wp_query = new WP_Query(array('post_type' => array('team'), 'showposts' => 99));
            $team_members = array();
            while ($wp_query->have_posts()) {
                $wp_query->the_post();
                $team_members[$wp_query->post->ID] = get_the_title();
            }
            $instance = wp_parse_args($instance, $defaults);
            extract($instance);
            ?>
            <p class="description half">
                <label for="<?php 
            echo $this->get_field_id('title');
            ?>
">
                    Title (required)<br/>
                    <?php 
            echo aq_field_input('title', $block_id, $title);
            ?>
                </label>
            </p>
            <p class="description half last">
                <label for="<?php 
            echo $this->get_field_id('limit');
            ?>
">
                    Limit (required)<br/>
                    <?php 
            echo aq_field_select('limit', $block_id, $limit_options, $limit);
            ?>
                </label>
            </p>
            <p class="description">
                <label for="<?php 
            echo $this->get_field_id('filters');
            ?>
">
                    Select members (for all leave blank)<br/>
                    <?php 
            echo aq_field_multiselect('members', $block_id, $team_members, $members);
            ?>
                </label>
            </p>

            <?php 
        }
    function form($instance)
    {
        $defaults = array('qty' => '', 'category' => array(), 'autoplay' => '5000', 'excerpt_length' => '30', 'random' => false);
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        $terms = get_terms('category');
        $all_terms = array();
        foreach ($terms as $term) {
            $all_terms[$term->term_id] = $term->name;
        }
        ?>
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
				<?php 
        _e('Title (optional)', 'engine');
        ?>
				<?php 
        echo aq_field_input('title', $block_id, $title, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('qty');
        ?>
">
				<?php 
        _e('Number of Posts', 'engine');
        ?>
				<?php 
        echo aq_field_input('qty', $block_id, $qty, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('category');
        ?>
">
				<?php 
        _e('Categories', 'engine');
        ?>
				<?php 
        echo aq_field_multiselect('category', $block_id, $all_terms, $category);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('excerpt_length');
        ?>
">
				<?php 
        _e('Excerpt Length', 'engine');
        ?>
				<?php 
        echo aq_field_input('excerpt_length', $block_id, $excerpt_length, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('autoplay');
        ?>
">
				<?php 
        _e('Autoplay', 'engine');
        ?>
				<?php 
        echo aq_field_input('autoplay', $block_id, $autoplay, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('random');
        ?>
">
				<?php 
        _e('Randomize?', 'engine');
        ?>
				<?php 
        echo aq_field_checkbox('random', $block_id, $random);
        ?>
			</label>
		</p>
		
		<?php 
    }
示例#3
0
        function form($instance)
        {
            $defaults = array('title' => 'Recent News', 'limit' => '', 'orderby' => '', 'order' => '', 'categories' => array(), 'tags' => array());
            $post_categories = ($temp = get_terms('category')) ? $temp : array();
            $categories_options = array();
            foreach ($post_categories as $cat) {
                $categories_options[$cat->term_id] = $cat->name;
            }
            $post_tags = ($temp = get_terms('post_tag')) ? $temp : array();
            $tags_options = array();
            foreach ($post_tags as $tag) {
                $tags_options[$tag->term_id] = $tag->name;
            }
            $limit_options = array();
            for ($i = 0; $i < 25; $i++) {
                $limit_options[$i] = $i;
            }
            $instance = wp_parse_args($instance, $defaults);
            extract($instance);
            ?>
         <p>Note: You should only use this block on a full-width template</p>
         <p class="description half">
            <label for="<?php 
            echo $this->get_field_id('title');
            ?>
">
                Title (required)<br/>
                <?php 
            echo aq_field_input('title', $block_id, $title);
            ?>
            </label>
        </p>
        <p class="description half last">
            <label for="<?php 
            echo $this->get_field_id('limit');
            ?>
">
                Limit (required)<br/>
                <?php 
            echo aq_field_select('limit', $block_id, $limit_options, $limit);
            ?>
            </label>
        </p>
        <?php 
            $orderby_options = array('none' => 'none', 'ID' => 'ID', 'author' => 'author', 'title' => 'title', 'name' => 'name', 'date' => 'date', 'modified' => 'modified', 'parent' => 'parent', 'rand' => 'rand', 'comment_count' => 'comment_count');
            ?>
        <p class="description half ">
            <label for="<?php 
            echo $this->get_field_id('orderby');
            ?>
">
                Orderby<br/>
                <?php 
            echo aq_field_select('orderby', $block_id, $orderby_options, $orderby);
            ?>
            </label>
        </p>
              <?php 
            $order_options = array('ASC' => 'from lowest to highest values (1, 2, 3; a, b, c)', 'DESC' => 'from highest to lowest values (3, 2, 1; c, b, a)');
            ?>
        <p class="description half last">
            <label for="<?php 
            echo $this->get_field_id('order');
            ?>
">
                Order (ASC/DSC)<br/>
                <?php 
            echo aq_field_select('order', $block_id, $order_options, $order);
            ?>
            </label>
        </p>
        <p class="description half">
                <label for="<?php 
            echo $this->get_field_id('categories');
            ?>
">
                Posts Categories (leave empty to display all)<br/>
                <?php 
            echo aq_field_multiselect('categories', $block_id, $categories_options, $categories);
            ?>
                </label>
            </p>
            <p class="description half last">
                <label for="<?php 
            echo $this->get_field_id('types');
            ?>
">
                Posts Tags (leave empty to display all)<br/>
                <?php 
            echo aq_field_multiselect('tags', $block_id, $tags_options, $tags);
            ?>
                </label>
            </p>

        <?php 
        }
    function form($instance)
    {
        $defaults = array('qty' => '', 'category' => array(), 'autoplay' => '5000', 'orderby' => 'date', 'asc' => 'DESC', 'style' => 'title', 'excerpt_length' => '17');
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        $terms = get_terms('category');
        $all_terms = array();
        foreach ($terms as $term) {
            $all_terms[$term->term_id] = $term->name;
        }
        $orderby_options = array('date' => __('Date', 'engine'), 'title' => __('Title', 'engine'), 'rand' => __('Random', 'engine'), 'comment_count' => __('Comments', 'engine'));
        $order_options = array('DESC' => 'DESC', 'ASC' => 'ASC');
        $style_options = array('title' => __('Title Only', 'engine'), 'title_meta' => __('Title & Meta', 'engine'), 'title_meta_thumb_side' => __('Title, Meta & Thumb (thumb on side)', 'engine'), 'title_meta_thumb_1' => __('Title, Meta & Thumb (1 column)', 'engine'), 'title_meta_thumb_2' => __('Title, Meta & Thumb (2 columns)', 'engine'), 'title_meta_thumb_3' => __('Title, Meta & Thumb (3 columns)', 'engine'), 'title_meta_thumb_4' => __('Title, Meta & Thumb (4 columns)', 'engine'));
        ?>
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
				<?php 
        _e('Title (optional)', 'engine');
        ?>
				<?php 
        echo aq_field_input('title', $block_id, $title, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('style');
        ?>
">
				<?php 
        _e('Style', 'engine');
        ?>
				<?php 
        echo aq_field_select('style', $block_id, $style_options, $style);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('qty');
        ?>
">
				<?php 
        _e('Number of Posts', 'engine');
        ?>
				<?php 
        echo aq_field_input('qty', $block_id, $qty, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('category');
        ?>
">
				<?php 
        _e('Categories', 'engine');
        ?>
				<?php 
        echo aq_field_multiselect('category', $block_id, $all_terms, $category);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('orderby');
        ?>
">
				<?php 
        _e('Order By', 'engine');
        ?>
				<?php 
        echo aq_field_select('orderby', $block_id, $orderby_options, $orderby);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('asc');
        ?>
">
				<?php 
        _e('Order', 'engine');
        ?>
				<?php 
        echo aq_field_select('asc', $block_id, $order_options, $asc);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('excerpt_length');
        ?>
">
				<?php 
        _e('Excerpt Length (optional)', 'engine');
        ?>
				<?php 
        echo aq_field_input('excerpt_length', $block_id, $excerpt_length, $size = 'full');
        ?>
			</label>
		</p>
		
		<?php 
    }
示例#5
0
        function form($instance)
        {
            $defaults = array('limit' => '4', 'title' => 'Testimonials', 'orderby' => 'date', 'order' => 'ASC', 'type' => 'standard', 'testimonials' => '');
            $wp_query = new WP_Query(array('post_type' => array('testimonial'), 'showposts' => 99));
            $testgroup = array();
            while ($wp_query->have_posts()) {
                $wp_query->the_post();
                $testgroup[$wp_query->post->ID] = get_the_title();
            }
            $limit_options = array();
            for ($i = 0; $i < 25; $i++) {
                $limit_options[$i] = $i;
            }
            $instance = wp_parse_args($instance, $defaults);
            extract($instance);
            ?>
         <p class="description half">
            <label for="<?php 
            echo $this->get_field_id('title');
            ?>
">
                Title (required)<br/>
                <?php 
            echo aq_field_input('title', $block_id, $title);
            ?>
            </label>
        </p>
        <p class="description half last">
            <label for="<?php 
            echo $this->get_field_id('limit');
            ?>
">
                Limit (required)<br/>
                <?php 
            echo aq_field_select('limit', $block_id, $limit_options, $limit);
            ?>
            </label>
        </p>
        <?php 
            $orderby_options = array('none' => 'none', 'ID' => 'ID', 'author' => 'author', 'title' => 'title', 'name' => 'name', 'date' => 'date', 'modified' => 'modified', 'parent' => 'parent', 'rand' => 'rand', 'comment_count' => 'comment_count');
            ?>
            <p class="description half ">
                <label for="<?php 
            echo $this->get_field_id('orderby');
            ?>
">
                    Orderby<br/>
                    <?php 
            echo aq_field_select('orderby', $block_id, $orderby_options, $orderby);
            ?>
                </label>
            </p>
            <?php 
            $order_options = array('ASC' => 'from lowest to highest values (1, 2, 3; a, b, c)', 'DESC' => 'from highest to lowest values (3, 2, 1; c, b, a)');
            ?>
                <p class="description half last">
                    <label for="<?php 
            echo $this->get_field_id('order');
            ?>
">
                        Order (ASC/DSC)<br/>
                        <?php 
            echo aq_field_select('order', $block_id, $order_options, $order);
            ?>
                    </label>
                </p>
                <?php 
            $type_options = array('standard' => 'Standard', 'happy' => 'Wide testimonials with logo');
            ?>
                <p class="description half ">
                    <label for="<?php 
            echo $this->get_field_id('type');
            ?>
">
                        Testimonials style (ASC/DSC)<br/>
                        <?php 
            echo aq_field_select('type', $block_id, $type_options, $type);
            ?>
                    </label>
                </p>

                <p class="description half last">
                    <label for="<?php 
            echo $this->get_field_id('filters');
            ?>
">
                        Select testimonials (for all leave blank)<br/>
                        <?php 
            echo aq_field_multiselect('testimonials', $block_id, $testgroup, $testimonials);
            ?>
                    </label>
                </p>
                    <?php 
        }
示例#6
0
        function form($instance)
        {
            $defaults = array('rows' => array(1 => array('title' => 'New Row', 'rowcolor' => 'default', 'column1' => '', 'column2' => '', 'column3' => '', 'column4' => '', 'column5' => '', 'column6' => '', 'column7' => '', 'column8' => '', 'column9' => '', 'column10' => '', 'column11' => '', 'column12' => '')), 'columns' => '4', 'types' => array('default'), 'id' => '', 'class' => '', 'style' => '');
            $instance = wp_parse_args($instance, $defaults);
            extract($instance);
            $table_type = array('default' => 'Default', 'striped' => 'Striped', 'bordered' => 'Bordered', 'hover' => 'Hover', 'condensed' => 'Condensed');
            $columns_per_row = array('2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12');
            ?>
			<div class="description cf">
				<ul id="aq-sortable-list-<?php 
            echo $block_id;
            ?>
" class="aq-sortable-list" rel="<?php 
            echo $block_id;
            ?>
">
					<?php 
            $rows = is_array($rows) ? $rows : $defaults['rows'];
            $count = 1;
            foreach ($rows as $row) {
                $this->row($row, $count, $columns);
                $count++;
            }
            ?>
				</ul>
				<p></p>
				<a href="#" rel="row" class="aq-sortable-add-new button">Add New</a>
				<p></p>
			</div>
			<div class="description half">
				<label for="<?php 
            echo $this->get_field_id('columns');
            ?>
">
					Number of Columns (per row)<br/>
					<?php 
            echo aq_field_select('columns', $block_id, $columns_per_row, $columns);
            ?>
				</label>
			</div>
			<div class="description half last">
				<label for="<?php 
            echo $this->get_field_id('types');
            ?>
">
					Table Type <em style="font-size: 0.8em;">(CTRL + click to select multiple options)</em><br/>
					<?php 
            echo aq_field_multiselect('types', $block_id, $table_type, $types);
            ?>
				</label>
			</div>
			<div class="description half">
				<label for="<?php 
            echo $this->get_field_id('id');
            ?>
">
					id (optional)<br/>
					<?php 
            echo aq_field_input('id', $block_id, $id, $size = 'full');
            ?>
				</label>
			</div>

			<div class="description half last">
				<label for="<?php 
            echo $this->get_field_id('class');
            ?>
">
					class (optional)<br/>
					<?php 
            echo aq_field_input('class', $block_id, $class, $size = 'full');
            ?>
				</label>
			</div>

			<div class="description">
				<label for="<?php 
            echo $this->get_field_id('style');
            ?>
">
					Additional inline css styling (optional)<br/>
					<?php 
            echo aq_field_input('style', $block_id, $style);
            ?>
				</label>
			</div>
			<?php 
        }
    function form($instance)
    {
        $defaults = array('author' => '', 'qty' => '', 'category' => array(), 'autoplay' => '5000', 'orderby' => 'date', 'asc' => 'DESC', 'style' => 'title', 'excerpt_length' => '17');
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        $button_class = array('button', 'button-hero', 'simple-image-widget-control-choose');
        $terms = get_terms('category');
        $all_terms = array();
        foreach ($terms as $term) {
            $all_terms[$term->term_id] = $term->name;
        }
        $orderby_options = array('date' => __('Date', 'engine'), 'title' => __('Title', 'engine'), 'rand' => __('Random', 'engine'), 'comment_count' => __('Comments', 'engine'));
        $order_options = array('DESC' => 'DESC', 'ASC' => 'ASC');
        $style_options = array('title' => __('Title Only', 'engine'), 'title_meta' => __('Title & Meta', 'engine'), 'title_meta_thumb_side' => __('Title, Meta & Thumb (thumb on side)', 'engine'), 'title_meta_thumb_1' => __('Title, Meta & Thumb (1 column)', 'engine'), 'title_meta_thumb_2' => __('Title, Meta & Thumb (2 columns)', 'engine'), 'title_meta_thumb_3' => __('Title, Meta & Thumb (3 columns)', 'engine'), 'title_meta_thumb_4' => __('Title, Meta & Thumb (4 columns)', 'engine'), 'title_meta_excerpt' => __('Title, Meta & Excerpt', 'engine'));
        ?>
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
				<?php 
        _e('Title (optional)', 'engine');
        ?>
				<?php 
        echo aq_field_input('title', $block_id, $title, $size = 'full');
        ?>
			</label>
		</p>

		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('author');
        ?>
">
				<?php 
        _e('Author', 'engine');
        ?>
				<?php 
        echo aq_field_input('author', $block_id, $author, $size = 'full');
        ?>
			</label>
		</p>
		
		<?php 
        if (!is_simple_image_widget_legacy()) {
            ?>
				<p class="simple-image-widget-control<?php 
            echo $image_id ? ' has-image' : '';
            ?>
"
					data-title="<?php 
            esc_attr_e('Choose an Image', 'simple-image-widget');
            ?>
"
					data-update-text="<?php 
            esc_attr_e('Update Image', 'simple-image-widget');
            ?>
"
					data-target=".image-id">
					<?php 
            if ($image_id) {
                echo wp_get_attachment_image($image_id, 'thumbnail', false);
                //echo wp_get_attachment_image( $image_id,  array(200,200), false );
                unset($button_class[array_search('button-hero', $button_class)]);
            }
            ?>
					<input type="hidden" name="<?php 
            echo esc_attr($this->get_field_name('image_id'));
            ?>
" id="<?php 
            echo esc_attr($this->get_field_id('image_id'));
            ?>
" value="<?php 
            echo absint($image_id);
            ?>
" class="image-id simple-image-widget-control-target">
					<a href="#" class="<?php 
            echo esc_attr(join(' ', $button_class));
            ?>
"><?php 
            _e('Choose an Image', 'simple-image-widget');
            ?>
</a>
				</p>
		<?php 
        }
        ?>

		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('style');
        ?>
">
				<?php 
        _e('Style', 'engine');
        ?>
				<?php 
        echo aq_field_select('style', $block_id, $style_options, $style);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('qty');
        ?>
">
				<?php 
        _e('Number of Posts', 'engine');
        ?>
				<?php 
        echo aq_field_input('qty', $block_id, $qty, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('category');
        ?>
">
				<?php 
        _e('Categories', 'engine');
        ?>
				<?php 
        echo aq_field_multiselect('category', $block_id, $all_terms, $category);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('orderby');
        ?>
">
				<?php 
        _e('Order By', 'engine');
        ?>
				<?php 
        echo aq_field_select('orderby', $block_id, $orderby_options, $orderby);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('asc');
        ?>
">
				<?php 
        _e('Order', 'engine');
        ?>
				<?php 
        echo aq_field_select('asc', $block_id, $order_options, $asc);
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('excerpt_length');
        ?>
">
				<?php 
        _e('Excerpt Length (optional)', 'engine');
        ?>
				<?php 
        echo aq_field_input('excerpt_length', $block_id, $excerpt_length, $size = 'full');
        ?>
			</label>
		</p>
		
		<?php 
    }
示例#8
0
        function form($instance)
        {
            $defaults = array('title' => 'Recent Work', 'limit' => '', 'orderby' => '', 'order' => '', 'filters' => '');
            $portfolio_filters = get_terms('filters');
            $filters_options = array();
            foreach ($portfolio_filters as $filter) {
                $filters_options[$filter->term_id] = $filter->name;
            }
            $limit_options = array();
            for ($i = 0; $i < 25; $i++) {
                $limit_options[$i] = $i;
            }
            $instance = wp_parse_args($instance, $defaults);
            extract($instance);
            ?>
         <p>Note: You should only use this block on a full-width template</p>
         <p class="description half">
            <label for="<?php 
            echo $this->get_field_id('title');
            ?>
">
                Title (required)<br/>
                <?php 
            echo aq_field_input('title', $block_id, $title);
            ?>
            </label>
        </p>
        <p class="description half last">
            <label for="<?php 
            echo $this->get_field_id('limit');
            ?>
">
                Limit (required)<br/>
                <?php 
            echo aq_field_select('limit', $block_id, $limit_options, $limit);
            ?>
            </label>
        </p>
        <?php 
            $orderby_options = array('none' => 'none', 'ID' => 'ID', 'author' => 'author', 'title' => 'title', 'name' => 'name', 'date' => 'date', 'modified' => 'modified', 'parent' => 'parent', 'rand' => 'rand', 'comment_count' => 'comment_count');
            ?>
        <p class="description half ">
            <label for="<?php 
            echo $this->get_field_id('orderby');
            ?>
">
                Orderby<br/>
                <?php 
            echo aq_field_select('orderby', $block_id, $orderby_options, $orderby);
            ?>
            </label>
        </p>
              <?php 
            $order_options = array('ASC' => 'from lowest to highest values (1, 2, 3; a, b, c)', 'DESC' => 'from highest to lowest values (3, 2, 1; c, b, a)');
            ?>
        <p class="description half last">
            <label for="<?php 
            echo $this->get_field_id('order');
            ?>
">
                Order (ASC/DSC)<br/>
                <?php 
            echo aq_field_select('order', $block_id, $order_options, $order);
            ?>
            </label>
        </p>
        <p class="description">
            <label for="<?php 
            echo $this->get_field_id('filters');
            ?>
">
                Portfolio Filters (for all leave blank)<br/>
                <?php 
            echo aq_field_multiselect('filters', $block_id, $filters_options, $filters);
            ?>
            </label>
        </p>
        <?php 
        }