I’m facing trouble with the media picker set by CFT. The link to media picker itself works fine, but the link to select the image shows a javascript void(0), and cannot select the image. This occurs both on default post/page and custom post types.
I tried the solution in this post but had no luck.
https://www.ads-software.com/support/topic/plugin-custom-field-template-media-picker-not-inserting
I also checked with all other plugins turned off, with the default twenty fourteen theme, but still had the same problem.
Is anyone having the same issue? Or does anyone have some advice? Thanks.
https://www.ads-software.com/plugins/custom-field-template/
]]>https://www.ads-software.com/extend/plugins/additional-image-sizes-zui/
]]>my CFT code
[cft_group_fieldset]
type = fieldset_open
multiple = true
multipleButton = true
mediaRemove = true
[cft_group_photo]
label = select a photo
type = file
hideKey = true
mediaButton = true
mediaLibrary = true
relation=true
[cft_group_alt]
type= text
label= alt text
hideKey = true
[cft_group_fieldset]
type = fieldset_close
in functions.php and in single.php I used the code proposed here:
if( !function_exists('get_cft_repeating_data') ){
function get_cft_repeating_data( $like_item ){
global $post, $wpdb;
$sql = "SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID AND meta_key LIKE '%" . $like_item . "%' ORDER BY meta_id ASC";
$data_objects = $wpdb->get_results($sql);
$project = array();
$i = 0;
$fieldset = $like_item . '_fieldset';
foreach($data_objects as $data) {
// the name of the fieldset:
if ( $data->meta_key == $fieldset ) {
$limit = $data->meta_value - 1;
}
$i = ( $i <= $limit ) ? $i : 0;
if( $data->meta_key != $fieldset && $data->meta_value !='' ) {
$project[$i]["$data->meta_key"] = $data->meta_value;
}
$i++;
}
if(!$limit && is_user_logged_in() )
echo 'Could not establish Custom Field Limit. The $like_item set was ' .$like_item . '<br /> SQL query was ' . $sql;
return $project;
}
}
Everything works well till the moment I try to delete an image previously uploded.
As I refresh/reload my post the img is still there, and I have an error message in my site page (frontend).
Could not establish Custom Field Limit. The $like_item set was cft_group
SQL query was SELECT * FROM lmyrph0_postmeta WHERE post_id = 101 AND meta_key LIKE ‘%cft_group%’ ORDER BY meta_id ASC
In addition Media picker is buggy and doesn’t work
Any suggestions please?
]]>I can’t seem to assign an image to a file field now. The picker appears but the image is not assigned to the field.
The symptoms are the same as a recent issue where the picker was not working for custom post types, but this applies to all post types.
I have tried out the picker on two different sites and it is working on neither.
]]>I want to use CFT to let users select a number of images from the Media Library that I place in my template. However, I don’t want the ‘upload’ option to appear with it.
Is there any way to disable / remove the Browse button even if it’s just with CSS? I only want the user to be able to select previously uploaded images.
Thanks
mn
https://www.ads-software.com/extend/plugins/custom-field-template/
]]>It opens up the media library dialog box. After clicking “use this” it dissapears but no value is assigned to the field.
https://www.ads-software.com/extend/plugins/custom-field-template/
]]>