Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@MaryOJob
MaryOJob / pmprowoo_redirect_member.php
Last active Dec 4, 2020 — forked from andrewlimaza/pmproc_redirect_member.php
Redirect logged in members on level "1" away from the Shop and Contact page, to a custom page you have created.
View pmprowoo_redirect_member.php
<?php // Do no copy this line
//Copy lines 5 onwards into your PMPro custom plugin -> http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
function pmprowoo_redirect_member(){
if( is_user_logged_in() && function_exists('pmpro_hasMembershipLevel') && pmpro_hasMembershipLevel() ){ //check if user is logged in, pmpro is installed and user has an active level.
global $current_user;
$current_user->membership_level = pmpro_getMembershipLevelForUser($current_user->ID); //get current users level ID
@MaryOJob
MaryOJob / my-pmprorh-avatar-and-logo.php
Last active Nov 27, 2020 — forked from ipokkel/my-pmprorh-avatar-and-logo.php
User avatar using PMPro Register Helper
View my-pmprorh-avatar-and-logo.php
<?php // Do NOT copy this line
/*
* Add WP User Avatar from Register Helper field during checkout.
*/
add_action( 'added_user_meta', 'my_updated_user_meta', 10, 4 );
add_action( 'updated_user_meta', 'my_updated_user_meta', 10, 4 );
function my_updated_user_meta( $meta_id, $user_id, $meta_key, $meta_value ) {
// Change user_avatar to your Register Helper file upload name.
@MaryOJob
MaryOJob / adjust_pmpro_email_according_to_level.php
Created Nov 3, 2020 — forked from andrewlimaza/adjust_pmpro_email_according_to_level.php
Change confirmation email contents in Paid Memberships Pro according to user level checkout.
View adjust_pmpro_email_according_to_level.php
<?php
/**
* Adjust email template according to user's level that they are checking out for.
* Add this code to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* For more information in customizing emails in Paid Memberships Pro visit - https://www.paidmembershipspro.com/documentation/member-communications/customizing-email-templates/
* List of available email templates - https://www.paidmembershipspro.com/documentation/member-communications/list-of-pmpro-email-templates/
*/
function adjust_pmpro_email_according_to_level( $email ){
@MaryOJob
MaryOJob / a-gettext-filter-4-pmpro.php
Last active Sep 22, 2020 — forked from pbrocks/a-gettext-filter-4-pmpro.php
Sometimes we may want to change the wording of the language used in a plugin or theme, but don't want to edit code directly. A cleaner way to go is to use the built in filter that WordPress has called 'gettext'. This filter will search your codebase for translatable strings and replace when an exact match is found.
View a-gettext-filter-4-pmpro.php
<?php // Do not copy this line
/**
* This filter will search your codebase for translatable strings and replace when an exact match is found.
*
* Here we're changing 'Membership' to 'Subscription' for Paid Memberships Pro.
*
* Add this code to your PMPro Customizations Plugin
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above.
*
View pmpro account page edit
// overwite the account shortcode
function overwite_pmpro_shortcode_account($atts, $content=null, $code="")
{
global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
// $atts ::= array of attributes
// $content ::= text within enclosing form of shortcode element
// $code ::= the shortcode found, when == callback name
// examples: [pmpro_account] [pmpro_account sections="membership,profile"/]
@MaryOJob
MaryOJob / pmpro-australia-gst.php
Created Sep 10, 2020 — forked from strangerstudios/pmpro-australia-gst.php
Paid Memberships Pro - Australia GST
View pmpro-australia-gst.php
<?php
/*
Plugin Name: Paid Memberships Pro - Australia GST
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-australia-gst/
Description: Apply Australia GST to Checkouts with PMPro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
/*
@MaryOJob
MaryOJob / my-default-wp-user-bio-checkout-fields.php
Last active Nov 2, 2020 — forked from ipokkel/my-default-wp-user-checkout-fields.php
Capture default user profile 'Biography' field (Biographical Info) at Membership Checkout using Register Helper and save with custom callback using save_function for RH
View my-default-wp-user-bio-checkout-fields.php
<?php
/**
* This recipe adds Biographical Info to the Membership Checkout.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@MaryOJob
MaryOJob / pmpro-restrict-email-levels.php
Last active Aug 12, 2020 — forked from ronalfy/pmpro-restrict-email-level.php
Paid Memberships Pro - Restrict Email for More Than One Level
View pmpro-restrict-email-levels.php
<?php // Do not copy this line
/**
* Restrict Membership Signup by Email Domain
* Make sure to edit the $valid_domains array defined further below
* to include only the domains you'd like to allow.
*
* Add this code to a custom plugin. More info: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@MaryOJob
MaryOJob / pmpro-rh-ec-fields.php
Created Aug 10, 2020 — forked from ronalfy/pmpro-rh-ec-fields.php
Paid Memberships Pro Register Helper Adding Emergency Contact Fields
View pmpro-rh-ec-fields.php
<?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' );
@MaryOJob
MaryOJob / my_pmpro_change_text_example.php
Last active Jul 15, 2020 — forked from kimwhite/my_pmpro_change_text_example.php
Change text example in a PMPro Page Template.
View my_pmpro_change_text_example.php
<?php // Do Not Copy This Line Please
/**
* This recipe replaces text strings in the content filter.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
You can’t perform that action at this time.