Property | Type | Description | |
---|---|---|---|
$error_message | Store the potential error messages. | ||
$index | |||
$instance | object | Instance of this class. | |
$parent_id | |||
$post_id |
Method | Description | |
---|---|---|
__construct ( ) | ||
add_form_enctype ( $post ) | ||
add_wrapper_class_admin ( array $classes, array $field ) : array | Add a custom class to the upload field wrapper in the admin | |
attachment_endpoint ( ) : void | Add a new rewrite endpoint. | |
attachment_query_var ( WP_Query $query ) : void | Add the attachment query var to the $query object. | |
can_attach_files ( ) : boolean | Check if the current user can attach a file. | |
create_upload_dir ( string $dir ) : boolean | Create the upload directory for a ticket. | |
custom_mime_types ( array $mimes ) : array | Add the custom file types to the WordPress whitelist | |
delete_attachments ( integer $post_id ) : void | Delete post attachments. | |
filter_attachments_out ( array $clauses, WP_Query $wp_query ) : array | Filter out tickets and ticket replies attachments | |
get_allowed_filetypes ( ) | ||
get_attachments ( integer $post_id ) : array | Get post attachments. | |
get_instance ( ) : object | Return an instance of this class. | |
has_attachments ( integer $post_id ) : boolean | Check if post has attachments. | |
human_filesize ( integer $bytes, integer $decimals = 2 ) : string | Human readable filesize. | |
individualize_files ( ) : boolean | Individualize uploaded files. | |
limit_upload ( array $file ) : array | Limit upload filetypes. | |
new_reply_attachment ( integer $reply_id ) : void | Process upload on new reply creation. | |
new_reply_backend_attachment ( integer $reply_id ) : void | Process upload on new reply creation. | |
new_ticket_attachment ( integer $ticket_id ) : void | Process upload on new ticket creation. | |
process_upload ( ) : boolean | Process the upload. | |
redirect_error ( string $location ) : string | Change the redirection URL. | |
set_upload_dir ( array $upload ) : string | Set upload directory. | |
show_attachments ( integer $post_id ) : void | Show ticket attachments. | |
upload_field ( ) : void | Add dropzone markup. | |
view_attachment ( ) : void | Display the attachment. |
Method | Description | |
---|---|---|
protect_upload_dir ( string $dir ) : void | Protects an upload directory by adding an .htaccess file |
public attachment_endpoint ( ) : void | ||
return | void |
public attachment_query_var ( WP_Query $query ) : void | ||
$query | WP_Query | The WordPress main query |
return | void |
public can_attach_files ( ) : boolean | ||
return | boolean | True if the user has the capability, false otherwise |
public create_upload_dir ( string $dir ) : boolean | ||
$dir | string | Upload directory |
return | boolean | Whether or not the directory was created |
public custom_mime_types ( array $mimes ) : array | ||
$mimes | array | Allowed mime types |
return | array | Our custom mime types list |
public delete_attachments ( integer $post_id ) : void | ||
$post_id | integer | ID of the post to be deleted |
return | void |
public filter_attachments_out ( array $clauses, WP_Query $wp_query ) : array | ||
$clauses | array | SQL query clauses |
$wp_query | WP_Query | WordPress query object |
return | array |
public get_attachments ( integer $post_id ) : array | ||
$post_id | integer | ID of the post to get attachment for |
return | array | Array of attachments or empty array if no attachments are found |
public static get_instance ( ) : object | ||
return | object | A single instance of this class. |
public has_attachments ( integer $post_id ) : boolean | ||
$post_id | integer | ID of the post to get attachment for |
return | boolean | True if the ticket has attachments, false otherwise |
public individualize_files ( ) : boolean | ||
return | boolean | Whether or not files were individualized |
public limit_upload ( array $file ) : array | ||
$file | array | Currently processed file details |
return | array | File details with a possible error message |
public new_reply_attachment ( integer $reply_id ) : void | ||
$reply_id | integer | New reply ID |
return | void |
public new_reply_backend_attachment ( integer $reply_id ) : void | ||
$reply_id | integer | New reply ID |
return | void |
public new_ticket_attachment ( integer $ticket_id ) : void | ||
$ticket_id | integer | New ticket ID |
return | void |
public process_upload ( ) : boolean | ||
return | boolean | Whether or not the upload has been processed |
protected protect_upload_dir ( string $dir ) : void | ||
$dir | string | Upload directory |
return | void |
public redirect_error ( string $location ) : string | ||
$location | string | Original redirection URL |
return | string | New redirection URL |
public set_upload_dir ( array $upload ) : string | ||
$upload | array | Initial upload directory |
return | string | Upload directory |
public show_attachments ( integer $post_id ) : void | ||
$post_id | integer | ID of the post to get attachment for |
return | void |
public view_attachment ( ) : void | ||
return | void |
protected static object $instance | ||
return | object |