static function generate($depth = False) { # Get current Filter string $filter = RawUrlDecode(Get_Query_Var('filter')); if (!empty($filter)) { $str_filter = $filter; } elseif (Is_Singular()) { $str_filter = StrToLower(Get_The_Title()); } else { $str_filter = ''; } # Explode Filter string $arr_current_filter = empty($str_filter) ? array() : PReg_Split('/(?<!^)(?!$)/u', $str_filter); Array_UnShift($arr_current_filter, ''); $arr_filter = array(); # This will be the function result $filter_part = ''; # Check if we are inside a taxonomy archive $taxonomy_term = Is_Tax() ? Get_Queried_Object() : Null; foreach ($arr_current_filter as $filter_letter) { $filter_part .= $filter_letter; $arr_available_filters = self::getFilters($filter_part, $taxonomy_term); if (Count($arr_available_filters) <= 1) { break; } $active_filter_part = MB_SubStr(Implode($arr_current_filter), 0, MB_StrLen($filter_part) + 1); $arr_filter_line = array(); foreach ($arr_available_filters as $available_filter) { $arr_filter_line[$available_filter] = (object) array('filter' => MB_StrToUpper(MB_SubStr($available_filter, 0, 1)) . MB_SubStr($available_filter, 1), 'link' => Post_Type::getArchiveLink($available_filter, $taxonomy_term), 'active' => $active_filter_part == $available_filter, 'disabled' => False); } $arr_filter[] = $arr_filter_line; # Check filter depth limit if ($depth && Count($arr_filter) >= $depth) { break; } } # Run a filter $arr_filter = Apply_Filters('glossary_prefix_filter_links', $arr_filter, $depth); return $arr_filter; }
<div class="tablenav"> <div class="tablenav-pages"><?php echo $page_links; ?> </div> </div> <?php } ?> <?php foreach ($images_query->posts as $image) { $attachment_counter++; $image->parent = Get_Post($image->post_parent); if (Is_Object($image->parent)) { $image->parent->title = Get_The_Title($image->parent->ID); $image->parent->link = Get_Permalink($image->parent->ID); $image->parent->type = Get_Post_Type_Object($image->parent->post_type); } else { $image->parent = False; } $image->move_link = Add_Query_Arg(array('move_attachment' => $image->ID, 'move_to' => $current_gallery->ID)); ?> <div class="attachment" id="attachment-<?php echo $image->ID; ?> "> <?php echo wp_get_attachment_image($image->ID); ?> <div class="details">