wppaste
WordPress

CallableNameFilter

Source
wp-includes/SimplePie/src/Cache/CallableNameFilter.php:13
Creating a cache filename with callables

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 1

$callableSimplePie\Cache\callable(string):private

Methods · 2

Source code

final class CallableNameFilter implements NameFilter{    /**     * @var callable(string): string     */    private $callable;     /**     * @param callable(string): string $callable     */    public function __construct(callable $callable)    {        $this->callable = $callable;    }     /**     * Method to create cache filename with.     *     * The returning name MUST follow the rules for keys in PSR-16.     *     * @link https://www.php-fig.org/psr/psr-16/     *     * The returning name MUST be a string of at least one character     * that uniquely identifies a cached item, MUST only contain the     * characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding     * and MUST not longer then 64 characters. The following characters     * are reserved for future extensions and MUST NOT be used: {}()/\@:     *     * A provided implementing library MAY support additional characters     * and encodings or longer lengths, but MUST support at least that     * minimum.     *     * @param string $name The name for the cache will be most likely an url with query string     *     * @return string the new cache name     */    public function filter(string $name): string    {        return call_user_func($this->callable, $name);    }}

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/SimplePie/src/Cache/CallableNameFilter.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.