Replies
- Alex on July 30, 2024 at 5:17 pm in reply to: [Resolved] How to display bullet lists on the user profile? #52893
I made it work by modifying class-bp-xprofile-fiel-type-textarea.php. So this thread can be marked as solved.
- Alex on July 30, 2024 at 8:32 am in reply to: [Resolved] How to display bullet lists on the user profile? #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/qzMPggTmFor 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 4 months, 3 weeks ago by Alex.
- Alex on July 29, 2024 at 11:21 am in reply to: [Resolved] How to display bullet lists on the user profile? #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 4 months, 3 weeks ago by Alex.
- Alex on July 27, 2024 at 11:37 pm in reply to: [Resolved] How to display bullet lists on the user profile? #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 - Alex on July 27, 2024 at 1:10 pm in reply to: [Resolved] How to display bullet lists on the user profile? #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/rxY8JqqEditor Source view
https://ibb.co/r2FNKBWWhat do I need to do to avoid this?
- Alex on July 27, 2024 at 10:45 am in reply to: [Resolved] How to display bullet lists on the user profile? #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.
- Alex on July 2, 2024 at 10:19 am in reply to: Multiline texfield has no limitation for characters #52816
I switched the value field from longtext to varchar at the xprofile data field in MySQL. Then it cuts off everything which is longer than the given limit no matter JS is switched on or not.
Is this the way to go? I mean you are more into buddypress than me. If this change leads to other problems than plz tell me.
- Alex on July 1, 2024 at 10:59 pm in reply to: Multiline texfield has no limitation for characters #52815
Maybe we have a misunderstanding.
Have a look at this:
https://ibb.co/SrCSz5kIn the buddypress core there are code to put out a shorter version of tinymce with less items at the toolbar.
Check class-bp-xprofile-field-type-textarea.php
Anyway, I could also use the wordpress bio field which is a multiline textfield only without the editor.Meanwhile I found a solution for the tinymce editor which is javascript driven unfortunately. This means a user can switch it off, then has the normal textfield back and can write thousands of words and crash the layout.
So let me ask again, is there any PHP solution for this texfield (multi-line text box or bio textfield) to limit the characters which beeing saved?
Regards Alex
- Alex on May 29, 2024 at 5:44 pm in reply to: Random filter does not work as expected when limiting results #52617
Any ideas to solve this issue? List all users but not in alphabetical order…
- Alex on April 10, 2024 at 7:34 pm in reply to: Question to the Buddypress Conditional logic Plugin #52327
Sorry, to ask once more.
No way to add some code wich is like “bypass submit for a field which is required and hidden”?I saw conditional logic like that at the register pages from Gravity forms which sync to Buddypress xfields but to get this plugin just for that feature is beyond my budget.