Skip to content

Commit

Permalink
Version 1.9.1 Release
Browse files Browse the repository at this point in the history
Version 1.9.1 Release and bump.
  • Loading branch information
andrewlimaza committed Aug 19, 2021
1 parent 989a85d commit dadce4c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
12 changes: 8 additions & 4 deletions pmpro-pdf-invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Plugin URI: https://yoohooplugins.com/plugins/pmpro-pdf-invoices/
* Author: Yoohoo Plugins
* Author URI: https://yoohooplugins.com
* Version: 1.9
* Version: 1.9.1
* License: GPL2 or later
* Tested up to: 5.4
* Requires PHP: 5.6
Expand Down Expand Up @@ -38,7 +38,7 @@
define( 'YOOHOO_STORE', 'https://yoohooplugins.com/edd-sl-api/' );
}
define( 'PMPRO_PDF_PLUGIN_ID', 2117 );
define( 'PMPRO_PDF_VERSION', '1.9' );
define( 'PMPRO_PDF_VERSION', '1.9.1' );
define( 'PMPRO_PDF_DIR', dirname( __file__ ) );

define( 'PMPRO_PDF_LOGO_URL', 'PMPRO_PDF_LOGO_URL');
Expand Down Expand Up @@ -177,6 +177,12 @@ function pmpropdf_added_order( $order ) {
* As well as the batch processing tool
*/
function pmpropdf_generate_pdf($order_data){

// Stop PDF from generating in certain cases.
if ( ! apply_filters( 'pmpropdf_should_generate_pdf', true, $order_data ) ) {
return;
}

$user = get_user_by('ID', $order_data->user_id);

$dompdf = new Dompdf( array( 'enable_remote' => true ) );
Expand Down Expand Up @@ -828,7 +834,6 @@ function pmpropdf_migrate_custom_template(){
*/
function pmpropdf_updated_order( $order ) {
// Let developers decide if generate the pdf

if ( apply_filters( 'pmpropdf_can_regenerate_pdf_on_added_order', true, $order ) ) {
$invoice_dir = pmpropdf_get_invoice_directory_or_url();
$invoice_name = pmpropdf_generate_invoice_name($order->code);
Expand All @@ -841,4 +846,3 @@ function pmpropdf_updated_order( $order ) {
}
}
add_action( 'pmpro_updated_order', 'pmpropdf_updated_order', 99, 1);

11 changes: 8 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Contributors: andrewza, yoohooplugins
Tags: pdf, pdf invoice, invoices
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4GC4JEZH7KSKL
Requires at least: 4.5
Tested up to: 5.6
Requires at least: 4.9
Tested up to: 5.8
Requires PHP: 5.6
Stable tag: 1.8
Stable tag: 1.9.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -26,6 +26,11 @@ Yes the PDF templates are customizable and use general HTML code with custom tag

== Changelog ==

= 1.9.1 - 19-08-2021 =
* Enhancement: Filter added 'pmpro_should_generate_pdf'. Allows developers to stop generating PDFs for certain cases.
* Enhancement: Filter added 'pmpropdf_invoice_table_requires_active_membership'. Restricts PDF invoices table/shortcode to members only. Thanks @mircobabini
* Bug Fix/Enhancement: Make sure an order exists when generating PDF invoice. Thanks @mircobabini

= 1.9 - 10-05-2021 =
* Enhancement: Changed custom template storage path to make use of the uploads directory instead (Directory: pmpro-invoice-templates/order.html)
* Enhancement: Added automated migration for custom templates from child theme directory to the uploads directory, automatically deletes original
Expand Down

0 comments on commit dadce4c

Please sign in to comment.