Advertisement
tolikpunkoff

ljr-lj-poll-4-wordpress

Jul 25th, 2016
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. Plugin Name: LJR-pollDisplay
  5. Description: Display poll's from lj.rossia.org
  6. Version: 0.0.1
  7. Author: IDT & Tolik Punkoff
  8. Author URI: http://tolik-punkoff.com/
  9. License: any
  10.  */
  11.  
  12. include ('getpoll.php');
  13.  
  14. function ljrpoll_shortcode($atts)
  15. {
  16.     //достаем ID опроса
  17.     extract(shortcode_atts(array(
  18.           'id' => -1,
  19.     ), $atts));
  20.    
  21.     //Если id не задан, надо вывести сообщение об ошибке
  22.     if ($id==-1)
  23.     {
  24.         $ans='Poll ID not set!';
  25.     }
  26.     else
  27.     {
  28.         $ans=GetPoll($id);
  29.     }
  30.  
  31.     return $ans;
  32. }
  33.  
  34. add_shortcode ('ljrpoll','ljrpoll_shortcode');
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement