Skip to content

Instantly share code, notes, and snippets.

🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
Block or report user

Report or block MaryOJob

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pmpro_customizations_gift_levels_example.php
<?php // do not copy this line please
/* PMPro Gift Levels Example */
global $pmprogl_gift_levels;
$pmprogl_gift_levels = array(
// Set level 1 as a "Purchase Gift" membership level to create a gift code for a free level 2 gift.
1 => array( // "Purchase Gift" level ID
'level_id' => 2, // Membership Level ID of the gift membership level.
@MaryOJob
MaryOJob / my_caldera_nigeria_country_code.php
Created Feb 9, 2020
Set the default country code to Nigeria for Caldera Forms
View my_caldera_nigeria_country_code.php
<?php // do not copy this line
add_filter( 'caldera_forms_phone_js_options', function( $options){
//Use ISO_3166-1_alpha-2 formatted country code
$options[ 'initialCountry' ] = 'NG';
return $options;
});
View my_pmpro_default_registration_level.php
<?php // do not copy this line
/**
* When registering, add the member to a specific membership level
* @param integer $user_id
**/
//Disables the pmpro redirect to levels page when user tries to register
add_filter("pmpro_login_redirect", "__return_false");
function my_pmpro_default_registration_level($user_id) {
@MaryOJob
MaryOJob / show_buddypress_email_on_xprofile_page.php
Created Jan 16, 2020
Show WordPress email on BuddyPress user xprofiles page
View show_buddypress_email_on_xprofile_page.php
<?php // do not copy this line, doing so will give you a fatal error when you run this script
/*
If you are using this code, please be aware of privacy laws in your region and also beware of spambots harvesting your users'
emails from your website.
*/
function tiquality_add_custom_field() {
if ( bp_is_active( 'xprofile' ) ) :
@MaryOJob
MaryOJob / my_pmpro_sponsored_members_charge_recievers.php
Last active Jan 22, 2020
Allows sponsored recipients to individually pay for the seats given by their sponsored giver.
View my_pmpro_sponsored_members_charge_recievers.php
<?php
/* This codes requires you to have the sponsored Members Add On up and configured.
This code should also be added together with your configured sponsored members code in your PMPro customizations Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
This script is an example that allows level 2 to purchase 5 membership accounts for level 3 but
have level 3 individualy pay $20 for their membership accounts.
Please see the add on guide for more attributes that can be configured for your sponsored members add on here: https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
*/
global $pmprosm_sponsored_account_levels;
@MaryOJob
MaryOJob / my_pmpro_login_redirect_url.php
Created Jan 15, 2020 — forked from travislima/my_pmpro_login_redirect_url.php
Redirect on login if user has any failed payments. (Requires Paid Memberships Pro Failed Payment Limit Add On)
View my_pmpro_login_redirect_url.php
<?php
/*
* Redirect on login if user has any failed payments. (Requires Paid Memberships Pro Failed Payment Limit Add On)
* Adjust the code on the line the line "site_url( ' payment-failed')" to redirect to page of your prefereance.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_login_redirect_url( $url, $request, $user ) {
@MaryOJob
MaryOJob / pmprosm_sponsored_account_levels.php
Last active Jan 14, 2020 — forked from ideadude/pmprosm_sponsored_account_levels.php
Example global settings for the PMPro Sponsored Members Add On
View pmprosm_sponsored_account_levels.php
<?php
/*
Define the global array below for your main accounts and sponsored levels.
Array keys should be the main account level.
*/
$pmprosm_sponsored_account_levels = array(
/*
@MaryOJob
MaryOJob / my_pmpro_add_addtional_field_to_register_helper.php
Last active Feb 6, 2020
Already have Register Helper Fields Created and want to Add more fields to it - Use this script to Add to existing Customization
View my_pmpro_add_addtional_field_to_register_helper.php
<?php
/**
* Please only add this script if you have previously added a custom field to your Register Helper and you need to add another field
*/
$fields = array(); // this line should not be added a second time if you have previously declared it which i believe you have if you are trying to use this code recipe
$fields[] = new PMProRH_Field(
'field_name', // input name, will also be used as meta key
'text', // type of field
@MaryOJob
MaryOJob / my_pmpro_custom_select_and_text_fields_to_register_helper.php
Last active Jan 6, 2020
Adding A Custom Field (Select & Text) to Register Helper
View my_pmpro_custom_select_and_text_fields_to_register_helper.php
<?php
/**
* Register Helper example for a select and text field.
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprorh_init() {
//don't break if Register Helper is not loaded
if(!function_exists( "pmprorh_add_registration_field" )) {
@MaryOJob
MaryOJob / my_pmpro_sync_xprofile_to_member_directory.php
Last active Dec 20, 2019
Sync XProfile Fields with PMPro Members Directory using Register Helper
View my_pmpro_sync_xprofile_to_member_directory.php
<?php
/**
* Based on the Register Helper example.
* We've added a "buddypress" option for each field
* set to the XProfile name we used when setting up
* the fields in the BuddyPress extended profile.
* If the PMPro BuddyPress Add On is activated
* then the fields will be synchronized.
* Register Helper: https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
You can’t perform that action at this time.