Skip to:
Content
Pages
Categories
Search
Top
Bottom

HTML Showing Up in Profile Pages

Viewing 8 replies - 1 through 8 (of 8 total)

  • myershenry
    Participant

    @myershenry

    I was using a bad theme so the above link might not have worked. I’ve changed themes and I’m having the same problems.

    This is what profiles look like:

    
    I'm the author of <a href="http://www.henrybaum.com/2011/01/north-of-sunset-2&quot; rel="nofollow">North of Sunset</a>, winner of the Hollywood Book Festival Grand Prize, and <a href="http://www.anothersky.org/in-print/the-golden-calf-henry-baum/&quot; rel="nofollow">The Golden Calf</a> – first published by Soft Skull Press, with editions in the U.K. (Rebel Inc.) and France (Hachette Littératures). Visit <a href="http://www.henrybaum.com/&quot; rel="nofollow">henrybaum.com</a> for more information. I’m the editor of <i>Self-Publishing Review</i>.

    Henry Wright
    Moderator

    @henrywright

    Did this happen in 1.9? Or just 1.9.1?


    myershenry
    Participant

    @myershenry

    I don’t know. I just added the most recent version after 1.6.

    I found this but it’s not working:

    Enable or Disable All HTML Tags in WordPress Author Biography Profiles

    //disable WordPress sanitization to allow more than just $allowedtags from /wp-includes/kses.php
    remove_filter(‘pre_user_description’, ‘wp_filter_kses’);
    //add sanitization for WordPress posts
    add_filter( ‘pre_user_description’, ‘wp_filter_post_kses’);


    Henry Wright
    Moderator

    @henrywright

    I think xprofile_data_value_before_save is the hook you want to use. So, if you add this to functions.php your xprofile fields will accept HTML:

    remove_filter( 'xprofile_data_value_before_save', 'xprofile_sanitize_data_value_before_save', 1, 2 );

    Note: Use this with caution. Not sanitizing incoming data is dangerous so you will need to add your own custom sanitization if you use this.


    myershenry
    Participant

    @myershenry

    That didn’t seem to do it. I can just dump that code into the theme’s functions.php file?

    I’m not great with php. Or is it this:

    //disable WordPress sanitization to allow more than just $allowedtags from /wp-includes/kses.php
    remove_filter( ‘xprofile_data_value_before_save’,
    //add sanitization for WordPress posts
    ‘xprofile_sanitize_data_value_before_save’, 1, 2 );


    Henry Wright
    Moderator

    @henrywright

    Humm, I’ll have to look into it to see exactly what’s going on here.


    myershenry
    Participant

    @myershenry

    this is my bp-custom file:

    <?php
    function remove_xprofile_links() {
    remove_filter( ‘bp_get_the_profile_field_value’, ‘xprofile_filter_link_profile_data’, 9, 2 );
    }
    add_action( ‘bp_init’, ‘remove_xprofile_links’ );
    define(“BP_DEFAULT_COMPONENT”,”profile”)
    ?>


    Henry Wright
    Moderator

    @henrywright

    function remove_xprofile_links() {
    remove_filter( ‘bp_get_the_profile_field_value’, ‘xprofile_filter_link_profile_data’, 9, 2 );
    }
    add_action( ‘bp_init’, ‘remove_xprofile_links’ );

    This function above (called remove_xprofile_links) and it’s hook to bp_init might be what you need to remove. Try removing all of the above from bp-custom.php

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘HTML Showing Up in Profile Pages’ is closed to new replies.
Skip to toolbar