The BuddyDrive Editor uses the BuddyPress Attachments API introduced in BuddyPress 2.3. It's a feature to demonstrate how to manage user generated media from the front-end.
By default, nothing will happen, that's because you're free to choose where to display this editor :)
Here's an example of code that would add a button into the user's activity stream to let him share a public file.
function test_bp_personal_activity() {
// Always check the editor is available to prevent fatals!
if ( bp_is_my_profile() && function_exists( 'buddydrive_editor' ) ) {
// 'whats-new' is the id attribute of the textarea to publish activities
buddydrive_editor( 'whats-new' );
}
}
add_action( 'bp_before_member_activity_post_form', 'test_bp_personal_activity' );
NB: You could for instance add this code into a bp-custom.php file.
The above code is adding a button above the what's new text area and once clicked, you get the BuddyDrive Editor :
![buddydrive-editor](https://cloud.githubusercontent.com/assets/1834524/7929886/4f6fbaca-0903-11e5-98ff-7713c7e52e03.png)
There's more! Let's imagine you have BuddyPress 2.3, BuddyDrive 1.3 activated and another plugin dealing with user's front end submission by using a wp_editor
(e.g.: WP Idea Stream). This another plugin could take benefit of the buddydrive_editor()
function simply by using this code :
if ( function_exists( 'buddydrive_editor' ) ) {
// when no id attribute is provided, BuddyDrive will look for tinyMCE/Quick tags editor.
buddydrive_editor();
}
Here's a demo of this in WP Idea Stream (note that WP Idea Stream is not ready yet, you'll need to wait for version 2.2!)
https://vimeo.com/129146068
This new feature will also generate public thumbnails so that the BuddyDrive embed function will display a thumbnail in case the public file is an image :
![buddydrive-embed](https://cloud.githubusercontent.com/assets/1834524/7929937/d16ba05c-0903-11e5-8800-4e715cd3c56d.png)
If the user changes the privacy of the file to something else than public, then the thumbnail will be deleted and a mime type icon will be used.