- This topic has 5 replies, 4 voices, and was last updated 6 years ago by
Steve.
-
AuthorPosts
-
-
January 6, 2016 at 5:14 pm #5514
DanielMemberI’ve known about piklist for a while. I finally have a break in between projects to try to spend some time using it…I am coming from ACF so bear with me as I adjust.
Is the “file upload” field the proper field to use for images? If so, is there control over the upload limit? (how many files can be attached to that field). If not, what are my options?
-
January 6, 2016 at 5:33 pm #5515
DanielMemberI just found the answer to my question searching the forum. I need to use the limit validation found here:
Is there a way to control the display of the image once it’s inserted? It looks like it’s using the thumbnail size, which is good for small images, but not for banners.
-
January 26, 2016 at 10:06 am #5755
-
January 26, 2016 at 11:06 am #5756
DanielMemberNo. Didn’t find any options.
-
January 26, 2016 at 2:04 pm #5757
pwwwpwwwMemberif you look at the code that constructs the file upload meta box (\parts\fields\file.php), you find this at the top of it:
<?php $options = array_merge( array( 'button' =>'Add Media' ,'modal_title' =>'Add Media' ,'basic' => false ,'preview_size' => 'thumbnail' ,'textarea_rows' => 5 ,'save' => 'id' ) ,isset($options) && is_array($options) ? $options : array() ); ?>So I’m guessing you can do this:
`piklist(‘field’, array(
‘type’ => ‘file’
,’field’ => ‘upload_basic’
,’scope’ => ‘post_meta’
,’label’ => __(‘Add File(s)’,’piklist’)
,’description’ => __(‘This is the basic upload field.’,’piklist’)
,’options’ => array(
‘preview_size’ => ‘thumbnail’ //change this i.e ‘medium’, ‘large’, ‘full’ etc
)
));`Not tested, so let me know if it works
-
January 27, 2016 at 11:30 pm #5776
SteveKeymasterYou can use the
limitvalidation rule to limit the number of file uploads.
-
-
AuthorPosts
- You must be logged in to reply to this topic.