<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>search &#8211; Snippets</title>
	<atom:link href="http://wp.djtedfunke.com/tag/search/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.djtedfunke.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 Jan 2019 20:53:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>

<image>
	<url>http://wp.djtedfunke.com/wp-content/uploads/2018/12/cropped-front-end_developer-2-512-32x32.png</url>
	<title>search &#8211; Snippets</title>
	<link>http://wp.djtedfunke.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Search &#8211; Only post types</title>
		<link>http://wp.djtedfunke.com/search-only-post-types/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:53:10 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[search]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=73</guid>

					<description><![CDATA[Enable search only with post types:]]></description>
										<content:encoded><![CDATA[
<p>Enable search only with post types:</p>



<pre class="wp-block-code"><code>function mySearchFilter($query) {
    $post_type = 'page';
    if($query->is_main_query()){
        if ($query->is_search) {
        $query->set('post_type', $post_type);
        }
    }
};
add_action('pre_get_posts','mySearchFilter');</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable search</title>
		<link>http://wp.djtedfunke.com/disable-search/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:14:55 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[search]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=69</guid>

					<description><![CDATA[// Check deprecated create_function]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>function disable_search( $query, $error = true ) {
  if ( is_search() ) {
    $query->is_search = false;
    $query->query_vars[s] = false;
    $query->query[s] = false;
    // to error
    if ( $error == true )
    $query->is_404 = true;
  }
}

add_action( 'parse_query', 'disable_search' );
// add_filter( 'get_search_form', create_function( '$a', "return null;" ) );</code></pre>



<p>// Check deprecated create_function</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
