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 | |
// use the leaky_paywall_new_subscriber action to do something with the new user data after they are added to the WordPress user table | |
add_action( 'leaky_paywall_new_subscriber', 'lp_add_new_user_to_third_party_api', 20, 5 ); | |
function lp_add_new_user_to_third_party_api( $user_id, $email, $meta, $customer_id, $meta_args ) { | |
// replace with the specific API data needed by your third party system (mailchimp, emma, etc.) | |
$api_key = 'yourkeyhere'; | |
$url = 'https://www.yourapiurl.com/resourcepath?key=' . $api_key; |
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_userdata_before_user_create', 'zeen101_force_email_for_new_user' ); | |
function zeen101_force_email_for_new_user( $userdata ) { | |
$userdata['user_login'] = $userdata['user_email']; | |
return $userdata; | |
} |
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_subscription_options_allowed_content', 'zeen101_show_level_benefits_on_card', 10, 3 ); | |
function zeen101_show_level_benefits_on_card( $allowed_content, $level_id, $level ) { | |
switch ( $level_id ) { | |
case 0: | |
$output = '<ul>'; | |
$output .= '<li>Gold Benfit #1</li>'; |
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_current_user_can_view_all_content', 'zeen101_allow_access_leaky_paywall_content_by_cap' ); | |
function zeen101_allow_access_leaky_paywall_content_by_cap( $capability ) { | |
// for contributors | |
$capability = 'delete_posts'; | |
// for authors |
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( 'woocommerce_cart_calculate_fees','endo_handling_fee' ); | |
function endo_handling_fee() { | |
global $woocommerce; | |
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
return; | |
$subtotal = $woocommerce->cart->subtotal; | |
$fee_percentage = 0.1; // 10 percent |
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 | |
public function create_blog_post() { | |
$blog_title = isset( $_POST['blog_title']) ? wp_strip_all_tags( $_POST['blog_title'] ) : ''; | |
$blog_description = isset($_POST['blog_description']) ? strip_tags( $_POST['blog_description'] ) : ''; | |
$tags = isset($_POST['blog_tags']) ? strip_tags( $_POST['blog_tags'] ) : ''; | |
if ( !$blog_title || !$blog_description ) { | |
return; |
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
<a class="morebtn" onclick="ga('send', 'event', { eventCategory: 'Download', eventAction: 'PDF', eventLabel: 'Brainstorming-Home-Business-Ideas-with-Traveling-Vineyard.pdf'});" target="_blank" href="http://www.travelingvineyard.com/wp-content/uploads/2014/12/Brainstorming-Home-Business-Ideas-with-Traveling-Vineyard.pdf">Download PDF</a> |
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( 'gform_field_value_default_quantity', 'endo_set_default_quantity' ); | |
function endo_set_default_quantity() { | |
return 1; // change this number to whatever you want the default quantity to be | |
} |
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 | |
$details = array( | |
'Garage Capacity' => get_post_meta( get_the_ID(), '_listing_garage_capacity', true ), | |
'Garage Type' => get_post_meta( get_the_ID(), '_listing_garage_type', true ), | |
'Heating' => get_post_meta( get_the_ID(), '_listing_heating', true ), | |
'Cooling' => get_post_meta( get_the_ID(), '_listing_cooling', true ), | |
'Basement' => get_post_meta( get_the_ID(), '_listing_basement', true ), | |
'Water Frontage' => get_post_meta( get_the_ID(), '_listing_water_frontage', true ), | |
'Deeded Acres' => get_post_meta( get_the_ID(), '_listing_deeded_acres', true ), |
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 leaky_paywall_register_2checkout_gateway( $gateways ) { | |
$gateways['2checkout'] = array( | |
'label' => '2Checkout', | |
'admin_label' => '2Checkout Credit / Debit Card', | |
'class' => 'Leaky_Paywall_Payment_Gateway_2checkout' | |
); | |
return $gateways; |