WordPress.org

Forums

[resolved] Author profile page not parsing html in description? (21 posts)

  1. uno
    Member
    Posted 10 years ago #

    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?

  2. MichaelH
    Member
    Posted 10 years ago #

    This has been reported on Trac but likely won't be fixed until at least WordPress 2.1:

    http://trac.wordpress.org/ticket/2272

  3. uno
    Member
    Posted 10 years ago #

    Anyone know a fix for this so I don't need to wait?

  4. ctingom
    Member
    Posted 10 years ago #

    Does anyone know a fix for this?

  5. MichaelH
    Member
    Posted 10 years ago #

    To quote Trac http://trac.wordpress.org/ticket/2272

    "...we don't allow HTML in the profile pages."

  6. BillyG
    Member
    Posted 10 years ago #

    well that answers that...

    I just added a Page for the first time and was not able to add a picture to it although the clickable link behind it did appear (but I didn't click to see if it worked, it was blue and underlined though so...)

    at least now I know why the picture wouldn't stay (because the box did try to open lol)

    always ready for a new version :-)

  7. uno
    Member
    Posted 10 years ago #

    So what is the ETA on version 2.1?

    This was a feature that was very important to one of my sites.

  8. ctingom
    Member
    Posted 10 years ago #

    Does anyone have a mod to allow this to work?

  9. uno
    Member
    Posted 10 years ago #

    I sure hope so.

  10. ctingom
    Member
    Posted 10 years ago #

    I wish instead of disabling it there was an option to have it display html code rendered or not rendered. Weird.

  11. BillyG
    Member
    Posted 10 years ago #

    please disregard my msg above, was definitely my cache or host, HTML did post as of me checking again just a minute ago, sorry about the confusion

    but I was talking about an added PAGE to my WP blog, not necessarily the Author profile page... I should've just stayed out of the thread

  12. MichaelH
    Member
    Posted 10 years ago #

    Please note that at patch that fixes this has been suggested at:
    http://trac.wordpress.org/ticket/2272

  13. uno
    Member
    Posted 10 years ago #

    OK I'm a code tard, how can I use that patch to fix this problem? Where should I enter that into that file, etc?

  14. ctingom
    Member
    Posted 10 years ago #

    I'm confused by the patch. Does anybody know if this patch trims html from the profile or if it renders html?

  15. uno
    Member
    Posted 10 years ago #

    Any help/clarification here?

  16. uno
    Member
    Posted 10 years ago #

    ?

  17. romme
    Member
    Posted 10 years ago #

    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.

  18. ctingom
    Member
    Posted 10 years ago #

    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.

  19. msmeritt
    Member
    Posted 9 years ago #

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

  20. neatnate
    Member
    Posted 9 years ago #

    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.

  21. msmeritt
    Member
    Posted 9 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags