Table_Shortcode implements Standard_Service, Registerable, Conditional

This class handles our posts table shortcode.

Example usage: [posts_table post_type="band" columns="title,content,tax:country,tax:genre,cf:_price,cf:stock" tag="cool", term="country:uk,artist:beatles"]

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Standard_Service
Registerable
Conditional

Table of Contents

SHORTCODE  = 'posts_table'
change_default_shortcode_atts()  : array<string|int, mixed>
Change the default shortcode attributes.
do_shortcode()  : string
Handles our posts data table shortcode.
is_required()  : bool
Checks if the service is required.
register()  : mixed
Registers the posts table shortcode.
back_compat_args()  : array<string|int, mixed>
Converts old shortcode argument names to their new equivalents for backwards compatibility.
can_do_shortocde()  : bool
Determines if the shortcode can be executed.

Constants

Methods

change_default_shortcode_atts()

Change the default shortcode attributes.

public change_default_shortcode_atts(array<string|int, mixed> $out, array<string|int, mixed> $pairs, array<string|int, mixed> $atts, string $shortcode) : array<string|int, mixed>
Parameters
$out : array<string|int, mixed>

The output array of shortcode attributes.

$pairs : array<string|int, mixed>

The supported attributes and their defaults.

$atts : array<string|int, mixed>

The user defined shortcode attributes.

$shortcode : string

The shortcode name.

Tags
Return values
array<string|int, mixed>

The output array of shortcode attributes.

do_shortcode()

Handles our posts data table shortcode.

public static do_shortcode(array<string|int, mixed> $atts[, string $content = '' ]) : string
Parameters
$atts : array<string|int, mixed>

The attributes passed in to the shortcode

$content : string = ''

The content passed to the shortcode (not used)

Tags
Return values
string

The shortcode output

is_required()

Checks if the service is required.

public is_required() : bool
Tags
Return values
bool

True if the service is required, false otherwise.

register()

Registers the posts table shortcode.

public register() : mixed
Tags
Return values
mixed

back_compat_args()

Converts old shortcode argument names to their new equivalents for backwards compatibility.

private static back_compat_args(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

The shortcode arguments to convert

Tags
Return values
array<string|int, mixed>

The converted arguments with old names replaced by new ones

can_do_shortocde()

Determines if the shortcode can be executed.

private static can_do_shortocde() : bool
Tags
Return values
bool

True if the shortcode can be executed, false otherwise.

Search results