static function isGlossarySearch($query) { if ($query->is_search) { # Check post type if ($query->Get('post_type') == Post_Type::$post_type_name) { return True; } # Check taxonomies $glossary_taxonomies = Get_Object_Taxonomies(Post_Type::$post_type_name); if (!empty($glossary_taxonomies) && $query->Is_Tax($glossary_taxonomies)) { return True; } } return False; }
function Form($settings) { // Load options $this->load_options($settings); unset($settings); ?> <p> <label for="<?php echo $this->Get_Field_Id('title'); ?> "><?php echo $this->t('Title'); ?> </label>: <input type="text" id="<?php echo $this->Get_Field_Id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo HTMLSpecialChars($this->get_option('title')); ?> " /><br /> <small><?php echo $this->t('Leave blank to use the widget default title.'); ?> </small> </p> <p> <label for="<?php echo $this->Get_Field_Id('taxonomy'); ?> "><?php echo $this->t('Taxonomy'); ?> </label>: <select id="<?php echo $this->Get_Field_Id('taxonomy'); ?> " name="<?php echo $this->Get_Field_Name('taxonomy'); ?> "> <?php foreach (Get_Object_Taxonomies($this->fancy_gallery->gallery_post_type) as $taxonomy) { $taxonomy = Get_Taxonomy($taxonomy); ?> <option value="<?php echo $taxonomy->name; ?> " <?php Selected($this->get_option('taxonomy'), $taxonomy->name); ?> ><?php echo HTMLSpecialChars($taxonomy->labels->name); ?> </option> <?php } ?> </select><br /> <small><?php echo $this->t('Please choose the Taxonomy the widget should display.'); ?> </small> </p> <p> <label for="<?php echo $this->Get_Field_Id('number'); ?> "><?php echo $this->t('Number'); ?> </label>: <input type="text" id="<?php echo $this->Get_Field_Id('number'); ?> " name="<?php echo $this->get_field_name('number'); ?> " value="<?php echo HTMLSpecialChars($this->get_option('number')); ?> " size="4" /><br /> <small><?php echo $this->t('Leave blank to show all.'); ?> </small> </p> <p> <label for="<?php echo $this->get_field_id('exclude'); ?> "><?php _e('Exclude:'); ?> </label> <input type="text" value="<?php echo HTMLSpecialChars($this->get_option('exclude')); ?> " name="<?php echo $this->get_field_name('exclude'); ?> " id="<?php echo $this->get_field_id('exclude'); ?> " class="widefat" /><br /> <small><?php echo $this->t('Term IDs, separated by commas.'); ?> </small> </p> <p> <input type="checkbox" id="<?php echo $this->get_field_id('count'); ?> " name="<?php echo $this->get_field_name('count'); ?> " <?php Checked($this->get_option('count') == True); ?> /> <label for="<?php echo $this->get_field_id('count'); ?> "><?php _e('Show Gallery counts.'); ?> </label> </p> <p> <label for="<?php echo $this->Get_Field_Id('orderby'); ?> "><?php echo $this->t('Order by'); ?> </label>: <select id="<?php echo $this->Get_Field_Id('orderby'); ?> " name="<?php echo $this->Get_Field_Name('orderby'); ?> "> <option value="name" <?php Selected($this->get_option('orderby'), 'name'); ?> ><?php echo __('Name'); ?> </option> <option value="count" <?php Selected($this->get_option('orderby'), 'count'); ?> ><?php echo $this->t('Gallery Count'); ?> </option> <option value="ID" <?php Selected($this->get_option('orderby'), 'ID'); ?> >ID</option> <option value="slug" <?php Selected($this->get_option('orderby'), 'slug'); ?> ><?php echo $this->t('Slug'); ?> </option> </select> </p> <p> <label for="<?php echo $this->Get_Field_Id('order'); ?> "><?php echo $this->t('Order'); ?> </label>: <select id="<?php echo $this->Get_Field_Id('order'); ?> " name="<?php echo $this->Get_Field_Name('order'); ?> "> <option value="ASC" <?php Selected($this->get_option('order'), 'ASC'); ?> ><?php _e('Ascending'); ?> </option> <option value="DESC" <?php Selected($this->get_option('order'), 'DESC'); ?> ><?php _e('Descending'); ?> </option> </select> </p> <?php }
function Add_Taxonomy_Archive_Urls() { foreach (Get_Object_Taxonomies($this->name) as $taxonomy) { /*$taxonomy = Get_Taxonomy($taxonomy)*/ Add_Action($taxonomy . '_edit_form_fields', array($this, 'Print_Taxonomy_Archive_Urls'), 10, 3); } }