eventsmanager

shortcode for events archives by a given year/month url

Oct 4th, 2013
289
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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');
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×