[buddypress-trac] [BuddyPress Trac] #6948: Add more filters to short-circuit avatar/cover image operations.
buddypress-trac
noreply at wordpress.org
Tue Mar 8 18:15:07 UTC 2016
#6948: Add more filters to short-circuit avatar/cover image operations.
-------------------------------------+--------------------
Reporter: DJPaul | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.5.1
Component: Component - Attachments | Version:
Severity: normal | Resolution:
Keywords: |
-------------------------------------+--------------------
Comment (by imath):
I understand, but returning false to the filter, this is what the user
will get :
[[Image(https://cldup.com/cu9TSZ7DwL.png)]]
Using what i suggest you can do the stuff you need and then return
something like :
{{{
function write_on_any_cloud_service( $result, $bp_params, $needs_reset,
$object_data ) {
return array(
'result' => true,
'name' => 'random_cover_name.jpg',
'url' => 'https://cldup.com/DB-6lSS9Or.jpg',
'feedback_code' => 1,
);
}
add_filter( 'bp_attachments_pre_cover_image_ajax_upload',
'write_on_any_cloud_service', 10, 4 );
}}}
Then you would get something more interesting for the user
1. The cover image
2. the feedback
3. the link to delete it
This is the result of the above code with 02.patch
[[Image(https://cldup.com/qgtUi2AhpW.png)]]
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6948#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list