Document_Loop implements Registerable, Premium_Service

This class protects or unlocks documents inside document loops.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Premium_Service

Table of Contents

$hidden_document_ids  : mixed
$unlocked_document_ids  : mixed
aioseo_exclude_protected_documents()  : array<string|int, mixed>
Exclude hidden documents from All in One SEO Pack sitemap.
exclude_protected_documents()  : mixed
Protect documents in the loop.
include_unlocked_documents()  : mixed
Add unlocked documents to the loop when relevant.
register()  : mixed
{@inheritdoc}
update_category_counts()  : array<string|int, mixed>
Update the category counts to reflect hidden ones.
wpseo_exclude_protected_documents()  : string
Exclude hidden documents from WPSEO sitemap.
hidden_document_ids()  : array<string|int, mixed>
Set and retrieve hidden document ids.
include_intersecting_unlocked_documents()  : string
Include unlocked documents that match query restrictions.
unlocked_document_ids()  : array<string|int, mixed>
Set and retrieve unlocked document ids.

Properties

$hidden_document_ids

private mixed $hidden_document_ids = false
Tags

$unlocked_document_ids

private mixed $unlocked_document_ids = false
Tags

Methods

aioseo_exclude_protected_documents()

Exclude hidden documents from All in One SEO Pack sitemap.

public aioseo_exclude_protected_documents(array<string|int, mixed> $ids, string $type) : array<string|int, mixed>
Parameters
$ids : array<string|int, mixed>

The IDs of the documents to exclude.

$type : string

The type of the sitemap.

Tags
Return values
array<string|int, mixed>

The IDs of the documents to exclude.

exclude_protected_documents()

Protect documents in the loop.

public exclude_protected_documents(string $where, WP_Query $query) : mixed
Parameters
$where : string
$query : WP_Query
Tags
Return values
mixed

include_unlocked_documents()

Add unlocked documents to the loop when relevant.

public include_unlocked_documents(string $where, WP_Query $query) : mixed
Parameters
$where : string
$query : WP_Query
Tags
Return values
mixed

register()

{@inheritdoc}

public register() : mixed
Tags
Return values
mixed

update_category_counts()

Update the category counts to reflect hidden ones.

public update_category_counts(array<string|int, mixed> $terms, array<string|int, mixed> $taxonomies, array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$terms : array<string|int, mixed>
$taxonomies : array<string|int, mixed>
$args : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

wpseo_exclude_protected_documents()

Exclude hidden documents from WPSEO sitemap.

public wpseo_exclude_protected_documents(string $url, string $type, object $data_object) : string
Parameters
$url : string
$type : string
$data_object : object
Tags
Return values
string

hidden_document_ids()

Set and retrieve hidden document ids.

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

include_intersecting_unlocked_documents()

Include unlocked documents that match query restrictions.

private include_intersecting_unlocked_documents(string $where, WP_Query $query, array<string|int, mixed> $unlocked_document_ids, string $post_status) : string

Clones the query, runs it without protection, and intersects with unlocked documents to find those that should be included.

Parameters
$where : string

The WHERE clause.

$query : WP_Query

The query object.

$unlocked_document_ids : array<string|int, mixed>

Unlocked document IDs.

$post_status : string

The post status.

Tags
Return values
string

Modified WHERE clause.

unlocked_document_ids()

Set and retrieve unlocked document ids.

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

Search results