[ Index ]

PHP Cross Reference of BuddyPress




/src/bp-core/ -> bp-core-attachments.php (summary)

BuddyPress Attachments functions.

File Size: 1568 lines (50 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 23 functions


Functions that are not part of a class:

bp_attachments_uploads_dir_get( $data = '' )   X-Ref
Get the Attachments Uploads dir data.

return: string|array The needed Upload dir data.
param: string $data The data to get. Possible values are: 'dir', 'basedir' & 'baseurl'.
since: 2.4.0

bp_attachments_cover_image_upload_dir( $args = array()   X-Ref
Gets the upload dir array for cover images.

return: array See wp_upload_dir().
since: 3.0.0

bp_attachments_get_max_upload_file_size( $type = '' )   X-Ref
Get the max upload file size for any attachment.

return: int Max upload file size for any attachment.
param: string $type A string to inform about the type of attachment
since: 2.4.0

bp_attachments_get_allowed_types( $type = 'avatar' )   X-Ref
Get allowed types for any attachment.

return: array The list of allowed extensions for attachments.
param: string $type The extension types to get.
since: 2.4.0

bp_attachments_get_allowed_mimes( $type = '', $allowed_types = array()   X-Ref
Get allowed attachment mime types.

return: array List of allowed mime types.
param: string $type          The extension types to get (Optional).
param: array  $allowed_types List of allowed extensions.
since: 2.4.0

bp_attachments_check_filetype( $file, $filename, $allowed_mimes )   X-Ref
Check the uploaded attachment type is allowed.

return: bool True if the attachment type is allowed. False otherwise
param: string $file          Full path to the file.
param: string $filename      The name of the file (may differ from $file due to $file being
param: array  $allowed_mimes The attachment allowed mimes (Required).
since: 2.4.0

bp_attachments_create_item_type( $type = 'avatar', $args = array()   X-Ref
Use the absolute path to an image to set an attachment type for a given item.

return: bool True on success, false otherwise.
param: string $type The attachment type to create (avatar or cover_image). Default: avatar.
param: array  $args {
since: 2.4.0

bp_attachments_get_attachment( $data = 'url', $args = array()   X-Ref
Get the url or the path for a type of attachment.

return: string|bool The url or the path to the attachment, false otherwise
param: string $data whether to get the url or the path.
param: array  $args {
since: 2.4.0

bp_attachments_delete_file( $args = array()   X-Ref
Delete an attachment for the given arguments

return: bool True if the attachment was deleted, false otherwise.
param: array $args Array of arguments for the attachment deletion.
since: 2.4.0

bp_attachments_get_plupload_default_settings()   X-Ref
Get the BuddyPress Plupload settings.

return: array List of BuddyPress Plupload settings.
since: 2.3.0

bp_attachments_get_plupload_l10n()   X-Ref
Builds localization strings for the BuddyPress Uploader scripts.

return: array Plupload default localization strings.
since: 2.3.0

bp_attachments_enqueue_scripts( $class = '' )   X-Ref
Enqueues the script needed for the Uploader UI.

return: null|WP_Error
param: string $class Name of the class extending BP_Attachment (eg: BP_Attachment_Avatar).
since: 2.3.0

bp_attachments_current_user_can( $capability, $args = array()   X-Ref
Check the current user's capability to edit an avatar for a given object.

return: bool
param: string $capability The capability to check.
param: array  $args       An array containing the item_id and the object to check.
since: 2.3.0

bp_attachments_json_response( $success, $is_html4 = false, $data = null )   X-Ref
Send a JSON response back to an Ajax upload request.

param: bool  $success  True for a success, false otherwise.
param: bool  $is_html4 True if the Plupload runtime used is html4, false otherwise.
param: mixed $data     Data to encode as JSON, then print and die.
since: 2.3.0

bp_attachments_get_template_part( $slug )   X-Ref
Get an Attachment template part.

return: bool
param: string $slug Template part slug. eg 'uploader' for 'uploader.php'.
since: 2.3.0

bp_attachments_get_cover_image_settings( $component = 'members' )   X-Ref
Get the cover image settings

return: false|array The cover image settings in array, false on failure.
param: string $component The component to get the settings for ("members" for user or "groups").
since: 2.4.0

bp_attachments_get_cover_image_dimensions( $component = 'members' )   X-Ref
Get cover image Width and Height.

return: array|bool An associative array containing the advised width and height for the cover image. False if settings are empty.
param: string $component The BuddyPress component concerned ("members" for user or "groups").
since: 2.4.0

bp_attachments_cover_image_is_edit()   X-Ref
Are we on a page to edit a cover image?

return: bool True if on a page to edit a cover image, false otherwise.
since: 2.4.0

bp_attachments_get_user_has_cover_image( $user_id = 0 )   X-Ref
Does the user has a cover image?

return: bool True if the user has a cover image, false otherwise.
param: int $user_id User ID to retrieve cover image for.
since: 2.4.0

bp_attachments_get_group_has_cover_image( $group_id = 0 )   X-Ref
Does the group has a cover image?

return: bool True if the group has a cover image, false otherwise.
param: int $group_id Group ID to check cover image existence for.
since: 2.4.0
since: 6.0.0 Renamed the filter coherently.

bp_attachments_cover_image_generate_file( $args = array()   X-Ref
Generate the cover image file.

return: false|array An array containing cover image data on success, false otherwise.
param: array                          $args {
param: BP_Attachment_Cover_Image|null $cover_image_class The class to use to fit the cover image.
since: 2.4.0

bp_attachments_cover_image_ajax_upload()   X-Ref
Ajax Upload and set a cover image

return: string|null A json object containing success data if the upload succeeded,
since: 2.4.0

bp_attachments_cover_image_ajax_delete()   X-Ref
Ajax delete a cover image for a given object and item id.

return: string|null A json object containing success data if the cover image was deleted
since: 2.4.0

Generated: Wed Jan 27 01:01:37 2021 Cross-referenced by PHPXref 0.7.1