BuddyDev

Search

[Resolved] Buddypress Group Description Html tag support?

Tagged: , , ,

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #12189

    How can I allow html tag in BP Group Description?

    For example:

      ,

    1. Listing tags not work.

      Normally:

      *post1
      *post2
      *post3

      BP Group Description:

      post1post2post3

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #12190

    Sorry. I wrote wrong. I’m rewriting because the edit is disabled.

    For example: ol – li Listing tags not work.

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #12220

    Hi Ekiz,
    Please put this in your bp-custom.php

    
    /**
     * Add remove filters to allow more tags.
     */
    function buddydev_add_remove_group_desc_filters() {
    	remove_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 );
    	add_filter( 'groups_group_description_before_save', 'bp_groups_filter_kses', 1 );
    }
    
    add_action( 'bp_loaded', 'buddydev_add_remove_group_desc_filters');
    
    /**
     * Allow extra tags in group description.
     *
     * @param $tags
     *
     * @return mixed
     */
    function buddydev_allow_extra_group_desc_tags( $tags ) {
        $tags['ul'] = array();
        $tags['li'] = array();
        $tags['strong'] = array();
        $tags['b'] = array();
        return $tags;
    }
    add_filter( 'bp_groups_filter_kses', 'buddydev_allow_extra_group_desc_tags' );
    

    It will allow list and strong/bold tags.

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #12225

    Hi Brajesh Singh,

    Thanks. I tried code now. But not working 🙁

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #12252

    Hi Ekiz,
    I see the problem. You are using ordered list while the code I posted allowed unordered list. I have updated the code to allow ordered list too now

    
    /**
     * Add remove filters to allow more tags.
     */
    function buddydev_add_remove_group_desc_filters() {
    	remove_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 );
    	add_filter( 'groups_group_description_before_save', 'bp_groups_filter_kses', 1 );
    }
    
    add_action( 'bp_loaded', 'buddydev_add_remove_group_desc_filters');
    
    /**
     * Allow extra tags in group description.
     *
     * @param $tags
     *
     * @return mixed
     */
    function buddydev_allow_extra_group_desc_tags( $tags ) {
        $tags['ul'] = array();
        $tags['ol'] = array();
        $tags['li'] = array();
        $tags['strong'] = array();
        $tags['b'] = array();
        return $tags;
    }
    add_filter( 'bp_groups_filter_kses', 'buddydev_allow_extra_group_desc_tags' );
    
    

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #12265

    Hi Brajesh Singh,

    Still not working.

    Also;

    -ol- tag works. (with/without your code)

    Sample:

    1-post1
    2-post2
    3-post3

    -ul- tag not working. (with/without your code)

    Sample:

    ● post1
    ● post2
    ● post2

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #12266

    Please try checking the source page. Some themes may not style it.

    Do you see the ul tag in the textarea or does it get removed on update?

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #12268

    Not deleted after the update.

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #12269

    That simply means that your theme is not styling it. It should be there if you check the source. You will need to style it to look like the unordered list using css.

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #12270

    Thanks.

    I will try.

The topic ‘ [Resolved] Buddypress Group Description Html tag support?’ is closed to new replies.

This topic is: resolved