diff --git a/assets/wp-pdf-helper-print.css b/assets/wp-pdf-helper-print.css index a23cde3..bc7da9b 100644 --- a/assets/wp-pdf-helper-print.css +++ b/assets/wp-pdf-helper-print.css @@ -20,7 +20,9 @@ footer, .other-posts, .no-print, #wpadminbar, -.skip-link.screen-reader-text +.skip-link.screen-reader-text, +#audio-player-container, +.bird-wikipedia-container { display: none !important; } @@ -33,6 +35,7 @@ main, } .gallery, +.wpwbd-bird-entry, .attached-gpx { page-break-before: auto; /* 'always,' 'avoid,' 'left,' 'inherit,' or 'right' */ page-break-after: auto; /* 'always,' 'avoid,' 'left,' 'inherit,' or 'right' */ @@ -100,3 +103,9 @@ main, .gallery figure { margin: 2px !important; } + +#audio-player-container, +.bird-wikipedia-container +{ + display: none !important; +} diff --git a/wp-pdf-helper.php b/wp-pdf-helper.php index 38b2994..1b2bacb 100644 --- a/wp-pdf-helper.php +++ b/wp-pdf-helper.php @@ -12,8 +12,8 @@ if ( ! defined( 'WPINC' ) ) { } function ww_load_styles(){ - wp_enqueue_style('dashicons'); - wp_enqueue_style( 'wpdfh-main', plugin_dir_url( __FILE__ ) . 'assets/wp-pdf-helper.css' ); + wp_enqueue_style('dashicons'); + wp_enqueue_style( 'wpdfh-main', plugin_dir_url( __FILE__ ) . 'assets/wp-pdf-helper.css' ); } add_action('wp_enqueue_scripts', 'ww_load_styles', 999); @@ -38,7 +38,7 @@ function manage_custom_columns ($column_key, $post_id) { if ($column_key == 'wp-pdf-helper') { $checked = (get_post_meta($post_id, 'wpdfh.print', true) == '') ? '' : 'checked'; echo ""; -// error_log("PHP: \$column_key: $column_key, \$post_id: $post_id, \$is_printable: $is_printable.", 0); + // error_log("PHP: \$column_key: $column_key, \$post_id: $post_id, \$is_printable: $is_printable.", 0); } } @@ -89,25 +89,31 @@ function wpdfh_enqueue_print_scripts() { add_filter( 'wpagpx_shortcode_parameters', 'filter_shortcode_parameters' ); function filter_shortcode_parameters($parameters) { - $parameters['mheight'] = '200px'; - $parameters['gheight'] = '150px'; - $parameters['download'] = 'false'; + $gpxmap_size = array_key_exists('gpxmap-size', $_GET) ? $_GET['gpxmap-size'] : 'small'; + if ( $gpxmap_size === 'small') { + $parameters['mheight'] = '200px'; + $parameters['gheight'] = '150px'; + } else if ( $gpxmap_size === 'large') { + $parameters['mheight'] = '550px'; + $parameters['gheight'] = '300px'; + } $parameters['attachments'] = 'false'; -// error_log('PHP: $_GET: '.print_r($_GET, true), 0); + $parameters['download'] = 'false'; + error_log('PHP: $_GET: '.print_r($_GET, true), 0); return $parameters; } add_filter( 'get_block_templates', 'change_block_template_content', 10, 3 ); function change_block_template_content( $block_templates, $query, $template_type ) { -// error_log('PHP: get_block_template($block_template: '.print_r($block_template, true).", \$query: ".print_r($query, true).", \$template_type: $template_type)", 0); -// error_log("PHP: get_block_template(..., \$query: ".print_r($query, true).", \$template_type: $template_type)", 0); - + // error_log('PHP: get_block_template($block_template: '.print_r($block_template, true).", \$query: ".print_r($query, true).", \$template_type: $template_type)", 0); + // error_log("PHP: get_block_template(..., \$query: ".print_r($query, true).", \$template_type: $template_type)", 0); + if ( $template_type === 'wp_template' ) { $id = $block_templates[0]->id; $print_id = "$id-print"; $print_template = get_block_template($print_id); -// error_log('PHP: get_block_template, $print_template: '.print_r($print_template, true).", \$id: ".print_r($id, true).", \$print_id: $print_id)", 0); + error_log('PHP: get_block_template, $print_template: '.print_r($print_template, true).", \$id: ".print_r($id, true).", \$print_id: $print_id)", 0); if ($print_template !== null) { $block_templates[0] = $print_template; }