function hook_search_api_attachments_indexable in Search API attachments 7
Same name and namespace in other branches
- 8 search_api_attachments.api.php \hook_search_api_attachments_indexable()
- 9.0.x search_api_attachments.api.php \hook_search_api_attachments_indexable()
Determines whether an attachment should be indexed.
Parameters
array $file: An attachment file array.
object $item: A field item object.
string|null $field_name: The name of the field the file was in, if applicable.
Return value
bool|null Return FALSE if the attachment should not be indexed.
2 invocations of hook_search_api_attachments_indexable()
- SearchApiAttachmentsAlterSettings::isFileIndexable in includes/
callback_attachments_settings.inc - Checks if file is allowed to be indexed.
- SearchApiAttachmentsLinksAlterSettings::isFileIndexable in contrib/
search_api_attachments_links/ includes/ callback_attachments_links_settings.inc - Checks if file is allowed to be indexed.
File
- ./
search_api_attachments.api.php, line 26 - Hooks provided by the "Search API attachments" module.
Code
function hook_search_api_attachments_indexable(array $file, $item, $field_name) {
// Don't index files on entities owned by our bulk upload bot accounts.
if (in_array($item->uid, my_module_blocked_uids())) {
return FALSE;
}
}