Support for monthly summaries and wp-whobird
This commit is contained in:
1 parent
6cdc709a98
commit
636517f393
2 files changed
+27
-12
No files matched your search
+17
-11
@@ -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 "<input type='checkbox' class='wpdfh_print_checkbox' name='Print' data-post_id='$post_id' $checked />";
|
||||
// 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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user