You are here

function _tweet_get_title in Tweet 7.4

Same name and namespace in other branches
  1. 5.2 tweet.module \_tweet_get_title()
  2. 5 tweet.module \_tweet_get_title()
  3. 6.4 tweet.module \_tweet_get_title()
  4. 6 tweet.module \_tweet_get_title()
  5. 6.2 tweet.module \_tweet_get_title()
  6. 6.3 tweet.module \_tweet_get_title()

Returns the title of the node for which the NID was passed or the current page. Note that there is no good way to get the page title for a page that is not the current page. We assume the title is the same as the title of the node if a node is being viewed, but this is often not the case when certain modules are being used. In this case, it is recommended that you manually pass the title to tweet_to_twitter().

Parameters

$nid: The NID of the node for which to return the title. If not passed, uses the current page.

Return value

The title of the node for the NID passed or the title of the current page.

1 call to _tweet_get_title()
_tweet_to_twitter in ./tweet.module
Creates a link to post a URL and optionally title to twitter. Uses the current page by default.

File

./tweet.module, line 329
Builds links to post pages to Twitter API sites.

Code

function _tweet_get_title($nid = '') {
  if (is_numeric($nid)) {
    $node = node_load($nid);
    $title = $node->title;
  }
  else {
    $title = drupal_get_title();
  }
  return $title;
}