[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

BuddyPress Attachments functions.

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

Defines 24 functions

  bp_attachments_is_wp_version_supported()
  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()

Functions
Functions that are not part of a class:

bp_attachments_is_wp_version_supported()   X-Ref
Check if the current WordPress version is using Plupload 2.1.1

Plupload 2.1.1 was introduced in WordPress 3.9. Our bp-plupload.js
script requires it. So we need to make sure the current WordPress
match with our needs.

return: bool Always true.
since: 2.3.0
since: 3.0.0 This is always true.

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

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

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.
since: 2.4.0
param: string $type A string to inform about the type of attachment

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

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

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

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

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
since: 2.4.0
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).

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.
since: 2.4.0
param: string $type The attachment type to create (avatar or cover_image). Default: avatar.
param: array  $args {

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
since: 2.4.0
param: string $data whether to get the url or the path.
param: array  $args {

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.
since: 2.4.0
param: array $args Array of arguments for the attachment deletion.

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
since: 2.3.0
param: string $class Name of the class extending BP_Attachment (eg: BP_Attachment_Avatar).

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
since: 2.3.0
param: string $capability The capability to check.
param: array  $args       An array containing the item_id and the object to check.

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

since: 2.3.0
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.

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

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

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

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

bp_attachments_get_cover_image_dimensions( $component = 'xprofile' )   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.
since: 2.4.0
param: string $component The BuddyPress component concerned ("xprofile" for user or "groups").

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.
since: 2.4.0
param: int $user_id User ID to retrieve cover image for.

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.
since: 2.4.0
param: int $group_id Group ID to check cover image existence for.

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.
since: 2.4.0
param: array                          $args {
param: BP_Attachment_Cover_Image|null $cover_image_class The class to use to fit the cover image.

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 May 22 01:01:45 2019 Cross-referenced by PHPXref 0.7.1