SHARE
TWEET

ljr-lj-poll-4-wordpress

tolikpunkoff Jul 25th, 2016 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ?>
RAW Paste Data
Want to get better at PHP?
Learn to code PHP in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top