Skip to content

Instantly share code, notes, and snippets.

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / my-pmprorh-init-pause-access.php
Last active Jul 30, 2020
Pause membership content access checkbox Register Helper example field.
View my-pmprorh-init-pause-access.php
<?php
/**
* This recipe creates a custom fields for membership registration.
*
* Pause content access checkbox for this article:
* @link https://www.paidmembershipspro.com/block-pause-members-access-restricted-content/
*
* @requires Register Helper Add On
* @link https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
*
@ipokkel
ipokkel / pmpro-redirect-to-user-page.php
Last active Jul 30, 2020 — forked from strangerstudios/pmpro-redirect-to-user-page.php
Plugin to work with PMPro and PMPro User Pages to redirect someone to their latest user page on login.
View pmpro-redirect-to-user-page.php
<?php
/**
* This recipe redirects members to their User Page on login.
*
* This recipe assumes the User Pages Add On is installed and configured.
* @link https://www.paidmembershipspro.com/add-ons/pmpro-user-pages/
*
* 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.
@ipokkel
ipokkel / my-pmprorh-read-only.php
Created Jul 29, 2020
Set Register Helper field to read only for members but not administrators or membership managers with the readonly field option.
View my-pmprorh-read-only.php
<?php
/**
* This recipe creates a custom fields for membership registration
* that is readonly on the user edit profile for members and
* editable by administrators or users with the membership manager role.
*
* This recipe assumes that the registration field is required during checkout.
*
* @requires Register Helper Add On
* @link https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
@ipokkel
ipokkel / change-text-for-add-member-from-admin.php
Created Jul 27, 2020
Translate or change text for Add Member From Admin
View change-text-for-add-member-from-admin.php
<?php
<?php
/**
* This recipe changes localized text strings for
* Add Member from Admin using the gettext filter.
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*
* 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.
@ipokkel
ipokkel / my-custom-admin-css.php
Created Jul 27, 2020
Example of adding custom CSS for the Admin area in WordPress. This example hides the Payment dropdown and total fields in Add Member From Admin
View my-custom-admin-css.php
<?php
/**
* This recipe is an example of how to add custom CSS to WordPress Admin
*
*
* 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/
*/
@ipokkel
ipokkel / pmpromd-hide-from-directory-addmember-field.php
Created Jul 27, 2020
Add a hide member profile from Member Directory in Add Member from Admin
View pmpromd-hide-from-directory-addmember-field.php
<?php
/**
* This recipe creates a checkbox in addmember to optionally
* hide a member's profile from the Member Directory and Profile
* pages.
*
* @requires Register Helper Add On
* @link https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
*
* You can add this recipe to your site by creating a custom plugin
@ipokkel
ipokkel / my-pmprorh-init-must-love-dogs-example-save-function.php
Created Jul 26, 2020
Custom save-function callback example that will capitalize input string value.
View my-pmprorh-init-must-love-dogs-example-save-function.php
<?php
// Create a registration form field with a custom callback
function my_pmprorh_init_must_love_dogs_example_save_function() {
// don't break if Register Helper is not loaded
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
// define the fields
$fields = array();
// Basic Text Field Example
@ipokkel
ipokkel / sav-function-custom-callback.php
Created Jul 26, 2020
Basic example of using a custom callback function for a Register Helper
View sav-function-custom-callback.php
<?php
// Create a registration form field with a custom callback
function my_pmprorh_init_example_save_function() {
// don't break if Register Helper is not loaded
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
// define the fields
$fields = array();
// Basic Text Field Example
@ipokkel
ipokkel / my-pmpro-email-data.php
Created Jul 23, 2020
This recipe add user meta as email variables that may be used for the PMPro Email Template Editor Add On.
View my-pmpro-email-data.php
<?php
/**
* This recipe add user meta as email variables that may be used for
* the PMPro Email Template Editor Add On.
*
* 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/
*/
@ipokkel
ipokkel / my-register-helper-field-usermeta-bullet.php
Created Jul 22, 2020
Display a usermeta field captured with Register Helper as a bullet on the Account, Billing and Invoice page.
View my-register-helper-field-usermeta-bullet.php
<?php
/**
* This recipe displays a usermeta field as a bullet on
* the Account, Billing and Invoice page through using
* available action hooks on those pages.
*
* Action hooks:
* Account Page: pmpro_account_bullets_top, pmpro_account_bullets_botttom
* Billing Page: pmpro_billing_bullets_top, pmpro_billing_bullets_botttom
* Invoice Page: pmpro_invoice_bullets_top, pmpro_invoice_bullets_botttom
You can’t perform that action at this time.