You are here

function Disqus::thread_by_identifier in Disqus 7

Get or create thread by identifier.

This method tries to find a thread by its identifier and title. If there is no such thread, the method creates it. In either case, the output value is a thread object.

Parameters

$identifier: Unique value (per forum) for a thread that is used to keep be able to get data even if permalink is changed.

$title: The title of the thread to possibly be created.

Return value

Returns a hash with two keys:

  • thread: a hash representing the thread corresponding to the identifier.
  • created: indicates whether the thread was created as a result of this method call. If created, it will have the specified title.

File

./disqus.php, line 198
Provides the Disqus PHP API.

Class

Disqus
The Disqus PHP API.

Code

function thread_by_identifier($identifier, $title) {
  return $this
    ->call('thread_by_identifier', array(
    'title' => $title,
    'identifier' => $identifier,
  ), TRUE);
}