eventsmanager

Shortcode for Past My Bookings Page

Aug 27th, 2020
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * Part 1: https://pastebin.com/7DaB0bqq
  3. * should be created under wp-content/themes/Your Theme Name/plugins/events-manager/templates/my-past-bookings.php
  4. *
  5. * Part 2: the snippet below should be added at the end of your theme functions.php or use mu-plugins
  6. * http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  7. * usage: [my_past_bookings] in your WP page or post
  8. */
  9.  
  10. function em_get_my_past_bookings(){
  11. if( get_option('dbem_css_rsvp') ) echo '<div class="css-my-bookings">';
  12. em_locate_template('templates/my-past-bookings.php', true);
  13. if( get_option('dbem_css_rsvp') ) echo '</div>';
  14. }
  15. function em_my_past_bookings_shortcode( $args = array() ){
  16. return em_get_my_past_bookings();
  17. }
  18. add_shortcode ( 'my_past_bookings', 'em_my_past_bookings_shortcode');
RAW Paste Data