Open TAS1426 opened 2 months ago
buddypress-docs changes URLs to the format ?bp-attachment=
when the plugin detects that your installation supports "protection" mode. This generally means you're running Apache, and buddypress-docs has managed to set up the necessary rewrite rules. This feature is intended to provide protection against non-authorized access to attachments.
As for the direct download, in general this is the intended behavior for Doc attachments. But there's a feature that allows you to filter the headers, allowing the browser to open the file where possible. See https://github.com/boonebgorges/buddypress-docs/issues/659#issuecomment-521731262. See also #723.
This is great. Thank you. It worked. One more question. Is there a way to have it open in a new tab that you're aware of?
Something like this will probably work:
add_filter(
'bp_docs_attachment_item_markup',
function( $markup ) {
$markup = str_replace( '<a ', '<a target="_blank" ', $markup );
return $markup;
}
);
That worked. Thank you so much!
We are having an issue where documents are automatically downloading when clicked on, instead of opening in the current tab, or a new tab. Also, the URL of the document trying to download has "?bp-attachment=", and is a different URL than what is in our Media section.