Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_wp_register_meta_args_allowed_list() WordPress Function

The wp_register_meta_args_allowed_list function is used to register a list of allowed keys for a specific metadata type. This function should be called in the ‘init’ action. The first parameter is the name of the metadata type. The second parameter is an array of allowed keys. This function allows you to specify which keys are allowed for a specific metadata type. This can be useful for ensuring that only valid keys are used when adding metadata to an object.

_wp_register_meta_args_allowed_list( array $args, array $default_args ) #

Filters out register_meta() args based on an allowed list.


Description

register_meta() args may change over time, so requiring the allowed list to be explicitly turned off is a warranty seal of sorts.


Top ↑

Parameters

$args

(array)(Required)Arguments from register_meta().

$default_args

(array)(Required)Default arguments for register_meta().


Top ↑

Return

(array) Filtered arguments.


Top ↑

Source

File: wp-includes/meta.php

function _wp_register_meta_args_allowed_list( $args, $default_args ) {
	return array_intersect_key( $args, $default_args );
}


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.