Theater for WordPress Code Reference
  • Package
  • Class

Packages

  • Theater
    • Abstracts
    • Events

Classes

  • Theater_Item
  • Theater_List

Class Theater_List

Abstract Theater Lists class.

Direct known subclasses

Theater_Event_Date_List, Theater_Event_List

Abstract
Package: Theater\Abstracts
Located at functions/abstract/class-theater-list.php

Methods summary

public
# __construct( array[string] $default_args = array() )

Sets the default filter arguments for a list.

Sets the default filter arguments for a list.

Parameters

$default_args
Optional. Custom default filter arguments for this list.

Since

0.16

Uses

Theater_Dates::$default_args to merge the built-in filter argument defaults with custom filter argument defaults.
public Theater_Item[]
# __invoke( )

Retrieves a list of items if the class is called as a function.

Retrieves a list of items if the class is called as a function.

Returns

Theater_Item[]
An array of items.

Since

0.16

Uses

Theater_Lists::get() to return an array of event dates.
public string
# __toString( )

Gets a fully formatted list of items in HTML if this class is treated like a string.

Gets a fully formatted list of items in HTML if this class is treated like a string.

Returns

string
Formatted HTML list of items.

Since

0.16

Uses

Theater_Lists::get_html() to return a formatted HTML list of items.
public static array
# add_query_vars( array $vars )

Adds the page selectors to the public query vars.

Adds the page selectors to the public query vars.

This is needed to make $wp_query->query_vars['wpt_category'] work. Override this method to add your own page selectors.

Parameters

$vars
The current public query vars.

Returns

array
The new public query vars.

Since

0.10
protected
# filter_pagination( $field, $options, $args = array() )

Used by

Theater_Event_Date_List::get_html_page_navigation()
protected array
# get_classes_for_html( array $args = array() )

Gets the classes of a listing.

Gets the classes of a listing.

Parameters

$args
The listing args.

Returns

array
The classes of a listing.

Since

0.?

0.14.7 Added a new 'wpt/listing/classes' filter. Deprecated the 'wpt_listing_classes' filter.


protected string
# get_html( array $args = array() )

Gets a list in HTML.

Gets a list in HTML.

Parameters

$args

{ An array of arguments. Optional.

These can be any of the arguments used in the $filters of WPT_Listing::load(), plus:

Returns

string
HTML.

Since

0.10

0.15.2 Added actions directly before and after the HTML is generated. Used by WPT_Context() to give set the context for a listing.


See

WPT_Listing::get_html_pagination()
WPT_Listing::get_html_for_page()

WPT_Listing::get_html_grouped() for possible values. Default .


WPT_Listing::get_html_pagination() for possible values. Default <[]>.


Used by

Theater_Event_Date_List::get_html()
to generate the HTML for an event dates list.

Type

string $groupby Field to group the listing by.
array $paginateby Fields to paginate the listing by.

string $template Template to use for the individual list items. Default . }


protected array
# get_pagination_filters( )

Gets the pagination filters for a listing.

Gets the pagination filters for a listing.

Returns

array
The pagination filters for a listing.

Since

0.13.4
protected string
# get_html_page_navigation( array $args = array() )

Gets the page navigation for a listing in HTML.

Gets the page navigation for a listing in HTML.

Override this method to create your own page navigation using WPT_Listing::filter_pagination() helper method.

Parameters

$args

The arguments being used for the event listing. See WPT_Listing::get_html() for possible values.

Returns

string
The HTML for the page navigation.

Since

0.10

See

WPT_Listing::filter_pagination()
protected string
# get_html_for_page( array $args = array() )

Gets a list of events in HTML for a page.

Gets a list of events in HTML for a page.

Override this method to assemble your own page content.

Parameters

$args
See WPT_Listing::get_html() for possible values.

Returns

string
The HTML.

Since

0.10
public array
# get( $filters = array() )

Gets a list of events.

Gets a list of events.

Returns

array
An array of WPT_Event objects.

Since

0.8

Properties summary

protected array $default_args
# array()
protected array $default_args_for_html

Default arguments for all HTML methods.

Default arguments for all HTML methods.

Since

0.10
# array( 'groupby' => false, 'paginateby' => array(), 'template' => null, )
Theater for WordPress Code Reference API documentation generated by ApiGen