@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -23,17 +23,17 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return void |
| 25 | 25 | */ |
| 26 | -function give_trigger_donation_receipt( $payment_id ) { |
|
| 26 | +function give_trigger_donation_receipt($payment_id) { |
|
| 27 | 27 | // Make sure we don't send a receipt while editing a donation. |
| 28 | - if ( isset( $_POST['give-action'] ) && 'edit_payment' == $_POST['give-action'] ) { |
|
| 28 | + if (isset($_POST['give-action']) && 'edit_payment' == $_POST['give-action']) { |
|
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // Send email. |
| 33 | - give_email_donation_receipt( $payment_id ); |
|
| 33 | + give_email_donation_receipt($payment_id); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -add_action( 'give_complete_donation', 'give_trigger_donation_receipt', 999, 1 ); |
|
| 36 | +add_action('give_complete_donation', 'give_trigger_donation_receipt', 999, 1); |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Resend the Email Donation Receipt. (This can be done from the Donation History Page) |
@@ -44,29 +44,29 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return void |
| 46 | 46 | */ |
| 47 | -function give_resend_donation_receipt( $data ) { |
|
| 47 | +function give_resend_donation_receipt($data) { |
|
| 48 | 48 | |
| 49 | - $purchase_id = absint( $data['purchase_id'] ); |
|
| 49 | + $purchase_id = absint($data['purchase_id']); |
|
| 50 | 50 | |
| 51 | - if ( empty( $purchase_id ) ) { |
|
| 51 | + if (empty($purchase_id)) { |
|
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - if ( ! current_user_can( 'edit_give_payments', $purchase_id ) ) { |
|
| 56 | - wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
| 55 | + if ( ! current_user_can('edit_give_payments', $purchase_id)) { |
|
| 56 | + wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - give_email_donation_receipt( $purchase_id, false ); |
|
| 59 | + give_email_donation_receipt($purchase_id, false); |
|
| 60 | 60 | |
| 61 | - wp_redirect( add_query_arg( array( |
|
| 61 | + wp_redirect(add_query_arg(array( |
|
| 62 | 62 | 'give-message' => 'email_sent', |
| 63 | 63 | 'give-action' => false, |
| 64 | 64 | 'purchase_id' => false |
| 65 | - ) ) ); |
|
| 65 | + ))); |
|
| 66 | 66 | exit; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | -add_action( 'give_email_links', 'give_resend_donation_receipt' ); |
|
| 69 | +add_action('give_email_links', 'give_resend_donation_receipt'); |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * Trigger the sending of a Test Email |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return void |
| 79 | 79 | */ |
| 80 | -function give_send_test_email( $data ) { |
|
| 81 | - if ( ! wp_verify_nonce( $data['_wpnonce'], 'give-test-email' ) ) { |
|
| 80 | +function give_send_test_email($data) { |
|
| 81 | + if ( ! wp_verify_nonce($data['_wpnonce'], 'give-test-email')) { |
|
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | give_email_test_donation_receipt(); |
| 87 | 87 | |
| 88 | 88 | // Remove the test email query arg. |
| 89 | - wp_redirect( remove_query_arg( 'give_action' ) ); |
|
| 89 | + wp_redirect(remove_query_arg('give_action')); |
|
| 90 | 90 | exit; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | -add_action( 'give_send_test_email', 'give_send_test_email' ); |
|
| 93 | +add_action('give_send_test_email', 'give_send_test_email'); |
|
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 13 | +if ( ! defined('ABSPATH')) {
|
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -36,29 +36,29 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * Templates |
| 38 | 38 | */ |
| 39 | - add_filter( 'template_include', array( __CLASS__, 'template_loader' ) ); |
|
| 39 | + add_filter('template_include', array(__CLASS__, 'template_loader'));
|
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Content Wrappers |
| 43 | 43 | */ |
| 44 | - add_action( 'give_before_main_content', 'give_output_content_wrapper', 10 ); |
|
| 45 | - add_action( 'give_after_main_content', 'give_output_content_wrapper_end', 10 ); |
|
| 44 | + add_action('give_before_main_content', 'give_output_content_wrapper', 10);
|
|
| 45 | + add_action('give_after_main_content', 'give_output_content_wrapper_end', 10);
|
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Entry Summary Classes |
| 49 | 49 | */ |
| 50 | - add_filter( 'give_forms_single_summary_classes', array( $this, 'give_set_single_summary_classes' ) ); |
|
| 50 | + add_filter('give_forms_single_summary_classes', array($this, 'give_set_single_summary_classes'));
|
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Sidebar |
| 54 | 54 | */ |
| 55 | - add_action( 'give_before_single_form_summary', array( $this, 'give_output_sidebar_option' ), 1 ); |
|
| 55 | + add_action('give_before_single_form_summary', array($this, 'give_output_sidebar_option'), 1);
|
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Single Forms Summary Box |
| 59 | 59 | */ |
| 60 | - add_action( 'give_single_form_summary', 'give_template_single_title', 5 ); |
|
| 61 | - add_action( 'give_single_form_summary', 'give_get_donation_form', 10 ); |
|
| 60 | + add_action('give_single_form_summary', 'give_template_single_title', 5);
|
|
| 61 | + add_action('give_single_form_summary', 'give_get_donation_form', 10);
|
|
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @return string $classes List of space separated class names. |
| 75 | 75 | */ |
| 76 | - public function give_set_single_summary_classes( $classes ) {
|
|
| 76 | + public function give_set_single_summary_classes($classes) {
|
|
| 77 | 77 | |
| 78 | 78 | //Add full width class when feature image is disabled AND no widgets are present |
| 79 | - if ( ! give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) ) {
|
|
| 79 | + if ( ! give_is_setting_enabled(give_get_option('form_sidebar'))) {
|
|
| 80 | 80 | $classes .= ' give-full-width'; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | public function give_output_sidebar_option() {
|
| 98 | 98 | |
| 99 | 99 | //Add full width class when feature image is disabled AND no widgets are present |
| 100 | - if ( give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) ) {
|
|
| 101 | - add_action( 'give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5 ); |
|
| 102 | - add_action( 'give_before_single_form_summary', 'give_show_form_images', 10 ); |
|
| 103 | - add_action( 'give_before_single_form_summary', 'give_get_forms_sidebar', 20 ); |
|
| 104 | - add_action( 'give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30 ); |
|
| 100 | + if (give_is_setting_enabled(give_get_option('form_sidebar'))) {
|
|
| 101 | + add_action('give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5);
|
|
| 102 | + add_action('give_before_single_form_summary', 'give_show_form_images', 10);
|
|
| 103 | + add_action('give_before_single_form_summary', 'give_get_forms_sidebar', 20);
|
|
| 104 | + add_action('give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30);
|
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | } |
@@ -123,20 +123,20 @@ discard block |
||
| 123 | 123 | * |
| 124 | 124 | * @return string $template |
| 125 | 125 | */ |
| 126 | - public static function template_loader( $template ) {
|
|
| 127 | - $find = array( 'give.php' ); |
|
| 126 | + public static function template_loader($template) {
|
|
| 127 | + $find = array('give.php');
|
|
| 128 | 128 | $file = ''; |
| 129 | 129 | |
| 130 | - if ( is_single() && get_post_type() == 'give_forms' ) {
|
|
| 130 | + if (is_single() && get_post_type() == 'give_forms') {
|
|
| 131 | 131 | $file = 'single-give-form.php'; |
| 132 | 132 | $find[] = $file; |
| 133 | - $find[] = apply_filters( 'give_template_path', 'give/' ) . $file; |
|
| 133 | + $find[] = apply_filters('give_template_path', 'give/').$file;
|
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if ( $file ) {
|
|
| 137 | - $template = locate_template( array_unique( $find ) ); |
|
| 138 | - if ( ! $template ) {
|
|
| 139 | - $template = GIVE_PLUGIN_DIR . '/templates/' . $file; |
|
| 136 | + if ($file) {
|
|
| 137 | + $template = locate_template(array_unique($find)); |
|
| 138 | + if ( ! $template) {
|
|
| 139 | + $template = GIVE_PLUGIN_DIR.'/templates/'.$file; |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @return void |
| 28 | 28 | */ |
| 29 | -function give_email_donation_receipt( $payment_id, $admin_notice = true ) { |
|
| 29 | +function give_email_donation_receipt($payment_id, $admin_notice = true) { |
|
| 30 | 30 | |
| 31 | - $payment_data = give_get_payment_meta( $payment_id ); |
|
| 31 | + $payment_data = give_get_payment_meta($payment_id); |
|
| 32 | 32 | |
| 33 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); |
|
| 33 | + $from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Filters the from name. |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @since 1.0 |
| 42 | 42 | */ |
| 43 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, $payment_id, $payment_data ); |
|
| 43 | + $from_name = apply_filters('give_donation_from_name', $from_name, $payment_id, $payment_data); |
|
| 44 | 44 | |
| 45 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); |
|
| 45 | + $from_email = give_get_option('from_email', get_bloginfo('admin_email')); |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Filters the from email. |
@@ -52,19 +52,19 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @since 1.0 |
| 54 | 54 | */ |
| 55 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, $payment_id, $payment_data ); |
|
| 55 | + $from_email = apply_filters('give_donation_from_address', $from_email, $payment_id, $payment_data); |
|
| 56 | 56 | |
| 57 | - $to_email = give_get_payment_user_email( $payment_id ); |
|
| 57 | + $to_email = give_get_payment_user_email($payment_id); |
|
| 58 | 58 | |
| 59 | - $subject = give_get_option( 'donation_subject', esc_html__( 'Donation Receipt', 'give' ) ); |
|
| 59 | + $subject = give_get_option('donation_subject', esc_html__('Donation Receipt', 'give')); |
|
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Filters the donation email receipt subject. |
| 63 | 63 | * |
| 64 | 64 | * @since 1.0 |
| 65 | 65 | */ |
| 66 | - $subject = apply_filters( 'give_donation_subject', wp_strip_all_tags( $subject ), $payment_id ); |
|
| 67 | - $subject = give_do_email_tags( $subject, $payment_id ); |
|
| 66 | + $subject = apply_filters('give_donation_subject', wp_strip_all_tags($subject), $payment_id); |
|
| 67 | + $subject = give_do_email_tags($subject, $payment_id); |
|
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Filters the donation email receipt attachments. By default, there is no attachment but plugins can hook in to provide one more multiple for the donor. Examples would be a printable ticket or PDF receipt. |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @since 1.0 |
| 76 | 76 | */ |
| 77 | - $attachments = apply_filters( 'give_receipt_attachments', array(), $payment_id, $payment_data ); |
|
| 78 | - $message = give_do_email_tags( give_get_email_body_content( $payment_id, $payment_data ), $payment_id ); |
|
| 77 | + $attachments = apply_filters('give_receipt_attachments', array(), $payment_id, $payment_data); |
|
| 78 | + $message = give_do_email_tags(give_get_email_body_content($payment_id, $payment_data), $payment_id); |
|
| 79 | 79 | |
| 80 | 80 | $emails = Give()->emails; |
| 81 | 81 | |
| 82 | - $emails->__set( 'from_name', $from_name ); |
|
| 83 | - $emails->__set( 'from_email', $from_email ); |
|
| 84 | - $emails->__set( 'heading', esc_html__( 'Donation Receipt', 'give' ) ); |
|
| 82 | + $emails->__set('from_name', $from_name); |
|
| 83 | + $emails->__set('from_email', $from_email); |
|
| 84 | + $emails->__set('heading', esc_html__('Donation Receipt', 'give')); |
|
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Filters the donation receipt's email headers. |
@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @since 1.0 |
| 93 | 93 | */ |
| 94 | - $headers = apply_filters( 'give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data ); |
|
| 95 | - $emails->__set( 'headers', $headers ); |
|
| 94 | + $headers = apply_filters('give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data); |
|
| 95 | + $emails->__set('headers', $headers); |
|
| 96 | 96 | |
| 97 | 97 | //Send the donation receipt. |
| 98 | - $emails->send( $to_email, $subject, $message, $attachments ); |
|
| 98 | + $emails->send($to_email, $subject, $message, $attachments); |
|
| 99 | 99 | |
| 100 | 100 | //If admin notifications are on, send the admin notice. |
| 101 | - if ( $admin_notice && ! give_admin_notices_disabled( $payment_id ) ) { |
|
| 101 | + if ($admin_notice && ! give_admin_notices_disabled($payment_id)) { |
|
| 102 | 102 | /** |
| 103 | 103 | * Fires in the donation email receipt. |
| 104 | 104 | * |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @param int $payment_id Payment id. |
| 110 | 110 | * @param mixed $payment_data Payment meta data. |
| 111 | 111 | */ |
| 112 | - do_action( 'give_admin_donation_email', $payment_id, $payment_data ); |
|
| 112 | + do_action('give_admin_donation_email', $payment_id, $payment_data); |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
@@ -122,41 +122,41 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | function give_email_test_donation_receipt() { |
| 124 | 124 | |
| 125 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); |
|
| 125 | + $from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); |
|
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * Filters the from name. |
| 129 | 129 | * |
| 130 | 130 | * @since 1.7 |
| 131 | 131 | */ |
| 132 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, 0, array() ); |
|
| 132 | + $from_name = apply_filters('give_donation_from_name', $from_name, 0, array()); |
|
| 133 | 133 | |
| 134 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); |
|
| 134 | + $from_email = give_get_option('from_email', get_bloginfo('admin_email')); |
|
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | 137 | * Filters the from email. |
| 138 | 138 | * |
| 139 | 139 | * @since 1.7 |
| 140 | 140 | */ |
| 141 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, 0, array() ); |
|
| 141 | + $from_email = apply_filters('give_donation_from_address', $from_email, 0, array()); |
|
| 142 | 142 | |
| 143 | - $subject = give_get_option( 'donation_subject', esc_html__( 'Donation Receipt', 'give' ) ); |
|
| 144 | - $subject = apply_filters( 'give_donation_subject', wp_strip_all_tags( $subject ), 0 ); |
|
| 145 | - $subject = give_do_email_tags( $subject, 0 ); |
|
| 143 | + $subject = give_get_option('donation_subject', esc_html__('Donation Receipt', 'give')); |
|
| 144 | + $subject = apply_filters('give_donation_subject', wp_strip_all_tags($subject), 0); |
|
| 145 | + $subject = give_do_email_tags($subject, 0); |
|
| 146 | 146 | |
| 147 | - $attachments = apply_filters( 'give_receipt_attachments', array(), 0, array() ); |
|
| 147 | + $attachments = apply_filters('give_receipt_attachments', array(), 0, array()); |
|
| 148 | 148 | |
| 149 | - $message = give_email_preview_template_tags( give_get_email_body_content( 0, array() ) ); |
|
| 149 | + $message = give_email_preview_template_tags(give_get_email_body_content(0, array())); |
|
| 150 | 150 | |
| 151 | 151 | $emails = Give()->emails; |
| 152 | - $emails->__set( 'from_name', $from_name ); |
|
| 153 | - $emails->__set( 'from_email', $from_email ); |
|
| 154 | - $emails->__set( 'heading', esc_html__( 'Donation Receipt', 'give' ) ); |
|
| 152 | + $emails->__set('from_name', $from_name); |
|
| 153 | + $emails->__set('from_email', $from_email); |
|
| 154 | + $emails->__set('heading', esc_html__('Donation Receipt', 'give')); |
|
| 155 | 155 | |
| 156 | - $headers = apply_filters( 'give_receipt_headers', $emails->get_headers(), 0, array() ); |
|
| 157 | - $emails->__set( 'headers', $headers ); |
|
| 156 | + $headers = apply_filters('give_receipt_headers', $emails->get_headers(), 0, array()); |
|
| 157 | + $emails->__set('headers', $headers); |
|
| 158 | 158 | |
| 159 | - $emails->send( give_get_admin_notice_emails(), $subject, $message, $attachments ); |
|
| 159 | + $emails->send(give_get_admin_notice_emails(), $subject, $message, $attachments); |
|
| 160 | 160 | |
| 161 | 161 | } |
| 162 | 162 | |
@@ -170,49 +170,49 @@ discard block |
||
| 170 | 170 | * |
| 171 | 171 | * @return void |
| 172 | 172 | */ |
| 173 | -function give_admin_email_notice( $payment_id = 0, $payment_data = array() ) { |
|
| 173 | +function give_admin_email_notice($payment_id = 0, $payment_data = array()) { |
|
| 174 | 174 | |
| 175 | - $payment_id = absint( $payment_id ); |
|
| 175 | + $payment_id = absint($payment_id); |
|
| 176 | 176 | |
| 177 | - if ( empty( $payment_id ) ) { |
|
| 177 | + if (empty($payment_id)) { |
|
| 178 | 178 | return; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if ( ! give_get_payment_by( 'id', $payment_id ) ) { |
|
| 181 | + if ( ! give_get_payment_by('id', $payment_id)) { |
|
| 182 | 182 | return; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); |
|
| 185 | + $from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); |
|
| 186 | 186 | |
| 187 | 187 | /** |
| 188 | 188 | * Filters the from name. |
| 189 | 189 | * |
| 190 | 190 | * @since 1.0 |
| 191 | 191 | */ |
| 192 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, $payment_id, $payment_data ); |
|
| 192 | + $from_name = apply_filters('give_donation_from_name', $from_name, $payment_id, $payment_data); |
|
| 193 | 193 | |
| 194 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); |
|
| 194 | + $from_email = give_get_option('from_email', get_bloginfo('admin_email')); |
|
| 195 | 195 | |
| 196 | 196 | /** |
| 197 | 197 | * Filters the from email. |
| 198 | 198 | * |
| 199 | 199 | * @since 1.0 |
| 200 | 200 | */ |
| 201 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, $payment_id, $payment_data ); |
|
| 201 | + $from_email = apply_filters('give_donation_from_address', $from_email, $payment_id, $payment_data); |
|
| 202 | 202 | |
| 203 | 203 | /* translators: %s: payment id */ |
| 204 | - $subject = give_get_option( 'donation_notification_subject', sprintf( esc_html__( 'New Donation - Payment #%s', 'give' ), $payment_id ) ); |
|
| 204 | + $subject = give_get_option('donation_notification_subject', sprintf(esc_html__('New Donation - Payment #%s', 'give'), $payment_id)); |
|
| 205 | 205 | |
| 206 | 206 | /** |
| 207 | 207 | * Filters the donation notification subject. |
| 208 | 208 | * |
| 209 | 209 | * @since 1.0 |
| 210 | 210 | */ |
| 211 | - $subject = apply_filters( 'give_admin_donation_notification_subject', wp_strip_all_tags( $subject ), $payment_id ); |
|
| 212 | - $subject = give_do_email_tags( $subject, $payment_id ); |
|
| 211 | + $subject = apply_filters('give_admin_donation_notification_subject', wp_strip_all_tags($subject), $payment_id); |
|
| 212 | + $subject = give_do_email_tags($subject, $payment_id); |
|
| 213 | 213 | |
| 214 | - $headers = "From: " . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . " <$from_email>\r\n"; |
|
| 215 | - $headers .= "Reply-To: " . $from_email . "\r\n"; |
|
| 214 | + $headers = "From: ".stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8'))." <$from_email>\r\n"; |
|
| 215 | + $headers .= "Reply-To: ".$from_email."\r\n"; |
|
| 216 | 216 | //$headers .= "MIME-Version: 1.0\r\n"; |
| 217 | 217 | $headers .= "Content-Type: text/html; charset=utf-8\r\n"; |
| 218 | 218 | |
@@ -221,28 +221,28 @@ discard block |
||
| 221 | 221 | * |
| 222 | 222 | * @since 1.0 |
| 223 | 223 | */ |
| 224 | - $headers = apply_filters( 'give_admin_donation_notification_headers', $headers, $payment_id, $payment_data ); |
|
| 224 | + $headers = apply_filters('give_admin_donation_notification_headers', $headers, $payment_id, $payment_data); |
|
| 225 | 225 | |
| 226 | 226 | /** |
| 227 | 227 | * Filters the donation notification email attachments. By default, there is no attachment but plugins can hook in to provide one more multiple. |
| 228 | 228 | * |
| 229 | 229 | * @since 1.0 |
| 230 | 230 | */ |
| 231 | - $attachments = apply_filters( 'give_admin_donation_notification_attachments', array(), $payment_id, $payment_data ); |
|
| 231 | + $attachments = apply_filters('give_admin_donation_notification_attachments', array(), $payment_id, $payment_data); |
|
| 232 | 232 | |
| 233 | - $message = give_get_donation_notification_body_content( $payment_id, $payment_data ); |
|
| 233 | + $message = give_get_donation_notification_body_content($payment_id, $payment_data); |
|
| 234 | 234 | |
| 235 | 235 | $emails = Give()->emails; |
| 236 | - $emails->__set( 'from_name', $from_name ); |
|
| 237 | - $emails->__set( 'from_email', $from_email ); |
|
| 238 | - $emails->__set( 'headers', $headers ); |
|
| 239 | - $emails->__set( 'heading', esc_html__( 'New Donation!', 'give' ) ); |
|
| 236 | + $emails->__set('from_name', $from_name); |
|
| 237 | + $emails->__set('from_email', $from_email); |
|
| 238 | + $emails->__set('headers', $headers); |
|
| 239 | + $emails->__set('heading', esc_html__('New Donation!', 'give')); |
|
| 240 | 240 | |
| 241 | - $emails->send( give_get_admin_notice_emails(), $subject, $message, $attachments ); |
|
| 241 | + $emails->send(give_get_admin_notice_emails(), $subject, $message, $attachments); |
|
| 242 | 242 | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | -add_action( 'give_admin_donation_email', 'give_admin_email_notice', 10, 2 ); |
|
| 245 | +add_action('give_admin_donation_email', 'give_admin_email_notice', 10, 2); |
|
| 246 | 246 | |
| 247 | 247 | /** |
| 248 | 248 | * Retrieves the emails for which admin notifications are sent to (these can be changed in the Give Settings). |
@@ -252,12 +252,12 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | function give_get_admin_notice_emails() { |
| 254 | 254 | |
| 255 | - $email_option = give_get_option( 'admin_notice_emails' ); |
|
| 255 | + $email_option = give_get_option('admin_notice_emails'); |
|
| 256 | 256 | |
| 257 | - $emails = ! empty( $email_option ) && strlen( trim( $email_option ) ) > 0 ? $email_option : get_bloginfo( 'admin_email' ); |
|
| 258 | - $emails = array_map( 'trim', explode( "\n", $emails ) ); |
|
| 257 | + $emails = ! empty($email_option) && strlen(trim($email_option)) > 0 ? $email_option : get_bloginfo('admin_email'); |
|
| 258 | + $emails = array_map('trim', explode("\n", $emails)); |
|
| 259 | 259 | |
| 260 | - return apply_filters( 'give_admin_notice_emails', $emails ); |
|
| 260 | + return apply_filters('give_admin_notice_emails', $emails); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
@@ -269,11 +269,11 @@ discard block |
||
| 269 | 269 | * |
| 270 | 270 | * @return mixed |
| 271 | 271 | */ |
| 272 | -function give_admin_notices_disabled( $payment_id = 0 ) { |
|
| 272 | +function give_admin_notices_disabled($payment_id = 0) { |
|
| 273 | 273 | |
| 274 | 274 | return apply_filters( |
| 275 | 275 | 'give_admin_notices_disabled', |
| 276 | - ! give_is_setting_enabled( give_get_option( 'admin_notices' ) ), |
|
| 276 | + ! give_is_setting_enabled(give_get_option('admin_notices')), |
|
| 277 | 277 | $payment_id |
| 278 | 278 | ); |
| 279 | 279 | } |
@@ -288,19 +288,19 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | function give_get_default_donation_notification_email() { |
| 290 | 290 | |
| 291 | - $default_email_body = esc_html__( 'Hi there,', 'give' ) . "\n\n"; |
|
| 292 | - $default_email_body .= esc_html__( 'This email is to inform you that a new donation has been made on your website:', 'give' ) . ' <a href="' . get_bloginfo( 'url' ) . '" target="_blank">' . get_bloginfo( 'url' ) . '</a>' . ".\n\n"; |
|
| 293 | - $default_email_body .= '<strong>' . esc_html__( 'Donor:', 'give' ) . '</strong> {name}' . "\n"; |
|
| 294 | - $default_email_body .= '<strong>' . esc_html__( 'Donation:', 'give' ) . '</strong> {donation}' . "\n"; |
|
| 295 | - $default_email_body .= '<strong>' . esc_html__( 'Amount:', 'give' ) . '</strong> {amount}' . "\n"; |
|
| 296 | - $default_email_body .= '<strong>' . esc_html__( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n\n"; |
|
| 297 | - $default_email_body .= esc_html__( 'Thank you,', 'give' ) . "\n\n"; |
|
| 298 | - $default_email_body .= '{sitename}' . "\n"; |
|
| 291 | + $default_email_body = esc_html__('Hi there,', 'give')."\n\n"; |
|
| 292 | + $default_email_body .= esc_html__('This email is to inform you that a new donation has been made on your website:', 'give').' <a href="'.get_bloginfo('url').'" target="_blank">'.get_bloginfo('url').'</a>'.".\n\n"; |
|
| 293 | + $default_email_body .= '<strong>'.esc_html__('Donor:', 'give').'</strong> {name}'."\n"; |
|
| 294 | + $default_email_body .= '<strong>'.esc_html__('Donation:', 'give').'</strong> {donation}'."\n"; |
|
| 295 | + $default_email_body .= '<strong>'.esc_html__('Amount:', 'give').'</strong> {amount}'."\n"; |
|
| 296 | + $default_email_body .= '<strong>'.esc_html__('Payment Method:', 'give').'</strong> {payment_method}'."\n\n"; |
|
| 297 | + $default_email_body .= esc_html__('Thank you,', 'give')."\n\n"; |
|
| 298 | + $default_email_body .= '{sitename}'."\n"; |
|
| 299 | 299 | |
| 300 | - $custom_message = give_get_option( 'donation_notification' ); |
|
| 301 | - $message = ! empty( $custom_message ) ? $custom_message : $default_email_body; |
|
| 300 | + $custom_message = give_get_option('donation_notification'); |
|
| 301 | + $message = ! empty($custom_message) ? $custom_message : $default_email_body; |
|
| 302 | 302 | |
| 303 | - return apply_filters( 'give_default_donation_notification_email', $message ); |
|
| 303 | + return apply_filters('give_default_donation_notification_email', $message); |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | |
@@ -314,25 +314,25 @@ discard block |
||
| 314 | 314 | */ |
| 315 | 315 | function give_get_default_donation_receipt_email() { |
| 316 | 316 | |
| 317 | - $default_email_body = esc_html__( 'Dear', 'give' ) . " {name},\n\n"; |
|
| 318 | - $default_email_body .= esc_html__( 'Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give' ) . "\n\n"; |
|
| 319 | - $default_email_body .= '<strong>' . esc_html__( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n"; |
|
| 320 | - $default_email_body .= '<strong>' . esc_html__( 'Donation:', 'give' ) . '</strong> {donation}' . "\n"; |
|
| 321 | - $default_email_body .= '<strong>' . esc_html__( 'Donation Date:', 'give' ) . '</strong> {date}' . "\n"; |
|
| 322 | - $default_email_body .= '<strong>' . esc_html__( 'Amount:', 'give' ) . '</strong> {amount}' . "\n"; |
|
| 323 | - $default_email_body .= '<strong>' . esc_html__( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n"; |
|
| 324 | - $default_email_body .= '<strong>' . esc_html__( 'Payment ID:', 'give' ) . '</strong> {payment_id}' . "\n"; |
|
| 325 | - $default_email_body .= '<strong>' . esc_html__( 'Receipt ID:', 'give' ) . '</strong> {receipt_id}' . "\n\n"; |
|
| 326 | - $default_email_body .= '{receipt_link}' . "\n\n"; |
|
| 317 | + $default_email_body = esc_html__('Dear', 'give')." {name},\n\n"; |
|
| 318 | + $default_email_body .= esc_html__('Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give')."\n\n"; |
|
| 319 | + $default_email_body .= '<strong>'.esc_html__('Donor:', 'give').'</strong> {fullname}'."\n"; |
|
| 320 | + $default_email_body .= '<strong>'.esc_html__('Donation:', 'give').'</strong> {donation}'."\n"; |
|
| 321 | + $default_email_body .= '<strong>'.esc_html__('Donation Date:', 'give').'</strong> {date}'."\n"; |
|
| 322 | + $default_email_body .= '<strong>'.esc_html__('Amount:', 'give').'</strong> {amount}'."\n"; |
|
| 323 | + $default_email_body .= '<strong>'.esc_html__('Payment Method:', 'give').'</strong> {payment_method}'."\n"; |
|
| 324 | + $default_email_body .= '<strong>'.esc_html__('Payment ID:', 'give').'</strong> {payment_id}'."\n"; |
|
| 325 | + $default_email_body .= '<strong>'.esc_html__('Receipt ID:', 'give').'</strong> {receipt_id}'."\n\n"; |
|
| 326 | + $default_email_body .= '{receipt_link}'."\n\n"; |
|
| 327 | 327 | $default_email_body .= "\n\n"; |
| 328 | - $default_email_body .= esc_html__( 'Sincerely,', 'give' ) . "\n"; |
|
| 329 | - $default_email_body .= '{sitename}' . "\n"; |
|
| 328 | + $default_email_body .= esc_html__('Sincerely,', 'give')."\n"; |
|
| 329 | + $default_email_body .= '{sitename}'."\n"; |
|
| 330 | 330 | |
| 331 | - $custom_message = give_get_option( 'donation_receipt' ); |
|
| 331 | + $custom_message = give_get_option('donation_receipt'); |
|
| 332 | 332 | |
| 333 | - $message = ! empty( $custom_message ) ? $custom_message : $default_email_body; |
|
| 333 | + $message = ! empty($custom_message) ? $custom_message : $default_email_body; |
|
| 334 | 334 | |
| 335 | - return apply_filters( 'give_default_donation_receipt_email', $message ); |
|
| 335 | + return apply_filters('give_default_donation_receipt_email', $message); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /** |
@@ -344,19 +344,19 @@ discard block |
||
| 344 | 344 | * |
| 345 | 345 | * @return array $email_names |
| 346 | 346 | */ |
| 347 | -function give_get_email_names( $user_info ) { |
|
| 347 | +function give_get_email_names($user_info) { |
|
| 348 | 348 | $email_names = array(); |
| 349 | - $user_info = maybe_unserialize( $user_info ); |
|
| 349 | + $user_info = maybe_unserialize($user_info); |
|
| 350 | 350 | |
| 351 | 351 | $email_names['fullname'] = ''; |
| 352 | - if ( isset( $user_info['id'] ) && $user_info['id'] > 0 && isset( $user_info['first_name'] ) ) { |
|
| 353 | - $user_data = get_userdata( $user_info['id'] ); |
|
| 352 | + if (isset($user_info['id']) && $user_info['id'] > 0 && isset($user_info['first_name'])) { |
|
| 353 | + $user_data = get_userdata($user_info['id']); |
|
| 354 | 354 | $email_names['name'] = $user_info['first_name']; |
| 355 | - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
| 355 | + $email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name']; |
|
| 356 | 356 | $email_names['username'] = $user_data->user_login; |
| 357 | - } elseif ( isset( $user_info['first_name'] ) ) { |
|
| 357 | + } elseif (isset($user_info['first_name'])) { |
|
| 358 | 358 | $email_names['name'] = $user_info['first_name']; |
| 359 | - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
| 359 | + $email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name']; |
|
| 360 | 360 | $email_names['username'] = $user_info['first_name']; |
| 361 | 361 | } else { |
| 362 | 362 | $email_names['name'] = $user_info['email']; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @since 1.0 |
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | -add_action( 'give_manual_cc_form', '__return_false' ); |
|
| 23 | +add_action('give_manual_cc_form', '__return_false'); |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Processes the donation data and uses the Manual Payment gateway to record |
@@ -32,17 +32,17 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @return void |
| 34 | 34 | */ |
| 35 | -function give_manual_payment( $purchase_data ) { |
|
| 35 | +function give_manual_payment($purchase_data) { |
|
| 36 | 36 | |
| 37 | - if ( ! wp_verify_nonce( $purchase_data['gateway_nonce'], 'give-gateway' ) ) { |
|
| 38 | - wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
| 37 | + if ( ! wp_verify_nonce($purchase_data['gateway_nonce'], 'give-gateway')) { |
|
| 38 | + wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | //Create payment_data array |
| 42 | 42 | $payment_data = array( |
| 43 | 43 | 'price' => $purchase_data['price'], |
| 44 | 44 | 'give_form_title' => $purchase_data['post_data']['give-form-title'], |
| 45 | - 'give_form_id' => intval( $purchase_data['post_data']['give-form-id'] ), |
|
| 45 | + 'give_form_id' => intval($purchase_data['post_data']['give-form-id']), |
|
| 46 | 46 | 'give_price_id' => isset($purchase_data['post_data']['give-price-id']) ? $purchase_data['post_data']['give-price-id'] : '', |
| 47 | 47 | 'date' => $purchase_data['date'], |
| 48 | 48 | 'user_email' => $purchase_data['user_email'], |
@@ -52,24 +52,24 @@ discard block |
||
| 52 | 52 | 'status' => 'pending' |
| 53 | 53 | ); |
| 54 | 54 | // Record the pending payment |
| 55 | - $payment = give_insert_payment( $payment_data ); |
|
| 55 | + $payment = give_insert_payment($payment_data); |
|
| 56 | 56 | |
| 57 | - if ( $payment ) { |
|
| 58 | - give_update_payment_status( $payment, 'publish' ); |
|
| 57 | + if ($payment) { |
|
| 58 | + give_update_payment_status($payment, 'publish'); |
|
| 59 | 59 | give_send_to_success_page(); |
| 60 | 60 | } else { |
| 61 | 61 | give_record_gateway_error( |
| 62 | - esc_html__( 'Payment Error', 'give' ), |
|
| 62 | + esc_html__('Payment Error', 'give'), |
|
| 63 | 63 | sprintf( |
| 64 | 64 | /* translators: %s: payment data */ |
| 65 | - esc_html__( 'The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give' ), |
|
| 66 | - json_encode( $payment_data ) |
|
| 65 | + esc_html__('The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give'), |
|
| 66 | + json_encode($payment_data) |
|
| 67 | 67 | ), |
| 68 | 68 | $payment |
| 69 | 69 | ); |
| 70 | 70 | // If errors are present, send the user back to the donation page so they can be corrected |
| 71 | - give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] ); |
|
| 71 | + give_send_back_to_checkout('?payment-mode='.$purchase_data['post_data']['give-gateway']); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | -add_action( 'give_gateway_manual', 'give_manual_payment' ); |
|
| 75 | +add_action('give_gateway_manual', 'give_manual_payment'); |
|
@@ -9,11 +9,11 @@ discard block |
||
| 9 | 9 | * @since 1.8 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 12 | +if ( ! defined('ABSPATH')) { |
|
| 13 | 13 | exit; // Exit if accessed directly |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! class_exists( 'Give_Settings_License' ) ) : |
|
| 16 | +if ( ! class_exists('Give_Settings_License')) : |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Give_Settings_License. |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function __construct() { |
| 45 | 45 | $this->id = 'licenses'; |
| 46 | - $this->label = esc_html__( 'Licenses', 'give' ); |
|
| 46 | + $this->label = esc_html__('Licenses', 'give'); |
|
| 47 | 47 | |
| 48 | - add_filter( 'give-settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
| 49 | - add_action( "give-settings_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
| 48 | + add_filter('give-settings_tabs_array', array($this, 'add_settings_page'), 20); |
|
| 49 | + add_action("give-settings_settings_{$this->id}_page", array($this, 'output')); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | * @param array $pages Lst of pages. |
| 57 | 57 | * @return array |
| 58 | 58 | */ |
| 59 | - public function add_settings_page( $pages ) { |
|
| 59 | + public function add_settings_page($pages) { |
|
| 60 | 60 | $setting = $this->get_settings(); |
| 61 | 61 | // Bailout: Do not add licenses setting tab if it does not contain any setting fields. |
| 62 | - if( ! empty( $setting ) ) { |
|
| 63 | - $pages[ $this->id ] = $this->label; |
|
| 62 | + if ( ! empty($setting)) { |
|
| 63 | + $pages[$this->id] = $this->label; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return $pages; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * Filter the licenses settings. |
| 80 | 80 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
| 81 | 81 | */ |
| 82 | - $settings = apply_filters( 'give_settings_licenses', $settings ); |
|
| 82 | + $settings = apply_filters('give_settings_licenses', $settings); |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Filter the settings. |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * @since 1.8 |
| 88 | 88 | * @param array $settings |
| 89 | 89 | */ |
| 90 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
| 90 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
| 91 | 91 | |
| 92 | 92 | // Output. |
| 93 | 93 | return $settings; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | public function output() { |
| 103 | 103 | $settings = $this->get_settings(); |
| 104 | 104 | |
| 105 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
| 105 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -9,11 +9,11 @@ discard block |
||
| 9 | 9 | * @since 1.8 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 12 | +if ( ! defined('ABSPATH')) { |
|
| 13 | 13 | exit; // Exit if accessed directly |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! class_exists( 'Give_Settings_Addon' ) ) : |
|
| 16 | +if ( ! class_exists('Give_Settings_Addon')) : |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Give_Settings_Addon. |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct() { |
| 28 | 28 | $this->id = 'addons'; |
| 29 | - $this->label = esc_html__( 'Add-ons', 'give' ); |
|
| 29 | + $this->label = esc_html__('Add-ons', 'give'); |
|
| 30 | 30 | |
| 31 | 31 | parent::__construct(); |
| 32 | 32 | } |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | * @param $setting_tab |
| 39 | 39 | * @return string |
| 40 | 40 | */ |
| 41 | - function set_default_setting_tab( $setting_tab ) { |
|
| 41 | + function set_default_setting_tab($setting_tab) { |
|
| 42 | 42 | $default_tab = ''; |
| 43 | 43 | |
| 44 | 44 | // Set default tab to first setting tab. |
| 45 | - if( $sections = array_keys( $this->get_sections() ) ) { |
|
| 46 | - $default_tab = current( $sections ); |
|
| 45 | + if ($sections = array_keys($this->get_sections())) { |
|
| 46 | + $default_tab = current($sections); |
|
| 47 | 47 | } |
| 48 | 48 | return $default_tab; |
| 49 | 49 | } |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | * @param array $pages Lst of pages. |
| 56 | 56 | * @return array |
| 57 | 57 | */ |
| 58 | - public function add_settings_page( $pages ) { |
|
| 58 | + public function add_settings_page($pages) { |
|
| 59 | 59 | $setting = $this->get_settings(); |
| 60 | 60 | // Bailout: Do not add addons setting tab if it does not contain any setting fields. |
| 61 | - if( ! empty( $setting ) ) { |
|
| 62 | - $pages[ $this->id ] = $this->label; |
|
| 61 | + if ( ! empty($setting)) { |
|
| 62 | + $pages[$this->id] = $this->label; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | return $pages; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * Filter the addons settings. |
| 79 | 79 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
| 80 | 80 | */ |
| 81 | - $settings = apply_filters( 'give_settings_addons', $settings ); |
|
| 81 | + $settings = apply_filters('give_settings_addons', $settings); |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * Filter the settings. |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @since 1.8 |
| 87 | 87 | * @param array $settings |
| 88 | 88 | */ |
| 89 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
| 89 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
| 90 | 90 | |
| 91 | 91 | // Output. |
| 92 | 92 | return $settings; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 13 | +if ( ! defined('ABSPATH')) {
|
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -22,19 +22,19 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | function give_add_shortcode_to_publish_metabox() {
|
| 24 | 24 | |
| 25 | - if ( 'give_forms' !== get_post_type() ) {
|
|
| 25 | + if ('give_forms' !== get_post_type()) {
|
|
| 26 | 26 | return false; |
| 27 | 27 | } |
| 28 | 28 | global $post; |
| 29 | 29 | |
| 30 | 30 | //Only enqueue scripts for CPT on post type screen |
| 31 | - if ( 'give_forms' === $post->post_type ) {
|
|
| 31 | + if ('give_forms' === $post->post_type) {
|
|
| 32 | 32 | //Shortcode column with select all input |
| 33 | - $shortcode = htmlentities( '[give_form id="' . $post->ID . '"]' ); |
|
| 34 | - echo '<div class="shortcode-wrap box-sizing"><label for="shortcode-input">' . esc_html__( 'Give Form Shortcode:', 'give' ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" name="shortcode-input" id="shortcode-input" class="shortcode-input" readonly value="' . $shortcode . '"></div>'; |
|
| 33 | + $shortcode = htmlentities('[give_form id="'.$post->ID.'"]');
|
|
| 34 | + echo '<div class="shortcode-wrap box-sizing"><label for="shortcode-input">'.esc_html__('Give Form Shortcode:', 'give').'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" name="shortcode-input" id="shortcode-input" class="shortcode-input" readonly value="'.$shortcode.'"></div>';
|
|
| 35 | 35 | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | -add_action( 'post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox' ); |
|
| 40 | +add_action('post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox');
|
|
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -24,14 +24,14 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @return string |
| 26 | 26 | */ |
| 27 | -function give_admin_rate_us( $footer_text ) { |
|
| 27 | +function give_admin_rate_us($footer_text) { |
|
| 28 | 28 | global $typenow; |
| 29 | 29 | |
| 30 | - if ( $typenow == 'give_forms' ) { |
|
| 30 | + if ($typenow == 'give_forms') { |
|
| 31 | 31 | $rate_text = sprintf( |
| 32 | 32 | /* translators: %s: Link to 5 star rating */ |
| 33 | - __( 'If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give' ), |
|
| 34 | - '<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" style="text-decoration:none;" data-rated="' . esc_attr__( 'Thanks :)', 'give' ) . '">★★★★★</a>' |
|
| 33 | + __('If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give'), |
|
| 34 | + '<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" style="text-decoration:none;" data-rated="'.esc_attr__('Thanks :)', 'give').'">★★★★★</a>' |
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | return $rate_text; |
@@ -40,4 +40,4 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -add_filter( 'admin_footer_text', 'give_admin_rate_us' ); |
|
| 43 | +add_filter('admin_footer_text', 'give_admin_rate_us'); |
|
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | * @see Give_Cron::weekly_events() |
| 35 | 35 | */ |
| 36 | 36 | public function __construct() { |
| 37 | - add_filter( 'cron_schedules', array( $this, 'add_schedules' ) ); |
|
| 38 | - add_action( 'wp', array( $this, 'schedule_Events' ) ); |
|
| 37 | + add_filter('cron_schedules', array($this, 'add_schedules')); |
|
| 38 | + add_action('wp', array($this, 'schedule_Events')); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -48,11 +48,11 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @return array An array of non-default cron schedules. |
| 50 | 50 | */ |
| 51 | - public function add_schedules( $schedules = array() ) { |
|
| 51 | + public function add_schedules($schedules = array()) { |
|
| 52 | 52 | // Adds once weekly to the existing schedules. |
| 53 | 53 | $schedules['weekly'] = array( |
| 54 | 54 | 'interval' => 604800, |
| 55 | - 'display' => esc_html__( 'Once Weekly', 'give' ) |
|
| 55 | + 'display' => esc_html__('Once Weekly', 'give') |
|
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | 58 | return $schedules; |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | * @return void |
| 81 | 81 | */ |
| 82 | 82 | private function weekly_events() { |
| 83 | - if ( ! wp_next_scheduled( 'give_weekly_scheduled_events' ) ) { |
|
| 84 | - wp_schedule_event( current_time( 'timestamp' ), 'weekly', 'give_weekly_scheduled_events' ); |
|
| 83 | + if ( ! wp_next_scheduled('give_weekly_scheduled_events')) { |
|
| 84 | + wp_schedule_event(current_time('timestamp'), 'weekly', 'give_weekly_scheduled_events'); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | * @return void |
| 95 | 95 | */ |
| 96 | 96 | private function daily_events() { |
| 97 | - if ( ! wp_next_scheduled( 'give_daily_scheduled_events' ) ) { |
|
| 98 | - wp_schedule_event( current_time( 'timestamp' ), 'daily', 'give_daily_scheduled_events' ); |
|
| 97 | + if ( ! wp_next_scheduled('give_daily_scheduled_events')) { |
|
| 98 | + wp_schedule_event(current_time('timestamp'), 'daily', 'give_daily_scheduled_events'); |
|
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |