Advertisement
eventsmanager

shortcode for events archives by a given year/month url

Oct 4th, 2013
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. /*
  2. This shortcode will create an events list group by month with a given $_REQUEST month and year
  3.  
  4. eg.
  5. URL: http://domain.com/archive_page/?year=2013&month=09
  6.  
  7. Result:
  8.  
  9. shortcode: [events_list_monthly]
  10.  
  11. Sep 2013
  12. Event A - 2013/09/15
  13. Event B - 2013/09/16
  14. */
  15.  
  16. function em_events_list_by_month(){
  17. $year = wp_kses_data($_REQUEST['year']);
  18. $month = wp_kses_data($_REQUEST['month']);
  19.  
  20. echo do_shortcode('[events_list_grouped mode="monthly" year="'.$year.'" month="'.$month.'" pagination=0 ]');
  21. }
  22. add_shortcode('events_list_monthly', 'em_events_list_by_month');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement