Skip to main content

data

pb.data(key, value)

The data function object contains methods for reading and writing to the pb.data hash containing unique data about the forum or current page.

The data function itself is a legacy function for backwards compatibility with v5 data set/get calls.

Returns: Object | Array | string | number - Returns the corresponding value, or void if setting a key.

ParamTypeDescription
keyArray | stringThe key or array of keys to be inserted into the data hash.
valueArray | stringThe value or array of values to be inserted into the data hash.

Methods

get

pb.data.get(key)

Gets the value for the specified key in the data hash.

Returns: Object | Array | string | number - Returns the corresponding value.

ParamTypeDescription
keyStringThe name of the key to obtain the value of.

set

pb.data.set(key, value)

Sets the value of the data hash for the parameter 'key' to the specified parameter 'value'.

ParamTypeDescription
keyArray | stringThe key or array of keys to be inserted into the data hash.
valueArray | stringThe value or array of values to be inserted into the data hash.

previewData

pb.data.previewData()

Displays all the loaded data accessible by data.get. For reference purposes only. Not intended for production use in scripts.

Returns: Object - Returns the data hash.

getObject

pb.data.getObject(type, id)

Returns an object on the current page based on the type and id given.

Returns: Object - Returns the corresponding object.

ParamTypeDescription
typestringThe name for the type of object.
idnumberThe id of the object.

previewObjects

pb.data.previewObjects()

Displays all the loaded objects accessible by data.getObject. For reference purposes only. Not intended for production use in scripts.

Returns: Object - Returns the loaded objects.