Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / pmpro-hide-admin-membership-access-toolbar.php
Created April 4, 2024 11:22
Hide the PMPro admin "View As" selector from the WordPress Toolbar.
<?php
/**
* This will hide the Membership Access Toolbar from the WordPress Admin Bar.
*
* 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/
*/
add_filter( 'pmpro_hide_admin_membership_access_toolbar', '__return_true' );
<?php
/**
* Hide the email address from the member directory.
*
* 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/
*/
function remove_user_email_address_from_member_profile( $value, $original_value, $field_name ) {
<?php
/**
*
* ===== WARNING =====
* This code recipe is intended for developers and requires extensive knowledge of websites, and WordPress.
* Copying and pasting this recipe into your site as-is won't work - you need to follow the steps outlined in this code.
* If you are unsure, please hire a local WordPress developer or freelance for assistance.
*
* This code recipe is experimental and was built for private use, outside of Paid Memberships Pro and it's support scope.
*
<?php
/**
* Set custom PMPro email data variables per locale.
*
* 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/
*/
function my_pmpro_email_data_variables_per_locale( $data, $email ) {
<?php
/**
* Change the "Extra Fields:" text string to "Member Information:".
*
* 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/
*/
function my_pmpro_change_extra_fields_text_string( $translated_text, $text, $domain ) {
@ipokkel
ipokkel / pmpro-email-bcc-admin-activity-email.php
Created March 20, 2024 06:18
BCC Activity report email to additional email addresses
<?php
/**
* BCC additional email addresses on the admin activity email.
*
* 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/
*/
function my_pmpro_email_bcc_admin_activity_email( $headers, $email ) {
@ipokkel
ipokkel / pmpro-signup-shortcode-redirect-members-to-account.php
Created March 13, 2024 06:39
Redirect members to their account page from a page with the PMPro Signup Shortcode
<?php
/**
* Redirect users who are already members away from the PMPro Signup Shortcode.
*
* 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/
*/
function my_pmprosus_redirect_members() {
@ipokkel
ipokkel / pmpro-email-change-subject-based-on-locale.php
Created March 12, 2024 07:12
Set a custom PMPro Email subject per locale.
<?php
/**
* Change the email subject based on the user's locale.
*
* 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/
*/
function pmpro_email_change_subject_based_on_locale( $subject, $email ) {
<?php
/**
* Redirect to the referrer after logout.
*
* 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/
*/
function wp_redirect_to_referrer_after_logout() {
<?php
/**
* Change the email subject per template per level.
*
* 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/
*/
function pmpro_email_subject_per_template_per_level( $subject, $email ) {