I have created a custom post and on the custom field I want to give value to name field in the back end, the post hasn't created yet and I wanted to create a field with name value so that the user can just input the value. please see the photo below, thanks...
You just have to click on Enter New and then you are going to be able to put the name and the value that you want, it's pretty intuitive.
Updated. Now that the OP clarified what he wants.
You will have to use
add_post_meta, you will use it like this:
<?php add_post_meta( 68, 'my_key', '47', true ); ?>
The first argument is the
$post_id, the second one is the
$meta_key, the thirf one is the value
$meta_value, and the last (
$unique) one is a boolear whether or not you want the key to stay unique. When set to true, the custom field will not be added if the given key already exists among custom fields of the specified post.
@MuteGlider As was said by @WebElaine you should search for:
Follow the documentation link: https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/