WordPress.org

Forums

BuddyPress Activity Plus
[resolved] Delete images when deleting groups (4 posts)

  1. Le_Achim
    Member
    Posted 11 months ago #

    Hello,

    I use BuddyPress Activity Plus for uploading images in Buddypress groups. This works well. I found the function to delete an image when an activity is deleted. Works well too.
    But I had to delete the entire group and then the images are not deleted. I need one of this two possible solutions:
    - a function and/or hook to delete the images in activities, when the group is deleted
    - or the other solution, upload the images to a unique directory for each group (where is the function which creates the path name?) Maybe this is more easy and I can delete the directory wiht the images after deleting the group.

    Thank you,
    Michael

    https://wordpress.org/plugins/buddypress-activity-plus/

  2. WPMU DEV
    Member
    Posted 11 months ago #

    Hi Michael,

    I hope you are well today and thank you for your question.

    - or the other solution, upload the images to a unique directory for each group (where is the function which creates the path name?) Maybe this is more easy and I can delete the directory wiht the images after deleting the group.

    You can achieve this by developing custom code referring the solutions posted in the following replies.

    http://premium.wpmudev.org/forums/topic/change-upload-directory-based-on-user-id#post-237378

    http://premium.wpmudev.org/forums/topic/change-upload-directory-based-on-user-id#post-237825

    Best Regards,
    WPMU DEV

  3. Le_Achim
    Member
    Posted 11 months ago #

    Hello DEV-Team,

    thank you for your answer, this is a nice idea but:

    - is it possible to redefine the constants every time the user changes the active group?

    - code is poetry - but code can also be a jungle ;-)
    can you give me a hint where to include the definitions so they are active when the user chooses a group?

    - the activity input is also possible in sitewide activity. Maybe this results in any problems with your solution? I think on this page there is no "active group".

    Sorry for the questions, although I'm an experienced programmer, PHP and the organisation of wordpress code is new to me.

    with regards,
    Michael

  4. WPMU DEV
    Member
    Posted 11 months ago #

    Hi Michael,

    Thank you for your reply.

    The solutions that i have shared you on the links are only references for the custom solution that you want to develop, it's not the end solution and i have not used / tested it so you will have to develop custom code yourself code to achieve end result.

    Developing custom code is beyond the scope of support that we provide. You can consider hiring a developer to develop it if you are not WordPress developer.

    You can undefine and redefine PHP constants using uopz_undefine and define functions respectively.

    Cheers,
    WPMU DEV

Reply

You must log in to post.

About this Plugin

  • BuddyPress Activity Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags