/var/www/(Del)hsihk.com/wp-content/themes/flatsome/inc/shortcodes/buttons.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
// [button]
function button_shortcode$atts$content null ){
  
extractshortcode_atts( array(
    
'text' => '',
    
'style' => '',
    
'size' => '',
    
'link' => '',
    
'target' => ''
  
), $atts ) );

if(
$target$target 'target="'.$target.'"';
return 
'<a href="'.$link.'" class="button '.$size.' '.$style.'" '.$target.'>'.$text.'</a>';
}
add_shortcode('button''button_shortcode');

// [facebook_login_button]
function facebook_login_shortcode$atts$content null ){
  
extractshortcode_atts( array(
    
'text' => 'Login / Register with Facebook',
    
'size' => 'medium'
  
), $atts ) );
      
ob_start();
      global 
$post;
?><a href="<?php echo wp_login_url(); ?>?loginFacebook=1&redirect=<?php echo the_permalink(); ?>"  class="button <?php echo $size?> facebook-button" onclick="window.location = '<?php echo wp_login_url(); ?>?loginFacebook=1&redirect='+window.location.href; return false;"><i class="icon-facebook"></i><?php echo $text?></a><?php
$content 
ob_get_contents();
ob_end_clean();
return 
$content;
}
add_shortcode('facebook_login_button''facebook_login_shortcode');