PHP Класс WPAS_Tickets_List

Автор: Julien Liabeuf ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$instance object Instance of this class.

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

public __construct ( )

add_core_custom_columns() публичный Метод

Add this column after the date.
С версии: 3.0.0
public add_core_custom_columns ( array $columns ) : array
$columns array List of default columns
Результат array Updated list of columns

add_ticket_id_title() публичный Метод

Add ticket ID to the ticket title in admin list screen
С версии: 3.3
public add_ticket_id_title ( string $title ) : string
$title string Original title
Результат string

apply_ordering_criteria() публичный Метод

$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.
С версии: 3.3
public apply_ordering_criteria ( WP_Post[] $posts, WP_Query $query ) : WP_Post[]
$posts WP_Post[]
$query WP_Query
Результат WP_Post[]

core_custom_columns_content() публичный Метод

Manage core column content.
С версии: 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() публичный Метод

Filter tickets by assigned staff
С версии: 3.3
public filter_staff ( WP_Query $wp_query ) : void
$wp_query WP_Query
Результат void

get_instance() публичный статический Метод

Return an instance of this class.
С версии: 3.0.0
public static get_instance ( ) : object
Результат object A single instance of this class.

get_replies_query() публичный Метод

Try to get the replies from cache and if not possible, run the query and cache the result.
С версии: 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
Результат WP_Query

hide_closed_tickets() публичный Метод

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.
С версии: 3.0.0
public hide_closed_tickets ( ) : boolean
Результат boolean True if the closed tickets were hiddne, false otherwise

remove_excerpt() публичный Метод

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
Результат string Excerpt if applicable or empty string otherwise

remove_quick_edit() публичный Метод

Remove Quick Edit action
С версии: 3.1.6
public remove_quick_edit ( array $actions ) : array
$actions array An array of row action links.
Результат array Updated array of row action links

set_ordering_query_var() публичный Метод

$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.
С версии: 3.3
public set_ordering_query_var ( WP_Query $query ) : void
$query WP_Query
Результат void

ticket_row_class() публичный Метод

Filter the list of CSS classes for the current post.
С версии: 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.
Результат array

Описание свойств

$instance защищенное статическое свойство

Instance of this class.
С версии: 1.0.0
protected static object $instance
Результат object