Filters_Custom_Normalizer implements Registerable, Standard_Service

Normalizes the filters_custom value from the DB format to a comma-separated string of slugs.

The settings UI stores filters_custom as an array of objects [{name, slug}], but the PTP args system expects a comma-separated string of filter slugs. This service hooks into the site default args filter to normalize the value before it enters the Table_Args parsing chain.

Tags
todo

This file is here temporarily until the tables refactor.

author

Barn2 Plugins [email protected]

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Standard_Service

Table of Contents

normalize_filters_custom()  : array<string|int, mixed>
Normalize filters_custom from the DB format [{name, slug}] to a comma-separated string of slugs.
register()  : void
{@inheritdoc}

Methods

normalize_filters_custom()

Normalize filters_custom from the DB format [{name, slug}] to a comma-separated string of slugs.

public normalize_filters_custom(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>

The site default arguments.

Tags
Return values
array<string|int, mixed>

The modified site default arguments.

Search results