wc_array_filter_default_attributes()
Callback for array filter to get default attributes. Will allow for '0' string values, but regard all other class PHP FALSE equivalents normally.
No Hooks.
Return
true|false
.
Usage
wc_array_filter_default_attributes( $attribute );
- $attribute(mixed) (required)
- Attribute being considered for exclusion from parent array.
Changelog
Since 3.1.0 | Introduced. |
wc_array_filter_default_attributes() wc array filter default attributes code WC 9.6.1
function wc_array_filter_default_attributes( $attribute ) { return is_scalar( $attribute ) && ( ! empty( $attribute ) || '0' === $attribute ); }