PHP Class WPAS_Tickets_List

Author: Julien Liabeuf ([email protected])
Afficher le fichier Open project: awesome-support/awesome-support Class Usage Examples

Protected Properties

Свойство Type Description
$instance object Instance of this class.

Méthodes publiques

Méthode 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 méthode

public __construct ( )

add_core_custom_columns() public méthode

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

add_ticket_id_title() public méthode

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
Résultat string

apply_ordering_criteria() public méthode

$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
Résultat WP_Post[]

core_custom_columns_content() public méthode

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 méthode

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

get_instance() public static méthode

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

get_replies_query() public méthode

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
Résultat WP_Query

hide_closed_tickets() public méthode

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
Résultat boolean True if the closed tickets were hiddne, false otherwise

remove_excerpt() public méthode

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
Résultat string Excerpt if applicable or empty string otherwise

remove_quick_edit() public méthode

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

set_ordering_query_var() public méthode

$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
Résultat void

ticket_row_class() public méthode

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.
Résultat array

Property Details

$instance protected_oe static_oe property

Instance of this class.
Since: 1.0.0
protected static object $instance
Résultat object