Last active
May 15, 2023 15:53
-
-
Save kwcjr/1af340122e747bba706892eb7ca78097 to your computer and use it in GitHub Desktop.
Add site name to pdf report file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Snippet Action: Add Site Name to pdf file. | |
* Snippet Type: MainWP Custom Dashboard CSS snippet. | |
* Snippet Author: Keith Crain ( MainWP.com ) | |
*/ | |
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 ) { | |
$website = MainWP\Dashboard\MainWP_DB::instance()->get_website_by_id( $site_id ); | |
$suffix = date( 'Y-m-d' ); // 2020-11-11 | |
return $website->name . '-' . 'managed-care-report' . '-' . $suffix . '.pdf'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment