{"id":50990,"date":"2016-09-21T21:26:57","date_gmt":"2016-09-21T21:26:57","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/haystack\/"},"modified":"2019-03-18T20:34:34","modified_gmt":"2019-03-18T20:34:34","slug":"haystack","status":"closed","type":"plugin","link":"https:\/\/ar.wordpress.org\/plugins\/haystack\/","author":15127106,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.2.9","stable_tag":"1.2.9","tested":"5.1.26","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"Haystack","header_author":"<a href=\"https:\/\/mellenger.com\/\">Mellenger Inc.<\/a>","header_description":"","assets_banners_color":"ffffff","last_updated":"2019-03-18 20:34:34","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/haystack.menu\/","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/haystack\/","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1207,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.0":"<p>The first version of the plugin has been created.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":"1499944","resolution":"128x128","location":"assets"},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":"1499944","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":"1507766","resolution":"1544x500","location":"assets"},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"1507766","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.2","1.1","1.2","1.2.1","1.2.2","1.2.3","1.2.4","1.2.5","1.2.6","1.2.7","1.2.7.5","1.2.9"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1499945","resolution":"1","location":"assets"},"screenshot-2.gif":{"filename":"screenshot-2.gif","revision":"1499945","resolution":"2","location":"assets"}},"screenshots":{"1":"Go to https:\/\/haystack.menu\/ to get your <em>license<\/em> for the Haystack search"}},"plugin_section":[],"plugin_tags":[23025,22799,77219,1753,944],"plugin_category":[43],"plugin_contributors":[126960],"plugin_business_model":[],"class_list":["post-50990","plugin","type-plugin","status-closed","hentry","plugin_tags-elasticsearch","plugin_tags-haystack","plugin_tags-mellenger","plugin_tags-navigation","plugin_tags-search","plugin_category-customization","plugin_contributors-francoisppeloquin","plugin_committers-haystacksearch"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/haystack_ffffff.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/haystack\/assets\/screenshot-1.png?rev=1499945","caption":"Go to https:\/\/haystack.menu\/ to get your <em>license<\/em> for the Haystack search"},{"src":"https:\/\/ps.w.org\/haystack\/assets\/screenshot-2.gif?rev=1499945","caption":""}],"raw_content":"<!--section=description-->\n<p>Modern, mobile-friendly web design simplifies navigation but makes it harder to locate specific content. By adding Haystack to your site, your search bar becomes a super-charged, auto-completing web utility that helps people quickly find what they\u2019re looking for.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Go to <a href=\"https:\/\/haystack.menu\/\">Haystack.menu<\/a> to get your <em>license<\/em> for the Haystack search<\/li>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/haystack-wordpress<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<li>Use the Haystack screen and configure the plugin<\/li>\n<li>Set the optional search field ID tag in HTML (i.e. #search_bar) or allow Haystack to create a default styled footer bar<\/li>\n<li>Allow time for the indexer to run the first crawl of the site<\/li>\n<li>Go to the home page and try it out<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How do I obtain a license for Haystack?<\/dt>\n<dd><p>Got to <a href=\"https:\/\/haystack.menu\/\">Haystack.menu<\/a> and follow the simple steps in order to create your account and receive access.<\/p><\/dd>\n<dt>Are there ways to override the content sent up to the server? Such as images or content so that I can make my searches more customizable?<\/dt>\n<dd><p>Haystack has built in filters that allow you to change some defined variables that represent your web page. Currently the filters <code>haystack_set_type<\/code>, <code>haystack_set_image<\/code>, <code>haystack_set_body<\/code>, and <code>haystack_set_tags<\/code> have been enabled. These functions are passed the ID of the post, and the returned data will be sent to elasticsearch.<\/p>\n\n<p>Here are two examples set in a user's theme folder in their functions.php file:<\/p>\n\n<pre><code>\/\/We want type here to show much more data than the average\nfunction _haystack_set_type($id) {\n  \/\/Adding post type as the first of the tags to pass\n  $post_type = get_post_type($id);\n  $post_type = get_post_type_object($post_type);\n  $tags[] = array($post_type-&gt;labels-&gt;singular_name);\n\n  \/\/Adding the post author as the second part of the tags array to pass\n  $post_auth = get_post($id);\n  $post_auth = $post_auth-&gt;post_author;\n  $tags[] = get_the_author_meta('nicename',$post_auth);\n\n  \/\/Adding categories to the array\n  $post_cat = wp_get_post_categories($id);\n  foreach ($post_cat as $c) {\n    $cat = get_category($c);\n    $tags[] = $cat-&gt;name;\n  }\n\n  \/\/Adding tags associated with the post, if they exist\n  $post_tags = wp_get_post_tags($id);\n  foreach ($post_tags as $key =&gt; $val) {\n    $tags[] = $val-&gt;name;\n  }\n\n  \/\/Return in &lt;cat&gt; tags\n  return (!empty($tags) ? '&lt;cat&gt;'.implode('&lt;\/cat&gt;&lt;cat&gt;',$tags).'&lt;\/cat&gt;' : '');\n}\n\/\/Apply the filter\nadd_filter('haystack_set_type','_haystack_set_type');\n<\/code><\/pre>\n\n<p>The second example here hooks in and replaces all images with a static one:<\/p>\n\n<pre><code>\/\/Add a sample image to each Haystack post item. Image could alternately be fetched from the ID\nfunction _haystack_set_image($id) {\n  return 'http:\/\/www.gallaghersmash.com\/wp-content\/uploads\/2015\/04\/gallagher.jpg';\n}\n\/\/Apply the filter\nadd_filter('haystack_set_image','_haystack_set_image');\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0<\/h4>\n\n<ul>\n<li>The first version of the plugin has been created.<\/li>\n<\/ul>","raw_excerpt":"Haystack enables your search bar to become a super-charged, auto-completing web for finding content.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/50990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=50990"}],"author":[{"embeddable":true,"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/haystacksearch"}],"wp:attachment":[{"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=50990"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=50990"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=50990"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=50990"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=50990"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ar.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=50990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}