PHP Class WPAS_Tickets_List

Author: Julien Liabeuf ([email protected])
显示文件 Open project: awesome-support/awesome-support Class Usage Examples

Protected Properties

Property Type Description
$instance object Instance of this class.

Public Methods

Method Description
__construct ( )
add_core_custom_columns ( array $columns ) : array Add age custom column.
add_ticket_id_title ( string $title ) : string Add ticket ID to the ticket title in admin list screen
apply_ordering_criteria ( WP_Post[] $posts, WP_Query $query ) : WP_Post[] Called by the 'posts_clauses' filter hook this method modifies WP_Query SQL for ticket post types when:
core_custom_columns_content ( array $column, integer $post_id ) Manage core column content.
filter_staff ( WP_Query $wp_query ) : void Filter tickets by assigned staff
get_instance ( ) : object Return an instance of this class.
get_replies_query ( integer $ticket_id ) : WP_Query Get all ticket replies
hide_closed_tickets ( ) : boolean Hide closed tickets.
remove_excerpt ( string $content ) : string Remove the ticket excerpt.
remove_quick_edit ( array $actions ) : array Remove Quick Edit action
set_ordering_query_var ( WP_Query $query ) : void Called by the 'pre_get_posts' filter hook this method sets the following to true when for the admin ticket list page:
ticket_row_class ( array $classes, array $class, integer $post_id ) : array Filter the list of CSS classes for the current post.

Method Details

__construct() public method

public __construct ( )

add_core_custom_columns() public method

Add this column after the date.
Since: 3.0.0
public add_core_custom_columns ( array $columns ) : array
$columns array List of default columns
return array Updated list of columns

add_ticket_id_title() public method

Add ticket ID to the ticket title in admin list screen
Since: 3.3
public add_ticket_id_title ( string $title ) : string
$title string Original title
return string

apply_ordering_criteria() public method

$wp_query->get('wpas_order_by_urgency') === true The query var 'wpas_order_by_urgency' will be set in the set_ordering_query_var() function called by the 'pre_get_posts' action hook.
Since: 3.3
public apply_ordering_criteria ( WP_Post[] $posts, WP_Query $query ) : WP_Post[]
$posts WP_Post[]
$query WP_Query
return WP_Post[]

core_custom_columns_content() public method

Manage core column content.
Since: 3.0.0
public core_custom_columns_content ( array $column, integer $post_id )
$column array Column currently processed
$post_id integer ID of the post being processed

filter_staff() public method

Filter tickets by assigned staff
Since: 3.3
public filter_staff ( WP_Query $wp_query ) : void
$wp_query WP_Query
return void

get_instance() public static method

Return an instance of this class.
Since: 3.0.0
public static get_instance ( ) : object
return object A single instance of this class.

get_replies_query() public method

Try to get the replies from cache and if not possible, run the query and cache the result.
Since: 3.3
public get_replies_query ( integer $ticket_id ) : WP_Query
$ticket_id integer ID of the ticket we want to get the replies for
return WP_Query

hide_closed_tickets() public method

If the plugin is set to hide closed tickets, we modify the "All Tickets" link in the post type menu and append the status filter with the "open" value.
Since: 3.0.0
public hide_closed_tickets ( ) : boolean
return boolean True if the closed tickets were hiddne, false otherwise

remove_excerpt() public method

We don't want ot display the ticket excerpt in the tickets list when the excerpt mode is selected.
public remove_excerpt ( string $content ) : string
$content string Ticket excerpt
return string Excerpt if applicable or empty string otherwise

remove_quick_edit() public method

Remove Quick Edit action
Since: 3.1.6
public remove_quick_edit ( array $actions ) : array
$actions array An array of row action links.
return array Updated array of row action links

set_ordering_query_var() public method

$wp_query->query_var['wpas_order_by_urgency'] Setting this to true will trigger modifications to the query that will be made in the apply_ordering_criteria() function called by the 'posts_clauses' filter hook.
Since: 3.3
public set_ordering_query_var ( WP_Query $query ) : void
$query WP_Query
return void

ticket_row_class() public method

Filter the list of CSS classes for the current post.
Since: 3.3
public ticket_row_class ( array $classes, array $class, integer $post_id ) : array
$classes array An array of post classes.
$class array An array of additional classes added to the post.
$post_id integer The post ID.
return array

Property Details

$instance protected_oe static_oe property

Instance of this class.
Since: 1.0.0
protected static object $instance
return object