Folder_Tree
This class handles the folders HTML output
Tags
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
= []
$args
private
mixed
$args
$exclude_categories
private
mixed
$exclude_categories
= []
$exclude_terms
private
mixed
$exclude_terms
= []
$include_categories
private
mixed
$include_categories
= []
$include_terms
private
mixed
$include_terms
= []
$query
private
mixed
$query
$shortcode_atts
private
mixed
$shortcode_atts
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> = []
Return values
mixed —get_html()
Retrieves the folder tree HTML
public
get_html() : string
Return values
string —$folder_html
icon_svgs()
public
icon_svgs(mixed $icons) : mixed
Parameters
- $icons : mixed
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
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>
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> = []
Return values
mixed —generate_category_tree()
Generates the full category tree.
private
generate_category_tree() : array<string|int, mixed>
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>
Return values
array<string|int, WP_Term> —$categories
get_term_status()
private
get_term_status(mixed $term) : mixed
Parameters
- $term : mixed
Return values
mixed —init_category_options()
Get any terms options associated to or excluded from the folder structure
private
init_category_options() : mixed
Return values
mixed —maybe_output_search_box()
Output the folder search box.
private
maybe_output_search_box([string $context = 'top' ]) : mixed
Parameters
- $context : string = 'top'
Return values
mixed —maybe_output_search_results_container()
Output the search results container DIV.
private
maybe_output_search_results_container() : mixed
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>
Return values
array<string|int, mixed> —$category_tree