/ Published in: PHP
Using shortcode to retrieve the author page url (ex. abc.com/?author=123), using the WP Shortcode API as reference.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//retrieve author page url (ex. http://www.abc.com/?author=123) by using shortcode [XXXXX id=123] function XXXXX_func($atts) { "id" => '1' ), $atts)); return get_author_posts_url($id);; } //add shortcode [XXXXX id=123] add_shortcode('XXXXX', 'XXXXX_func');
URL: http://codex.wordpress.org/Shortcode_API