Table_Generator implements Registerable, Standard_Service

This class handles the registration of the table generator library.

Tags
author

Barn2 Plugins [email protected]

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Standard_Service

Table of Contents

$plugin  : Plugin
Instance of the plugin.
$rest_callbacks  : array<string|int, mixed>
Nested REST callback contexts. The shared save hook supplies no plugin ID.
__construct()  : mixed
Get things started.
change_table_settings()  : array<string|int, mixed>
Change table settings.
forget_rest_callback()  : mixed
Restore the outer callback after REST dispatch, including error responses.
init()  : void
Init the table generator library.
register()  : void
Hook into WP.
remember_rest_callback()  : mixed
Remember the invoking handler and fields before the shared route adds defaults.
resolve_filter_state_for_shortcode_args()  : array<string|int, mixed>
Respect the PTP builder's mode flag and explicit shortcode overrides.
resolve_filter_state_for_table_api_response()  : array<string|int, mixed>
Represent disabled filters in this plugin's editor response.
resolve_filter_state_for_table_settings()  : array<string|int, mixed>
Normalize this plugin's submitted filter fields, retaining omitted saved fields.

Properties

$rest_callbacks

Nested REST callback contexts. The shared save hook supplies no plugin ID.

private array<string|int, mixed> $rest_callbacks = []
Tags

Methods

__construct()

Get things started.

public __construct(Plugin $plugin) : mixed
Parameters
$plugin : Plugin
Tags
Return values
mixed —

change_table_settings()

Change table settings.

public change_table_settings(array<string|int, mixed> $submitted_settings, int $table_id) : array<string|int, mixed>
Parameters
$submitted_settings : array<string|int, mixed>

Submitted table settings.

$table_id : int

Table ID.

Tags
Return values
array<string|int, mixed> —

forget_rest_callback()

Restore the outer callback after REST dispatch, including error responses.

public forget_rest_callback(mixed $response) : mixed
Parameters
$response : mixed

REST response.

Tags
Return values
mixed —

init()

Init the table generator library.

public init() : void
Tags
Return values
void —

register()

Hook into WP.

public register() : void
Tags
Return values
void —

remember_rest_callback()

Remember the invoking handler and fields before the shared route adds defaults.

public remember_rest_callback(mixed $response, array<string|int, mixed> $handler, WP_REST_Request $request) : mixed
Parameters
$response : mixed

REST response.

$handler : array<string|int, mixed>

Registered handler.

$request : WP_REST_Request

REST request.

Tags
Return values
mixed —

resolve_filter_state_for_shortcode_args()

Respect the PTP builder's mode flag and explicit shortcode overrides.

public resolve_filter_state_for_shortcode_args(array<string|int, mixed> $args, Content_Table $table, array<string|int, mixed> $attributes) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

Merged runtime arguments.

$table : Content_Table

Saved table.

$attributes : array<string|int, mixed>

Explicit shortcode attributes.

Tags
Return values
array<string|int, mixed> —

resolve_filter_state_for_table_api_response()

Represent disabled filters in this plugin's editor response.

public resolve_filter_state_for_table_api_response(array<string|int, mixed> $data, array<string|int, mixed> $class_function, mixed $type) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

Response data.

$class_function : array<string|int, mixed>

Invoking class/function.

$type : mixed

Response type.

Tags
Return values
array<string|int, mixed> —

resolve_filter_state_for_table_settings()

Normalize this plugin's submitted filter fields, retaining omitted saved fields.

public resolve_filter_state_for_table_settings(array<string|int, mixed> $submitted_settings, int $table_id) : array<string|int, mixed>
Parameters
$submitted_settings : array<string|int, mixed>

Sanitized settings from the shared route.

$table_id : int

Table ID.

Tags
Return values
array<string|int, mixed> —

Search results