Pages_Protector implements Registerable, Service

Handles the protection of non WC pages.

Interfaces, Classes and Traits

Registerable
Service

Table of Contents

hide_pages_in_search()  : void
Hide protected pages from the search results.
hide_pages_in_widgets()  : array<string|int, mixed>
Hide protected pages from the pages widget.
protect()  : mixed
protect_nav_menus()  : array<string|int, mixed>
Hide protected other pages from the menu.
protect_other_pages()  : bool
Mark a page as protected when the metadata is enabled.
register()  : mixed
register_page_meta()  : void
Register a new metadata field.

Methods

Hide protected pages from the search results.

public hide_pages_in_search(object &$query) : void
Parameters
$query : object
Return values
void

hide_pages_in_widgets()

Hide protected pages from the pages widget.

public hide_pages_in_widgets(array<string|int, mixed> $excludes) : array<string|int, mixed>
Parameters
$excludes : array<string|int, mixed>
Return values
array<string|int, mixed>

protect_nav_menus()

Hide protected other pages from the menu.

public protect_nav_menus(array<string|int, mixed> $items, array<string|int, mixed> $menu, array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>
$menu : array<string|int, mixed>
$args : array<string|int, mixed>
Return values
array<string|int, mixed>

protect_other_pages()

Mark a page as protected when the metadata is enabled.

public protect_other_pages(bool $protected) : bool
Parameters
$protected : bool
Return values
bool

register_page_meta()

Register a new metadata field.

public register_page_meta() : void
Return values
void

Search results