postmeta_form_keys
This is a WordPress - postmeta_form_keys hook. The plugin just uses it.
Filters values for the meta key dropdown in the Custom Fields meta box.
Compatibility filter for postmeta_form_keys
Usage
add_filter( 'postmeta_form_keys', 'wp_kama_postmeta_form_keys_filter', 10, 2 ); /** * Function for `postmeta_form_keys` filter-hook. * * @param array|null $keys Pre-defined meta keys to be used in place of a postmeta query. * @param WP_Post $post The current post object. * * @return array|null */ function wp_kama_postmeta_form_keys_filter( $keys, $post ){ // filter... return $keys; }
- $keys(array|null)
- Pre-defined meta keys to be used in place of a postmeta query.
Default: null - $post(WP_Post)
- The current post object.
Changelog
Since 6.9.0 | Introduced. |
Where the hook is called
postmeta_form_keys
woocommerce/src/Internal/Admin/Orders/MetaBoxes/CustomMetaBox.php 115
$keys = apply_filters( 'postmeta_form_keys', null, $order );