BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #53132

    Thanks again for your answer.

    You solution changes the background color of the selected filter. I don’t see any advantage in just adding css and overwrite the grey with a prefered color.

    In my case I wanted the grey label green when active filter ist selected, red when newest member and blue when random. But as I worried this is not possible adding code to the members loop directly to id the label.

    To do this is probably to much effort, isn’t it?

  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #53127

    Hello Ravi,
    thanks for your answer. Unfortunately I cant provide you with these credentials because the site is not public yet and protected.

    The tag where I want to change the background color has no different id’s or classes for active, random or newest member seach. So I wonder how you want to assign different colors just using CSS?

    SourceCode:
    <li id=”members-all” class=”selected” data-bp-scope=”all” data-bp-object=”members”>
    Active Members <span class=”count”>4</span>

    I can use li a { background-color: blue; } but again, then ALL labels are in blue.

    Regards

  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #52957

    Hello Brajesh,
    works! Thanks for quick fix!

    Regards

  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #52904

    I know, I know. But after weeks of testing, googling, asking developers and so on, this was the easiest way to make it work. Finally. In my opinion buddypress dev team should remove old tinymce 4.9. Or, at least letting admins use other rich text editors easily. As I wrote this is not only my wish.

    Ups, I put the code into functions.php.

    But isn’t your approach a security issue? It switch off kses for all fields, right? So isn’t modifying this core file the better choice in this case?

  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #52893

    I made it work by modifying class-bp-xprofile-fiel-type-textarea.php. So this thread can be marked as solved.

  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #52889

    Hello Brajesh,
    Thanks again for your answer. To change the editor might be to much effort indeed because of all the wordpress dependencies which have to be considered.
    Therefore I tried your code and added this just for testing. I also tried to disable kses at all:
    add_action( ‘bp_init’, function () {
    remove_filter( ‘bp_get_the_profile_field_value’, ‘bp_xprofile_escape_field_data’, 8 );
    } );
    remove_filter(‘pre_user_description’, ‘wp_filter_kses’);

    But at the profile page, li elements still stripped off. See image.
    https://postimg.cc/qzMPggTm

    For the biography field richtext is not enabled. How to enable it?
    But does BP checking the bio field for richtext possibilities at all?
    If not, enabling richtext will make no sense. Any more ideas to solve this on the profile page?

    The backend shows the tags
    https://postimg.cc/dDX2ZxMz

    • This reply was modified 1 month, 1 week ago by Alex.
  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #52881

    Sorry for asking again:
    And there is no way to load just the tiny 7 cloud one with wp_editor()?

    https://www.tiny.cloud/docs/tinymce/latest/editor-and-features/

    If I could use the cloud version without switching off rich text options with the code below, no HTML would be stripped off on the frontend profile page.

    function antipole_remove_rich_text() {
    return false;
    }
    add_filter(‘bp_xprofile_is_richtext_enabled_for_field’, ‘antipole_remove_rich_text’);

    • This reply was modified 1 month, 1 week ago by Alex.
  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #52877

    Long story short:
    1. If using the biography field. How can I prevent buddypress from stripping off html on these field? On user profile edit and view page.
    2. If using the rich multiline textarea field. How to use the tinymce 7 cloud version which currently conflicts with the old 4.9 implemented one.

    Tinymce 4.9 which WordPress and Buddypress uses has security issues. Maybe someone should tell the buddypress dev team for a solution on that??
    See this: https://core.trac.wordpress.org/ticket/47218

  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #52874

    Ok, thanks to GPT I made it work for the multiline xprofile field as well.
    But again, I still have the problem that all lists were moved to one line after saving. See screenshots.
    https://ibb.co/LpSMyy9
    After saving
    https://ibb.co/rxY8Jqq

    Editor Source view
    https://ibb.co/r2FNKBW

    What do I need to do to avoid this?

    • This reply was modified 1 month, 2 weeks ago by Alex.
    • This reply was modified 1 month, 2 weeks ago by Alex.
  • Participant
    Level: Enlightened
    Posts: 24
    Alex on #52873

    Thanks Brajesh,
    I would not have such a problem if WordPress would use the latest tinymce one but instead integrates tinymce 4.9 which is very old.

    I am using the biography field already. This is currently the only solution to me using the cdn-tinymce version 7 – with the problem that it changes bullet lists to words line by line separated by an <br> on the profile view page. The edit page looks fine.

    Furthermore I only can use it on the biography field with this code:

    function antipole_remove_rich_text() {
    return false;
    }
    add_filter(‘bp_xprofile_is_richtext_enabled_for_field’, ‘antipole_remove_rich_text’);

    Another solution might be use it on the rich multiline textarea as you wrote.
    BUT with using the above code I am only able to integrate tinymce 7 cloud on the biography field and not on the multiline xfield.
    Without the code I cannot load it either on the bio nor on the multiline text field.

    Do you have a solution to make it running on the multiline-textarea field? I would need to get rid of the integrated one and then load the cloud one.

    Otherwise I only can prevent buddypress from changing the bullet lists on biography profile view page where I also have no idea how to.