Return to Snippet

Revision: 37095
at December 3, 2010 22:54 by sdxxx


Updated Code
//retrieve author page url (ex. http://www.abc.com/?author=123) by using shortcode [XXXXX id=123]
function XXXXX_func($atts) {
    extract(shortcode_atts(array(
        "id" => '1'
    ), $atts));
    return get_author_posts_url($id);;
}
//add shortcode [XXXXX id=123]
add_shortcode('XXXXX', 'XXXXX_func');

Revision: 37094
at December 3, 2010 22:53 by sdxxx


Updated Code
//retrieve author page url (ex. abc.com/?author=123) by using shortcode [XXXXX id=123]
function XXXXX_func($atts) {
    extract(shortcode_atts(array(
        "id" => '1'
    ), $atts));
    return get_author_posts_url($id);;
}
//add shortcode [XXXXX id=123]
add_shortcode('XXXXX', 'XXXXX_func');

Revision: 37093
at December 3, 2010 22:43 by sdxxx


Initial Code
//retrieve author page url by using shortcode [XXXXX id=123]
function XXXXX_func($atts) {
    extract(shortcode_atts(array(
        "id" => '1'
    ), $atts));
    return get_author_posts_url($id);;
}
//add shortcode [XXXXX id=123]
add_shortcode('XXXXX', 'XXXXX_func');

Initial URL
http://codex.wordpress.org/Shortcode_API

Initial Description
Using shortcode to retrieve the author page url (ex. abc.com/?author=123), using the WP Shortcode API as reference.

Initial Title
WP Shortcode - retrieve author page url

Initial Tags
wordpress

Initial Language
PHP