| [ Index ] |
PHP Cross Reference of BuddyPress |
[Source view] [Print] [Project Stats]
Core attachment class.
| File Size: | 757 lines (23 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| __construct( $args = '' ) X-Ref |
| Construct Upload parameters. param: array|string $args { since: 2.3.0 since: 2.4.0 Add the $upload_dir_filter_args argument to the $arguments array |
| set_upload_dir() X-Ref |
| Set upload path and url for the component. since: 2.3.0 |
| set_upload_error_strings( $param = array() X-Ref |
| Set Upload error messages. Used into the $overrides argument of BP_Attachment->upload() param: array $param A list of error messages to add to BuddyPress core ones. since: 2.3.0 return: array $upload_errors The list of upload errors. |
| includes() X-Ref |
| Include the WordPress core needed files. since: 2.3.0 |
| upload( $file, $upload_dir_filter = '', $time = null ) X-Ref |
| Upload the attachment. param: array $file The appropriate entry the from $_FILES superglobal. param: string $upload_dir_filter A specific filter to be applied to 'upload_dir' (optional). param: string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. since: 2.3.0 return: array On success, returns an associative array of file attributes. |
| sanitize_utf8_filename( $retval ) X-Ref |
| Helper to convert utf-8 characters in filenames to their ASCII equivalent. param: string $retval Filename. since: 2.9.0 return: string |
| validate_mime_types() X-Ref |
| Validate the allowed mime types using WordPress allowed mime types. In case of a multisite, the mime types are already restricted by the 'upload_filetypes' setting. BuddyPress will respect this setting. since: 2.3.0 |
| validate_upload( $file = array() X-Ref |
| Specific upload rules. Override this function from your child class to build your specific rules By default, if an original_max_filesize is provided, a check will be done on the file size. param: array $file The temporary file attributes (before it has been moved). since: 2.3.0 return: array The file. |
| upload_dir_filter( $upload_dir = array() X-Ref |
| Default filter to save the attachments. param: array $upload_dir The original Uploads dir. since: 2.3.0 since: 2.4.0 Add the $upload_dir parameter to the method return: array The upload directory data. |
| create_dir() X-Ref |
| Create the custom base directory for the component uploads. Override this function in your child class to run specific actions. (eg: add an .htaccess file) since: 2.3.0 |
| crop( $args = array() X-Ref |
| Crop an image file. param: array $args { since: 2.3.0 return: string|WP_Error New filepath on success, WP_Error on failure. |
| script_data() X-Ref |
| Build script datas for the Uploader UI. Override this method from your child class to build the script datas. since: 2.3.0 return: array The javascript localization data. |
| add_revision( $attachment_type, $args = array() X-Ref |
| Adds a new revision of a file. param: string $attachment_type The attachement type (eg: avatar). param: array $args { since: 10.0.0 return: object|WP_Error An object informing about the URL an Path to a revision file, a WP_Error object on failure. |
| get_image_data( $file ) X-Ref |
| Get full data for an image param: string $file Absolute path to the uploaded image. since: 2.4.0 return: bool|array An associate array containing the width, height and metadatas. |
| edit_image( $attachment_type, $args = array() X-Ref |
| Edit an image file to resize it or rotate it param: string $attachment_type The attachment type (eg: avatar or cover_image). Required. param: array $args { since: 2.4.0 return: string|WP_Image_Editor|WP_Error The edited image path or the WP_Image_Editor object in case of success, |
| Generated: Fri Nov 7 01:00:56 2025 | Cross-referenced by PHPXref 0.7.1 |