Skip to content

Instantly share code, notes, and snippets.

@Dimasmagadan
Created October 27, 2013 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dimasmagadan/7182972 to your computer and use it in GitHub Desktop.
Save Dimasmagadan/7182972 to your computer and use it in GitHub Desktop.
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