WC_Product_Download::raise_invalid_file_exception()
Convenience method, allows us to re-use the same exception messaging from different areas.
Method of the class: WC_Product_Download{}
No Hooks.
Returns
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->raise_invalid_file_exception( $download_file ): void;
- $download_file(string) (required)
- -
WC_Product_Download::raise_invalid_file_exception() WC Product Download::raise invalid file exception code WC 9.8.5
private function raise_invalid_file_exception( string $download_file ): void { throw new Exception( sprintf( /* translators: %1$s is the downloadable file path, %2$s is an opening link tag, %3%s is a closing link tag. */ __( 'The downloadable file %s cannot be used as it does not exist on the server, or is not located within an approved directory. Please contact a site administrator for help. %2$sLearn more.%3$s', 'woocommerce' ), '<code>' . $download_file . '</code>', '<a href="https://woocommerce.com/document/approved-download-directories">', '</a>' ) ); }