I have a problem.
I'm using a custom shortcode to try to get the url. If the shortcode is inside a post then it gets the post url. When I open the post on a category list, this post shortcode works correctly.
extract(shortcode_atts(array(
'gurl' => get_permalink(),
), $atts));
But when i try to add this shortcode in widget text, I get the last post url.
Tell me please how I can get the post url when the shortcode is in a widget.