Created
October 27, 2013 14:39
-
-
Save Dimasmagadan/7182972 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function os_my_link_shortcode( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'link' => '', | |
), $atts ) | |
); | |
if(is_user_logged_in()){ | |
$out=$link; | |
} else { | |
// $id вашей страницы с полями для регистрации\входа | |
$out= get_permalink( $id ); | |
} | |
return '<a href="'.$out.'">скачать</a>'; | |
} | |
add_shortcode( 'my_link', 'os_my_link_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment