Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
<?php
/**
* Change the end date of a membership level when a user is approved.
*
* 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_change_level_enddate_on_approval( $user_id, $level_id ) {
<?php
/**
* Hide the submit button on the member profile edit page.
*
* 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_profile_edit_page_hide_submit_button() {
<?php
/**
* Hide the submit button on the member profile edit page.
*
* 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_profile_edit_page_remove_submit_button_js() {
<?php
/**
* Show the display name field for administrators in the WordPress dashboard.
*
* 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 / pmpro-set-default-value-for-display-name-field.php
Created June 24, 2024 07:11
Fetch and set the value for the display name user field in admin.
<?php
/**
* Set the default value for the display_name field when editing a user in the WordPress admin.
*
* This recipe assumes a PMPro User field for the display_name exists.
*
* 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/
<?php
/**
* Add the display_name field to the wp_users table.
*
* 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/
*/
// Set display_name field to be saved in the wp_user table
@ipokkel
ipokkel / pmpro-login-form-blank.css
Created June 21, 2024 08:09
Blank CSS example template for the login, lost password, and reset password forms.
/* General styling for the form container */
.pmpro_login_wrap,
.pmpro_lost_password_wrap,
.pmpro_reset_password_wrap {
/* Add your styling here */
}
/* Styling for the form element */
.pmpro_login_wrap #loginform,
.pmpro_lost_password_wrap #lostpasswordform,
@ipokkel
ipokkel / pmpro-show-member-links-for-affiliates-only.php
Created June 20, 2024 16:17
Add CSS to only show member Member Links on the PMPro Account page for affiliates.
<?php
/**
* Verify that the user is at least 18 years old before registering.
*
* 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_min_required_age( $okay ) {
<?php
/**
* Hide the WordPress toolbar for all users that do not have
* the administrative 'manage_options' capability.
*
* 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/
*/