Elgg  Version 2.3
Namespaces | Functions | Variables
tags.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Activate a plugin or plugins.
 

Functions

 string_to_tag_array ($string)
 Takes in a comma-separated string and returns an array of tags which have been trimmed. More...
 
 elgg_get_tags (array $options=array())
 Get popular tags and their frequencies. More...
 
 elgg_register_tag_metadata_name ($name)
 Registers a metadata name as containing tags for an entity. More...
 
 elgg_get_registered_tag_metadata_names ()
 Returns an array of valid metadata names for tags. More...
 
 _elgg_tags_init ()
 private More...
 

Variables

return function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks)
 

Function Documentation

_elgg_tags_init ( )

private

Definition at line 236 of file tags.php.

elgg_get_registered_tag_metadata_names ( )

Returns an array of valid metadata names for tags.

Returns
array
Since
1.7.0

Definition at line 227 of file tags.php.

elgg_get_tags ( array  $options = array())

Get popular tags and their frequencies.

Supports similar arguments as elgg_get_entities()

Parameters
array$optionsArray in format:
threshold => INT minimum tag count

tag_names => array() metadata tag names - must be registered tags

limit => INT number of tags to return (default from settings)

types => null|STR entity type (SQL: type = '$type')

subtypes => null|STR entity subtype (SQL: subtype IN ('subtype1', 'subtype2)) Use ELGG_ENTITIES_NO_VALUE to match the default subtype. Use ELGG_ENTITIES_ANY_VALUE to match any subtype.

type_subtype_pairs => null|ARR (array('type' => 'subtype')) array( 'object' => array('blog', 'file'), // All objects with subtype of 'blog' or 'file' 'user' => ELGG_ENTITY_ANY_VALUE, // All users irrespective of subtype );

owner_guids => null|INT entity guid

container_guids => null|INT container_guid

site_guids => null (current_site)|INT site_guid

created_time_lower => null|INT Created time lower boundary in epoch time

created_time_upper => null|INT Created time upper boundary in epoch time

modified_time_lower => null|INT Modified time lower boundary in epoch time

modified_time_upper => null|INT Modified time upper boundary in epoch time

wheres => array() Additional where clauses to AND together

joins => array() Additional joins

Returns
object[]|false If no tags or error, false otherwise, array of objects with ->tag and ->total values
Since
1.7.1
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 78 of file tags.php.

elgg_register_tag_metadata_name (   $name)

Registers a metadata name as containing tags for an entity.

This is required if you are using a non-standard metadata name for your tags.

Parameters
string$nameTag name
Returns
bool
Since
1.7.0

Definition at line 209 of file tags.php.

string_to_tag_array (   $string)

Takes in a comma-separated string and returns an array of tags which have been trimmed.

Parameters
string$stringComma-separated tag string
Returns
mixed An array of strings or the original data if input was not a string

Definition at line 18 of file tags.php.

Variable Documentation

Definition at line 241 of file tags.php.