Свойство | Тип | Описание | |
---|---|---|---|
$error_message | Store the potential error messages. | ||
$index | |||
$instance | object | Instance of this class. | |
$parent_id | |||
$post_id |
Метод | Описание | |
---|---|---|
__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. |
Метод | Описание | |
---|---|---|
protect_upload_dir ( string $dir ) : void | Protects an upload directory by adding an .htaccess file |
public attachment_endpoint ( ) : void | ||
Результат | void |
public attachment_query_var ( WP_Query $query ) : void | ||
$query | WP_Query | The WordPress main query |
Результат | void |
public can_attach_files ( ) : boolean | ||
Результат | boolean | True if the user has the capability, false otherwise |
public create_upload_dir ( string $dir ) : boolean | ||
$dir | string | Upload directory |
Результат | boolean | Whether or not the directory was created |
public custom_mime_types ( array $mimes ) : array | ||
$mimes | array | Allowed mime types |
Результат | array | Our custom mime types list |
public delete_attachments ( integer $post_id ) : void | ||
$post_id | integer | ID of the post to be deleted |
Результат | void |
public filter_attachments_out ( array $clauses, WP_Query $wp_query ) : array | ||
$clauses | array | SQL query clauses |
$wp_query | WP_Query | WordPress query object |
Результат | array |
public get_attachments ( integer $post_id ) : array | ||
$post_id | integer | ID of the post to get attachment for |
Результат | array | Array of attachments or empty array if no attachments are found |
public static get_instance ( ) : object | ||
Результат | 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 |
Результат | boolean | True if the ticket has attachments, false otherwise |
public individualize_files ( ) : boolean | ||
Результат | boolean | Whether or not files were individualized |
public limit_upload ( array $file ) : array | ||
$file | array | Currently processed file details |
Результат | array | File details with a possible error message |
public new_reply_attachment ( integer $reply_id ) : void | ||
$reply_id | integer | New reply ID |
Результат | void |
public new_reply_backend_attachment ( integer $reply_id ) : void | ||
$reply_id | integer | New reply ID |
Результат | void |
public new_ticket_attachment ( integer $ticket_id ) : void | ||
$ticket_id | integer | New ticket ID |
Результат | void |
public process_upload ( ) : boolean | ||
Результат | boolean | Whether or not the upload has been processed |
protected protect_upload_dir ( string $dir ) : void | ||
$dir | string | Upload directory |
Результат | void |
public redirect_error ( string $location ) : string | ||
$location | string | Original redirection URL |
Результат | string | New redirection URL |
public set_upload_dir ( array $upload ) : string | ||
$upload | array | Initial upload directory |
Результат | string | Upload directory |
public show_attachments ( integer $post_id ) : void | ||
$post_id | integer | ID of the post to get attachment for |
Результат | void |
public view_attachment ( ) : void | ||
Результат | void |
protected static object $instance | ||
Результат | object |