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

Default filter to save the attachments.


Description Description


Parameters Parameters

$upload_dir

(Optional) The original Uploads dir.

Default value: array()


Top ↑

Return Return

(array) The upload directory data.


Top ↑

Source Source

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

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

		/**
		 * Filters the component's upload directory.
		 *
		 * @since 2.3.0
		 * @since 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 );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.4.0 Add the $upload_dir parameter to the method regarding to context
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.