PHP Class Admin_Apple_News_List_Table, apple-news

Since: 0.4.0
Inheritance: extends WP_List_Table
Datei anzeigen Open project: alleyinteractive/apple-news Class Usage Examples

Public Properties

Property Type Description
$per_page integer How many entries per page will be displayed.
$settings Settings Current settings.

Public Methods

Method Description
__construct ( Settings $settings ) Constructor.
column_cb ( WP_Post $item ) : string Required IF using checkboxes or bulk actions. The 'cb' column gets special treatment when columns are processed. It ALWAYS needs to have it's own method.
column_default ( mixed $item, string $column_name ) : string Set column defaults.
column_title ( WP_Post $item ) : string This method is responsible for what is rendered in any column with a name/slug of 'title'.
get_bulk_actions ( ) : array Get bulk actions.
get_columns ( ) : array Dictates the table columns and titles. The 'cb' column is special and, if existant, there needs to be a column_cb method defined.
prepare_items ( ) Prepare items for the table.

Protected Methods

Method Description
date_range_filter_field ( ) Display datepickers to filter by date range
extra_tablenav ( string $which ) Display extra filtering options.
get_date_from_filter ( ) : string Get the current date from filter value.
get_date_to_filter ( ) : string Get the current date to filter value.
get_publish_status_filter ( ) : string Get the current publish status filter value.
get_search_filter ( ) : string Get the current search filter value.
publish_status_filter_field ( ) Display a dropdown to filter by publish state.

Private Methods

Method Description
get_status_for ( WP_Post $post ) : string Get the Apple News status.
get_synced_status_for ( WP_Post $post ) : string Get the synced status.
get_updated_at ( WP_Post $post ) : string Get the updated at time.

Method Details

__construct() public method

Constructor.
public __construct ( Settings $settings )
$settings Settings

column_cb() public method

Required IF using checkboxes or bulk actions. The 'cb' column gets special treatment when columns are processed. It ALWAYS needs to have it's own method.
public column_cb ( WP_Post $item ) : string
$item WP_Post
return string

column_default() public method

Set column defaults.
public column_default ( mixed $item, string $column_name ) : string
$item mixed
$column_name string
return string

column_title() public method

Every time the class needs to render a column, it first looks for a method named column_{$column_title}, if it exists, that method is run, otherwise, column_default() is called. Actions can be generated here.
public column_title ( WP_Post $item ) : string
$item WP_Post
return string

date_range_filter_field() protected method

Display datepickers to filter by date range
protected date_range_filter_field ( )

extra_tablenav() protected method

Display extra filtering options.
protected extra_tablenav ( string $which )
$which string

get_bulk_actions() public method

Get bulk actions.
public get_bulk_actions ( ) : array
return array

get_columns() public method

Dictates the table columns and titles. The 'cb' column is special and, if existant, there needs to be a column_cb method defined.
public get_columns ( ) : array
return array An array where the key is the column slug and the value is the title text.

get_date_from_filter() protected method

Get the current date from filter value.
protected get_date_from_filter ( ) : string
return string

get_date_to_filter() protected method

Get the current date to filter value.
protected get_date_to_filter ( ) : string
return string

get_publish_status_filter() protected method

Get the current publish status filter value.
protected get_publish_status_filter ( ) : string
return string

get_search_filter() protected method

Get the current search filter value.
protected get_search_filter ( ) : string
return string

prepare_items() public method

Prepare items for the table.
public prepare_items ( )

publish_status_filter_field() protected method

Display a dropdown to filter by publish state.

Property Details

$per_page public_oe property

How many entries per page will be displayed.
Since: 0.4.0
public int $per_page
return integer

$settings public_oe property

Current settings.
Since: 0.9.0
public Settings $settings
return Settings