FacetWP – index attachments (edit_attachment hook, instead of save_post)

mgibbs189

{{gist file=”test.php” lang=”php”}}
<?php

function mysite_index_attachment( $post_id ) {
if ( function_exists( ‘FWP’ ) ) {
FWP()->indexer->index( $post_id );
}
}
add_action( ‘edit_attachment’, ‘mysite_index_attachment’ );

{{/gist}}