BP_Attachment::upload_dir_filter( array $upload_dir = array() )

Default filter to save the attachments.

Description

Parameters

$upload_dir

(array) (Optional) The original Uploads dir.

Default value: array()

Return

(array) The upload directory data.

Source

File: bp-core/classes/class-bp-attachment.php

	public function upload_dir_filter( $upload_dir = array() ) {

		/**
		 * Filters the component's upload directory.
		 *
		 * @since BuddyPress 2.3.0
		 * @since BuddyPress 2.4.0 Include the original Upload directory as the second parameter of the filter.
		 *
		 * @param array $value          Array containing the path, URL, and other helpful settings.
		 * @param array $upload_dir     The original Uploads dir.
		 */
		return apply_filters( 'bp_attachment_upload_dir', array(
			'path'    => $this->upload_path,
			'url'     => $this->url,
			'subdir'  => false,
			'basedir' => $this->upload_path,
			'baseurl' => $this->url,
			'error'   => false
		), $upload_dir );
	}

Changelog

Changelog
Version Description
BuddyPress 2.3.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.