function form($instance) { $defaults = array('title' => __('Latest Posts', 'mars')); $instance = wp_parse_args((array) $instance, $defaults); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title:', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo $instance['title']; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('post_category'); ?> "><?php _e('Category:', 'mars'); ?> </label> <?php wp_dropdown_categories($args = array('show_option_all' => 'All', 'orderby' => 'ID', 'order' => 'ASC', 'show_count' => 1, 'hide_empty' => 1, 'child_of' => 0, 'echo' => 1, 'selected' => isset($instance['post_category']) ? $instance['post_category'] : null, 'hierarchical' => 0, 'name' => $this->get_field_name('post_category'), 'id' => $this->get_field_id('post_category'), 'taxonomy' => 'category', 'hide_if_empty' => true, 'class' => 'postform mars-dropdown')); ?> </p> <p> <label for="<?php echo $this->get_field_id('post_tag'); ?> "><?php _e('Post Tag:', 'mars'); ?> </label> <input placeholder="<?php _e('Eg: tag1,tag2,tag3', 'mars'); ?> " id="<?php echo $this->get_field_id('post_tag'); ?> " name="<?php echo $this->get_field_name('post_tag'); ?> " value="<?php echo isset($instance['post_tag']) ? $instance['post_tag'] : null; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('date'); ?> "><?php _e('Date (Show posts associated with a certain time and date period, (yy-mm-dd)):', 'mars'); ?> </label> <input class="vt-datetime" id="<?php echo $this->get_field_id('date'); ?> " name="<?php echo $this->get_field_name('date'); ?> " value="<?php echo isset($instance['date']) ? $instance['date'] : null; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('post_orderby'); ?> "><?php _e('Orderby:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('post_orderby'); ?> " name="<?php echo $this->get_field_name('post_orderby'); ?> "> <?php foreach (post_orderby_options() as $key => $value) { $selected = $instance['post_orderby'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('post_order'); ?> "><?php _e('Order:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('post_order'); ?> " name="<?php echo $this->get_field_name('post_order'); ?> "> <?php foreach ($this->widget_video_order() as $key => $value) { $selected = $instance['post_order'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('widget_column'); ?> "><?php _e('Widget Column:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('widget_column'); ?> " name="<?php echo $this->get_field_name('widget_column'); ?> "> <?php foreach ($this->widget_video_column() as $key => $value) { $selected = $instance['widget_column'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('post_shows'); ?> "><?php _e('Shows:', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('post_shows'); ?> " name="<?php echo $this->get_field_name('post_shows'); ?> " value="<?php echo isset($instance['post_shows']) ? (int) $instance['post_shows'] : 16; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('rows'); ?> "><?php _e('Rows (Available with 3 or 1 Column):', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('rows'); ?> " name="<?php echo $this->get_field_name('rows'); ?> " value="<?php echo isset($instance['rows']) ? (int) $instance['rows'] : 1; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('auto'); ?> "><?php _e('Auto Play:', 'mars'); ?> </label> <input type="checkbox" id="<?php echo $this->get_field_id('auto'); ?> " name="<?php echo $this->get_field_name('auto'); ?> " <?php print isset($instance['auto']) && $instance['auto'] == 'on' ? 'checked' : null; ?> /> </p> <p> <label for="<?php echo $this->get_field_id('view_more'); ?> "><?php _e('View more link:', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('view_more'); ?> " name="<?php echo $this->get_field_name('view_more'); ?> " value="<?php echo isset($instance['view_more']) ? $instance['view_more'] : null; ?> " style="width:100%;" /> </p> <?php }
function form($instance) { $defaults = array('title' => __('Right Sidebar Videos', 'mars')); $instance = wp_parse_args((array) $instance, $defaults); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title:', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo isset($instance['title']) ? $instance['title'] : null; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('video_category'); ?> "><?php _e('Video Category:', 'mars'); ?> </label> <?php wp_dropdown_categories($args = array('show_option_all' => 'All', 'orderby' => 'ID', 'order' => 'ASC', 'show_count' => 1, 'hide_empty' => 1, 'child_of' => 0, 'echo' => 1, 'selected' => isset($instance['video_category']) ? $instance['video_category'] : null, 'hierarchical' => 0, 'name' => $this->get_field_name('video_category'), 'id' => $this->get_field_id('video_category'), 'taxonomy' => 'categories', 'hide_if_empty' => true, 'class' => 'postform mars-dropdown')); ?> </p> <p> <label for="<?php echo $this->get_field_id('video_tag'); ?> "><?php _e('Video Tag:', 'mars'); ?> </label> <input placeholder="<?php _e('Eg: tag1,tag2,tag3', 'mars'); ?> " id="<?php echo $this->get_field_id('video_tag'); ?> " name="<?php echo $this->get_field_name('video_tag'); ?> " value="<?php echo isset($instance['video_tag']) ? $instance['video_tag'] : null; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('video_orderby'); ?> "><?php _e('Orderby:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('video_orderby'); ?> " name="<?php echo $this->get_field_name('video_orderby'); ?> "> <?php foreach (post_orderby_options('video') as $key => $value) { $selected = $instance['video_orderby'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('video_order'); ?> "><?php _e('Order:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('video_order'); ?> " name="<?php echo $this->get_field_name('video_order'); ?> "> <?php foreach ($this->widget_video_order() as $key => $value) { $selected = $instance['video_order'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('widget_column'); ?> "><?php _e('Widget Column:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('widget_column'); ?> " name="<?php echo $this->get_field_name('widget_column'); ?> "> <?php foreach ($this->widget_video_column() as $key => $value) { $selected = $instance['widget_column'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('video_shows'); ?> "><?php _e('Shows:', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('video_shows'); ?> " name="<?php echo $this->get_field_name('video_shows'); ?> " value="<?php echo isset($instance['video_shows']) ? (int) $instance['video_shows'] : 4; ?> " style="width:100%;" /> </p> <?php }
function form($instance) { $defaults = array('title' => __('Related posts', 'mars')); $instance = wp_parse_args((array) $instance, $defaults); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title:', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo isset($instance['title']) ? $instance['title'] : null; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('post_orderby'); ?> "><?php _e('Orderby:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('post_orderby'); ?> " name="<?php echo $this->get_field_name('post_orderby'); ?> "> <?php foreach (post_orderby_options() as $key => $value) { $selected = $instance['post_orderby'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('post_order'); ?> "><?php _e('Order:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('post_order'); ?> " name="<?php echo $this->get_field_name('post_order'); ?> "> <?php foreach ($this->widget_post_order() as $key => $value) { $selected = $instance['post_order'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('post_filter_condition'); ?> "><?php _e('Filter Condition:', 'mars'); ?> </label> <select style="width:100%;" id="<?php echo $this->get_field_id('post_filter_condition'); ?> " name="<?php echo $this->get_field_name('post_filter_condition'); ?> "> <?php foreach ($this->condition() as $key => $value) { $selected = $instance['post_filter_condition'] == $key ? 'selected' : null; ?> <option <?php print $selected; ?> value="<?php print $key; ?> "><?php print $value; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('post_shows'); ?> "><?php _e('Shows:', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('post_shows'); ?> " name="<?php echo $this->get_field_name('post_shows'); ?> " value="<?php echo isset($instance['post_shows']) ? (int) $instance['post_shows'] : 16; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('rows'); ?> "><?php _e('Rows:', 'mars'); ?> </label> <input id="<?php echo $this->get_field_id('rows'); ?> " name="<?php echo $this->get_field_name('rows'); ?> " value="<?php echo isset($instance['rows']) ? (int) $instance['rows'] : 1; ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('auto'); ?> "><?php _e('Auto Play:', 'mars'); ?> </label> <input type="checkbox" id="<?php echo $this->get_field_id('auto'); ?> " name="<?php echo $this->get_field_name('auto'); ?> " <?php print isset($instance['auto']) && $instance['auto'] == 'on' ? 'checked' : null; ?> /> </p> <?php }