Folder_Tree

This class handles the folders HTML output

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

$allowed_terms  : mixed
$args  : mixed
$exclude_categories  : mixed
$exclude_terms  : mixed
$include_categories  : mixed
$include_terms  : mixed
$query  : mixed
$shortcode_atts  : mixed
__construct()  : mixed
Constructor.
get_html()  : string
Retrieves the folder tree HTML
icon_svgs()  : mixed
fill_in_subcategories()  : array<string|int, mixed>
Recursively fills in the attached subcategories of a tree root
generate_categories_tree_root()  : mixed
Generate the top level of the tree array
generate_category_folder_html()  : mixed
Generates the folder HTML.
generate_category_tree()  : array<string|int, mixed>
Generates the full category tree.
get_attached_categories()  : array<string|int, WP_Term>
Retrieves all categories currently attached to the current table query
get_term_status()  : mixed
init_category_options()  : mixed
Get any terms options associated to or excluded from the folder structure
maybe_output_search_box()  : mixed
Output the folder search box.
maybe_output_search_results_container()  : mixed
Output the search results container DIV.
populate_missing_categories_into_tree()  : array<string|int, mixed>
Populates in missing category hierarchy of included terms

Properties

$allowed_terms

private mixed $allowed_terms = []
Tags

$exclude_categories

private mixed $exclude_categories = []
Tags

$exclude_terms

private mixed $exclude_terms = []
Tags

$include_categories

private mixed $include_categories = []
Tags

$include_terms

private mixed $include_terms = []
Tags

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $args = [] ][, array<string|int, mixed> $atts = [] ]) : mixed
Parameters
$args : array<string|int, mixed> = []
$atts : array<string|int, mixed> = []
Tags
Return values
mixed

get_html()

Retrieves the folder tree HTML

public get_html() : string
Tags
Return values
string

$folder_html

icon_svgs()

public icon_svgs(mixed $icons) : mixed
Parameters
$icons : mixed
Tags
Return values
mixed

fill_in_subcategories()

Recursively fills in the attached subcategories of a tree root

private fill_in_subcategories(array<string|int, WP_Term$categories, int $parent) : array<string|int, mixed>
Parameters
$categories : array<string|int, WP_Term>
$parent : int
Tags
Return values
array<string|int, mixed>

$category_tree

generate_categories_tree_root()

Generate the top level of the tree array

private generate_categories_tree_root(array<string|int, WP_Term$categories) : mixed
Parameters
$categories : array<string|int, WP_Term>
Tags
Return values
mixed

generate_category_folder_html()

Generates the folder HTML.

private generate_category_folder_html(mixed $categories[, bool $root = false ][, array<string|int, mixed> $shortcode_atts = [] ]) : mixed
Parameters
$categories : mixed
$root : bool = false
$shortcode_atts : array<string|int, mixed> = []
Tags
Return values
mixed

generate_category_tree()

Generates the full category tree.

private generate_category_tree() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

get_attached_categories()

Retrieves all categories currently attached to the current table query

private get_attached_categories() : array<string|int, WP_Term>
Tags
Return values
array<string|int, WP_Term>

$categories

get_term_status()

private get_term_status(mixed $term) : mixed
Parameters
$term : mixed
Tags
Return values
mixed

init_category_options()

Get any terms options associated to or excluded from the folder structure

private init_category_options() : mixed
Tags
Return values
mixed

Output the folder search box.

private maybe_output_search_box([string $context = 'top' ]) : mixed
Parameters
$context : string = 'top'
Tags
Return values
mixed

maybe_output_search_results_container()

Output the search results container DIV.

private maybe_output_search_results_container() : mixed
Tags
Return values
mixed

populate_missing_categories_into_tree()

Populates in missing category hierarchy of included terms

private populate_missing_categories_into_tree(array<string|int, mixed> $category_tree) : array<string|int, mixed>
Parameters
$category_tree : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

$category_tree

Search results