Documentation

O3PO_PeopleShortcodes
in package
implements O3PO_SettingsSpecifyer

Class representing the shortcodes generating various lists of people

Tags
since
0.4.1
subpackage

O3PO/includes

Table of Contents

Interfaces

O3PO_SettingsSpecifyer
Interface for classes specifying settings.

Properties

$shortcode_atts  : mixed
$shortcode_descriptions  : mixed

Methods

add_shortcodes()  : mixed
Add shortcodes of this class
persons_count_shortcode()  : int
Function generating the person-count shotcode
persons_ul_shortcode()  : string
Function generating the person-ul shotcode
render_people_shortcode_settings()  : mixed
Render the person data field(s)
specify_settings()  : mixed
Specifies class specific settings sections and fields.

Properties

$shortcode_atts

public static mixed $shortcode_atts = array('persons-ul' => array('sort' => array('default' => 'last_names', 'allowed' => ['last_names', 'first_names', 'False'], 'description' => 'Whether to sort and according to what.'), 'role' => array('default' => '', 'allowed' => ['', 'editor', 'coordinator', 'steering board', 'admin', 'executive board'], 'description' => 'If provided only persons with the given role are included. Multiple roles can be given as a comma separated list.'), 'link' => array('default' => 'True', 'allowed' => ['True', 'False'], 'description' => 'Whether make the name a link to the persons URL.'), 'affiliation' => array('default' => 'True', 'allowed' => ['True', 'False'], 'description' => 'Whether include the persons affiliation.'), 'country' => array('default' => 'True', 'allowed' => ['True', 'False'], 'description' => 'Whether include the persons country.'), 'date' => array('default' => 'True', 'allowed' => ['True', 'False'], 'description' => 'Whether include the date(s) the persons joined or and/or left their position.'), 'former' => array('default' => 'False', 'allowed' => ['False', 'True', 'Only'], 'description' => 'Whether to include (or only include) people who are leaving their role in the current year.'), 'extra' => array('default' => 'True', 'allowed' => ['False', 'True'], 'description' => 'Whether to print the persons extra in brackets.'), 'li-style' => array('default' => '', 'allowed' => ['', 'css'], 'description' => 'Style to apply to every li element.')), 'persons-count' => array('role' => array('default' => '', 'allowed' => ['', 'editor', 'coordinator', 'steering board', 'admin', 'executive board'], 'description' => 'If provided only persons with the given role are included. Multiple roles can be given as a comma separated list.'), 'former' => array('default' => 'False', 'allowed' => ['False', 'True', 'Only'], 'description' => 'Whether to include (or only include) people who are leaving their role in the current year.')))

$shortcode_descriptions

public static mixed $shortcode_descriptions = array('persons-ul' => "An itemized (i.e. not numbered but unordered) list of people.", 'persons-count' => "The number of people matching the given criteria.")

Methods

add_shortcodes()

Add shortcodes of this class

public static add_shortcodes() : mixed

To be added to the init hook.

Tags
since
0.4.1+
access

public

persons_count_shortcode()

Function generating the person-count shotcode

public static persons_count_shortcode(array<string|int, mixed> $atts, string $content, string $tag) : int

To be added as a shortcode via add_shortcode()

Parameters
$atts : array<string|int, mixed>

Array of attributes

$content : string

Content of the shortcode (is ignored)

$tag : string

Ignored

Tags
since
0.4.1+
access

public

Return values
int —

The count

persons_ul_shortcode()

Function generating the person-ul shotcode

public static persons_ul_shortcode(array<string|int, mixed> $atts, string $content, string $tag) : string

To be added as a shortcode via add_shortcode()

Parameters
$atts : array<string|int, mixed>

Array of attributes

$content : string

Content of the shortcode (is ignored)

$tag : string

Ignored

Tags
since
0.4.1+
access

public

Return values
string —

The html formated list

render_people_shortcode_settings()

Render the person data field(s)

public static render_people_shortcode_settings() : mixed
Tags
since
0.4.1+
access

public

specify_settings()

Specifies class specific settings sections and fields.

public static specify_settings(O3PO_Settings $settings) : mixed

To be called from O3PO_Settings::configure().

Parameters
$settings : O3PO_Settings

Settings object.

Tags
since
0.4.0
access

public


        
On this page

Search results