Advertisement
kremisoski

Snippet

Jan 29th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <?php
  2.  
  3. // hacks and mods will go here
  4.  
  5. /* WGA Login Redirect */
  6. function wga_login_redirect($redirect_to) {
  7.     return home_url() . '/home';
  8. }
  9.  
  10. add_filter("login_redirect", "wga_login_redirect");
  11.  
  12. /* WGA Custom Buttons */
  13. function wgabutton_shortcode( $atts, $content = null ) {
  14.    extract( shortcode_atts( array(
  15.       'url' => '',
  16.       'target' => '',
  17.       'color' => '',
  18.       'width' => '',     
  19. ), $atts ) );
  20.  
  21.  if(esc_attr($target)) {
  22.  $target = 'target="'.esc_attr($target).'"';
  23.  }
  24.    if(!is_user_logged_in()) {
  25.     return '<div class="button-wrap '.esc_attr($width).'"><div class="'.esc_attr($color).' button ' . esc_attr($width). '"><a href="' . esc_attr($url) . '" ' . $target . '>' . $content . '</a></div></div>';
  26.    }
  27.    else {
  28.     return '<div class="button-wrap '.esc_attr($width).'"><div class="'.esc_attr($color).' button ' . esc_attr($width). '"><a href="#" ' . $target . '>' . 'Thank You For Signing Up!' . '</a></div></div>';
  29.    }
  30. }
  31.  
  32. /* Add Shortcodes */
  33. add_shortcode('wgabutton', 'wgabutton_shortcode');
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement