This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function zeen101_redirect_user_after_login_by_level( $user_login, $user ) { | |
| $mode = leaky_paywall_get_current_mode(); | |
| $level_id = get_user_meta( $user->ID, '_issuem_leaky_paywall_' . $mode . '_level_id', true ); | |
| if ( $level_id == 0 ) { | |
| wp_redirect( home_url('sales-partner-portal') ); | |
| exit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'leaky_paywall_mailchimp_merge_fields', 'zeen101_custom_mailchimp_merge_fields', 10, 2 ); | |
| function zeen101_custom_mailchimp_merge_fields( $merge_fields, $email ) { | |
| $mode = leaky_paywall_get_current_mode(); | |
| $user = get_user_by( 'email', $email ); | |
| if ( !$user ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Change the word "Post" to "Article" in the Leaky Paywall - Article Countdown Nag add-on | |
| */ | |
| add_filter( 'leaky_paywall_acn_countdown_remaining_text', 'zeen101_change_countdown_remaining_text', 10, 2 ); | |
| function zeen101_change_countdown_remaining_text( $remaining_text, $post_id ) { | |
| return str_replace( 'Post', 'Article', $remaining_text ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'leaky_paywall_process_stripe_payment_customer_array', 'zeen101_add_meta_to_stripe_customer' ); | |
| function zeen101_add_meta_to_stripe_customer( $customer_array ) { | |
| $location = sanitize_text_field( $_POST['location'] ); | |
| if ( $location ) { | |
| $customer_array['metadata'] = array( | |
| 'location' => $location, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'leaky_paywall_filter_is_restricted', 'zeen101_allow_access_for_category', 10, 3 ); | |
| function zeen101_allow_access_for_category( $is_restricted, $restriction_settings, $post_id ) { | |
| if ( !is_single( $post_id ) ) { | |
| return $is_restricted; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'leaky_paywall_filter_is_restricted', 'zeen101_check_meter_bypass', 10, 3 ); | |
| function zeen101_check_meter_bypass( $is_restricted, $restriction_settings, $post_id ) { | |
| $bypass_value = 'utm_source=My+Site'; | |
| $referrer = $_SERVER['HTTP_REFERER']; | |
| if ( $referrer ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $terms = get_terms( array( | |
| 'taxonomy' => 'issuem_issue', | |
| 'hide_empty' => false, | |
| ) ); | |
| $num = 4; | |
| shuffle( $terms ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'leaky_paywall_after_update_stripe_subscription', 'zeen101_charge_proration_after_upgrade', 10, 3 ); | |
| function zeen101_charge_proration_after_upgrade( $cu, $sub, $level ) { | |
| $invoice_items = \Stripe\InvoiceItem::all(["limit" => 3]); | |
| foreach( $invoice_items->data as $item ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'leaky_paywall_cancelled_subscriber', 'zeen101_send_admin_cancel_notification_email', 10, 2 ); | |
| function zeen101_send_admin_cancel_notification_email( $user, $gateway ) { | |
| $mode = leaky_paywall_get_current_mode(); | |
| $level_id = get_user_meta( $user->ID, '_issuem_leaky_paywall_' . $mode . '_level_id', true ); | |
| $levels = leaky_paywall_get_levels(); | |