Plugin sitemap class

access public
package kocuj_sitemap

 Methods

Create sitemap

create(string $locale = '') : array
access public

Parameters

$locale

string

Language locale - default: empty

Returns

arraySitemap data

Get sitemap to display

get(string $homeLinkText = '', string $class = '', array $exclude = array(), array $hideTypes = array(), integer $widget = \KocujSitemapPlugin\Enums\Widget::NO, integer $display = \KocujSitemapPlugin\Enums\DisplayType::STANDARD) : string
access public

Parameters

$homeLinkText

string

Home link text in the sitemap - default: empty

$class

string

Sitemap class - default: empty

$exclude

array

List of elements to exclude - it is divided into sections: "post", "category", "author", "term" - default: empty

$hideTypes

array

List of elements types to hide; there are the following types allowed: "authors", "custom", "home", "menus", "pages", "posts", "tags" - default: empty

$widget

integer

It is widget or not; must be one of the following constants from \KocujSitemapPlugin\Enums\Widget: NO (when it is not widget) or YES (when it is widget) - default: \KocujSitemapPlugin\Enums\Widget::NO

$display

integer

Display type; must be one of the following constants from \KocujSitemapPlugin\Enums\DisplayType: STANDARD (when it is standard display) or DROPDOWN (when it is drop-down list display) - default: \KocujSitemapPlugin\Enums\DisplayType::STANDARD

Returns

stringSitemap to display

Get element type

getElementType(string $type) : array
access public

Parameters

$type

string

Element type

Returns

arrayElement type

Get element type administration panel class object

getElementTypeAdminObject(string $type) : object
access public

Parameters

$type

string

Element type

Returns

objectElement type administration panel class

Get element type class object

getElementTypeObject(string $type) : object
access public

Parameters

$type

string

Element type

Returns

objectElement type class

Get elements types

getElementsTypes(integer $onlyWithConfigurableOrder = \KocujSitemapPlugin\Enums\OnlyWithConfigurableOrder::NO) : array
access public

Parameters

$onlyWithConfigurableOrder

integer

Get only elements types with configurable order or all of them; must be one of the following constants from \KocujSitemapPlugin\Enums\OnlyWithConfigurableOrder: NO (to get all elements types) or YES (to get elements types only with configurable order) - default: \KocujSitemapPlugin\Enums\OnlyWithConfigurableOrder::NO

Returns

arrayElements types

Get all exclude defaults

getExcludeDefaults(array $labels, string $keyPrefix = 'exclude', string $filterPrefix = 'kocujsitemap_default_exclude_') : array
access public

Parameters

$labels

array

Output with labels for each suffix

$keyPrefix

string

Prefix for keys in output array - default: exclude

$filterPrefix

string

Prefix for filter with default value; if empty, there will be not filter - default: kocujsitemap_defaultexclude

Returns

arrayAll exclude defaults

Get hide types list

getHideTypesList() : array
access public

Returns

arrayHide types list

Get home link text position

getHomeLinkTextPos() : integer
access public

Returns

integerHome link text position

Get singleton instance

getInstance() : object
Static
access public

Returns

objectSingleton instance

Set home link text position

setHomeLinkTextPos(integer $homeLinkTextPos) : void
access public

Parameters

$homeLinkTextPos

integer

Home link text position

Sitemap shortcode

shortcode(array|string $args) : string
access public

Parameters

$args

arraystring

Arguments

Returns

stringParsed output

Disable cloning of object

__clone() : void
access private

Constructor

__construct() : void
access private

Add sitemap text

addSitemapText(string $type, array $attr, array $data, array $index, $first, array $exclude, boolean $isWidget, integer $display) : string
access private

Parameters

$type

string

Sitemap data type

$attr

array

Attributes

$data

array

Sitemap data

$index

array

Sitemap data index

$first

$exclude

array

List of elements to exclude - it is divided into sections: "post", "category", "author", "term"

$isWidget

boolean

Sitemap for widget (true) or not (false)

$display

integer

Display type; must be one of the following constants from \KocujSitemapPlugin\Enums\DisplayType: STANDARD (when it is standard display) or DROPDOWN (when it is drop-down list display)

Returns

stringSitemap text

Add sitemap text by reccurence

addSitemapTextReccurence(string $type, array $data, array $index, array $attr, boolean $firstLevel, $first, array $exclude, boolean $isWidget, integer $display, integer $depth, $urls) : string
access private

Parameters

$type

string

Sitemap data type

$data

array

Sitemap data

$index

array

Sitemap data index

$attr

array

Attributes

$firstLevel

boolean

It is first level on list (true) or not (false)

$first

$exclude

array

List of elements to exclude - it is divided into sections: "post", "category", "author", "term"

$isWidget

boolean

Sitemap for widget (true) or not (false)

$display

integer

Display type; must be one of the following constants from \KocujSitemapPlugin\Enums\DisplayType: STANDARD (when it is standard display) or DROPDOWN (when it is drop-down list display)

$depth

integer

Depth

$urls

Returns

stringSitemap text

Prepare sitemap data for text by reccurence when there are any elements excluded

addSitemapTextReccurencePrepareForExclude(string $type, $data, array $index, array $attr, array $exclude) : void
access private

Parameters

$type

string

Sitemap data type

$data

$index

array

Sitemap data index

$attr

array

Attributes

$exclude

array

List of elements to exclude - it is divided into sections: "post", "category", "author", "term"

Compress sitemap elements

compressElements($data, $index, array $attr) : void
access private

Parameters

$data

$index

$attr

array

Attributes

Compress text

compressText(string $text) : string
access private

Parameters

$text

string

Text to compress

Returns

stringCompressed text

Decompress sitemap element

decompressElement(array $element, array $index, array $attr) : array
access private

Parameters

$element

array

Sitemap element to change

$index

array

Sitemap data index

$attr

array

Attributes

Returns

arrayDecompressed sitemap element

Decompress text

decompressText(string $text) : string
access private

Parameters

$text

string

Text to decompress

Returns

stringDecompressed text

 Properties

 

Elements types

$elementsTypes : array

Default

array()
access private
 

Home link text position

$homeLinkTextPos : integer

Default

-1
access private
 

Singleton instance

$instance : object

Default

NULL
Static
access private

 Constants