[wp-meta] [Making WordPress.org] #417: Dates in support forum search results

Making WordPress.org noreply at wordpress.org
Sun Jun 28 14:25:36 UTC 2015


#417: Dates in support forum search results
--------------------------+----------------------------
  Reporter:  johnbillion  |      Owner:
      Type:  defect       |     Status:  new
  Priority:  normal       |  Component:  Support Forums
Resolution:               |   Keywords:
--------------------------+----------------------------

Comment (by joostdevalk):

 We should just add date filtering to the search results box. I've just
 pasted the following code to @ocean90 that should add that:

 {{{
 <script src="//www.google.com/jsapi" type="text/javascript"></script>
 <script type="text/javascript">
   google.load('search', '1', {language : 'en'});
   google.setOnLoadCallback(function() {
     var orderByOptions = {};
     orderByOptions['keys'] = [{label: 'Relevance', key: ''} , {label:
 'Date', key: 'date'}];
         customSearchOptions['enableOrderBy'] = true;
         customSearchOptions['orderByOptions'] = orderByOptions;
     var customSearchControl = new google.search.CustomSearchControl('foo',
 customSearchOptions);
 customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
 customSearchControl.setLinkTarget(google.search.Search.LINK_TARGET_TOP);
     var options = new google.search.DrawOptions();
     options.setAutoComplete(true);
     customSearchControl.draw('cse', options);
 <?php
 if ( !empty($terms) ) {
         echo 'customSearchControl.execute('.json_encode($terms).');';
 }
  ?>
   }, true);
 </script>
 }}}

 The only problem is that it's incredibly hard to test this without LIVE
 testing it, so that's what we should do, I guess :)

--
Ticket URL: <https://meta.trac.wordpress.org/ticket/417#comment:2>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list