wc_get_post_data_by_key( string $key, string $default = '' )

Get an item of post data if set, otherwise return a default value.


Description Description


Parameters Parameters

$key

(Required) Meta key.

$default

(Optional) Default value.

Default value: ''


Top ↑

Return Return

(mixed) Value sanitized by wc_clean.


Top ↑

Source Source

File: includes/wc-core-functions.php

function wc_get_post_data_by_key( $key, $default = '' ) {
	return wc_clean( wp_unslash( wc_get_var( $_POST[ $key ], $default ) ) ); // @codingStandardsIgnoreLine
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.9 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.