• Resolved uno

    (@uno)


    In the old version of wordpress 1.5x my author description would display html, however, in 2.0 the author profiles no longer parse html. Any suggestions?

Viewing 5 replies - 16 through 20 (of 20 total)
  • Here’s how I fixed the problem in my author.php – template file:


    <?php

    if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;

    echo html_entity_decode($curauth->description);

    ?>

    It’s actually only the last line that’s interresting. The ‘html_entity_decode’ function in PHP converts entities to plain text, thereby allowing HTML to be used in the author description field.

    Romme, that looks very promising. I’m trying to integrate it into my template-functions-author.php file.

    Is your example replacing something that already exists? Or did you just drop that into the end of the document somehow? It didn’t work when I tried it, that’s why I ask.

    Anybody ever come up with a definitive answer on this topic?

    I modified wp-includes/default-filters.php as follows; I believe it has the effect of formatting a user’s profile description just like a post (but ignoring smilies):

    Remove the line add_filter('pre_user_description', 'wp_filter_kses');

    Add the lines:
    add_filter('pre_user_description', 'wp_filter_post_kses');
    add_filter('pre_user_description', 'wptexturize');
    add_filter('pre_user_description', 'wpautop');
    add_filter('pre_user_description', 'convert_chars');
    add_filter('pre_user_description', 'balanceTags', 50);

    The wp_filter_post_kses filter removes HTML prohibited in posts—it is less restrictive than wp_filter_kses.

    Omigosh, that worked beautifully. Thanks so much!!!!!!!!!!!!!!!!!!!!!!!!

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Author profile page not parsing html in description?’ is closed to new replies.