fbcommentshortcode

The Facebook Comments fbcommentshortcode function.

Description

fbcommentshortcode( $fbatts ); 

Parameters (1)

0. $fbatts
The fbatts.

Usage

  1. if ( !function_exists( 'fbcommentshortcode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'facebook-comments/class-frontend.php'; 
  3.  
  4. // The fbatts. 
  5. $fbatts = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = fbcommentshortcode($fbatts); 
  9.  

Defined (1)

The function is defined in the following location(s).

/class-frontend.php  
  1. function fbcommentshortcode($fbatts) { 
  2. extract(shortcode_atts(array( 
  3. "fbcomments" => get_option('fbcomments'),  
  4. "url" => get_permalink(),  
  5. ), $fbatts)); 
  6. if (!empty($fbatts)) { 
  7. foreach ($fbatts as $key => $option) 
  8. $fbcomments[$key] = $option; 
  9. if (!isset($fbcomments['count'])) {$fbcomments['count'] = "";} 
  10. if ($fbcomments['count'] == 'on') { 
  11. if ($fbcomments['countstyle'] == '') { 
  12. $commentcount = "<p>"; 
  13. } else { 
  14. $commentcount = "<p class=\"".$fbcomments['countstyle']."\">"; 
  15. $commentcount .= "<fb:comments-count href=".$url."></fb:comments-count> ".$fbcomments['countmsg']."</p>"; 
  16. if ($fbcomments['title'] != '') { 
  17. if ($fbcomments['titleclass'] == '') { 
  18. $commenttitle = "<h3>"; 
  19. } else { 
  20. $commenttitle = "<h3 class=\"".$fbcomments['titleclass']."\">"; 
  21. $commenttitle .= $fbcomments['title']."</h3>"; 
  22. if (!isset($commentcount)) {$commentcount = "";} 
  23. $fbcommentbox = "<!-- Facebook Comments Plugin for WordPress: http://peadig.com/wordpress-plugins/facebook-comments/ -->".$commenttitle.$commentcount; 
  24.  
  25. if ($fbcomments['html5'] == 'on') { 
  26. $fbcommentbox .= "<div class=\"fb-comments\" data-href=\"".$url."\" data-num-posts=\"".$fbcomments['num']."\" data-width=\"".$fbcomments['width']."\" data-colorscheme=\"".$fbcomments['scheme']."\"></div>"; 
  27.  
  28. } else { 
  29. $fbcommentbox .= "<fb:comments href=\"".$url."\" num_posts=\"".$fbcomments['num']."\" width=\"".$fbcomments['width']."\" colorscheme=\"".$fbcomments['scheme']."\"></fb:comments>"; 
  30.  
  31. if (!empty($fbcomments['linklove'])) { 
  32. $fbcommentbox .= '<p>Powered by <a href="http://peadig.com/wordpress-plugins/facebook-comments/">Facebook Comments</a></p>'; 
  33. return $fbcommentbox;