[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

BuddyPress Attachments functions.

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

Defines 27 functions

  bp_attachments_uploads_dir_get()
  bp_attachments_cover_image_upload_dir()
  bp_attachments_get_max_upload_file_size()
  bp_attachments_get_allowed_types()
  bp_attachments_get_allowed_mimes()
  bp_attachments_check_filetype()
  bp_attachments_create_item_type()
  bp_attachments_get_attachment()
  bp_attachments_delete_file()
  bp_attachments_get_plupload_default_settings()
  bp_attachments_get_plupload_l10n()
  bp_attachments_enqueue_scripts()
  bp_attachments_current_user_can()
  bp_attachments_json_response()
  bp_attachments_get_template_part()
  bp_attachments_get_cover_image_settings()
  bp_attachments_get_cover_image_dimensions()
  bp_attachments_cover_image_is_edit()
  bp_attachments_get_user_has_cover_image()
  bp_attachments_get_group_has_cover_image()
  bp_attachments_cover_image_generate_file()
  bp_attachments_cover_image_ajax_upload()
  bp_attachments_cover_image_ajax_delete()
  bp_attachements_get_mime_type()
  bp_attachments_get_file_object()
  bp_attachments_list_directory_files()
  bp_attachments_list_directory_files_recursively()

Functions
Functions that are not part of a class:

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

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

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

since: 3.0.0
return: array See wp_upload_dir().

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

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

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

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

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

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

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

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
return: bool True if the attachment type is allowed. False otherwise

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.

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

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

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

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

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

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

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

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

since: 2.3.0
return: array Plupload default localization strings.

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

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

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

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
return: bool

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.

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

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

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

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

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

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

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

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

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

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

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

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

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
return: false|array An array containing cover image data on success, false otherwise.

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

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

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

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

bp_attachements_get_mime_type( $file = '' )   X-Ref
Returns a file's mime type.

param: string $file Absolute path of a file or directory.
since: 10.2.0
return: false|string False if the mime type is not supported by WordPress.

bp_attachments_get_file_object( SplFileInfo $file )   X-Ref
Returns a BP Attachments file object.

param: SplFileInfo $file The SplFileInfo file object.
since: 10.2.0
return: null|object      Null if the file is not supported by WordPress.

bp_attachments_list_directory_files( $directory_path = '' )   X-Ref
List the files of a directory.

param: string $directory_path Absolute path of a directory.
since: 10.0.0
return: array                 The file objects list of the directory.

bp_attachments_list_directory_files_recursively( $directory_path = '', $find = '' )   X-Ref
List the files of a directory recursively and eventually find a file using its ID.

param: string $directory_path Absolute path of a directory.
param: string $find           The file ID to find into the directory or its children.
since: 10.0.0
return: array                 The file objects list of the directory and subdirectories.



Generated: Sat Apr 27 01:00:55 2024 Cross-referenced by PHPXref 0.7.1