CPT + ACF Permalink
-
I am using the following code to redirect a Custom Post type to a PDF file in a ACF.
How would I make the wp_redirect open the PDF in a new tab/window?function wwl_redirect_to_document() { if ( is_singular( 'documents' ) ) { $pdf_url = get_field( 'upload_file' ); wp_redirect( $pdf_url ); exit(); } } add_action( 'template_redirect', 'wwl_redirect_to_document' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘CPT + ACF Permalink’ is closed to new replies.