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: ''
Return Return
(mixed) Value sanitized by wc_clean.
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 }
Changelog Changelog
Version | Description |
---|---|
3.0.9 | Introduced. |