You are here

function twitter_timeline_render in Twitter Timeline 7

Render a twitter timeline widget.

1 call to twitter_timeline_render()
TwitterTimelineBean::view in plugins/bean/twitter_timeline.inc
Displays the bean.

File

./twitter_timeline.module, line 37
Twitter Timeline module.

Code

function twitter_timeline_render($widget_id, $placeholder_text, $placeholder_url) {
  $output = '<a class="twitter-timeline" href="' . check_plain($placeholder_url) . '" data-widget-id="' . check_plain($widget_id) . '">' . check_plain($placeholder_text) . '</a>';
  drupal_add_js('!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");', 'inline');
  return $output;
}