sallida
(Sallida)
April 26, 2021, 11:43am
1
Hello,
i found in a other thread the snippet to change the Filename in Pro Reports. I was wondering if it is possible, to add after the new filename the creation date of the report ?
add_filter( ‘mainwp_pro_reports_pdf_filename’, ‘mycustom_mainwp_pro_reports_pdf_filename’, 10, 3 );
if ( !function_exists( ‘mycustom_mainwp_pro_reports_pdf_filename’ ) ) {
function mycustom_mainwp_pro_reports_pdf_filename( $filename, $report, $site_id ) {
return ‘new-file-name.pdf’;
}
}
Thx
br
bogdan
(Bogdan Rapaić)
April 26, 2021, 4:27pm
2
Hi Sallida,
Can you try with somthing like this:
add_filter( 'mainwp_pro_reports_pdf_filename', 'mycustom_mainwp_pro_reports_pdf_filename', 10, 3 );
if ( !function_exists( 'mycustom_mainwp_pro_reports_pdf_filename' ) ) {
function mycustom_mainwp_pro_reports_pdf_filename( $filename, $report, $site_id ) {
$date = date("Y/m/d");
return 'pro-report-' . $date . '.pdf';
}
}
sallida
(Sallida)
April 26, 2021, 5:23pm
3
Hi Bogdan,
thanks, code works:)
br
1 Like
system
(system)
Closed
April 27, 2021, 5:24pm
4
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.