Enqueuing the CSS script only if query string contains a print parameter and making the CSS always apply
This commit is contained in:
parent
8d41dcf22c
commit
c01b4a7ad6
|
|
@ -1,4 +1,3 @@
|
||||||
@media print {
|
|
||||||
|
|
||||||
video,
|
video,
|
||||||
.attached-videos,
|
.attached-videos,
|
||||||
|
|
@ -25,4 +24,3 @@ footer,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,12 @@ if ( ! defined( 'WPINC' ) ) {
|
||||||
|
|
||||||
add_action('wp_enqueue_scripts', 'wpdfh_enqueue_scripts');
|
add_action('wp_enqueue_scripts', 'wpdfh_enqueue_scripts');
|
||||||
function wpdfh_enqueue_scripts() {
|
function wpdfh_enqueue_scripts() {
|
||||||
|
if (array_key_exists('print', $_GET)) {
|
||||||
wp_enqueue_style( 'wpdfh', plugin_dir_url( __FILE__ ) . 'assets/wp-pdf-helper.css' );
|
wp_enqueue_style( 'wpdfh', plugin_dir_url( __FILE__ ) . 'assets/wp-pdf-helper.css' );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#error_log("PHP: parse_url($url, PHP_URL_QUERY): ".print_r(parse_url($url, PHP_URL_QUERY), true), 0);
|
||||||
|
#error_log('PHP: $_GET: '.print_r($_GET, true), 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue