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

buddypress-trac noreply at wordpress.org
Sat May 16 14:10:01 UTC 2015


#6438: BP Attachment API, warning when no base_dir set
--------------------------+-----------------------
 Reporter:  imath         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  high          |  Milestone:  2.3
Component:  API           |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------
 I've been testing the new BP_Attachment class with a specific case. Well
 actually it's a case i have to deal with for one of my plugin.

 Let's say, you want to use the BP_Attachment class but want to use the
 WordPress default upload dir. To do so, i haven't specified the base_dir
 argument of my extending class, but then i get a warning because the
 `$upload_dir_filter' is empty in this case and the plugin API doesn't find
 the missing filter.

 Then, there's a third parameter we should include to
 BP_Attachment->upload() method: `$time`. I can see cases (my plugin for
 instance) where we need to attach the file to a post type and make sure
 the file is saved in a WordPress generated subdirectory of the year and
 month of the post type's date. Just like it's the case when using directly
 `wp_handle_upload()`.

 I suggest to have the patch in before 2.3 release. I'm also adding a unit
 test.

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


More information about the buddypress-trac mailing list