Support » Plugin: Search in Place » No attachment ?
3 years, 10 months ago
Is there a way to hide attachments in results ?
You only should to edit the searchinplace.clss.php file (located in “/wp-content/plugins/search-in-place/php/searchinplace.clss.php”) commenting the line of code number 58:
// $posts = array_merge($wp_query->posts, $wpdb->get_results(“SELECT * FROM …
3 years, 5 months ago
I removed the complete line but this does not seem to help?
You should be sure to comment the line of code mentioned in the previous entry, and modify the snippet of code:
$query->set(‘post_type’, array(‘post’, ‘page’, ‘attachment’));
$query->set(‘post_type’, array(‘post’, ‘page’));
3 years, 4 months ago
Is it possible to make this a selectable option in a future iteration of the plugin so every time I update the plugin I don’t have to find where to comment out?
In the current version of plugin, these post_types are selected by default. I’ll consider your suggestion in the next version of plugin to make these post_types optional and selectable from the settings page of plugin.
3 years, 1 month ago
I did the changes… and nothing is showing anymore in search results.
I’ll need the access to your WordPress to check the edited code.
For send me sensitive information, use my support page in:
I’m sorry, after comment the line of code:
you should paste below the snippet of code:
$posts = $wp_query->posts;
OK, thank you.