Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 210725

Filter categories in Term/Category Legend

$
0
0

Replies: 0

My posts have several categories and for the purposes of my maps, I would like to restrict the ones that show up on the Term Legend to “year” categories.

In taxonomy.js, I made the following change:

		function sortTermLegendData( taxonomy, tax_data ) {
			var ordered_terms = [];

			$.each( tax_data.terms, function ( term_id, term_data ) {
				var order, sort_term = term_data;
				var years = ["196", "199", "195", "200", "201", "69", "203", "204", "205", "206", "58", "187", "193"];
				var is_year = years.indexOf( term_id );

				if(  is_year >= 0 ) {
......

This got me the desired effect of only displaying categories that are in the “years” array, but selecting/de-selecting the checkboxes now does not have any effect on the map pins. Is there something I am missing here?

  • This topic was modified 6 minutes ago by  gianners33.
  • This topic was modified 5 minutes ago by  gianners33.

Viewing all articles
Browse latest Browse all 210725

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>