/** * Creates the markup for the tags filter checkboxes on the docs loop * * @since 1.0-beta */ function filter_markup() { do_action('bp_docs_directory_filter_taxonomy_before'); $existing_terms = $this->get_item_terms(); $tag_filter = !empty($_GET['bpd_tag']); ?> <div id="docs-filter-section-tags" class="docs-filter-section<?php if ($tag_filter) { ?> docs-filter-section-open<?php } ?> "> <ul id="tags-list"> <?php if (!empty($existing_terms)) { ?> <?php foreach ($existing_terms as $term => $posts) { ?> <?php if (isset($posts['count'])) { $term_count = $posts['count']; } else { if (is_int($posts)) { $term_count = $posts; } else { $term_count = count($posts); } } if (isset($posts['name'])) { $term_name = $posts['name']; } else { $term_name = $term; } ?> <li> <!-- // XTEC ************ MODIFICAT - Add style for selected tags // 2016.04.27 @sarjona --> <?php $tags = explode(',', urldecode($_GET['bpd_tag'])); ?> <a href="<?php echo bp_docs_get_tag_link_multitag(array('tag' => $term, 'type' => 'url', 'tags' => $tags)); ?> " title="<?php echo esc_html($term_name); ?> " <?php echo in_array($term, $tags) ? ' class="selected-tag"' : ''; ?> ><?php echo esc_html($term_name); ?> <?php printf(__('(%d)', 'bp-docs'), $term_count); ?> </a> <!--//************ ORIGINAL <a href="<?php echo bp_docs_get_tag_link(array('tag' => $term, 'type' => 'url')); ?> " title="<?php echo esc_html($term_name); ?> "><?php echo esc_html($term_name); ?> <?php printf(__('(%d)', 'bp-docs'), $term_count); ?> </a> //************ FI --> </li> <?php } ?> <?php } else { ?> <li><?php _e('No tags to show.', 'bp-docs'); ?> </li> <?php } ?> </ul> </div> <?php do_action('bp_docs_directory_filter_taxonomy_after'); }
/** * Creates the markup for the tags filter checkboxes on the docs loop * * @since 1.0-beta */ function filter_markup() { do_action('bp_docs_directory_filter_taxonomy_before'); $existing_terms = $this->get_item_terms(); $tag_filter = !empty($_GET['bpd_tag']); ?> <div id="docs-filter-section-tags" class="docs-filter-section<?php if ($tag_filter) { ?> docs-filter-section-open<?php } ?> "> <ul id="tags-list"> <?php if (!empty($existing_terms)) { ?> <?php foreach ($existing_terms as $term => $posts) { ?> <?php if (isset($posts['count'])) { $term_count = $posts['count']; } else { if (is_int($posts)) { $term_count = $posts; } else { $term_count = count($posts); } } if (isset($posts['name'])) { $term_name = $posts['name']; } else { $term_name = $term; } ?> <li> <a href="<?php echo bp_docs_get_tag_link(array('tag' => $term, 'type' => 'url')); ?> " title="<?php echo esc_html($term_name); ?> "><?php echo esc_html($term_name); ?> <?php printf(__('(%d)', 'bp-docs'), $term_count); ?> </a> </li> <?php } ?> <?php } else { ?> <li><?php _e('No tags to show.', 'bp-docs'); ?> </li> <?php } ?> </ul> </div> <?php do_action('bp_docs_directory_filter_taxonomy_after'); }
/** * Creates the markup for the tags filter checkboxes on the docs loop * * @package BuddyPress Docs * @since 1.0-beta */ function filter_markup() { $existing_terms = $this->get_item_terms(); // No need to show the filter if there are no terms to show if (empty($existing_terms)) { return; } ?> <div class="docs-filter docs-filter-tags toggleable"> <p id="tags-toggle" class="toggle-switch"><?php _e('Filter by tag', 'bp-docs'); ?> </p> <ul id="tags-list" class="toggle-content"> <?php foreach ($existing_terms as $term => $posts) { ?> <li> <a href="<?php echo bp_docs_get_tag_link(array('tag' => $term, 'type' => 'url')); ?> " title="<?php echo esc_html($term); ?> "><?php echo esc_html($term); ?> <?php printf(__('(%d)', 'bp-docs'), count($posts)); ?> </a> <?php /* Going with tag cloud type fix for now */ ?> <?php /* <?php $checked = empty( $this->current_filters ) || ( !empty( $this->current_filters['tags'] ) && in_array( $term, $this->current_filters['tags'] ) ) ? true : false; ?> <label for="filter_terms[<?php echo esc_attr( $term ) ?>]"> <input type="checkbox" value="1" name="filter_terms[<?php echo esc_attr( $term ) ?>]" <?php checked( $checked ) ?>/> <?php echo esc_html( $term ) ?> <?php printf( __( '(%d)', 'bp-docs' ), count( $posts ) ) ?> </label> */ ?> </li> <?php } ?> </ul> </div> <?php }