BP_Attachment::set_upload_dir()
Set upload path and url for the component.
Description
Source
File: bp-core/classes/class-bp-attachment.php
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | public function set_upload_dir() { // Set the directory, path, & url variables. $this ->upload_dir = bp_upload_dir(); if ( empty ( $this ->upload_dir ) ) { return false; } $this ->upload_path = $this ->upload_dir[ 'basedir' ]; $this ->url = $this ->upload_dir[ 'baseurl' ]; // Ensure URL is https if SSL is set/forced. if ( is_ssl() ) { } /** * Custom base dir. * * If the component set this property, set the specific path, url and create the dir */ if ( ! empty ( $this ->base_dir ) ) { $this ->upload_path = trailingslashit( $this ->upload_path ) . $this ->base_dir; $this ->url = trailingslashit( $this ->url ) . $this ->base_dir; // Finally create the base dir. $this ->create_dir(); } } |
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.