Skip to:
Content

BuddyPress.org

#8764 closed task (fixed)

Improve Activity/Group Activity function to post updates

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 11.0.0 Priority: high
Severity: normal Version:
Component: Activity Keywords: has-patch
Cc:

Description

Working on the BP Attachments Add-on (see this merged GHPR) I noticed that in order to be able to simply attach a media as the content of an activity from the BP Nouveau Activity Post Form, it was necessary to improve these three functions:

  • bp_activity_post_update() so that it uses a filter name when "bp_parsing_args",
  • groups_post_update() so that it truly respects the 'error_type' => 'wp_error' argument,
  • bp_nouveau_ajax_post_update() to avoid a check about the $_POST['content'] that is already done in the 2 above functions and so that it uses the 'error_type' => 'wp_error' argument.

I'll share a PR about these changes asap.

Change History (2)

This ticket was mentioned in PR #37 on buddypress/buddypress by @imath.


22 months ago
#1

  • Keywords has-patch added

This change is required for the BP Attachments Add-on to be able to simply use a media as the Activity content.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8764

#2 @imath
22 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 13367:

Improve Activity & Group Activity post_update functions

  1. Improve the bp_activity_post_update() function's extensibility including a filter name ('activity_post_update') into the bp_parse_args() function used to merge given arguments with default ones. This allows Plugins or BuddyPress add-ons such as BP Attachments to create a content from a different input than the Activity Post Form's textarea using one of these two filters:
    • 'bp_before_activity_post_update_parse_args' or
    • 'bp_after_activity_post_update_parse_args'
  1. groups_post_update() now completely respects the $error_type argument making sure to return a WP_Error object when it is defined to wp_error. If not, it returns false.
  1. To avoid code/i18n string duplication adapt bp_nouveau_ajax_post_update() so that it enjoys the 2 above improvements.

Closes https://github.com/buddypress/buddypress/pull/37
Fixes #8764

Note: See TracTickets for help on using tickets.