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 pmpro_redirect_after_login( $redirect_to, $request, $user ) { | |
if ( ! empty( $user ) && ! empty( $user->ID ) && function_exists( 'pmpro_getMembershipLevelForUser' ) ) { | |
$level = pmpro_getMembershipLevelForUser( $user->ID ); | |
if ( 1 == $level ) { | |
$redirect_to = home_url(); | |
} | |
} | |
return $redirect_to; | |
} |
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 pmpro_level_cost_text_son( $text ) { | |
$text = str_replace( ' maintenant', '', $text ); | |
return $text; | |
} | |
add_filter( 'pmpro_level_cost_text', 'pmpro_level_cost_text_son', 10, 1 ); |
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 | |
global $pmprosm_sponsored_account_levels; | |
$pmprosm_sponsored_account_levels = array( | |
6 => array( | |
'main_level_id' => 6, //redundant but useful | |
'sponsored_level_id' => array(7), //array or single id | |
'seats' => 100 | |
), | |
); |
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 pmpro_invoice_code_helfer( $code ) { | |
$invoice_code = get_option( 'pmpro_helfer_invoice_code', array() ); | |
if ( empty( $invoice_code ) ) { | |
$invoice_code = array( | |
'prefix' => 'IAW', | |
'increment' => 1, | |
); | |
update_option( 'pmpro_helfer_invoice_code', $invoice_code ); | |
} |
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 pmpro_renew_smk() { | |
if ( ! is_user_logged_in() ) { | |
return; | |
} | |
?> | |
<div id="custom_renew_message" class="alert">This is a custom renew message shown to the user.</div> | |
<?php | |
} | |
add_action( 'pmpro_checkout_after_level_cost', 'pmpro_renew_smk' ); |
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 | |
// We have to put everything in a function called on init, so we are sure Register Helper is loaded. | |
function pmpro_register_field_trialsofg_init() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; | |
} | |
pmprorh_add_checkout_box( 'company', 'Company Information' ); | |
// Define the fields. |
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 | |
// We have to put everything in a function called on init, so we are sure Register Helper is loaded. | |
function pmpro_register_field_peakbagger_init() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; | |
} | |
pmprorh_add_checkout_box( 'contact', 'Contact Information' ); | |
pmprorh_add_checkout_box( 'emergency', 'Emergency Contact Information' ); |
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 | |
/** | |
* Plugin Name: My PMPro Directory Widget | |
* Description: Add widget to Member Directory page to filter results. | |
*/ | |
class My_PMPro_Directory_Widget extends WP_Widget { | |
/** | |
* Sets up the widget | |
*/ |
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 pmpro_invite_approval_message() { | |
if ( is_user_logged_in() ) { | |
global $current_user; | |
$user_id = $current_user->ID; | |
if ( ! PMPro_Approvals::isApproved( $user_id, 1 ) ) { // 1 is the membership level. | |
remove_filter( "pmpro_confirmation_message", "pmproio_pmpro_confirmation_message" ); | |
remove_filter('the_content', 'pmproio_the_content_account_page', 20, 1); | |
} | |
} |
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 pmpro_prorated_checkout_level( $level ) { | |
// 5 is the membership level ID. | |
if ( 5 === absint( $level->id ) ) { | |
$price_per_day = $level->initial_payment / 365.2425; // 365.2425 is the days in a year | |
// Get timestamp for end of year and current timestamp. | |
$end_date_timestamp = strtotime( 'first day of january next year' ); | |
$current_date_timestamp = time(); |