donmik
Forum Replies Created
-
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Wrap 'Required' in a spanAll filters should go inside the functions.php
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] File upload fieldHi,
it’s working on my test site. Is the file really uploaded? The original upload dir should “wp-content/uploads/profiles/USERID/”. Check if the upload failed, maybe it’s a permission issue.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Custom Image FieldThe default upload dir is: “wp-content/uploads/profiles/USERID/”
add_filter( 'bxcft_upload_dir', 'my_upload_dir', 10, 2); function my_upload_dir($path, $user_id) { return str_replace('profiles/', 'custom_dir/', $path); }This code will replace the “profiles” folder with a folder named “custom_dir”.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Issue with 'File' upload filedHi, this issue is solved with the latest version. Please update.
To set the max file size, you need to use this filter “bxcft_images_max_filesize”.
add_filter( 'bxcft_files_max_filesize', 'my_custom_max_filesize'); function my_custom_max_filesize() { return 10; }Replace 10 with the number of MB you want.
I’m afraid this is not that easy…
Hi,
Try Buddypress conditional profile fields. If it doesn’t work, I’m sorry but you would need to use some javascript and probably php to do this.
Right now, I don’t have time to do all this, maybe in following updates but I don’t know when.
Hi,
Well I’ll be glad to add more features but right now I haven’t much time to do it, sorry. You can try Buddypress conditional profile fields or maybe Gravity forms can help you with this.
Unfortunately, if you have too specific needs you will probably get your hands dirty and code them. If you need any help I can try to answer any questions.
Hi,
“xprofile_get_field_data” is returning the post_title because of my plugin. My plugin is using “xprofile_get_field_data” filter to display data in a more human readable way.
If you want to modify the content programmatically you should use “BP_XProfile_ProfileData::get_value_byid”:
// Get the current user's id $user_id = $bp->loggedin_user->userdata->ID; // Get the ID of your field. $field_id = 10; // Get the ID of the event you want to add. $event_id = 999; // Retrieve the Events (CPT) the user has already signup to $user_events = maybe_unserialize(BP_XProfile_ProfileData::get_value_byid($field_id, $user_id ); // Combine all the events and update the field array_push( $user_events, $event_id ); xprofile_set_field_data( 'Events', $user_id, $user_events );This should work.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Custom Image FieldOk, I’m dumb…xD. I changed the name of the function and forget to change the name inside the add_filter call… Sorry.
add_filter( 'bp_xprofile_field_edit_html_elements', 'accept_only_images', 10, 2 ); function accept_only_images($r, $field_class) { if ($field_class === 'Bxcft_Field_Type_Image') { $r['accept'] = 'image/*'; } return $r; }A Thread with the same issue already exists: https://wordpress.org/support/topic/images-field-broken-on-front-end?replies=4
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Custom Image FieldWhat error are you getting?
This issue is related to latest version. This thread talks about the same issue but with image fields.
It will be solved on next update, probably next monday I hope. You can use the filter to solve it meanwhile.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Images field broken on front endSorry this week I have too much work to do. Maybe next monday, I’m working on this update.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Any Plans or Phone Field?You probably miss the “tel:” before “5555555555”.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Custom Image FieldHi,
I believe right now you cannot change the upload dir without changing my plugin. Maybe using ‘upload_dir’ filter you can do it, but it will be easier if I provide a new filter specific for my plugin. I will do it on next release, hope to ship it this monday.
About your second question, you can do it using “bp_xprofile_field_edit_html_elements”:
add_filter( 'bp_xprofile_field_edit_html_elements', 'accept_only_images', 10, 2 ); function my_custom_html_elements($r, $field_class) { if ($field_class === 'Bxcft_Field_Type_Image') { $r['accept'] = 'image/*'; } return $r; }