Guest User

Untitled

a guest
Apr 26th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. function get_title_related($cut_at = '') {
  2. $api_token = '1234567'; // add you api token here
  3. $buffy = '';
  4. $buffy .= '<h3 class="entry-title td-module-title">';
  5. $buffy .='<a href="' . $this->href . $api_token . '" rel="bookmark" title="' . $this->title_attribute . '">';
  6.  
  7. //see if we have to cut the title and if we have the title lenght in the panel for ex: td_module_6__title_excerpt
  8. if ($cut_at != '') {
  9. //cut at the hard coded size
  10. $buffy .= td_util::excerpt($this->title, $cut_at, 'show_shortcodes');
  11.  
  12. } else {
  13. $current_module_class = get_class($this);
  14.  
  15. //see if we have a default setting for this module, and if so only apply it if we don't get other things form theme panel.
  16. if (td_api_module::_helper_check_excerpt_title($current_module_class)) {
  17. $db_title_excerpt = td_util::get_option($current_module_class . '_title_excerpt');
  18. if ($db_title_excerpt != '') {
  19. //cut from the database settings
  20. $buffy .= td_util::excerpt($this->title, $db_title_excerpt, 'show_shortcodes');
  21. } else {
  22. //cut at the default size
  23. $module_api = td_api_module::get_by_id($current_module_class);
  24. $buffy .= td_util::excerpt($this->title, $module_api['excerpt_title'], 'show_shortcodes');
  25. }
  26. } else {
  27. /**
  28. * no $cut_at provided and no setting in td_config -> return the full title
  29. * @see td_global::$modules_list
  30. */
  31. $buffy .= $this->title;
  32. }
  33.  
  34. }
  35. $buffy .='</a>';
  36. $buffy .= '</h3>';
  37. return $buffy;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment