Skip to:
Content
Pages
Categories
Search
Top
Bottom

Customize URL in Group Widget


  • kmligue
    Participant

    @kmligue

    I like to modify the image URL avatar displayed in groups widget. For example, say an image with a group avatar that has a URL of http://domain.com/myimage.jpg. I want to prefix that URL with one of Cloudinary’s URL (e.g. http://cloudinary.com/mycloudname/30/30/http://domain.com/myimage.jpg, which would create a 30×30 rendition of the image for example).

    I have manage to prefix the url in BP_Groups_Widget class(plugins/buddypress/bp-groups/classes/class-bp-groups-widget.php) line 132. I know this is not the right thing to do to modify the core but I can’t find an alternative way.

    Any suggestion on how to do this without touching the core?

Viewing 1 replies (of 1 total)

  • danbp
    Participant

    @danbp

    The simplest way would be to create a copy of the group widget from within your child-theme functions.php file.

    By doing this you can hardcode whatever you need to the original html. Once done, you use your widget instead the original widget. Only thing you have to take care is the function name which should be unique.

    And voilĂ .

    Of course, if you are a php ninja, you can probably extend the BP_Groups_Widget class to get the same result. Many examples here.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar