Last active
August 29, 2015 14:23
-
-
Save jchristopher/01e79bef22e2ec137f29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add to your theme's functions.php | |
add_filter( 'searchwp_indexed_post_types', 'my_searchwp_indexed_post_types' ); | |
add_filter( 'searchwp_engine_settings_default', 'my_searchwp_engine_settings_default', 10, 2 ); | |
function my_searchwp_indexed_post_types( $post_types ) { | |
if ( ! in_array( 'attachment', $post_types ) ) { | |
$post_types[] = 'attachment'; | |
} | |
return $post_types; | |
} | |
function my_searchwp_engine_settings_default( $settings, $query ) { | |
$settings['attachment']['enabled'] = true; | |
$settings['attachment']['weights']['title'] = 20; | |
return $settings; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment