1
0
Fork 0
mirror of https://github.com/buddypress/buddypress.git synced 2026-07-21 20:54:17 +08:00
buddypress/tests/phpunit/assets/attachment-extensions.php
Mathieu Viet 61924d9144 Allow class extending the BP_Attachment class to get the original WordPress upload dir within their upload_dir_filter() method.
To do so, you simply need to add the argument `$upload_dir_filter_args` to the array you use inside your constructor and set it to 1.

Props rittesh.patel

Fixes #6591

git-svn-id: https://buddypress.svn.wordpress.org/trunk@10194 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2015-10-06 23:53:33 +00:00

16 lines
421 B
PHP

<?php
/**
* The following implementations of BP_Attachment act as dummy plugins
* for our unit tests
*/
class BPTest_Attachment_Extension extends BP_Attachment {
public function __construct( $args = array() ) {
return parent::__construct( $args );
}
public function upload_dir_filter( $upload_dir = array() ) {
$this->original_upload_dir = $upload_dir;
return parent::upload_dir_filter( $upload_dir );
}
}