@@ -14,133 +14,133 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class GetPaid_WP_All_Import { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * @var RapidAddon[] |
|
| 19 | - */ |
|
| 20 | - protected $add_ons; |
|
| 21 | - |
|
| 22 | - /** |
|
| 23 | - * @var array |
|
| 24 | - */ |
|
| 25 | - protected $datastores = array( |
|
| 26 | - 'item' =>'WPInv_Item', |
|
| 27 | - 'invoice' =>'WPInv_Invoice', |
|
| 28 | - 'discount' =>'WPInv_Discount', |
|
| 29 | - ); |
|
| 17 | + /** |
|
| 18 | + * @var RapidAddon[] |
|
| 19 | + */ |
|
| 20 | + protected $add_ons; |
|
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * @var array |
|
| 24 | + */ |
|
| 25 | + protected $datastores = array( |
|
| 26 | + 'item' =>'WPInv_Item', |
|
| 27 | + 'invoice' =>'WPInv_Invoice', |
|
| 28 | + 'discount' =>'WPInv_Discount', |
|
| 29 | + ); |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * Class constructor. |
|
| 33 | - */ |
|
| 32 | + * Class constructor. |
|
| 33 | + */ |
|
| 34 | 34 | public function __construct() { |
| 35 | 35 | |
| 36 | - // Init each store separately. |
|
| 37 | - foreach ( array_keys( $this->datastores ) as $key ) { |
|
| 38 | - $this->init_store( $key ); |
|
| 39 | - } |
|
| 36 | + // Init each store separately. |
|
| 37 | + foreach ( array_keys( $this->datastores ) as $key ) { |
|
| 38 | + $this->init_store( $key ); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - } |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Inits a store. |
|
| 45 | - */ |
|
| 43 | + /** |
|
| 44 | + * Inits a store. |
|
| 45 | + */ |
|
| 46 | 46 | public function init_store( $key ) { |
| 47 | 47 | |
| 48 | - // Register the add-on. |
|
| 49 | - $this->add_ons[ $key ] = new RapidAddon( 'GetPaid', 'getpaid_wp_al_import_' . $key ); |
|
| 48 | + // Register the add-on. |
|
| 49 | + $this->add_ons[ $key ] = new RapidAddon( 'GetPaid', 'getpaid_wp_al_import_' . $key ); |
|
| 50 | 50 | |
| 51 | - // Create import function. |
|
| 52 | - $import_function = function ( $post_id, $data, $import_options, $_post ) use ( $key ) { |
|
| 53 | - $this->import_store( $key, $post_id, $data, $import_options, $_post ); |
|
| 51 | + // Create import function. |
|
| 52 | + $import_function = function ( $post_id, $data, $import_options, $_post ) use ( $key ) { |
|
| 53 | + $this->import_store( $key, $post_id, $data, $import_options, $_post ); |
|
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | - $this->add_ons[ $key ]->set_import_function( $import_function ); |
|
| 56 | + $this->add_ons[ $key ]->set_import_function( $import_function ); |
|
| 57 | 57 | |
| 58 | - // Register store fields. |
|
| 59 | - $this->add_store_fields( $key ); |
|
| 58 | + // Register store fields. |
|
| 59 | + $this->add_store_fields( $key ); |
|
| 60 | 60 | |
| 61 | - // Only load on the correct post type. |
|
| 62 | - $this->add_ons[ $key ]->run( array( 'post_types' => array( 'wpi_' . $key ) ) ); |
|
| 61 | + // Only load on the correct post type. |
|
| 62 | + $this->add_ons[ $key ]->run( array( 'post_types' => array( 'wpi_' . $key ) ) ); |
|
| 63 | 63 | |
| 64 | - // Disable images. |
|
| 65 | - $this->add_ons[ $key ]->disable_default_images(); |
|
| 64 | + // Disable images. |
|
| 65 | + $this->add_ons[ $key ]->disable_default_images(); |
|
| 66 | 66 | |
| 67 | - } |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * Retrieves store fields. |
|
| 71 | - */ |
|
| 69 | + /** |
|
| 70 | + * Retrieves store fields. |
|
| 71 | + */ |
|
| 72 | 72 | public function get_store_fields( $key ) { |
| 73 | 73 | |
| 74 | - // Fetch from data/invoice-schema.php, from data/discount-schema.php, from data/item-schema.php |
|
| 75 | - $fields = wpinv_get_data( $key . '-schema' ); |
|
| 74 | + // Fetch from data/invoice-schema.php, from data/discount-schema.php, from data/item-schema.php |
|
| 75 | + $fields = wpinv_get_data( $key . '-schema' ); |
|
| 76 | 76 | |
| 77 | - if ( empty( $fields ) ) { |
|
| 78 | - return array(); |
|
| 79 | - } |
|
| 77 | + if ( empty( $fields ) ) { |
|
| 78 | + return array(); |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - // Clean the fields. |
|
| 82 | - $prepared = array(); |
|
| 83 | - foreach ( $fields as $id => $field ) { |
|
| 81 | + // Clean the fields. |
|
| 82 | + $prepared = array(); |
|
| 83 | + foreach ( $fields as $id => $field ) { |
|
| 84 | 84 | |
| 85 | - // Skip read only fields. |
|
| 86 | - if ( ! empty( $field['readonly'] ) ) { |
|
| 87 | - continue; |
|
| 88 | - } |
|
| 85 | + // Skip read only fields. |
|
| 86 | + if ( ! empty( $field['readonly'] ) ) { |
|
| 87 | + continue; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - $prepared[ $id ] = $field; |
|
| 90 | + $prepared[ $id ] = $field; |
|
| 91 | 91 | |
| 92 | - } |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - return $prepared; |
|
| 94 | + return $prepared; |
|
| 95 | 95 | |
| 96 | - } |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * Registers store fields. |
|
| 100 | - */ |
|
| 98 | + /** |
|
| 99 | + * Registers store fields. |
|
| 100 | + */ |
|
| 101 | 101 | public function add_store_fields( $key ) { |
| 102 | 102 | |
| 103 | - foreach ( $this->get_store_fields( $key ) as $field_id => $data ) { |
|
| 104 | - $this->add_ons[ $key ]->add_field( $field_id, $data['description'], 'text' ); |
|
| 105 | - } |
|
| 103 | + foreach ( $this->get_store_fields( $key ) as $field_id => $data ) { |
|
| 104 | + $this->add_ons[ $key ]->add_field( $field_id, $data['description'], 'text' ); |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - /** |
|
| 110 | - * Handles store imports. |
|
| 111 | - */ |
|
| 109 | + /** |
|
| 110 | + * Handles store imports. |
|
| 111 | + */ |
|
| 112 | 112 | public function import_store( $key, $post_id, $data, $import_options, $_post ) { |
| 113 | 113 | |
| 114 | - // Is the store class set? |
|
| 115 | - if ( ! isset( $this->datastores[ $key ] ) ) { |
|
| 116 | - return; |
|
| 117 | - } |
|
| 114 | + // Is the store class set? |
|
| 115 | + if ( ! isset( $this->datastores[ $key ] ) ) { |
|
| 116 | + return; |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - /**@var GetPaid_Data */ |
|
| 120 | - $data_store = new $this->datastores[ $key ]( $post_id ); |
|
| 119 | + /**@var GetPaid_Data */ |
|
| 120 | + $data_store = new $this->datastores[ $key ]( $post_id ); |
|
| 121 | 121 | |
| 122 | - // Abort if the invoice/item/discount does not exist. |
|
| 123 | - if ( ! $data_store->exists() ) { |
|
| 124 | - return; |
|
| 125 | - } |
|
| 122 | + // Abort if the invoice/item/discount does not exist. |
|
| 123 | + if ( ! $data_store->exists() ) { |
|
| 124 | + return; |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - // Prepare data props. |
|
| 128 | - $prepared = array(); |
|
| 127 | + // Prepare data props. |
|
| 128 | + $prepared = array(); |
|
| 129 | 129 | |
| 130 | - foreach ( array_keys( $this->get_store_fields( $key ) ) as $field ) { |
|
| 131 | - // Make sure the user has allowed this field to be updated. |
|
| 132 | - if ( empty( $_post['ID'] ) || $this->add_ons[ $key ]->can_update_meta( $field, $import_options ) ) { |
|
| 130 | + foreach ( array_keys( $this->get_store_fields( $key ) ) as $field ) { |
|
| 131 | + // Make sure the user has allowed this field to be updated. |
|
| 132 | + if ( empty( $_post['ID'] ) || $this->add_ons[ $key ]->can_update_meta( $field, $import_options ) ) { |
|
| 133 | 133 | |
| 134 | - // Update the custom field with the imported data. |
|
| 135 | - $prepared[ $field ] = $data[ $field ]; |
|
| 136 | - } |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - // Only update if we have something to update. |
|
| 140 | - if ( ! empty( $prepared ) ) { |
|
| 141 | - $data_store->set_props( $prepared ); |
|
| 142 | - $data_store->save(); |
|
| 143 | - } |
|
| 134 | + // Update the custom field with the imported data. |
|
| 135 | + $prepared[ $field ] = $data[ $field ]; |
|
| 136 | + } |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + // Only update if we have something to update. |
|
| 140 | + if ( ! empty( $prepared ) ) { |
|
| 141 | + $data_store->set_props( $prepared ); |
|
| 142 | + $data_store->save(); |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | 145 | } |
| 146 | 146 | |
@@ -5,9 +5,9 @@ discard block |
||
| 5 | 5 | * @package GetPaid |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -defined( 'ABSPATH' ) || exit; |
|
| 8 | +defined('ABSPATH') || exit; |
|
| 9 | 9 | |
| 10 | -include plugin_dir_path( __FILE__ ) . 'rapid-addon.php'; |
|
| 10 | +include plugin_dir_path(__FILE__) . 'rapid-addon.php'; |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * WP All Import class. |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | public function __construct() { |
| 35 | 35 | |
| 36 | 36 | // Init each store separately. |
| 37 | - foreach ( array_keys( $this->datastores ) as $key ) { |
|
| 38 | - $this->init_store( $key ); |
|
| 37 | + foreach (array_keys($this->datastores) as $key) { |
|
| 38 | + $this->init_store($key); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | } |
@@ -43,51 +43,51 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Inits a store. |
| 45 | 45 | */ |
| 46 | - public function init_store( $key ) { |
|
| 46 | + public function init_store($key) { |
|
| 47 | 47 | |
| 48 | 48 | // Register the add-on. |
| 49 | - $this->add_ons[ $key ] = new RapidAddon( 'GetPaid', 'getpaid_wp_al_import_' . $key ); |
|
| 49 | + $this->add_ons[$key] = new RapidAddon('GetPaid', 'getpaid_wp_al_import_' . $key); |
|
| 50 | 50 | |
| 51 | 51 | // Create import function. |
| 52 | - $import_function = function ( $post_id, $data, $import_options, $_post ) use ( $key ) { |
|
| 53 | - $this->import_store( $key, $post_id, $data, $import_options, $_post ); |
|
| 52 | + $import_function = function($post_id, $data, $import_options, $_post) use ($key) { |
|
| 53 | + $this->import_store($key, $post_id, $data, $import_options, $_post); |
|
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | - $this->add_ons[ $key ]->set_import_function( $import_function ); |
|
| 56 | + $this->add_ons[$key]->set_import_function($import_function); |
|
| 57 | 57 | |
| 58 | 58 | // Register store fields. |
| 59 | - $this->add_store_fields( $key ); |
|
| 59 | + $this->add_store_fields($key); |
|
| 60 | 60 | |
| 61 | 61 | // Only load on the correct post type. |
| 62 | - $this->add_ons[ $key ]->run( array( 'post_types' => array( 'wpi_' . $key ) ) ); |
|
| 62 | + $this->add_ons[$key]->run(array('post_types' => array('wpi_' . $key))); |
|
| 63 | 63 | |
| 64 | 64 | // Disable images. |
| 65 | - $this->add_ons[ $key ]->disable_default_images(); |
|
| 65 | + $this->add_ons[$key]->disable_default_images(); |
|
| 66 | 66 | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Retrieves store fields. |
| 71 | 71 | */ |
| 72 | - public function get_store_fields( $key ) { |
|
| 72 | + public function get_store_fields($key) { |
|
| 73 | 73 | |
| 74 | 74 | // Fetch from data/invoice-schema.php, from data/discount-schema.php, from data/item-schema.php |
| 75 | - $fields = wpinv_get_data( $key . '-schema' ); |
|
| 75 | + $fields = wpinv_get_data($key . '-schema'); |
|
| 76 | 76 | |
| 77 | - if ( empty( $fields ) ) { |
|
| 77 | + if (empty($fields)) { |
|
| 78 | 78 | return array(); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // Clean the fields. |
| 82 | 82 | $prepared = array(); |
| 83 | - foreach ( $fields as $id => $field ) { |
|
| 83 | + foreach ($fields as $id => $field) { |
|
| 84 | 84 | |
| 85 | 85 | // Skip read only fields. |
| 86 | - if ( ! empty( $field['readonly'] ) ) { |
|
| 86 | + if (!empty($field['readonly'])) { |
|
| 87 | 87 | continue; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $prepared[ $id ] = $field; |
|
| 90 | + $prepared[$id] = $field; |
|
| 91 | 91 | |
| 92 | 92 | } |
| 93 | 93 | |
@@ -98,10 +98,10 @@ discard block |
||
| 98 | 98 | /** |
| 99 | 99 | * Registers store fields. |
| 100 | 100 | */ |
| 101 | - public function add_store_fields( $key ) { |
|
| 101 | + public function add_store_fields($key) { |
|
| 102 | 102 | |
| 103 | - foreach ( $this->get_store_fields( $key ) as $field_id => $data ) { |
|
| 104 | - $this->add_ons[ $key ]->add_field( $field_id, $data['description'], 'text' ); |
|
| 103 | + foreach ($this->get_store_fields($key) as $field_id => $data) { |
|
| 104 | + $this->add_ons[$key]->add_field($field_id, $data['description'], 'text'); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | } |
@@ -109,36 +109,36 @@ discard block |
||
| 109 | 109 | /** |
| 110 | 110 | * Handles store imports. |
| 111 | 111 | */ |
| 112 | - public function import_store( $key, $post_id, $data, $import_options, $_post ) { |
|
| 112 | + public function import_store($key, $post_id, $data, $import_options, $_post) { |
|
| 113 | 113 | |
| 114 | 114 | // Is the store class set? |
| 115 | - if ( ! isset( $this->datastores[ $key ] ) ) { |
|
| 115 | + if (!isset($this->datastores[$key])) { |
|
| 116 | 116 | return; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /**@var GetPaid_Data */ |
| 120 | - $data_store = new $this->datastores[ $key ]( $post_id ); |
|
| 120 | + $data_store = new $this->datastores[$key]($post_id); |
|
| 121 | 121 | |
| 122 | 122 | // Abort if the invoice/item/discount does not exist. |
| 123 | - if ( ! $data_store->exists() ) { |
|
| 123 | + if (!$data_store->exists()) { |
|
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // Prepare data props. |
| 128 | 128 | $prepared = array(); |
| 129 | 129 | |
| 130 | - foreach ( array_keys( $this->get_store_fields( $key ) ) as $field ) { |
|
| 130 | + foreach (array_keys($this->get_store_fields($key)) as $field) { |
|
| 131 | 131 | // Make sure the user has allowed this field to be updated. |
| 132 | - if ( empty( $_post['ID'] ) || $this->add_ons[ $key ]->can_update_meta( $field, $import_options ) ) { |
|
| 132 | + if (empty($_post['ID']) || $this->add_ons[$key]->can_update_meta($field, $import_options)) { |
|
| 133 | 133 | |
| 134 | 134 | // Update the custom field with the imported data. |
| 135 | - $prepared[ $field ] = $data[ $field ]; |
|
| 135 | + $prepared[$field] = $data[$field]; |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | // Only update if we have something to update. |
| 140 | - if ( ! empty( $prepared ) ) { |
|
| 141 | - $data_store->set_props( $prepared ); |
|
| 140 | + if (!empty($prepared)) { |
|
| 141 | + $data_store->set_props($prepared); |
|
| 142 | 142 | $data_store->save(); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -13,36 +13,36 @@ discard block |
||
| 13 | 13 | class GetPaid_Notification_Email { |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * Contains the type of this notification email. |
|
| 17 | - * |
|
| 18 | - * @var string |
|
| 19 | - */ |
|
| 16 | + * Contains the type of this notification email. |
|
| 17 | + * |
|
| 18 | + * @var string |
|
| 19 | + */ |
|
| 20 | 20 | public $id; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * Contains any object to use in filters. |
|
| 24 | - * |
|
| 25 | - * @var false|WPInv_Invoice|WPInv_Item|WPInv_Subscription |
|
| 26 | - */ |
|
| 23 | + * Contains any object to use in filters. |
|
| 24 | + * |
|
| 25 | + * @var false|WPInv_Invoice|WPInv_Item|WPInv_Subscription |
|
| 26 | + */ |
|
| 27 | 27 | public $object; |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * Class constructor. |
|
| 31 | - * |
|
| 30 | + * Class constructor. |
|
| 31 | + * |
|
| 32 | 32 | * @param string $id Email Type. |
| 33 | 33 | * @param mixed $object Optional. Associated object. |
| 34 | - */ |
|
| 35 | - public function __construct( $id, $object = false ) { |
|
| 34 | + */ |
|
| 35 | + public function __construct( $id, $object = false ) { |
|
| 36 | 36 | $this->id = $id; |
| 37 | 37 | $this->object = $object; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | - * Retrieves an option |
|
| 42 | - * |
|
| 41 | + * Retrieves an option |
|
| 42 | + * |
|
| 43 | 43 | * @return mixed |
| 44 | - */ |
|
| 45 | - public function get_option( $key ) { |
|
| 44 | + */ |
|
| 45 | + public function get_option( $key ) { |
|
| 46 | 46 | |
| 47 | 47 | $key = "email_{$this->id}_$key"; |
| 48 | 48 | $value = wpinv_get_option( $key, null ); |
@@ -60,80 +60,80 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | - * Retrieves the email body. |
|
| 64 | - * |
|
| 63 | + * Retrieves the email body. |
|
| 64 | + * |
|
| 65 | 65 | * @return string |
| 66 | - */ |
|
| 67 | - public function get_body() { |
|
| 66 | + */ |
|
| 67 | + public function get_body() { |
|
| 68 | 68 | $body = $this->get_option( 'body' ); |
| 69 | 69 | return apply_filters( 'getpaid_get_email_body', $body, $this->id, $this->object ); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * Retrieves the email subject. |
|
| 74 | - * |
|
| 73 | + * Retrieves the email subject. |
|
| 74 | + * |
|
| 75 | 75 | * @return string |
| 76 | - */ |
|
| 77 | - public function get_subject() { |
|
| 76 | + */ |
|
| 77 | + public function get_subject() { |
|
| 78 | 78 | $subject = $this->get_option( 'subject' ); |
| 79 | 79 | return apply_filters( 'getpaid_get_email_subject', $subject, $this->id, $this->object ); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | - * Retrieves the email heading. |
|
| 84 | - * |
|
| 83 | + * Retrieves the email heading. |
|
| 84 | + * |
|
| 85 | 85 | * @return string |
| 86 | - */ |
|
| 87 | - public function get_heading() { |
|
| 86 | + */ |
|
| 87 | + public function get_heading() { |
|
| 88 | 88 | $heading = $this->get_option( 'heading' ); |
| 89 | 89 | return apply_filters( 'getpaid_get_email_heading', $heading, $this->id, $this->object ); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | - * Checks if an email is active. |
|
| 94 | - * |
|
| 93 | + * Checks if an email is active. |
|
| 94 | + * |
|
| 95 | 95 | * @return bool |
| 96 | - */ |
|
| 97 | - public function is_active() { |
|
| 96 | + */ |
|
| 97 | + public function is_active() { |
|
| 98 | 98 | $is_active = ! empty( $this->get_option( 'active' ) ); |
| 99 | 99 | return apply_filters( 'getpaid_email_type_is_active', $is_active, $this->id, $this->object ); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * Checks if the site's admin should receive email notifications. |
|
| 104 | - * |
|
| 103 | + * Checks if the site's admin should receive email notifications. |
|
| 104 | + * |
|
| 105 | 105 | * @return bool |
| 106 | - */ |
|
| 107 | - public function include_admin_bcc() { |
|
| 106 | + */ |
|
| 107 | + public function include_admin_bcc() { |
|
| 108 | 108 | $include_admin_bcc = ! empty( $this->get_option( 'admin_bcc' ) ); |
| 109 | 109 | return apply_filters( 'getpaid_email_type_include_admin_bcc', $include_admin_bcc, $this->id, $this->object ); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | - * Checks whether this email should be sent to the customer or admin. |
|
| 114 | - * |
|
| 113 | + * Checks whether this email should be sent to the customer or admin. |
|
| 114 | + * |
|
| 115 | 115 | * @return bool |
| 116 | - */ |
|
| 117 | - public function is_admin_email() { |
|
| 116 | + */ |
|
| 117 | + public function is_admin_email() { |
|
| 118 | 118 | $is_admin_email = in_array( $this->id, array( 'new_invoice', 'failed_invoice' ) ); |
| 119 | 119 | return apply_filters( 'getpaid_email_type_is_admin_email', $is_admin_email, $this->id, $this->object ); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | - * Returns email attachments. |
|
| 124 | - * |
|
| 123 | + * Returns email attachments. |
|
| 124 | + * |
|
| 125 | 125 | * @return array |
| 126 | - */ |
|
| 127 | - public function get_attachments() { |
|
| 126 | + */ |
|
| 127 | + public function get_attachments() { |
|
| 128 | 128 | return apply_filters( 'getpaid_get_email_attachments', array(), $this->id, $this->object ); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * Returns an array of merge tags. |
|
| 133 | - * |
|
| 132 | + * Returns an array of merge tags. |
|
| 133 | + * |
|
| 134 | 134 | * @return array |
| 135 | - */ |
|
| 136 | - public function get_merge_tags() { |
|
| 135 | + */ |
|
| 136 | + public function get_merge_tags() { |
|
| 137 | 137 | |
| 138 | 138 | $merge_tags = array( |
| 139 | 139 | '{site_title}' => wpinv_get_blogname(), |
@@ -144,13 +144,13 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | - * Adds merge tags to a text. |
|
| 148 | - * |
|
| 147 | + * Adds merge tags to a text. |
|
| 148 | + * |
|
| 149 | 149 | * @param string string $text |
| 150 | 150 | * @param array $merge_tags |
| 151 | 151 | * @return string |
| 152 | - */ |
|
| 153 | - public function add_merge_tags( $text, $merge_tags = array() ) { |
|
| 152 | + */ |
|
| 153 | + public function add_merge_tags( $text, $merge_tags = array() ) { |
|
| 154 | 154 | |
| 155 | 155 | foreach ( $merge_tags as $key => $value ) { |
| 156 | 156 | $text = str_replace( $key, $value, $text ); |
@@ -160,13 +160,13 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | - * Returns the email content |
|
| 164 | - * |
|
| 163 | + * Returns the email content |
|
| 164 | + * |
|
| 165 | 165 | * @param array $merge_tags |
| 166 | 166 | * @param array $extra_args Extra template args |
| 167 | 167 | * @return string |
| 168 | - */ |
|
| 169 | - public function get_content( $merge_tags = array(), $extra_args = array() ) { |
|
| 168 | + */ |
|
| 169 | + public function get_content( $merge_tags = array(), $extra_args = array() ) { |
|
| 170 | 170 | |
| 171 | 171 | $content = wpinv_get_template_html( |
| 172 | 172 | "emails/wpinv-email-{$this->id}.php", |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | -defined( 'ABSPATH' ) || exit; |
|
| 7 | +defined('ABSPATH') || exit; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * Represents a single email type. |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @param string $id Email Type. |
| 33 | 33 | * @param mixed $object Optional. Associated object. |
| 34 | 34 | */ |
| 35 | - public function __construct( $id, $object = false ) { |
|
| 35 | + public function __construct($id, $object = false) { |
|
| 36 | 36 | $this->id = $id; |
| 37 | 37 | $this->object = $object; |
| 38 | 38 | } |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | * @return mixed |
| 44 | 44 | */ |
| 45 | - public function get_option( $key ) { |
|
| 45 | + public function get_option($key) { |
|
| 46 | 46 | |
| 47 | 47 | $key = "email_{$this->id}_$key"; |
| 48 | - $value = wpinv_get_option( $key, null ); |
|
| 49 | - if ( is_null( $value ) ) { |
|
| 48 | + $value = wpinv_get_option($key, null); |
|
| 49 | + if (is_null($value)) { |
|
| 50 | 50 | $options = wpinv_get_emails(); |
| 51 | 51 | |
| 52 | - if ( ! isset( $options[ $this->id ] ) || ! isset( $options[ $this->id ][ $key ] ) ) { |
|
| 52 | + if (!isset($options[$this->id]) || !isset($options[$this->id][$key])) { |
|
| 53 | 53 | return ''; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $value = isset( $options[ $this->id ][ $key ]['std'] ) ? $options[ $this->id ][ $key ]['std'] : ''; |
|
| 56 | + $value = isset($options[$this->id][$key]['std']) ? $options[$this->id][$key]['std'] : ''; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | return $value; |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | * @return string |
| 66 | 66 | */ |
| 67 | 67 | public function get_body() { |
| 68 | - $body = $this->get_option( 'body' ); |
|
| 69 | - return apply_filters( 'getpaid_get_email_body', $body, $this->id, $this->object ); |
|
| 68 | + $body = $this->get_option('body'); |
|
| 69 | + return apply_filters('getpaid_get_email_body', $body, $this->id, $this->object); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | * @return string |
| 76 | 76 | */ |
| 77 | 77 | public function get_subject() { |
| 78 | - $subject = $this->get_option( 'subject' ); |
|
| 79 | - return apply_filters( 'getpaid_get_email_subject', $subject, $this->id, $this->object ); |
|
| 78 | + $subject = $this->get_option('subject'); |
|
| 79 | + return apply_filters('getpaid_get_email_subject', $subject, $this->id, $this->object); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | * @return string |
| 86 | 86 | */ |
| 87 | 87 | public function get_heading() { |
| 88 | - $heading = $this->get_option( 'heading' ); |
|
| 89 | - return apply_filters( 'getpaid_get_email_heading', $heading, $this->id, $this->object ); |
|
| 88 | + $heading = $this->get_option('heading'); |
|
| 89 | + return apply_filters('getpaid_get_email_heading', $heading, $this->id, $this->object); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | * @return bool |
| 96 | 96 | */ |
| 97 | 97 | public function is_active() { |
| 98 | - $is_active = ! empty( $this->get_option( 'active' ) ); |
|
| 99 | - return apply_filters( 'getpaid_email_type_is_active', $is_active, $this->id, $this->object ); |
|
| 98 | + $is_active = !empty($this->get_option('active')); |
|
| 99 | + return apply_filters('getpaid_email_type_is_active', $is_active, $this->id, $this->object); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | * @return bool |
| 106 | 106 | */ |
| 107 | 107 | public function include_admin_bcc() { |
| 108 | - $include_admin_bcc = ! empty( $this->get_option( 'admin_bcc' ) ); |
|
| 109 | - return apply_filters( 'getpaid_email_type_include_admin_bcc', $include_admin_bcc, $this->id, $this->object ); |
|
| 108 | + $include_admin_bcc = !empty($this->get_option('admin_bcc')); |
|
| 109 | + return apply_filters('getpaid_email_type_include_admin_bcc', $include_admin_bcc, $this->id, $this->object); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | * @return bool |
| 116 | 116 | */ |
| 117 | 117 | public function is_admin_email() { |
| 118 | - $is_admin_email = in_array( $this->id, array( 'new_invoice', 'failed_invoice' ) ); |
|
| 119 | - return apply_filters( 'getpaid_email_type_is_admin_email', $is_admin_email, $this->id, $this->object ); |
|
| 118 | + $is_admin_email = in_array($this->id, array('new_invoice', 'failed_invoice')); |
|
| 119 | + return apply_filters('getpaid_email_type_is_admin_email', $is_admin_email, $this->id, $this->object); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @return array |
| 126 | 126 | */ |
| 127 | 127 | public function get_attachments() { |
| 128 | - return apply_filters( 'getpaid_get_email_attachments', array(), $this->id, $this->object ); |
|
| 128 | + return apply_filters('getpaid_get_email_attachments', array(), $this->id, $this->object); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | $merge_tags = array( |
| 139 | 139 | '{site_title}' => wpinv_get_blogname(), |
| 140 | - '{date}' => getpaid_format_date_value( current_time( 'mysql' ) ), |
|
| 140 | + '{date}' => getpaid_format_date_value(current_time('mysql')), |
|
| 141 | 141 | ); |
| 142 | 142 | |
| 143 | - return apply_filters( 'getpaid_get_email_merge_tags', $merge_tags, $this->object, $this->id ); |
|
| 143 | + return apply_filters('getpaid_get_email_merge_tags', $merge_tags, $this->object, $this->id); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -150,13 +150,13 @@ discard block |
||
| 150 | 150 | * @param array $merge_tags |
| 151 | 151 | * @return string |
| 152 | 152 | */ |
| 153 | - public function add_merge_tags( $text, $merge_tags = array() ) { |
|
| 153 | + public function add_merge_tags($text, $merge_tags = array()) { |
|
| 154 | 154 | |
| 155 | - foreach ( $merge_tags as $key => $value ) { |
|
| 156 | - $text = str_replace( $key, $value, $text ); |
|
| 155 | + foreach ($merge_tags as $key => $value) { |
|
| 156 | + $text = str_replace($key, $value, $text); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - return wptexturize( $text ); |
|
| 159 | + return wptexturize($text); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @param array $extra_args Extra template args |
| 167 | 167 | * @return string |
| 168 | 168 | */ |
| 169 | - public function get_content( $merge_tags = array(), $extra_args = array() ) { |
|
| 169 | + public function get_content($merge_tags = array(), $extra_args = array()) { |
|
| 170 | 170 | |
| 171 | 171 | $content = wpinv_get_template_html( |
| 172 | 172 | "emails/wpinv-email-{$this->id}.php", |
@@ -176,15 +176,15 @@ discard block |
||
| 176 | 176 | 'invoice' => $this->object, // Backwards compat. |
| 177 | 177 | 'object' => $this->object, |
| 178 | 178 | 'email_type' => $this->id, |
| 179 | - 'email_heading' => $this->add_merge_tags( $this->get_heading(), $merge_tags ), |
|
| 179 | + 'email_heading' => $this->add_merge_tags($this->get_heading(), $merge_tags), |
|
| 180 | 180 | 'sent_to_admin' => $this->is_admin_email(), |
| 181 | 181 | 'plain_text' => false, |
| 182 | - 'message_body' => wpautop( $this->add_merge_tags( $this->get_body(), $merge_tags ) ), |
|
| 182 | + 'message_body' => wpautop($this->add_merge_tags($this->get_body(), $merge_tags)), |
|
| 183 | 183 | ) |
| 184 | 184 | ) |
| 185 | 185 | ); |
| 186 | 186 | |
| 187 | - return wpinv_email_style_body( $content ); |
|
| 187 | + return wpinv_email_style_body($content); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | } |
@@ -7,20 +7,20 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Fetch the invoice. |
| 13 | -if ( empty( $invoice ) ) { |
|
| 14 | - $invoice = new WPInv_Invoice( $GLOBALS['post'] ); |
|
| 13 | +if (empty($invoice)) { |
|
| 14 | + $invoice = new WPInv_Invoice($GLOBALS['post']); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // Abort if it does not exist. |
| 18 | -if ( $invoice->get_id() == 0 ) { |
|
| 18 | +if ($invoice->get_id() == 0) { |
|
| 19 | 19 | exit; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | // Fires before printing an invoice. |
| 23 | -do_action( 'wpinv_invoice_print_before_display', $invoice ); |
|
| 23 | +do_action('wpinv_invoice_print_before_display', $invoice); |
|
| 24 | 24 | |
| 25 | 25 | ?><!DOCTYPE html> |
| 26 | 26 | |
@@ -29,16 +29,16 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | <head> |
| 31 | 31 | |
| 32 | - <meta charset="<?php bloginfo( 'charset' ); ?>"> |
|
| 32 | + <meta charset="<?php bloginfo('charset'); ?>"> |
|
| 33 | 33 | <meta name="viewport" content="width=device-width, initial-scale=1.0" > |
| 34 | 34 | |
| 35 | 35 | <meta name="robots" content="noindex,nofollow"> |
| 36 | 36 | |
| 37 | 37 | <link rel="profile" href="https://gmpg.org/xfn/11"> |
| 38 | 38 | |
| 39 | - <title>#<?php echo esc_html( $invoice->get_number() ); ?></title> |
|
| 39 | + <title>#<?php echo esc_html($invoice->get_number()); ?></title> |
|
| 40 | 40 | |
| 41 | - <?php do_action( 'wpinv_invoice_print_head', $invoice ); ?> |
|
| 41 | + <?php do_action('wpinv_invoice_print_head', $invoice); ?> |
|
| 42 | 42 | |
| 43 | 43 | <style type="text/css"> |
| 44 | 44 | .body{ |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | <body class="body wpinv wpinv-print" style="font-weight: 400;"> |
| 71 | 71 | |
| 72 | 72 | <div id="wpinv-print-inner"> |
| 73 | - <?php do_action( 'getpaid_invoice', $invoice ); ?> |
|
| 74 | - <?php do_action( 'wpinv_invoice_print_body_end', $invoice ); ?> |
|
| 73 | + <?php do_action('getpaid_invoice', $invoice); ?> |
|
| 74 | + <?php do_action('wpinv_invoice_print_body_end', $invoice); ?> |
|
| 75 | 75 | </div> |
| 76 | 76 | </body> |
| 77 | 77 | |
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | 14 | <div class="border-top pt-4 bg-white"> |
| 15 | 15 | <div class="container pr-0 pl-0"> |
| 16 | 16 | |
| 17 | - <?php if ( $term_text = wpinv_get_terms_text() ) : ?> |
|
| 17 | + <?php if ($term_text = wpinv_get_terms_text()) : ?> |
|
| 18 | 18 | <div class="terms-text"> |
| 19 | - <?php echo wp_kses_post( wpautop( $term_text ) ); ?> |
|
| 19 | + <?php echo wp_kses_post(wpautop($term_text)); ?> |
|
| 20 | 20 | </div> |
| 21 | 21 | <?php endif; ?> |
| 22 | 22 | |
| 23 | 23 | <div class="footer-text d-print-none"> |
| 24 | - <?php echo wp_kses_post( wpinv_get_business_footer() ); ?> |
|
| 24 | + <?php echo wp_kses_post(wpinv_get_business_footer()); ?> |
|
| 25 | 25 | </div> |
| 26 | 26 | |
| 27 | 27 | </div> |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays the invoice footer. |
| 4 | 4 | * |
@@ -7,17 +7,17 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -?> |
|
| 12 | + ?> |
|
| 13 | 13 | |
| 14 | 14 | <div class="border-top pt-4 bg-white"> |
| 15 | 15 | <div class="container pr-0 pl-0"> |
| 16 | 16 | |
| 17 | 17 | <?php if ( $term_text = wpinv_get_terms_text() ) : ?> |
| 18 | - <div class="terms-text"> |
|
| 18 | + <div class="terms-text"> |
|
| 19 | 19 | <?php echo wp_kses_post( wpautop( $term_text ) ); ?> |
| 20 | - </div> |
|
| 20 | + </div> |
|
| 21 | 21 | <?php endif; ?> |
| 22 | 22 | |
| 23 | 23 | <div class="footer-text d-print-none"> |
@@ -7,22 +7,22 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Print the email header. |
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 13 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 14 | 14 | |
| 15 | 15 | // Generate the custom message body. |
| 16 | -echo wp_kses_post( $message_body ); |
|
| 16 | +echo wp_kses_post($message_body); |
|
| 17 | 17 | |
| 18 | 18 | // Print invoice details. |
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 19 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); |
|
| 20 | 20 | |
| 21 | 21 | // Print invoice items. |
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print the billing details. |
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 26 | 26 | |
| 27 | 27 | // Print the email footer. |
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 28 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the completed invoice email. |
| 4 | 4 | * |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -// Print the email header. |
|
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 12 | + // Print the email header. |
|
| 13 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 14 | 14 | |
| 15 | -// Generate the custom message body. |
|
| 16 | -echo wp_kses_post( $message_body ); |
|
| 15 | + // Generate the custom message body. |
|
| 16 | + echo wp_kses_post( $message_body ); |
|
| 17 | 17 | |
| 18 | -// Print invoice details. |
|
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 18 | + // Print invoice details. |
|
| 19 | + do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 20 | 20 | |
| 21 | -// Print invoice items. |
|
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print invoice items. |
|
| 22 | + do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the billing details. |
|
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the billing details. |
|
| 25 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 26 | 26 | |
| 27 | -// Print the email footer. |
|
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 27 | + // Print the email footer. |
|
| 28 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
@@ -8,18 +8,18 @@ |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | $invoice = $object->get_parent_payment(); |
| 14 | 14 | |
| 15 | 15 | // Print the email header. |
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 17 | 17 | |
| 18 | 18 | // Generate the custom message body. |
| 19 | -echo wp_kses_post( $message_body ); |
|
| 19 | +echo wp_kses_post($message_body); |
|
| 20 | 20 | |
| 21 | 21 | // Print the billing details. |
| 22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print the email footer. |
| 25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the completed subscription email. |
| 4 | 4 | * |
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | + defined( 'ABSPATH' ) || exit; |
|
| 12 | 12 | |
| 13 | -$invoice = $object->get_parent_payment(); |
|
| 13 | + $invoice = $object->get_parent_payment(); |
|
| 14 | 14 | |
| 15 | -// Print the email header. |
|
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 15 | + // Print the email header. |
|
| 16 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 17 | 17 | |
| 18 | -// Generate the custom message body. |
|
| 19 | -echo wp_kses_post( $message_body ); |
|
| 18 | + // Generate the custom message body. |
|
| 19 | + echo wp_kses_post( $message_body ); |
|
| 20 | 20 | |
| 21 | -// Print the billing details. |
|
| 22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print the billing details. |
|
| 22 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the email footer. |
|
| 25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the email footer. |
|
| 25 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
@@ -8,24 +8,24 @@ |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | $invoice = $object->get_parent_payment(); |
| 14 | 14 | |
| 15 | 15 | // Print the email header. |
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 17 | 17 | |
| 18 | 18 | // Generate the custom message body. |
| 19 | -echo wp_kses_post( $message_body ); |
|
| 19 | +echo wp_kses_post($message_body); |
|
| 20 | 20 | |
| 21 | 21 | // Print invoice details. |
| 22 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print invoice items. |
| 25 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 26 | 26 | |
| 27 | 27 | // Print the billing details. |
| 28 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 28 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 29 | 29 | |
| 30 | 30 | // Print the email footer. |
| 31 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 31 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the upcoming renewal subscription email. |
| 4 | 4 | * |
@@ -8,24 +8,24 @@ discard block |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | + defined( 'ABSPATH' ) || exit; |
|
| 12 | 12 | |
| 13 | -$invoice = $object->get_parent_payment(); |
|
| 13 | + $invoice = $object->get_parent_payment(); |
|
| 14 | 14 | |
| 15 | -// Print the email header. |
|
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 15 | + // Print the email header. |
|
| 16 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 17 | 17 | |
| 18 | -// Generate the custom message body. |
|
| 19 | -echo wp_kses_post( $message_body ); |
|
| 18 | + // Generate the custom message body. |
|
| 19 | + echo wp_kses_post( $message_body ); |
|
| 20 | 20 | |
| 21 | -// Print invoice details. |
|
| 22 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print invoice details. |
|
| 22 | + do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print invoice items. |
|
| 25 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print invoice items. |
|
| 25 | + do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 26 | 26 | |
| 27 | -// Print the billing details. |
|
| 28 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 27 | + // Print the billing details. |
|
| 28 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 29 | 29 | |
| 30 | -// Print the email footer. |
|
| 31 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 30 | + // Print the email footer. |
|
| 31 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
@@ -7,22 +7,22 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Print the email header. |
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 13 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 14 | 14 | |
| 15 | 15 | // Generate the custom message body. |
| 16 | -echo wp_kses_post( $message_body ); |
|
| 16 | +echo wp_kses_post($message_body); |
|
| 17 | 17 | |
| 18 | 18 | // Print invoice details. |
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 19 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); |
|
| 20 | 20 | |
| 21 | 21 | // Print invoice items. |
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print the billing details. |
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 26 | 26 | |
| 27 | 27 | // Print the email footer. |
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 28 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generated the processing invoice email. |
| 4 | 4 | * |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -// Print the email header. |
|
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 12 | + // Print the email header. |
|
| 13 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 14 | 14 | |
| 15 | -// Generate the custom message body. |
|
| 16 | -echo wp_kses_post( $message_body ); |
|
| 15 | + // Generate the custom message body. |
|
| 16 | + echo wp_kses_post( $message_body ); |
|
| 17 | 17 | |
| 18 | -// Print invoice details. |
|
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 18 | + // Print invoice details. |
|
| 19 | + do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 20 | 20 | |
| 21 | -// Print invoice items. |
|
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print invoice items. |
|
| 22 | + do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the billing details. |
|
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the billing details. |
|
| 25 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 26 | 26 | |
| 27 | -// Print the email footer. |
|
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 27 | + // Print the email footer. |
|
| 28 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
@@ -7,22 +7,22 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Print the email header. |
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 13 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 14 | 14 | |
| 15 | 15 | // Generate the custom message body. |
| 16 | -echo wp_kses_post( $message_body ); |
|
| 16 | +echo wp_kses_post($message_body); |
|
| 17 | 17 | |
| 18 | 18 | // Print invoice details. |
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 19 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); |
|
| 20 | 20 | |
| 21 | 21 | // Print invoice items. |
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print the billing details. |
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 26 | 26 | |
| 27 | 27 | // Print the email footer. |
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 28 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the overdue emails. |
| 4 | 4 | * |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -// Print the email header. |
|
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 12 | + // Print the email header. |
|
| 13 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 14 | 14 | |
| 15 | -// Generate the custom message body. |
|
| 16 | -echo wp_kses_post( $message_body ); |
|
| 15 | + // Generate the custom message body. |
|
| 16 | + echo wp_kses_post( $message_body ); |
|
| 17 | 17 | |
| 18 | -// Print invoice details. |
|
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 18 | + // Print invoice details. |
|
| 19 | + do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 20 | 20 | |
| 21 | -// Print invoice items. |
|
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print invoice items. |
|
| 22 | + do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the billing details. |
|
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the billing details. |
|
| 25 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 26 | 26 | |
| 27 | -// Print the email footer. |
|
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 27 | + // Print the email footer. |
|
| 28 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|