permalink

Is there a way to passe permalink into link URL for button shortcode ? 

Is use this shortcode now, but i have to break Betheme shortcode to pass my shortcode


function permalink_thingy($atts) {
extract(shortcode_atts(array(
'id' => 1,
'text' => ""  // default value if none supplied
    ), $atts));
    
    if ($text) {
        $url = get_permalink($id);
        return "<a href='$url'>$text</a>";
    } else {
   return get_permalink($id);
}
}
add_shortcode('permalink', 'permalink_thingy');


 /* shortcode */
<a href="[permalink id=49]">Using without providing text</a>



Comments

Sign In or Register to comment.