[buddypress-trac] [BuddyPress Trac] #6438: BP Attachment API, warning when no base_dir set

buddypress-trac noreply at wordpress.org
Sun May 17 11:14:40 UTC 2015

#6438: BP Attachment API, warning when no base_dir set
 Reporter:  imath         |       Owner:  imath
     Type:  defect (bug)  |      Status:  closed
 Priority:  high          |   Milestone:  2.3
Component:  API           |     Version:
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |
Changes (by imath):

 * owner:   => imath
 * status:  new => closed
 * resolution:   => fixed


 In [changeset:"9874"]:
 #!CommitTicketReference repository="" revision="9874"
 In `BP_Attachment->upload()`, only filter the WordPress upload_dir if the
 callback function is set.

 This callback function can be passed as the second argument of
 `BP_Attachment->upload()`, or dynamically created if the specific
 `$base_dir` parameter was provided by the extending class.

 About this second case, if the extending class forgets to set the
 `$base_dir` parameter or do it on purpose in order to use the WordPress
 default upload directory, we will not filter the WordPress upload_dir to
 avoid a warning.

 This commit also adds a third argument to `BP_Attachment->upload()`, in
 case there is a need to pass a specific time (yyyy/mm) to set the
 WordPress default upload sub directory.

 Fixes #6438

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6438#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list