??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/pgtankstorage.sg/wp-content/plugins/polylang/src/format-util.php
⬅ Kembali
<?php
/**
* @package Polylang
*/
/**
* A class to match values against a given format.
*
* @since 3.6
* @since 3.7 Moved from Polylang Pro to Polylang.
*/
class PLL_Format_Util {
/**
* Cache for regex patterns.
* Useful when using `filter_list()` for example.
*
* @var string[] Formats as array keys, patterns as array values.
*
* @phpstan-var array<non-empty-string, non-empty-string>
*/
private $patterns = array();
/**
* Filters the given list to return only the values whose the key or value matches the given format.
*
* @since 3.6
* @since 3.7 Only accepts arrays as first parameter.
*
* @param array $list A list with keys or values to match against `$format`.
* @param string $format A format, where `*` means "any characters" (`.*`), unless escaped.
* @param string $mode Optional. Tell if we should filter the keys or values from `$list`.
* Possible values are `'use_keys'` and `'use_values'`. Default is `'use_keys'`.
* @return array
*
* @template TArrayValue
* @phpstan-param ($mode is 'use_keys' ? array<string, TArrayValue> : array<string>) $list
* @phpstan-param 'use_keys'|'use_values' $mode
* @phpstan-return ($mode is 'use_keys' ? array<string, TArrayValue> : array<string>)
*/
public function filter_list( array $list, string $format, string $mode = 'use_keys' ): array {
$filter = function ( $key ) use ( $format ) {
return $this->matches( (string) $key, $format );
};
if ( 'use_values' === $mode ) {
return array_filter( $list, $filter );
}
return array_filter( $list, $filter, ARRAY_FILTER_USE_KEY );
}
/**
* Tells if the given string matches the given format.
*
* @since 3.6
*
* @param string $key A string to test.
* @param string $format A format, where `*` means "any characters" (`.*`), unless escaped.
* @return bool
*/
public function matches( string $key, string $format ): bool {
if ( ! $this->is_format( $format ) ) {
return $key === $format;
}
if ( '*' === $format ) {
return true;
}
if ( empty( $this->patterns[ $format ] ) ) {
$pattern = addcslashes( $format, '.+?[^]$(){}=!<>|:-#/' ); // Escape regular expression characters (list from `preg_quote()` but `*` and `\` are ignored).
$pattern = preg_replace(
array(
'/\\\(?!\*)/', // Escape `\` characters except if followed by `*`.
'/(?<!\\\)\*/', // Replace `*` characters by `.*` except if preceded by `\`.
),
array( '\\', '.*' ),
$pattern
);
if ( empty( $pattern ) ) {
// Error.
return false;
}
$this->patterns[ $format ] = $pattern;
} else {
$pattern = $this->patterns[ $format ];
}
return (bool) preg_match( "/^{$pattern}$/", $key );
}
/**
* Tells if the given string is a format (that includes a `*`).
*
* @since 3.7
*
* @param string $format Format to test.
* @return bool
*
* @phpstan-assert-if-true non-empty-string $format
*/
public function is_format( string $format ): bool {
return (bool) preg_match( '/(?<!\\\)\*/', $format ); // Match `*` characters unless if preceded by `\`.
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
📁 Capabilities
dir
—
2026-06-17 21:10
📁 Model
dir
—
2026-06-17 21:10
📁 Options
dir
—
2026-06-17 21:10
📁 admin
dir
—
2026-06-17 21:10
📁 frontend
dir
—
2026-06-17 21:10
📁 install
dir
—
2026-06-17 21:10
📁 integrations
dir
—
2026-06-17 21:10
📁 modules
dir
—
2026-06-17 21:10
📁 settings
dir
—
2026-06-17 21:10
🐘 api.php
php
21.8 KB
2026-06-17 21:10
🐘 base.php
php
6.1 KB
2026-06-17 21:10
🐘 cache.php
php
2.4 KB
2026-06-17 21:10
🐘 class-polylang.php
php
8.3 KB
2026-06-17 21:10
🐘 constant-functions.php
php
1.8 KB
2026-06-17 21:10
🐘 cookie.php
php
3 KB
2026-06-17 21:10
🐘 crud-posts.php
php
14.7 KB
2026-06-17 21:10
🐘 crud-terms.php
php
8.8 KB
2026-06-17 21:10
🐘 default-term.php
php
6.4 KB
2026-06-17 21:10
🐘 filter-rest-routes.php
php
5 KB
2026-06-17 21:10
🐘 filters-links.php
php
5.6 KB
2026-06-17 21:10
🐘 filters-sanitization.php
php
3.2 KB
2026-06-17 21:10
🐘 filters-widgets-options.php
php
2.6 KB
2026-06-17 21:10
🐘 filters.php
php
12.9 KB
2026-06-17 21:10
🐘 format-util.php
php
3 KB
2026-06-17 21:10
🐘 functions.php
php
5.1 KB
2026-06-17 21:10
🐘 language-deprecated.php
php
7.1 KB
2026-06-17 21:10
🐘 language-factory.php
php
9.4 KB
2026-06-17 21:10
🐘 language.php
php
18.1 KB
2026-06-17 21:10
🐘 license.php
php
9.4 KB
2026-06-17 21:10
🐘 links-abstract-domain.php
php
3.2 KB
2026-06-17 21:10
🐘 links-default.php
php
3 KB
2026-06-17 21:10
🐘 links-directory.php
php
9.5 KB
2026-06-17 21:10
🐘 links-domain.php
php
2.9 KB
2026-06-17 21:10
🐘 links-model.php
php
6.5 KB
2026-06-17 21:10
🐘 links-permalinks.php
php
5.6 KB
2026-06-17 21:10
🐘 links-subdomain.php
php
2.2 KB
2026-06-17 21:10
🐘 links.php
php
1.4 KB
2026-06-17 21:10
🐘 mo.php
php
3.4 KB
2026-06-17 21:10
🐘 model.php
php
23 KB
2026-06-17 21:10
🐘 nav-menu.php
php
4.5 KB
2026-06-17 21:10
🐘 olt-manager.php
php
3 KB
2026-06-17 21:10
🐘 query.php
php
7.7 KB
2026-06-17 21:10
🐘 rest-request.php
php
4.2 KB
2026-06-17 21:10
🐘 static-pages.php
php
6.3 KB
2026-06-17 21:10
🐘 switcher.php
php
11 KB
2026-06-17 21:10
🐘 term-slug.php
php
4.9 KB
2026-06-17 21:10
🐘 translatable-object-with-types-interface.php
php
1 KB
2026-06-17 21:10
🐘 translatable-object-with-types-trait.php
php
2 KB
2026-06-17 21:10
🐘 translatable-object.php
php
17.6 KB
2026-06-17 21:10
🐘 translatable-objects.php
php
3.7 KB
2026-06-17 21:10
🐘 translate-option.php
php
13.1 KB
2026-06-17 21:10
🐘 translated-object.php
php
18.9 KB
2026-06-17 21:10
🐘 translated-post.php
php
17.2 KB
2026-06-17 21:10
🐘 translated-term.php
php
14.8 KB
2026-06-17 21:10
🐘 walker-dropdown.php
php
3.8 KB
2026-06-17 21:10
🐘 walker-list.php
php
2.5 KB
2026-06-17 21:10
🐘 walker.php
php
2.4 KB
2026-06-17 21:10
🐘 widget-calendar.php
php
11.6 KB
2026-06-17 21:10
🐘 widget-languages.php
php
5.3 KB
2026-06-17 21:10