Property | Type | Description | |
---|---|---|---|
$remove_mb | List of metaboxes to remove. |
Method | Description | |
---|---|---|
__construct ( ) | ||
add_custom_column ( array $columns ) : array | Add possible custom columns to tickets list. | |
add_field ( string $name = '', array $args = [] ) : boolean | Add a new custom field to the ticket. | |
check_required_fields ( $go, array $data = [] ) : mixed | Checks required custom fields. | |
custom_column_orderby ( object $query ) : void | Reorder custom columns based on custom values. | |
custom_columns_content ( string $column, integer $post_id ) : void | Manage custom columns content | |
custom_columns_sortable ( array $columns ) : array | Make custom columns sortable | |
custom_taxonomy_filter ( ) : void | Add filters for custom taxonomies | |
custom_taxonomy_filter_convert_id_term ( object $query ) : void | Convert taxonomy term ID into term slug. | |
enqueue_select2_assets ( ) : void | Register and enqueue the select2 assets | |
frontend_submission ( integer $ticket_id ) : void | Trigger the custom fields save function upon front-end submission of a new ticket. | |
get_custom_fields ( ) : array | Return the list of fields | |
have_custom_fields ( boolean $core = false ) : boolean | Check if custom fields are registered. | |
is_field_missing ( array $data = [] ) : boolean | WP_Error | Makes sure no required custom field is missing from the data passed. | |
move_status_first ( array $columns ) : array | Reorder the admin columns. | |
register_taxonomies ( ) : void | Register all custom taxonomies. | |
remove_field ( string $id ) : void | Remove a custom field. | |
remove_taxonomy_metabox ( ) : void | Remove taxonomies metaboxes. | |
save_core_field ( integer $post_id, array $field, mixed $value ) : void | Save the core fields. | |
save_custom_fields ( integer $post_id, array $data = [], boolean $allow_log = true ) : array | Save all custom fields given in $data to the database. | |
status_filter ( ) : void | Add status dropdown in the filters bar. | |
status_filter_by_status ( object $query ) : void | Filter tickets by status. | |
submission_form_fields ( ) : void | Display the custom fields on submission form. |
public add_custom_column ( array $columns ) : array | ||
$columns | array | List of default columns |
return | array | Updated list of columns |
public check_required_fields ( $go, array $data = [] ) : mixed | ||
$data | array | Array of data containing the custom fields to check for required attribute |
return | mixed | True if no error or a WP_Error otherwise |
public custom_column_orderby ( object $query ) : void | ||
$query | object | Main query |
return | void |
public custom_columns_sortable ( array $columns ) : array | ||
$columns | array | Already sortable columns |
return | array | New sortable columns |
public custom_taxonomy_filter ( ) : void | ||
return | void |
public custom_taxonomy_filter_convert_id_term ( object $query ) : void | ||
$query | object | WordPress current main query |
return | void |
public enqueue_select2_assets ( ) : void | ||
return | void |
public frontend_submission ( integer $ticket_id ) : void | ||
$ticket_id | integer | ID of the ticket that's just been added |
return | void |
public get_custom_fields ( ) : array | ||
return | array | List of custom fields |
public have_custom_fields ( boolean $core = false ) : boolean | ||
$core | boolean | True if core fields should be counted as registered custom fields. |
return | boolean | True if custom fields are present, false otherwise |
public is_field_missing ( array $data = [] ) : boolean | WP_Error | ||
$data | array | Array of data to check |
return | boolean | WP_Error | False if no field is missing, WP_Error with the list of missing fields otherwise |
public move_status_first ( array $columns ) : array | ||
$columns | array | List of admin columns |
return | array | Re-ordered list |
public register_taxonomies ( ) : void | ||
return | void |
public remove_field ( string $id ) : void | ||
$id | string | ID of the field to remove |
return | void |
public remove_taxonomy_metabox ( ) : void | ||
return | void |
public save_custom_fields ( integer $post_id, array $data = [], boolean $allow_log = true ) : array | ||
$post_id | integer | ID of the post being saved |
$data | array | Array of data that might contain custom fields values. |
$allow_log | boolean | Whether or not to allow logging actions. If this is set to false and the custom field is set to true, $log has higher priority. I tis used to prevent logging on ticket creation. |
return | array | Array of custom field / value saved to the database |
public status_filter ( ) : void | ||
return | void |
public status_filter_by_status ( object $query ) : void | ||
$query | object | WordPress current main query |
return | void |
public submission_form_fields ( ) : void | ||
return | void |