Last active
September 5, 2018 03:32
-
-
Save ribeiroeder/5129162c100947b35892c00a19a28fd1 to your computer and use it in GitHub Desktop.
Relevanssi index attachment Metabox.io File Advanced titles for parent post
This file contains 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
add_filter( 'relevanssi_content_to_index', 'rlv_index_attachment_names', 10, 2 ); | |
function rlv_index_attachment_names( $content, $post_id ) { | |
if ($post_id->post_type == "your_post_type") { | |
$files = rwmb_meta( '_your_meta_file_advanced' ); | |
foreach ( $files as $file ) { | |
$content .= ' ' . $file['title']; | |
} | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment