Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mohammadYousefiDev/5752369ea877bc05cd41aad14abbb439 to your computer and use it in GitHub Desktop.
Save mohammadYousefiDev/5752369ea877bc05cd41aad14abbb439 to your computer and use it in GitHub Desktop.
add options to "add new" custom field dropdown wordpress post type
add_filter( 'postmeta_form_keys', 'filter_function_name_1552', 10, 2 );
function filter_function_name_1552( $keys, $post ){
if($post->post_type == 'car') {
$keys[] = 'regular_price';
}
return $keys;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment