Home › Forums › Backend Issues (wp-admin) › Admin File Field Values not Displaying on Post Save – Custom Metabox › Reply To: Admin File Field Values not Displaying on Post Save – Custom Metabox
Sorry, here are the document variables from above the previous section of code. Just in case it helps.
// Field Array DOCUMENT ATTACH Metabox
$class = 'active';
$icon = wp_mime_type_icon( $file->ID );
$title = $file->post_title;
$size = size_format(filesize( get_attached_file( $file->ID ) ));
$url = wp_get_attachment_url( $file->ID );
$explode = explode('/', $url );
$name = end( $explode );
$prefix = 'document_';
$document_meta_fields = array(
array(
'label' => 'Document Upload',
'desc' => 'Upload or Select Document.',
'id' => $prefix.'file',
'type' => 'file',
'class' => $class,
'icon' => $icon,
'title' => $title,
'size' => $size,
'url' => $url,
'name' => $name,
'defaults' => array(
'save_format' => 'object',
'library' => 'all',
),
'l10n' => array(
'select' => __("Select File",'acf'),
'edit' => __("Edit File",'acf'),
'update' => __("Update File",'acf'),
'uploadedTo' => __("Uploaded to this post",'acf'),
),
),
);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.