/** * Enables annotations based on $options. * * @warning Unlike elgg_get_annotations() this will not accept an empty options array! * * @warning In order to enable annotations, you must first use * {@link access_show_hidden_entities()}. * * @param array $options An options array. {@link elgg_get_annotations()} * @return bool|null true on success, false on failure, null if no metadata enabled. * @since 1.8.0 */ function elgg_enable_annotations(array $options) { if (!$options || !is_array($options)) { return false; } $options['metastring_type'] = 'annotations'; return _elgg_batch_metastring_based_objects($options, 'elgg_batch_enable_callback'); }
/** * Enables metadata based on $options. * * @warning Unlike elgg_get_metadata() this will not accept an empty options array! * * @warning In order to enable metadata, you must first use * {@link access_show_hidden_entities()}. * * @param array $options An options array. {@link elgg_get_metadata()} * @return bool|null true on success, false on failure, null if no metadata enabled. * @since 1.8.0 */ function elgg_enable_metadata(array $options) { if (!$options || !is_array($options)) { return false; } _elgg_get_metadata_cache()->invalidateByOptions('enable', $options); $options['metastring_type'] = 'metadata'; return _elgg_batch_metastring_based_objects($options, 'elgg_batch_enable_callback'); }
/** * Enables metadata based on $options. * * @warning Unlike elgg_get_metadata() this will not accept an empty options array! * * @warning In order to enable metadata, you must first use * {@link access_show_hidden_entities()}. * * @param array $options An options array. {@link elgg_get_metadata()} * @return bool|null true on success, false on failure, null if no metadata enabled. */ function enableAll(array $options) { if (!$options || !is_array($options)) { return false; } $this->cache->invalidateByOptions($options); $options['metastring_type'] = 'metadata'; return _elgg_batch_metastring_based_objects($options, 'elgg_batch_enable_callback'); }