Password_Protected_Categories implements Registerable, Standard_Service

Handles integration with Password Protected Categories.

Tags
author

Barn2 Plugins [email protected]

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Standard_Service

Table of Contents

$hidden_term_ids_by_taxonomy  : array<string, array<string|int, int>>|false
Cached hidden term IDs grouped by taxonomy.
add_indexed_where_clause()  : string
Add PPC visibility constraints to DataViews indexed queries.
register()  : mixed
{@inheritdoc}
build_hidden_terms_clause()  : string
Build SQL that excludes posts assigned to hidden PPC terms.
get_hidden_term_ids_by_taxonomy()  : array<string, array<string|int, int>>
Get hidden PPC term IDs grouped by taxonomy, including child terms.
get_query_protectable_taxonomies()  : array<string|int, string>
Get the PPC-protectable taxonomies used by the current query post types.

Properties

$hidden_term_ids_by_taxonomy

Cached hidden term IDs grouped by taxonomy.

private array<string, array<string|int, int>>|false $hidden_term_ids_by_taxonomy = false
Tags

Methods

add_indexed_where_clause()

Add PPC visibility constraints to DataViews indexed queries.

public add_indexed_where_clause(string $clause, object $query[, string $plugin_prefix = '' ]) : string
Parameters
$clause : string

Existing SQL WHERE fragment.

$query : object

The View_Query object.

$plugin_prefix : string = ''

Plugin prefix.

Tags
Return values
string

Modified SQL WHERE fragment.

build_hidden_terms_clause()

Build SQL that excludes posts assigned to hidden PPC terms.

private build_hidden_terms_clause(array<string, array<string|int, int>> $hidden_terms) : string
Parameters
$hidden_terms : array<string, array<string|int, int>>

Hidden term IDs grouped by taxonomy.

Tags
Return values
string

SQL fragment starting with " AND ".

get_hidden_term_ids_by_taxonomy()

Get hidden PPC term IDs grouped by taxonomy, including child terms.

private get_hidden_term_ids_by_taxonomy() : array<string, array<string|int, int>>

PPC's WP_Query integration uses tax_query NOT IN with include_children=true. The indexed query SQL needs the expanded descendant IDs explicitly.

Tags
Return values
array<string, array<string|int, int>>

get_query_protectable_taxonomies()

Get the PPC-protectable taxonomies used by the current query post types.

private get_query_protectable_taxonomies(object $query) : array<string|int, string>
Parameters
$query : object

The View_Query object.

Tags
Return values
array<string|int, string>

Search results