Created
April 9, 2024 12:55
-
-
Save andrewlimaza/8fdeaab108294fc86690c83ae9ddaef0 to your computer and use it in GitHub Desktop.
Enqueue custom print.css file for Paid Memberships Pro.
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
<?php | |
/** | |
* If anyone created a custom print.css file, add this code to a custom plugin to re-enqueue it in your theme or template directory. | |
*/ | |
function my_enqueue_print_style() { | |
if ( file_exists( get_stylesheet_directory() . '/paid-memberships-pro/css/print.css' ) ) { | |
$print_css = get_stylesheet_directory_uri() . '/paid-memberships-pro/css/print.css'; | |
} elseif ( file_exists( get_template_directory() . '/paid-memberships-pro/print.css' ) ) { | |
$print_css = get_template_directory_uri() . '/paid-memberships-pro/print.css'; | |
} else { | |
return; | |
} | |
wp_enqueue_style( 'pmpro-print', $print_css, array(), '1.0', 'print' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_enqueue_print_style' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment