public function render_content() { $dropdown = wp_dropdown_categories(array('name' => '_customize-dropdown-categories-' . $this->id, 'echo' => 0, 'show_option_all' => __('— All Categories —', 'scoutwp-theme'), 'selected' => $this->value())); // Add in the link $dropdown = str_replace('<select', '<select ' . $this->get_link(), $dropdown); echo "<label class='customize-control-select'><span class='customize-control-title'>{$this->label}</span><span class='description customize-control-description'>{$this->description}</span> {$dropdown}</label>"; }
function extra_tablenav($which) { global $post_type_object, $cat; $term_id = 0; ?> <div class="alignleft actions"> <?php if ('top' == $which && !is_singular()) { $this->months_dropdown(self::$post_type); if (is_object_in_taxonomy(self::$post_type, SI_Record::TAXONOMY)) { $term_id = isset($_GET[SI_Record::TAXONOMY]) ? $_GET[SI_Record::TAXONOMY] : 0; $dropdown_options = array('taxonomy' => SI_Record::TAXONOMY, 'show_option_all' => __('View all types'), 'hide_empty' => 0, 'hierarchical' => 1, 'show_count' => 0, 'orderby' => 'name', 'selected' => $term_id, 'name' => SI_Record::TAXONOMY); wp_dropdown_categories($dropdown_options); } do_action('restrict_manage_posts'); submit_button(__('Filter'), 'secondary', false, false, array('id' => 'post-query-submit')); // Purge if (count($this->items) > 0) { if (isset($_GET[SI_Record::TAXONOMY]) && $_GET[SI_Record::TAXONOMY]) { $term = get_term($_GET[SI_Record::TAXONOMY], SI_Record::TAXONOMY); $button_label = __('Purge') . ' ' . $term->name . ' ' . __('Type'); } $button_label = isset($button_label) ? $button_label : __('Purge All Types'); printf('<button type="submit" name="purge_records" class="button" value="%s">%s</button>', $term_id, $button_label); printf('<input type="hidden" name="%s" value="%s" />', SI_Internal_Records::RECORD_PURGE_NONCE, wp_create_nonce(SI_Internal_Records::RECORD_PURGE_NONCE)); } } ?> </div> <?php }
function jbst_taxonomy_select($field, $meta) { wp_dropdown_categories(array('show_option_none' => 'Default', 'hierarchical' => 1, 'taxonomy' => $field['taxonomy'], 'orderby' => 'name', 'hide_empty' => 0, 'name' => $field['id'], 'selected' => $meta)); if (!empty($field['desc'])) { echo '<p class="cmb_metabox_description">' . $field['desc'] . '</p>'; } }
/** * Outputs the HTML for this widget. * * @param array $args An array of standard parameters for widgets in this theme * @param array $instance An array of settings for this widget instance * * @return void Echoes it's output */ public function widget($args, $instance) { $instance = wp_parse_args($instance, $this->defaults); extract($args); if ($title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base)) { echo $before_title . esc_html($title) . $after_title; } echo $before_widget; ?> <form method="get" action="<?php echo esc_url(home_url('/')); ?> " class="<?php echo $instance['instance'] ? 'instance-search' : ''; ?> "> <div class="product-cat"> <?php wp_dropdown_categories(array('name' => 'product_cat', 'taxonomy' => 'product_cat', 'class' => 'cs-select cs-skin-elastic', 'orderby' => 'NAME', 'order' => 'ASC', 'hierarchical' => 1, 'hide_empty' => 0, 'show_option_all' => __('All Categories', 'bigboom'), 'walker' => new TA_Cat_Slug_Walker())); ?> </div> <input type="text" name="s" class="search-field" placeholder="Search the entire shop....."> <input type="hidden" name="post_type" value="product"> <input type="submit" value="<?php esc_attr_e('Search', 'bigboom'); ?> " class="search-submit"> </form> <?php echo $after_widget; }
public function html($meta, $repeatable = null) { is_array($meta) and $meta = null; $name = is_null($repeatable) ? $this->_name : $this->_name . '[' . $repeatable . ']'; $id = is_null($repeatable) ? $this->_id : $this->_id . '_' . $repeatable; $classes = array(); if (!empty($this->_params['context']) and $this->_params['context'] != 'side') { $classes[] = 'form-field'; } $classes = implode(' ', $classes); empty($classes) or $classes = ' class="' . $classes . '"'; $args = array('id' => $id, 'name' => $name, 'selected' => $meta, 'echo' => 0, 'class' => $classes); empty($this->_params['args']) or $args = array_merge($args, $this->_params['args']); echo '<tr' . $classes . '>'; echo ' <th scope="row"> <label for="' . $id . '">' . $this->_label . '</label> </th> <td> ' . wp_dropdown_categories($args) . ' <p class="description">' . $this->_description . '</p> </td>'; echo '</tr>'; }
function formCreate($instance,$headline_instance, $cat_instance, $dropdown_instance,$num_post_instance){ //Generates widget options form which you see in the widgets section in the admin $headline = esc_attr($instance[$headline_instance]); $include_cats = esc_attr($instance[$cat_instance]); $num_post_selected = esc_attr($instance[$num_post_instance]); ?> <p><label for="<? echo $this->get_field_id($headline_instance); ?>">Headline: <input class="widefat" id="<? echo $this->get_field_id($headline_instance); ?>" name="<? echo $this->get_field_name($headline_instance); ?>" type="text" value="<? echo attribute_escape($headline); ?>" /> </label> </p> <p> Categories Dropdown / How Many Posts<br /> <? wp_dropdown_categories('orderby=name&hide_empty=0&show_option_none=Select Categories to include&id='.$dropdown_instance.'&name='.$dropdown_instance.'&taxonomy=category'); echo " "; echo $this->dw_createNumSelect($this->get_field_id($num_post_instance),$this->get_field_name($num_post_instance),10,$num_post_selected);?> <br /><br /> <label for="<? echo $this->get_field_id($cat_instance); ?>">Included Categories: <textarea class="widefat" id="<? echo $this->get_field_id($cat_instance); ?>" name="<? echo $this->get_field_name($cat_instance); ?>" rows="2" cols="1" style="text-align:left;"><? echo attribute_escape($include_cats); ?></textarea> </label> </p> <? }
public function show_ajax_form() { if (isset($_REQUEST['productid'])) { $dropdownargs = array('show_option_all' => false, 'show_option_none' => false, 'orderby' => 'id', 'order' => 'ASC', 'show_count' => 1, 'hide_empty' => 0, 'child_of' => 0, 'exclude' => '', 'echo' => 0, 'selected' => 0, 'hierarchical' => 1, 'name' => 'wcordersortupdateshelf', 'id' => '', 'class' => 'postform', 'depth' => 0, 'tab_index' => 0, 'taxonomy' => 'product_shelf', 'hide_if_empty' => false, 'option_none_value' => -1, 'value_field' => 'term_id'); $echo = ''; $product_name = '<a href="' . get_post_permalink($_REQUEST['productid']) . '" >' . get_the_title($_REQUEST['productid']) . '</a>'; $echo .= '<form method="post"> <table class="flat-table" cellspacing="3" >'; $echo .= '<tr>'; $echo .= '<th>Product Name : </th>'; $echo .= '<td>' . $product_name . '</td>'; $echo .= '</tr>'; $echo .= '<tr>'; $echo .= '<th>Shelf : </th>'; $echo .= '<td>' . wp_dropdown_categories($dropdownargs) . '</td>'; $echo .= '</tr>'; $echo .= '<tr>'; $echo .= '<td><input type="hidden" name="action" value="wcordersortforechangeshelf" /> </td>'; $echo .= '<td><input type="submit" class="myButton "value="Update Shelf"/> </td>'; $echo .= '</tr>'; $echo .= '</table> </form>'; $echo .= '<style>'; $echo .= 'table { width: 100%; } th { background: #eee; color: black; font-weight: bold; } td, th { padding: 6px; border: 1px solid #ccc; text-align: left; }'; $echo .= ".myButton {\tbackground:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #77b55a), color-stop(1, #72b352)); background:-moz-linear-gradient(top, #77b55a 5%, #72b352 100%); \tbackground:-webkit-linear-gradient(top, #77b55a 5%, #72b352 100%); \tbackground:-o-linear-gradient(top, #77b55a 5%, #72b352 100%); background:-ms-linear-gradient(top, #77b55a 5%, #72b352 100%); background:linear-gradient(to bottom, #77b55a 5%, #72b352 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#77b55a', endColorstr='#72b352',GradientType=0); background-color:#77b55a; -moz-border-radius:4px; \t-webkit-border-radius:4px; \tborder-radius:4px; \tborder:1px solid #4b8f29; display:inline-block; cursor:pointer; color:#ffffff; font-family:Arial; font-size:15px; font-weight:bold; padding:6px 12px;\ttext-decoration:none;\ttext-shadow:0px 1px 0px #5b8a3c;} .myButton:hover { background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #72b352), color-stop(1, #77b55a)); \tbackground:-moz-linear-gradient(top, #72b352 5%, #77b55a 100%); \tbackground:-webkit-linear-gradient(top, #72b352 5%, #77b55a 100%); \tbackground:-o-linear-gradient(top, #72b352 5%, #77b55a 100%); \tbackground:-ms-linear-gradient(top, #72b352 5%, #77b55a 100%); \tbackground:linear-gradient(to bottom, #72b352 5%, #77b55a 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#72b352', endColorstr='#77b55a',GradientType=0); \tbackground-color:#72b352; } .myButton:active { \tposition:relative; \ttop:1px; }"; $echo .= '</style>'; echo $echo; } wp_die(); }
public function render_content() { $dropdown = wp_dropdown_categories(array('name' => $this->id, 'echo' => 0, 'show_option_all' => __('All', 'matheson'), 'selected' => $this->value(), 'class' => 'customize-dropdown-cats')); // hackily add in the data link parameter. $dropdown = str_replace('<select', '<select ' . $this->get_link(), $dropdown); printf('<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>', $this->label, $dropdown); }
/** * Add the field to the filters */ public function job_manager_job_filters_search_jobs_end($atts) { if ((!isset($atts['selected_region']) || '' == $atts['selected_region']) && isset($_GET['search_region'])) { $atts['selected_region'] = absint($_GET['search_region']); } wp_dropdown_categories(apply_filters('job_manager_regions_dropdown_args', array('show_option_all' => __('All Regions', 'wp-job-manager-locations'), 'hierarchical' => true, 'taxonomy' => 'job_listing_region', 'name' => 'search_region', 'class' => 'search_region', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'selected' => isset($atts['selected_region']) ? $atts['selected_region'] : ''))); }
function build_taxo_dd_filter() { $tax_name = $this->name; $tax_obj = get_taxonomy($tax_name); $selected = empty($_GET[$tax_name]) ? '' : $_GET[$tax_name]; wp_dropdown_categories(array('show_option_all' => __('Show All ' . $tax_obj->label . ' '), 'taxonomy' => $tax_name, 'name' => $tax_obj->name, 'orderby' => 'name', 'selected' => $selected, 'hierarchical' => $tax_obj->hierarchical, 'show_count' => false, 'hide_empty' => false)); }
/** * Render the control's content. * * @since 3.4.0 */ public function render_content() { $dropdown = wp_dropdown_categories(array('name' => '_customize-dropdown-categories-' . $this->id, 'echo' => 0, 'show_option_none' => __('— Select —'), 'option_none_value' => '0', 'selected' => $this->value())); // Hackily add in the data link parameter. $dropdown = str_replace('<select', '<select ' . $this->get_link(), $dropdown); printf('<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>', $this->label, $dropdown); }
function sbc_shortcode($atts) { extract(shortcode_atts(array(' ' => null), $atts)); $args = array('show_option_none' => 'Select category', 'show_count' => 1, 'orderby' => 'name', 'echo' => 1, 'child_of' => tb_get_option('main_course_select'), 'class' => 'form-control subject'); ?> <section class="course-finder"> <h6 class="section-heading text-highlight"><span class="line">Course Finder</span></h1> <div class="section-content"> <form class="course-finder-form" action="<?php echo esc_url(home_url('/')); ?> " method="get"> <div class="row"> <div class="col-md-5 col-sm-5 subject"> <?php wp_dropdown_categories($args); ?> </div> <div class="col-md-7 col-sm-7 keywords"> <input type="text" class="form-control pull-left" name="s" id="s" placeholder="Search keywords" /> <button type="submit" class="btn btn-theme"> <i class="fa fa-search"></i> </button> </div> </div> <input type="hidden" name="post_type" value="courses" /> </form><!--//course-finder-form--> <a class="read-more" href="<?php echo esc_url(get_permalink(get_page_by_title('Courses'))); ?> ">View all our courses<i class="fa fa-chevron-right"></i></a> </div><!--//section-content--> </section><!--//course-finder--> <?php }
public static function restrict_contacts_by_status() { global $typenow; if (Sprout_Client::POST_TYPE === $typenow) { $selected = 0; $taxonomy = Sprout_Client::TYPE_TAXONOMY; if (isset($_GET[$taxonomy]) && $_GET[$taxonomy]) { $term = get_term_by('slug', $_GET[$taxonomy], $taxonomy); $selected = $term->term_id; } $status_taxonomy = get_taxonomy($taxonomy); wp_dropdown_categories(array('show_option_all' => sprintf(self::__('All %s'), $status_taxonomy->label), 'taxonomy' => $taxonomy, 'name' => $taxonomy, 'orderby' => 'name', 'selected' => $selected, 'show_count' => true, 'value_field' => 'slug')); $type_selected = 0; $taxonomy = Sprout_Client::STATUS_TAXONOMY; if (isset($_GET[$taxonomy]) && $_GET[$taxonomy]) { $term = get_term_by('slug', $_GET[$taxonomy], $taxonomy); $type_selected = $term->term_id; } $status_taxonomy = get_taxonomy($taxonomy); wp_dropdown_categories(array('show_option_all' => sprintf(self::__('All %s'), $status_taxonomy->label), 'taxonomy' => $taxonomy, 'name' => $taxonomy, 'orderby' => 'name', 'selected' => $type_selected, 'show_count' => true, 'value_field' => 'slug')); if ($selected || $type_selected) { $url = add_query_arg(array('post_type' => Sprout_Client::POST_TYPE), admin_url('edit.php')); printf('<a href="%s" id="filter_reset_link" class="del_button">X</a>', $url); } } }
public function render_content() { $dropdown = wp_dropdown_categories(array('name' => $this->name, 'echo' => 0, 'hide_empty' => false, 'show_option_none' => false, 'hide_if_empty' => false, 'selected' => $this->value())); $dropdown = str_replace('<select', '<select multiple = "multiple" style = "height:95px;" ' . $this->get_link(), $dropdown); printf('<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>', $this->label, $dropdown); echo '<p class="description">' . __('Hold down the Ctrl (windows) / Command (Mac) button to select multiple options.', 'catch-base') . '</p>'; }
/** * Render the control to be displayed in the Customizer. */ public function render_content() { $default_args = array('show_option_none' => ' ', 'option_none_value' => '0', 'taxonomy' => 'category'); $args = wp_parse_args($this->args, $default_args); $args['name'] = '_customize-dropdown-taxonomies-' . $this->id; $args['selected'] = $this->value(); $args['echo'] = false; ?> <label> <?php if (!empty($this->label)) { ?> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <?php } if (!empty($this->description)) { ?> <span class="description customize-control-description"><?php echo $this->description; ?> </span> <?php } ?> <?php echo str_replace('<select', '<select ' . $this->get_link(), wp_dropdown_categories($args)); ?> </label> <?php }
function restrict_manage_posts() { global $wp_query; if ($wp_query->query_vars['post_type'] == EM_POST_TYPE_EVENT || $wp_query->query_vars['post_type'] == 'event-recurring') { ?> <select name="scope"> <?php $scope = !empty($wp_query->query_vars['scope']) ? $wp_query->query_vars['scope'] : 'future'; foreach (em_get_scopes() as $key => $value) { $selected = ""; if ($key == $scope) { $selected = "selected='selected'"; } echo "<option value='{$key}' {$selected}>{$value}</option> "; } ?> </select> <?php if (get_option('dbem_categories_enabled')) { //Categories $selected = !empty($_GET['event-categories']) ? $_GET['event-categories'] : 0; wp_dropdown_categories(array('hide_empty' => 1, 'name' => EM_TAXONOMY_CATEGORY, 'hierarchical' => true, 'orderby' => 'name', 'id' => EM_TAXONOMY_CATEGORY, 'taxonomy' => EM_TAXONOMY_CATEGORY, 'selected' => $selected, 'show_option_all' => __('View all categories'))); } if (!empty($_REQUEST['author'])) { ?> <input type="hidden" name="author" value="<?php echo esc_attr($_REQUEST['author']); ?> " /> <?php } } }
function related_categories($category) { $category = $_REQUEST['tag_ID']; ?> <style type="text/css"> ul.categorychecklist li {float: left; width: 33% !important;} input[type="checkbox"], input[type="radio"] {width: auto !important;} </style> <tr class="form-field"> <th scope="row" valign="top"><label for="related_categories">Related Categories</label></th> <td> <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> <?php $related_categories = get_option("related_categories_" . $category); $checked = ''; $related_categories_arr = array(); if (!$related_categories) { $checked = ' checked="checked"'; } else { $related_categories_arr = explode(",", $related_categories); if (in_array("0", $related_categories_arr) || $related_categories == "") { $checked = ' checked="checked"'; } } ?> <li class="popular-category"><label class="selectit"><input type="checkbox" name="post_category[]" value="0"<?php echo $checked; ?> >All categories</label></li> <?php $related_categories_arr = explode(",", $related_categories); $args = array('show_option_all' => '', 'show_option_none' => '', 'orderby' => 'name', 'order' => 'ASC', 'show_count' => 0, 'hide_empty' => 0, 'child_of' => 0, 'exclude' => '', 'echo' => 0, 'selected' => 0, 'hierarchical' => 0, 'name' => 'related_categories', 'id' => 'related_categories', 'class' => 'popular-category', 'depth' => 0, 'tab_index' => 0, 'taxonomy' => 'category', 'hide_if_empty' => false); $select = wp_dropdown_categories($args); $select = preg_replace("#<[/]*select[^>]*>#", "", $select); $categories_options = explode("<option ", $select); $final_select = ""; foreach ($categories_options as $categories_option) { if (strlen($categories_option) < 5) { continue; } $categories_option = str_replace(' class="level-0"', '', $categories_option); $categories_option = str_replace('</option>', '</label></li>', $categories_option); preg_match('#value="(\\d+)"#', $categories_option, $matches); $cat_id = $matches[1]; if (in_array($cat_id, $related_categories_arr)) { $categories_option = 'checked="checked" ' . $categories_option; } $final_select .= '<li class="popular-category"><label class="selectit"><input type="checkbox" name="post_category[]" ' . $categories_option; } echo $final_select; ?> </ul> </td> </tr> <?php }
function form($instance) { $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $category = isset($instance['category']) ? esc_attr($instance['category']) : ''; ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> ">Título:</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " maxlength="26" value="<?php echo $title; ?> " class="widefat" /> </p> <p> <label for="<?php echo $this->get_field_id('category'); ?> ">Categoria:</label> <?php wp_dropdown_categories('class=widefat&show_count=1&hierarchical=1&name=' . $this->get_field_name('category') . '&selected=' . $instance['category']); ?> </p> <?php }
/** * Function to render the content on the theme customizer page * * @access public * @since 1.0.0 * * @param null * @return void * */ public function render_content() { $supermag_customizer_name = 'supermag_customizer_dropdown_categories_' . $this->id; $supermag_dropdown_categories = wp_dropdown_categories(array('name' => $supermag_customizer_name, 'echo' => 0, 'show_option_none' => __('Select', 'supermag'), 'option_none_value' => '0', 'selected' => $this->value())); $supermag_dropdown_final = str_replace('<select', '<select ' . $this->get_link(), $supermag_dropdown_categories); printf('<label><span class="customize-control-title">%s</span> %s</label>', $this->label, $supermag_dropdown_final); }
function widget($args, $instance) { extract($args, EXTR_SKIP); $category_id = empty($instance['category_id']) ? 1 : $instance['category_id']; $use_cat_title = empty($instance['use_cat_title']) ? 0 : $instance['use_cat_title']; $hide_empty_cats = empty($instance['hide_empty_cats']) ? 0 : $instance['hide_empty_cats']; $show_post_count = empty($instance['show_post_count']) ? 0 : $instance['show_post_count']; $title_link = empty($instance['title_link']) ? 0 : $instance['title_link']; $excluded = empty($instance['excluded']) ? '' : $instance['excluded']; $sub_subs = empty($instance['sub_subs']) ? 0 : $instance['sub_subs']; $dropdown = empty($instance['dropdown']) ? 0 : $instance['dropdown']; $post_is_parent = empty($instance['post_is_parent']) ? 0 : $instance['post_is_parent']; $dropdown_text = empty($instance['dropdown_text']) ? __('Select Sub-category', 'sub-categories-widget') : $instance['dropdown_text']; $list_order = empty($instance['list_order']) ? 0 : $instance['list_order']; if ($post_is_parent) { $category = get_the_category(); $category_id = $category ? $category[0]->cat_ID : 1; } if ($use_cat_title) { $title = apply_filters('widget_title', get_cat_name($category_id), $instance, $this->id_base); } else { $title = apply_filters('widget_title', empty($instance['title']) ? __('Sub Categories', 'sub-categories-widget') : $instance['title'], $instance, $this->id_base); } $parent = $sub_subs == 1 ? 'child_of' : 'parent'; $order = $list_order == 1 ? 'DESC' : 'ASC'; $no_sub_text = '<p>' . __('No sub-categories', 'sub-categories-widget') . '</p>'; $subs = wp_list_categories(array($parent => $category_id, 'hide_empty' => $hide_empty_cats, 'show_count' => $show_post_count, 'exclude' => $excluded, 'title_li' => null, 'show_option_none' => '', 'echo' => 0, 'orderby' => 'ID', 'order' => $order)); if ($post_is_parent == 0 || $post_is_parent == 1 && !empty($subs)) { echo $before_widget; if ($title_link) { echo $before_title . '<a href="' . get_category_link($category_id) . '">' . $title . '</a>' . $after_title; } else { echo $before_title . $title . $after_title; } if ($dropdown == 0) { if (!empty($subs)) { echo '<ul>' . $subs . '</ul>'; } else { echo $no_sub_text; } } else { $subs = wp_dropdown_categories(array('id' => 'sub-cat-' . $this->number, 'show_option_none' => $dropdown_text, $parent => $category_id, 'hide_empty' => $hide_empty_cats, 'show_count' => $show_post_count, 'exclude' => $excluded, 'hide_if_empty' => true, 'echo' => false, 'orderby' => 'ID', 'order' => $order)); if (!empty($subs)) { echo $subs; echo '<script type="text/javascript"> /* <![CDATA[ */ var dropdown' . $this->number . ' = document.getElementById("sub-cat-' . $this->number . '"); function onSubCatChange() { if (dropdown' . $this->number . '.options[dropdown' . $this->number . '.selectedIndex].value > 0) { location.href = "' . get_option('home') . '?cat="+dropdown' . $this->number . '.options[dropdown' . $this->number . '.selectedIndex].value; } } dropdown' . $this->number . '.onchange = onSubCatChange; /* ]]> */ </script>'; } else { echo $no_sub_text; } } echo $after_widget; } }
function add_custom_field_to_comment_form() { //Check case single if (!is_singular('cases')) { return; } if (has_term('', 'results')) { ?> <div class="toggle_case_result close_case"> <input type="checkbox" id="openCase" name="case_reset_result_cp" value="openCase"> <label for="openCase">Возобновить дело</label> </div> <?php } else { ?> <div class="toggle_case_result open_case"> <input type="checkbox" id="close_case_cp" name="close_case_comment_cp" value="1"> <label for="close_case_cp">Закрыть дело</label> <div id="result_select_container"><span>Укажите результат:</span> <?php wp_dropdown_categories('taxonomy=results&hide_empty=0&name=case_result_select&id=result_select&hide_if_empty=true'); ?> </div> </div> <?php } }
public function get_markup() { $walker = new WCMF_walker(); foreach ($this->taxonomies as $tax) { wp_dropdown_categories(array('taxonomy' => $tax, 'hide_if_empty' => true, 'show_option_all' => sprintf(get_taxonomy($tax)->labels->all_items), 'hide_empty' => true, 'hierarchical' => is_taxonomy_hierarchical($tax), 'show_count' => true, 'orderby' => 'name', 'selected' => '0' !== get_query_var($tax) ? get_query_var($tax) : false, 'name' => $tax, 'id' => $tax, 'walker' => $walker)); } }
function imag_render_imag_select_category($field, $meta) { wp_dropdown_categories(array('show_option_none' => __("All Blog Posts", 'virtue'), 'hierarchical' => 1, 'taxonomy' => 'category', 'orderby' => 'name', 'hide_empty' => 0, 'name' => $field['id'], 'selected' => $meta)); if (!empty($field['desc'])) { echo '<p class="cmb_metabox_description">' . $field['desc'] . '</p>'; } }
function restrict_user_form($user) { if (!current_user_can('add_users')) { return false; } $args = array('show_option_all' => '', 'show_option_none' => '== No restrict ==', 'orderby' => 'ID', 'order' => 'ASC', 'show_count' => 0, 'hide_empty' => 0, 'child_of' => 0, 'exclude' => '', 'echo' => 1, 'selected' => get_user_meta($user->ID, '_access', true), 'hierarchical' => 0, 'name' => 'allow', 'id' => '', 'class' => 'postform', 'depth' => 0, 'tab_index' => 0, 'taxonomy' => 'agencia', 'hide_if_empty' => false, 'walker' => ''); ?> <h3>Restrict the category in which this user can post to</h3> <table class="form-table"> <tr> <th><label for="access">Select category:</label></th> <td> <?php wp_dropdown_categories($args); ?> <br /> <span class="description">Use to restrict an author posting to just one category.</span> </td> </tr> </table> <?php }
function budget_extra_profile_fields($user) { ?> <h3>Budget</h3> <table class="form-table"> <tr> <th><label for="twitter">Default desk</label></th> <td> <?php wp_dropdown_categories(array('name' => 'default_desk', 'taxonomy' => 'desk', 'hide_empty' => false, 'selected' => ($default_desk = get_user_meta($user->ID, 'default_desk', true)) ? $default_desk : DEFAULT_DESK)); ?> </td> </tr> <tr> <th><label for="twitter">Default view</label></th> <td> <?php $default_view = ($default_view = get_user_meta($user->ID, 'default_view', true)) ? $default_view : 'user_docs'; ?> <select name="default_view"> <option value="user_docs" <?php echo $default_view == 'user_docs' ? 'selected="selected"' : ''; ?> >My docs</option> <option value="default_desk" <?php echo $default_view == 'default_desk' ? 'selected="selected"' : ''; ?> >Default desk</option> <option value="all" <?php echo $default_view == 'all' ? 'selected="selected"' : ''; ?> >All docs</option> </select> </td> </tr> <tr> <th><label for="assignment_editor">Assignment Editor</label></th> <td> <input type="checkbox" name="is_ae" <?php if (get_user_meta($user->ID, 'is_ae', true)) { ?> checked="checked"<?php } ?> > Assignment Editor </td> </tr> </table> <?php }
/** * How to display the widget on the screen. */ function widget($args, $instance) { extract($args); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : ''); $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post'; $taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type); $c = !empty($instance['count']) ? '1' : '0'; $h = !empty($instance['hierarchical']) ? '1' : '0'; $d = !empty($instance['dropdown']) ? '1' : '0'; $root = isset($instance['root']) ? (int) $instance['root'] : 0; $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h, 'taxonomy' => $taxonomy); if ($root > 0) { $cat_args['child_of'] = $root; } /* Before widget (defined by themes). */ echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <div class="widget_subcategories_inner"> <?php if ($d) { $cat_args['show_option_none'] = __('Select Category', 'axiom'); wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args)); ?> <script type='text/javascript'> /* <![CDATA[ */ jQuery('.widget_subcategories select').change(function() { var dropdown = jQuery(this).get(0); if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "<?php echo home_url(); ?> /?cat="+dropdown.options[dropdown.selectedIndex].value; } }); /* ]]> */ </script> <?php } else { ?> <ul> <?php $cat_args['title_li'] = ''; wp_list_categories(apply_filters('widget_categories_args', $cat_args)); ?> </ul> <?php } ?> </div> <?php /* After widget (defined by themes). */ echo $after_widget; }
function my_filter_list() { $screen = get_current_screen(); global $wp_query; if ($screen->post_type == 'wsc_team') { wp_dropdown_categories(array('show_option_all' => 'Show All Portfolios', 'taxonomy' => 'portfolio', 'name' => 'portfolio', 'orderby' => 'name', 'selected' => isset($wp_query->query['portfolio']) ? $wp_query->query['portfolio'] : '', 'hierarchical' => false, 'depth' => 3, 'show_count' => false, 'hide_empty' => true)); } }
/** * Create filter For custom Taxonomy * Function for display drop-down list with the results of content filtering */ function my_filtering() { $screen = get_current_screen(); global $wp_query; if ($screen->post_type == 'news') { wp_dropdown_categories(array('show_option_all' => 'Show All Topics for News', 'taxonomy' => 'topic_for_news', 'name' => 'topic_for_news', 'orderby' => 'name', 'selected' => isset($wp_query->query['topic_for_news']) ? $wp_query->query['topic_for_news'] : '', 'hierarchical' => false, 'depth' => 3, 'show_count' => false, 'hide_empty' => true)); } }
function marca_filtro() { $screen = get_current_screen(); global $wp_query; if ($screen->post_type == 'projeto') { wp_dropdown_categories(array('show_option_all' => 'Todas as categorias', 'taxonomy' => 'categoria_projecto', 'name' => 'Categoria', 'orderby' => 'name', 'selected' => isset($wp_query->query['categoria_projecto']) ? $wp_query->query['categoria_projecto'] : '', 'hierarchical' => true, 'depth' => 3, 'show_count' => false, 'hide_empty' => true)); } }
protected function render_content() { empty($this->tax_name) and $this->tax_name = 'category'; $dropdown = wp_dropdown_categories(array('tax_name' => $this->tax_name, 'name' => '_customize-dropdown-terms-' . $this->id, 'echo' => 0, 'show_option_none' => __('— Select —'), 'option_none_value' => '0', 'selected' => $this->value(), 'hide_empty' => 0, 'orderby' => 'name', 'hierarchical' => 1)); // Hackily add in the data link parameter. $dropdown = str_replace('<select', '<select ' . $this->get_link(), $dropdown); printf('<label class="customize-control-select"><span class="customize-control-title">%s</span> %s</label>', $this->label, $dropdown); }