[buddypress-trac] [BuddyPress Trac] #7265: uploads dir should filtered for cover images
buddypress-trac
noreply at wordpress.org
Sun Nov 6 17:56:53 UTC 2016
#7265: uploads dir should filtered for cover images
--------------------------+-----------------------------
Reporter: m_uysl | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Core | Version:
Severity: normal | Resolution:
Keywords: needs-patch |
--------------------------+-----------------------------
Comment (by rekmla):
We're running into this issue as well. Currently on BP v2.6.1.1.
I was not able to figure out how to use the
{{{bp_attachments_pre_cover_image_ajax_upload}}} filter without having to
hack {{{bp_attachments_cover_image_generate_file()}}}
Currently testing with two hacks:
{{{
// Get BuddyPress Attachments Uploads Dir datas.
$bp_attachments_uploads_dir = bp_attachments_uploads_dir_get();
$bp_attachments_uploads_dir =
$cover_image_attachment->upload_dir_filter( $bp_attachments_uploads_dir );
// The BP Attachments Uploads Dir is not set, stop.
}}}
in {{{bp_attachments_cover_image_ajax_upload()}}} and
{{{
$bp_attachments_uploads_dir = bp_attachments_uploads_dir_get();
$bp_attachments_uploads_dir =
$cover_image_class->upload_dir_filter( $bp_attachments_uploads_dir );
// Make sure the file is inside the Cover Image Upload path.
if ( false === strpos( $args['file'],
$bp_attachments_uploads_dir['path'] ) ) {
}}}
in {{{bp_attachments_cover_image_generate_file()}}}
Along with these hacks, we're using the following filters:
{{{bp_attachments_cover_image_upload_dir}}},
{{{bp_attachments_uploads_dir_get}}}, {{{bp_attachment_upload_dir}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7265#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list