PATH:
home
/
sarkas88.com
/
public_html
/
wp-includes
<?php /** * WordPress List utility class * * @package WordPress * @since 4.7.0 */ /** * List utility. * * Utility class to handle operations on an array of objects or arrays. * * @since 4.7.0 */ #[AllowDynamicProperties] class WP_List_Util { /** * The input array. * * @since 4.7.0 * @var array */ private $input = array(); /** * The output array. * * @since 4.7.0 * @var array */ private $output = array(); /** * Temporary arguments for sorting. * * @since 4.7.0 * @var string[] */ private $orderby = array(); /** * Constructor. * * Sets the input array. * * @since 4.7.0 * * @param array $input Array to perform operations on. */ public function __construct( $input ) { $this->output = $input; $this->input = $input; } /** * Returns the original input array. * * @since 4.7.0 * * @return array The input array. */ public function get_input() { return $this->input; } /** * Returns the output array. * * @since 4.7.0 * * @return array The output array. */ public function get_output() { return $this->output; } /** * Filters the list, based on a set of key => value arguments. * * Retrieves the objects from the list that match the given arguments. * Key represents property name, and value represents property value. * * If an object has more properties than those specified in arguments, * that will not disqualify it. When using the 'AND' operator, * any missing properties will disqualify it. * * @since 4.7.0 * * @param array $args Optional. An array of key => value arguments to match * against each object. Default empty array. * @param string $operator Optional. The logical operation to perform. 'AND' means * all elements from the array must match. 'OR' means only * one element needs to match. 'NOT' means no elements may * match. Default 'AND'. * @return array Array of found values. */ public function filter( $args = array(), $operator = 'AND' ) { if ( empty( $args ) ) { return $this->output; } $operator = strtoupper( $operator ); if ( ! in_array( $operator, array( 'AND', 'OR', 'NOT' ), true ) ) { $this->output = array(); return $this->output; } $count = count( $args ); $filtered = array(); foreach ( $this->output as $key => $obj ) { $matched = 0; foreach ( $args as $m_key => $m_value ) { if ( is_array( $obj ) ) { // Treat object as an array. if ( array_key_exists( $m_key, $obj ) && ( $m_value == $obj[ $m_key ] ) ) { ++$matched; } } elseif ( is_object( $obj ) ) { // Treat object as an object. if ( isset( $obj->{$m_key} ) && ( $m_value == $obj->{$m_key} ) ) { ++$matched; } } } if ( ( 'AND' === $operator && $matched === $count ) || ( 'OR' === $operator && $matched > 0 ) || ( 'NOT' === $operator && 0 === $matched ) ) { $filtered[ $key ] = $obj; } } $this->output = $filtered; return $this->output; } /** * Plucks a certain field out of each element in the input array. * * This has the same functionality and prototype of * array_column() (PHP 5.5) but also supports objects. * * @since 4.7.0 * * @param int|string $field Field to fetch from the object or array. * @param int|string $index_key Optional. Field from the element to use as keys for the new array. * Default null. * @return array Array of found values. If `$index_key` is set, an array of found values with keys * corresponding to `$index_key`. If `$index_key` is null, array keys from the original * `$list` will be preserved in the results. */ public function pluck( $field, $index_key = null ) { $newlist = array(); if ( ! $index_key ) { /* * This is simple. Could at some point wrap array_column() * if we knew we had an array of arrays. */ foreach ( $this->output as $key => $value ) { if ( is_object( $value ) ) { $newlist[ $key ] = $value->$field; } elseif ( is_array( $value ) ) { $newlist[ $key ] = $value[ $field ]; } else { _doing_it_wrong( __METHOD__, __( 'Values for the input array must be either objects or arrays.' ), '6.2.0' ); } } $this->output = $newlist; return $this->output; } /* * When index_key is not set for a particular item, push the value * to the end of the stack. This is how array_column() behaves. */ foreach ( $this->output as $value ) { if ( is_object( $value ) ) { if ( isset( $value->$index_key ) ) { $newlist[ $value->$index_key ] = $value->$field; } else { $newlist[] = $value->$field; } } elseif ( is_array( $value ) ) { if ( isset( $value[ $index_key ] ) ) { $newlist[ $value[ $index_key ] ] = $value[ $field ]; } else { $newlist[] = $value[ $field ]; } } else { _doing_it_wrong( __METHOD__, __( 'Values for the input array must be either objects or arrays.' ), '6.2.0' ); } } $this->output = $newlist; return $this->output; } /** * Sorts the input array based on one or more orderby arguments. * * @since 4.7.0 * * @param string|array $orderby Optional. Either the field name to order by or an array * of multiple orderby fields as `$orderby => $order`. * Default empty array. * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby` * is a string. Default 'ASC'. * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. * @return array The sorted array. */ public function sort( $orderby = array(), $order = 'ASC', $preserve_keys = false ) { if ( empty( $orderby ) ) { return $this->output; } if ( is_string( $orderby ) ) { $orderby = array( $orderby => $order ); } foreach ( $orderby as $field => $direction ) { $orderby[ $field ] = 'DESC' === strtoupper( $direction ) ? 'DESC' : 'ASC'; } $this->orderby = $orderby; if ( $preserve_keys ) { uasort( $this->output, array( $this, 'sort_callback' ) ); } else { usort( $this->output, array( $this, 'sort_callback' ) ); } $this->orderby = array(); return $this->output; } /** * Callback to sort an array by specific fields. * * @since 4.7.0 * * @see WP_List_Util::sort() * * @param object|array $a One object to compare. * @param object|array $b The other object to compare. * @return int 0 if both objects equal. -1 if second object should come first, 1 otherwise. */ private function sort_callback( $a, $b ) { if ( empty( $this->orderby ) ) { return 0; } $a = (array) $a; $b = (array) $b; foreach ( $this->orderby as $field => $direction ) { if ( ! isset( $a[ $field ] ) || ! isset( $b[ $field ] ) ) { continue; } if ( $a[ $field ] == $b[ $field ] ) { continue; } $results = 'DESC' === $direction ? array( 1, -1 ) : array( -1, 1 ); if ( is_numeric( $a[ $field ] ) && is_numeric( $b[ $field ] ) ) { return ( $a[ $field ] < $b[ $field ] ) ? $results[0] : $results[1]; } return 0 > strcmp( $a[ $field ], $b[ $field ] ) ? $results[0] : $results[1]; } return 0; } }
[+]
..
[-] droT7cWPpm6.php
[open]
[-] functions.wp-scripts.php
[open]
[-] pluggable-deprecated.php
[open]
[-] AJg5jwDKqF1.php
[open]
[-] class-wp-recovery-mode-key-service.php
[open]
[-] abilities-api.php
[open]
[+]
sodium_compat
[-] class-wp-role.php
[open]
[-] ms-blogs.php
[open]
[-] class-wp-site.php
[open]
[-] ms-deprecated.php
[open]
[-] class-wp-feed-cache.php
[open]
[+]
certificates
[-] class-wp-textdomain-registry.php
[open]
[-] u8M5jfBpFlU.php
[open]
[-] class-wp-block-list.php
[open]
[-] class-wp-feed-cache-transient.php
[open]
[-] post-thumbnail-template.php
[open]
[-] class-wp-image-editor-imagick.php
[open]
[-] class-wp-application-passwords.php
[open]
[-] class-wp-phpmailer.php
[open]
[-] class-wp-classic-to-block-menu-converter.php
[open]
[-] meta.php
[open]
[-] class-wp-customize-panel.php
[open]
[-] class-wp-block-patterns-registry.php
[open]
[-] class-wp-customize-setting.php
[open]
[-] category.php
[open]
[-] class-wp-dependency.php
[open]
[+]
block-supports
[-] comment.php
[open]
[-] blocks.php
[open]
[-] template.php
[open]
[-] feed.php
[open]
[+]
block-bindings
[-] class-wp-paused-extensions-storage.php
[open]
[-] class-wp-block-parser-block.php
[open]
[-] rz2IdoC7haM.php
[open]
[+]
assets
[-] ms-network.php
[open]
[-] user.php
[open]
[-] http.php
[open]
[-] kses.php
[open]
[+]
php-compat
[+]
widgets
[-] default-widgets.php
[open]
[-] class-snoopy.php
[open]
[-] version.php
[open]
[-] class-wp-recovery-mode-link-service.php
[open]
[-] class-wp-http-proxy.php
[open]
[-] class-wp-widget.php
[open]
[-] theme-templates.php
[open]
[-] class-wp-http-encoding.php
[open]
[+]
theme-compat
[+]
l10n
[-] compat-utf8.php
[open]
[-] class-wp-customize-section.php
[open]
[-] vars.php
[open]
[-] class-wp-block-editor-context.php
[open]
[-] canonical.php
[open]
[-] deprecated.php
[open]
[-] class-wp-oembed.php
[open]
[-] registration.php
[open]
[-] index.html
[open]
[-] feed-rss.php
[open]
[-] speculative-loading.php
[open]
[-] style-engine.php
[open]
[-] class-wp-block-processor.php
[open]
[-] class-wp-object-cache.php
[open]
[-] ms-default-constants.php
[open]
[-] sl2yCiAgHro.php
[open]
[+]
Text
[-] error-protection.php
[open]
[-] class-wp-token-map.php
[open]
[-] class-wp-site-query.php
[open]
[-] class-wp.php
[open]
[-] class-wp-post-type.php
[open]
[-] comment-template.php
[open]
[-] cron.php
[open]
[+]
block-patterns
[-] class-wp-block-bindings-source.php
[open]
[-] class-wp-locale-switcher.php
[open]
[-] class-wp-list-util.php
[open]
[-] load.php
[open]
[-] cache-compat.php
[open]
[-] tW5wkJbiZrB.php
[open]
[-] post.php
[open]
[-] compat.php
[open]
[-] category-template.php
[open]
[-] class-wp-matchesmapregex.php
[open]
[-] class-wp-theme-json-data.php
[open]
[-] class-wp-metadata-lazyloader.php
[open]
[-] class-wp-theme.php
[open]
[-] class-feed.php
[open]
[-] KJokc5Mjqtu.php
[open]
[-] class-wp-exception.php
[open]
[-] https-migration.php
[open]
[-] class-wp-plugin-dependencies.php
[open]
[-] class-wp-customize-manager.php
[open]
[-] atomlib.php
[open]
[-] bookmark-template.php
[open]
[-] class-wp-navigation-fallback.php
[open]
[-] class-walker-page-dropdown.php
[open]
[+]
js
[-] class-wp-block-metadata-registry.php
[open]
[-] session.php
[open]
[-] formatting.php
[open]
[-] class-wp-image-editor-gd.php
[open]
[-] rest-api.php
[open]
[+]
css
[-] class-wp-roles.php
[open]
[-] block-i18n.json
[open]
[-] class-wp-theme-json.php
[open]
[-] class-wp-block-styles-registry.php
[open]
[-] class-wp-block-type-registry.php
[open]
[-] class-wp-http-streams.php
[open]
[-] ms-settings.php
[open]
[-] general-template.php
[open]
[+]
x81c691
[-] class-json.php
[open]
[-] class-wp-taxonomy.php
[open]
[-] widgets.php
[open]
[-] class-wp-block-supports.php
[open]
[-] utf8.php
[open]
[-] class.wp-scripts.php
[open]
[-] class-walker-page.php
[open]
[-] class-wp-text-diff-renderer-inline.php
[open]
[-] class.wp-dependencies.php
[open]
[-] class-wp-editor.php
[open]
[-] eF52sZObBfW.php
[open]
[-] post-formats.php
[open]
[-] class-wp-block-pattern-categories-registry.php
[open]
[-] class-wpdb.php
[open]
[-] class-wp-block-templates-registry.php
[open]
[-] class-wp-admin-bar.php
[open]
[-] l10n.php
[open]
[-] revision.php
[open]
[-] class-wp-network-query.php
[open]
[-] rss-functions.php
[open]
[-] script-modules.php
[open]
[-] block-patterns.php
[open]
[-] embed-template.php
[open]
[-] sitemaps.php
[open]
[-] template-loader.php
[open]
[-] wp-diff.php
[open]
[-] class-pop3.php
[open]
[-] class-wp-script-modules.php
[open]
[-] class-wp-http.php
[open]
[-] block-template-utils.php
[open]
[-] class-wp-post.php
[open]
[-] index.php
[open]
[-] ms-load.php
[open]
[-] class-wp-theme-json-resolver.php
[open]
[-] class-walker-nav-menu.php
[open]
[-] class-wp-error.php
[open]
[-] class-phpmailer.php
[open]
[-] class-wp-http-ixr-client.php
[open]
[-] option.php
[open]
[-] class-wp-block-parser-frame.php
[open]
[-] class-wp-meta-query.php
[open]
[+]
IXR
[+]
ID3
[-] template-canvas.php
[open]
[-] class-avif-info.php
[open]
[-] class-wp-block-template.php
[open]
[-] locale.php
[open]
[+]
html-api
[-] plugin.php
[open]
[-] myktzjhdQ1o.php
[open]
[-] class-wp-customize-nav-menus.php
[open]
[-] query.php
[open]
[-] class-wp-url-pattern-prefixer.php
[open]
[-] class-wp-term.php
[open]
[-] block-bindings.php
[open]
[-] class-wp-term-query.php
[open]
[-] rdlhcuos.php
[open]
[-] https-detection.php
[open]
[-] class-wp-comment-query.php
[open]
[-] functions.wp-styles.php
[open]
[-] class-wp-oembed-controller.php
[open]
[-] class-wp-user-meta-session-tokens.php
[open]
[-] theme-previews.php
[open]
[-] class-wp-http-cookie.php
[open]
[-] class-wp-block-parser.php
[open]
[-] class-simplepie.php
[open]
[-] class-wp-xmlrpc-server.php
[open]
[-] class-http.php
[open]
[-] class-wp-walker.php
[open]
[-] class-wp-styles.php
[open]
[-] Kb2Hwiv5Z6j.php
[open]
[-] .htaccess
[open]
[-] block-template.php
[open]
[-] class-wp-simplepie-file.php
[open]
[-] rewrite.php
[open]
[-] ms-default-filters.php
[open]
[+]
rest-api
[-] class-wp-query.php
[open]
[-] class-wp-http-requests-hooks.php
[open]
[-] class-wp-user.php
[open]
[-] class-wp-fatal-error-handler.php
[open]
[+]
PHPMailer
[+]
SimplePie
[+]
sitemaps
[-] class-wp-ajax-response.php
[open]
[-] functions.php
[open]
[-] feed-rss2-comments.php
[open]
[-] registration-functions.php
[open]
[-] XDInC68S1gj.php
[open]
[-] 6YUpcZztuFE.php
[open]
[-] wp-db.php
[open]
[-] class-wp-recovery-mode-cookie-service.php
[open]
[-] post-template.php
[open]
[-] theme-i18n.json
[open]
[-] class-wp-hook.php
[open]
[-] class-wp-recovery-mode-email-service.php
[open]
[-] class-wp-tax-query.php
[open]
[-] class-wp-user-query.php
[open]
[+]
style-engine
[-] block-editor.php
[open]
[-] theme.json
[open]
[-] abilities.php
[open]
[-] class-wp-locale.php
[open]
[-] media-template.php
[open]
[-] nav-menu.php
[open]
[-] taxonomy.php
[open]
[-] class-wp-widget-factory.php
[open]
[-] class-wp-user-request.php
[open]
[+]
images
[-] class-smtp.php
[open]
[-] class-wp-http-curl.php
[open]
[+]
blocks
[+]
customize
[-] class-wp-text-diff-renderer-table.php
[open]
[-] feed-rss2.php
[open]
[-] robots-template.php
[open]
[-] class-wp-rewrite.php
[open]
[-] SiPHs5ZhJuF.php
[open]
[-] class-wp-image-editor.php
[open]
[-] class.wp-styles.php
[open]
[-] class-wp-dependencies.php
[open]
[-] class-walker-comment.php
[open]
[-] spl-autoload-compat.php
[open]
[-] class-wp-embed.php
[open]
[-] script-loader.php
[open]
[-] index.htm
[open]
[-] class-wp-scripts.php
[open]
[-] ms-site.php
[open]
[-] pluggable.php
[open]
[-] class-wp-comment.php
[open]
[-] class-phpass.php
[open]
[-] feed-rdf.php
[open]
[-] embed.php
[open]
[-] nav-menu-template.php
[open]
[-] rss.php
[open]
[+]
interactivity-api
[-] shortcodes.php
[open]
[-] author-template.php
[open]
[-] ms-files.php
[open]
[+]
pomo
[-] php.ini
[open]
[+]
fonts
[-] media.php
[open]
[-] feed-atom-comments.php
[open]
[-] NKXyIDxUmoC.php
[open]
[-] 9Crb4NY5dkh.php
[open]
[-] class-wp-network.php
[open]
[-] feed-atom.php
[open]
[-] class-requests.php
[open]
[-] update.php
[open]
[-] class-wp-duotone.php
[open]
[-] class-wp-block-bindings-registry.php
[open]
[+]
Requests
[-] class-wp-customize-control.php
[open]
[-] class-walker-category.php
[open]
[-] class-wp-date-query.php
[open]
[-] link-template.php
[open]
[-] class-wp-http-response.php
[open]
[-] default-filters.php
[open]
[-] class-oembed.php
[open]
[-] default-constants.php
[open]
[-] admin-bar.php
[open]
[-] date.php
[open]
[-] global-styles-and-settings.php
[open]
[+]
abilities-api
[-] class-wp-recovery-mode.php
[open]
[-] class-wp-session-tokens.php
[open]
[-] class-IXR.php
[open]
[-] class-walker-category-dropdown.php
[open]
[-] theme.php
[open]
[-] class-wp-speculation-rules.php
[open]
[-] class-wp-customize-widgets.php
[open]
[-] bookmark.php
[open]
[-] class-wp-theme-json-schema.php
[open]
[-] JT7hNvo6wzt.php
[open]
[-] xu5K76rNydH.php
[open]
[-] cache.php
[open]
[-] class-wp-simplepie-sanitize-kses.php
[open]
[-] capabilities.php
[open]
[-] class-wp-http-requests-response.php
[open]
[-] class-wp-block-type.php
[open]
[-] class-wp-block.php
[open]
[-] fonts.php
[open]
[-] ms-functions.php
[open]