eventsmanager

Untitled

Jul 22nd, 2016
364
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. This snippet will force event pages to use SSL
  4. http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  5.  */
  6. function my_em_force_ssl( $template ){
  7.     if( !is_ssl() && em_is_event_page() ){
  8.         wp_redirect(str_replace('http:','https:', get_permalink()));
  9.         die();
  10.     }
  11.     return $template;
  12. }
  13. add_filter('template_redirect', 'my_em_force_ssl', 10 );
RAW Paste Data