{"id":1164093,"date":"2016-09-14T11:15:03","date_gmt":"2016-09-14T18:15:03","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/"},"modified":"2016-09-14T11:15:03","modified_gmt":"2016-09-14T18:15:03","slug":"created-an-alternative-cost-filter-looking-for-second-opinions","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/","title":{"rendered":"Created an alternative cost filter, looking for second opinions."},"content":{"rendered":"<p>Hey everyone,<\/p>\n<p>I&#8217;ve created a <a href=\"https:\/\/bostonstartupsguide.com\/events\/\">Boston tech events calendar<\/a>, and the event prices ended up being a pretty large range. From meetups with $5 pizza costs to conferences with $5000+ registration fees. I wasn&#8217;t liking that my only options for the cost filter were a range slider that wasn&#8217;t really convenient for the distribution of the costs or a checklist of price-ranges that ended up being pretty arbitrary (and didn&#8217;t cover the ranges I actually wanted).<\/p>\n<p>So I added a new filter, following the process I&#8217;d seen on these forums (where the category filter was used as an example to add a custom taxonomy filter). Basically I copied the code for the Cost filter class, modified it, and added it to my functions.php with a line to initialize it:<\/p>\n<pre><code>class BSG__Cost__Tribe__Events__Filterbar__Filters__Cost extends Tribe__Events__Filterbar__Filter {\n\tconst EXPLICITLY_FREE = &#039;set_to_0&#039;;\n\tconst IMPLICITLY_FREE = &#039;unset_or_0&#039;;\n\n\tpublic $type = &#039;range&#039;;\n\tpublic $free = self::IMPLICITLY_FREE;\n\tprivate $min_cost = null;\n\tprivate $max_cost = null;\n\n\tprotected function settings() {\n\t\tparent::settings();\n\t\t$this-&gt;free_logic();\n\t}\n\n\tprotected function free_logic() {\n\t\t$settings = Tribe__Events__Filterbar__View::instance()-&gt;get_filter_settings();\n\t\t$this-&gt;free = isset( $settings[ $this-&gt;slug ][&#039;free&#039;] ) &amp;&amp; self::EXPLICITLY_FREE === $settings[ $this-&gt;slug ][&#039;free&#039;]\n\t\t\t? self::EXPLICITLY_FREE : self::IMPLICITLY_FREE;\n\t}\n\n\tprotected function get_submitted_value() {\n\t\tif ( ! empty( $_REQUEST[ &#039;tribe_&#039; . $this-&gt;slug ] ) ) {\n\t\t\t$value = (array) $_REQUEST[ &#039;tribe_&#039; . $this-&gt;slug ];\n\n\t\t\tif ( isset( $value[&#039;min&#039;] ) &amp;&amp; isset( $value[&#039;max&#039;] ) ) {\n\t\t\t\treturn array( $value );\n\t\t\t} else {\n\t\t\t\tforeach ( $value as &amp;$v ) {\n\t\t\t\t\t$range = explode( &#039;-&#039;, $v );\n\t\t\t\t\tif ( ! preg_match( &#039;\/[0-9]+\\-[0-9]+\/&#039;, $v ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$v = array( &#039;min&#039; =&gt; $range[0], &#039;max&#039; =&gt; $range[1] );\n\t\t\t\t}\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\t\treturn array();\n\t}\n\n\tpublic function get_admin_form() {\n\t\t$title = $this-&gt;get_title_field();\n\t\t$type = $this-&gt;get_type_field();\n\t\treturn $title.$type;\n\t}\n\n\tprotected function get_type_field() {\n\t\t$name = $this-&gt;get_admin_field_name( &#039;type&#039; );\n\t\t$type_field = sprintf( __( &#039;Type: %s %s&#039;, &#039;tribe-events-filter-view&#039; ),\n\t\t\tsprintf( &#039;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;%s&quot; value=&quot;range&quot; %s \/&gt; %s&lt;\/label&gt;&#039;,\n\t\t\t\t$name,\n\t\t\t\tchecked( $this-&gt;type, &#039;range&#039;, false ),\n\t\t\t\t__( &#039;Range Slider&#039;, &#039;tribe-events-filter-view&#039; )\n\t\t\t),\n\t\t\tsprintf( &#039;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;%s&quot; value=&quot;checkbox&quot; %s \/&gt; %s&lt;\/label&gt;&#039;,\n\t\t\t\t$name,\n\t\t\t\tchecked( $this-&gt;type, &#039;checkbox&#039;, false ),\n\t\t\t\t__( &#039;Checkboxes&#039;, &#039;tribe-events-filter-view&#039; )\n\t\t\t)\n\t\t);\n\n\t\t$name = $this-&gt;get_admin_field_name( &#039;free&#039; );\n\t\t$cost_field = sprintf( __( &#039;Events are considered free when cost field is: %s %s&#039;, &#039;tribe-events-filter-view&#039; ),\n\t\t\tsprintf( &#039;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;%s&quot; value=&quot;unset_or_0&quot; %s \/&gt; %s&lt;\/label&gt;&#039;,\n\t\t\t\t$name,\n\t\t\t\tchecked( $this-&gt;free, &#039;unset_or_0&#039;, false ),\n\t\t\t\tsprintf(\n\t\t\t\t\t__( &#039;&quot;%s&quot; or empty or set to zero&#039;, &#039;tribe-events-filter-view&#039; ),\n\t\t\t\t\t&#039;&lt;strong&gt;&lt;abbr title=&quot;&#039; . __( &#039;Used as the identifier for free Events&#039;, &#039;tribe-events-filter-view&#039; ) . &#039;&quot;&gt;&#039; . $this-&gt;get_free_string() . &#039;&lt;\/abbr&gt;&lt;\/strong&gt;&#039;\n\t\t\t\t)\n\t\t\t),\n\t\t\tsprintf( &#039;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;%s&quot; value=&quot;set_to_0&quot; %s \/&gt; %s&lt;\/label&gt;&#039;,\n\t\t\t\t$name,\n\t\t\t\tchecked( $this-&gt;free, &#039;set_to_0&#039;, false ),\n\t\t\t\t__( &#039;Only when set to zero&#039;, &#039;tribe-events-filter-view&#039; )\n\t\t\t)\n\t\t);\n\n\t\treturn &#039;&lt;div class=&quot;tribe_events_active_filter_type_options&quot;&gt;&#039; . $type_field . $cost_field . &#039;&lt;\/div&gt;&#039;;\n\t}\n\n\tprotected function get_free_string() {\n\t\treturn _x( &#039;Free&#039;, &#039;Used as the identifier for free Events&#039;, &#039;tribe-events-filter-view&#039; );\n\t}\n\n\tprotected function get_values() {\n\t\t$this-&gt;set_min_and_max();\n\n\t\tif ( $this-&gt;type == &#039;range&#039; ) {\n\t\t\treturn array( &#039;min&#039; =&gt; $this-&gt;min_cost, &#039;max&#039; =&gt; $this-&gt;max_cost );\n\t\t}\n\n\t\t$cost_range = array();\n\t\tif ( $this-&gt;has_non_numeric_costs() ) {\n\t\t\t$cost_range[&#039;other&#039;] = __( &#039;Other&#039;, &#039;tribe-events-filter-view&#039; );\n\t\t}\n\n\t\tif ( $this-&gt;min_cost == 0 ) {\n\t\t\t$cost_range[&#039;0-0&#039;] = __( &#039;Free&#039;, &#039;tribe-events-filter-view&#039; );\n\t\t}\n\t\tif ( $this-&gt;max_cost == $this-&gt;min_cost ) {\n\t\t\tif ( $this-&gt;max_cost != 0 ) {\n\t\t\t\t$cost_range[ $this-&gt;min_cost . &#039;-&#039; . $this-&gt;max_cost ] = $this-&gt;min_cost . &#039;-&#039; . $this-&gt;max_cost;\n\t\t\t}\n\t\t} else { \/\/hard-coding my desired price ranges\n\n\t\t\t$cost_range[&#039;1-49&#039;] = &#039;Inexpensive (\\$1 - \\$49)&#039;;\n\t\t\t$cost_range[&#039;50-249&#039;] = &#039;Moderate (\\$50 - \\$249)&#039;;\n\t\t\t$cost_range[&#039;250-&#039; . $this-&gt;max_cost] = &#039;Professional (\\$250+)&#039;;\n\t\t}\n\t\t$values = array();\n\t\tforeach ( $cost_range as $key =&gt; $cost ) {\n\t\t\t$values[] = array(\n\t\t\t\t&#039;name&#039; =&gt; $cost,\n\t\t\t\t&#039;value&#039; =&gt; $key,\n\t\t\t);\n\t\t}\n\t\treturn $values;\n\t}\n\n\tprivate function partition_range( $min, $max, $count ) {\n\t\t$range_size = $max - $min + 1;\n\t\t$partition_size = floor( $range_size \/ $count );\n\t\t$partition_remainder = $range_size % $count;\n\t\t$partitioned = array();\n\t\t$mark = $min;\n\t\tfor ( $i = 0; $i &lt; $count; $i++ ) {\n\t\t\t$incr = ( $i &lt; $partition_remainder ) ? $partition_size : $partition_size - 1;\n\t\t\t$partitioned[ $i ] = array(\n\t\t\t\t&#039;min&#039; =&gt; $mark,\n\t\t\t\t&#039;max&#039; =&gt; $mark + $incr,\n\t\t\t);\n\t\t\t$mark += $incr + 1;\n\t\t}\n\t\treturn $partitioned;\n\t}\n\n\tprotected function is_selected( $option ) {\n\t\tif ( preg_match( &#039;\/[0-9]*\\-[0-9]*\/&#039;, $option ) ) {\n\t\t\t$option = explode( &#039;-&#039;, $option );\n\t\t\t$option = array(\n\t\t\t\t&#039;min&#039; =&gt; $option[0],\n\t\t\t\t&#039;max&#039; =&gt; $option[1],\n\t\t\t);\n\t\t} elseif ( in_array( &#039;other&#039;, $this-&gt;currentValue ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn in_array( (array) $option, $this-&gt;currentValue );\n\t}\n\n\tprotected function setup_query_filters() {\n\t\tif ( $this-&gt;currentValue ) {\n\t\t\t$this-&gt;set_min_and_max();\n\t\t}\n\t\tparent::setup_query_filters();\n\t}\n\n\tprotected function setup_join_clause() {\n\t\tglobal $wpdb;\n\t\t$this-&gt;joinClause = &quot; LEFT JOIN {$wpdb-&gt;postmeta} AS cost_filter ON ({$wpdb-&gt;posts}.ID = cost_filter.post_id)&quot;;\n\t}\n\n\tprotected function setup_where_clause() {\n\t\tglobal $wpdb;\n\t\t$clauses = array();\n\n\t\tforeach ( $this-&gt;currentValue as $value ) {\n\t\t\t$free_clause = &#039;&#039;;\n\t\t\tif ( isset( $value[&#039;min&#039;] ) ) {\n\t\t\t\t\/\/ Should we exclude events where a cost has not been provided?\n\t\t\t\t$free_clause = $this-&gt;free_clause( $value[&#039;min&#039;] );\n\t\t\t}\n\n\t\t\tif ( &#039;other&#039; === $value ) {\n\t\t\t\t$length_clause = null;\n\t\t\t\tif ( self::IMPLICITLY_FREE === $this-&gt;free ) {\n\t\t\t\t\t$length_clause = &#039;AND LENGTH( TRIM( cost_filter.meta_value ) ) &gt; 0&#039;;\n\t\t\t\t}\n\n\t\t\t\t$clause = &quot;\n\t\t\t\t\t( cost_filter.meta_key = &#039;_EventCost&#039;\n\t\t\t\t\t$length_clause\n\t\t\t\t\tAND CAST( cost_filter.meta_value AS SIGNED ) = 0\n\t\t\t\t\tAND cost_filter.meta_value != &#039;0&#039;\n\t\t\t\t&quot;;\n\n\t\t\t\tif ( self::EXPLICITLY_FREE !== $this-&gt;free ) {\n\t\t\t\t\t$clause .= $wpdb-&gt;prepare( &#039; AND LOWER(cost_filter.meta_value) != %s&#039;, strtolower( $this-&gt;get_free_string() ) );\n\t\t\t\t}\n\n\t\t\t\t\/\/ Close the Conditional\n\t\t\t\t$clause .= &#039;)&#039;;\n\n\t\t\t\t$clauses[] = $clause;\n\t\t\t} elseif ( isset( $value[&#039;min&#039;], $value[&#039;max&#039;] ) &amp;&amp; $value[&#039;min&#039;] == 0 &amp;&amp; $value[&#039;max&#039;] == 0 ) {\n\n\t\t\t\t$blank_clause = null;\n\t\t\t\tif ( self::IMPLICITLY_FREE === $this-&gt;free ) {\n\t\t\t\t\t$blank_clause = &quot;\n\t\t\t\t\t\tOR cost_filter.meta_value = &#039;&#039;\n\t\t\t\t\t\tOR cost_filter.meta_value IS NULL\n\t\t\t\t\t\tOR $free_clause\n\t\t\t\t\t&quot;;\n\t\t\t\t}\n\n\t\t\t\t$clauses[] = &quot;\n\t\t\t\t\t(\n\t\t\t\t\t\tcost_filter.meta_key = &#039;_EventCost&#039;\n\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\tcost_filter.meta_value = &#039;0&#039;\n\t\t\t\t\t\t\t$blank_clause\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t&quot;;\n\t\t\t} else {\n\t\t\t\t$clauses[] = $wpdb-&gt;prepare(\n\t\t\t\t\t&quot;(\n\t\t\t\t\t\tcost_filter.meta_key = &#039;_EventCost&#039;\n\t\t\t\t\t\tAND cost_filter.meta_value &gt;= %d\n\t\t\t\t\t\tAND cost_filter.meta_value IS NOT NULL\n\t\t\t\t\t\tAND CAST(cost_filter.meta_value AS SIGNED) BETWEEN %d AND %d\n\t\t\t\t\t) &quot;,\n\t\t\t\t\t$value[&#039;min&#039;],\n\t\t\t\t\t$value[&#039;min&#039;],\n\t\t\t\t\t$value[&#039;max&#039;]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this-&gt;whereClause = &#039; AND (&#039; . implode( &#039; OR &#039;, $clauses ) . &#039;) &#039;;\n\t}\n\n\tprotected function free_clause( $min ) {\n\t\tglobal $wpdb;\n\n\t\tif ( 0 !== (int) $min ) {\n\t\t\treturn &#039;LENGTH( TRIM( cost_filter.meta_value ) ) &gt; 0 AND CAST( cost_filter.meta_value AS SIGNED ) &gt; 0&#039;;\n\t\t}\n\n\t\treturn $wpdb-&gt;prepare(\n\t\t\t&#039;(\n\t\t\t\tLENGTH( TRIM( cost_filter.meta_value ) ) &gt; 0\n\t\t\t\tAND CAST( cost_filter.meta_value AS SIGNED ) = 0\n\t\t\t\tAND LOWER( cost_filter.meta_value ) = %s\n\t\t\t)&#039;,\n\t\t\tstrtolower( $this-&gt;get_free_string() )\n\t\t);\n\t}\n\n\tprivate function set_min_and_max() {\n\t\tif ( ! isset( $this-&gt;max_cost ) || ! isset( $this-&gt;min_cost ) ) {\n\t\t\t$this-&gt;max_cost = tribe_get_maximum_cost();\n\t\t\t$this-&gt;min_cost = tribe_has_uncosted_events() ? 0 : tribe_get_minimum_cost();\n\t\t}\n\t}\n\n\tprivate function has_non_numeric_costs() {\n\t\t$costs = Tribe__Events__Cost_Utils::instance()-&gt;get_all_costs();\n\t\tforeach ( $costs as $index =&gt; $cost ) {\n\t\t\tif ( is_numeric( $index ) ) {\n\t\t\t\tunset( $costs[ $index ] );\n\t\t\t}\n\t\t}\n\t\treturn ! empty( $costs );\n\t}\n}\n$cost_filter_alternative = new BSG__Cost__Tribe__Events__Filterbar__Filters__Cost(&#039;Price&#039;, &#039;price&#039;);\n<\/code><\/pre>\n<p>The key bit is here, where I&#8217;ve removed Tribe&#8217;s chunking code and hard-coded my own ranges:<\/p>\n<pre><code>$cost_range = array();\n\t\tif ( $this-&gt;has_non_numeric_costs() ) {\n\t\t\t$cost_range[&#039;other&#039;] = __( &#039;Other&#039;, &#039;tribe-events-filter-view&#039; );\n\t\t}\n\n\t\tif ( $this-&gt;min_cost == 0 ) {\n\t\t\t$cost_range[&#039;0-0&#039;] = __( &#039;Free&#039;, &#039;tribe-events-filter-view&#039; );\n\t\t}\n\t\tif ( $this-&gt;max_cost == $this-&gt;min_cost ) {\n\t\t\tif ( $this-&gt;max_cost != 0 ) {\n\t\t\t\t$cost_range[ $this-&gt;min_cost . &#039;-&#039; . $this-&gt;max_cost ] = $this-&gt;min_cost . &#039;-&#039; . $this-&gt;max_cost;\n\t\t\t}\n\t\t} else { \/\/hard-coding my desired price ranges\n\n\t\t\t$cost_range[&#039;1-49&#039;] = &#039;Inexpensive (\\$1 - \\$49)&#039;;\n\t\t\t$cost_range[&#039;50-249&#039;] = &#039;Moderate (\\$50 - \\$249)&#039;;\n\t\t\t$cost_range[&#039;250-&#039; . $this-&gt;max_cost] = &#039;Professional (\\$250+)&#039;;\n\t\t}\n\t\t$values = array();\n\t\tforeach ( $cost_range as $key =&gt; $cost ) {\n\t\t\t$values[] = array(\n\t\t\t\t&#039;name&#039; =&gt; $cost,\n\t\t\t\t&#039;value&#039; =&gt; $key,\n\t\t\t);\n\t\t}\n\t\treturn $values;\n<\/code><\/pre>\n<p>Now, this works. I have the filter available within my settings, I&#8217;ve added it, and it filters correctly. The only thing that&#8217;s weird about it is the parameter that gets added to the URL has some extra percent-encoding in it: ?tribe_paged=1&amp;tribe_event_display=list<strong>&amp;tribe_price%5B%5D=1-49<\/strong> &#8211; not a big deal, but would be great if I could fix it.<\/p>\n<p>What I&#8217;m really asking for is anyone with more development experience than me (I&#8217;m a non-CS-background, copy-and-paste backend developer) to tell me if I&#8217;m doing anything wrong with this implementation? I feel like I&#8217;m repeating a lot of code, most of which I don&#8217;t know what it does, and even though it seems to be working, stuff like the URL having unexplained extra characters in it makes me wonder if there are other unintended consequences I&#8217;m missing. Have I missed any steps anywhere? Is there a better way to do what I&#8217;m doing?<\/p>\n","protected":false},"template":"","class_list":["post-1164093","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Created an alternative cost filter, looking for second opinions. -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Created an alternative cost filter, looking for second opinions. -\" \/>\n<meta property=\"og:description\" content=\"Hey everyone, I&#8217;ve created a Boston tech events calendar, and the event prices ended up being a pretty large range. From meetups with $5 pizza costs to conferences with $5000+ registration fees. I wasn&#8217;t liking that my only options for the cost filter were a range slider that wasn&#8217;t really convenient for the distribution of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/\",\"name\":\"Created an alternative cost filter, looking for second opinions. -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-09-14T18:15:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Filter Bar\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Created an alternative cost filter, looking for second opinions.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Created an alternative cost filter, looking for second opinions. -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/","og_locale":"en_US","og_type":"article","og_title":"Created an alternative cost filter, looking for second opinions. -","og_description":"Hey everyone, I&#8217;ve created a Boston tech events calendar, and the event prices ended up being a pretty large range. From meetups with $5 pizza costs to conferences with $5000+ registration fees. I wasn&#8217;t liking that my only options for the cost filter were a range slider that wasn&#8217;t really convenient for the distribution of [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/","name":"Created an alternative cost filter, looking for second opinions. -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-09-14T18:15:03+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/created-an-alternative-cost-filter-looking-for-second-opinions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Filter Bar","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/"},{"@type":"ListItem","position":5,"name":"Created an alternative cost filter, looking for second opinions."}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1164093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1164093\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1164093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}