Skip to content

Instantly share code, notes, and snippets.

View goodevibes's full-sized avatar

goodevibes goodevibes

  • Regular Rebellion
View GitHub Profile
@goodevibes
goodevibes / mepr-limit-countries-shown.php
Created January 3, 2024 11:10 — forked from cartpauj/mepr-limit-countries-shown.php
Limit which countries are shown in the MemberPress Countries address dropdown fields at signup
<?php
// Paste the code below into a plugin like Code Snippets (run on front end snippet type)
function leave_one_country($countries, $prioritize_my_country) {
return array(
'DE' => _x('Germany', 'ui', 'memberpress')
);
}
add_filter('mepr_countries', 'leave_one_country', 10, 2);
@goodevibes
goodevibes / memberpress-custom-field-dynamic-tag.php
Created January 3, 2024 10:30 — forked from renventura/memberpress-custom-field-dynamic-tag.php
Creates a dynamic tag for using in MemberPress custom fields.
<?php
add_filter( 'mepr_fetch_options', 'mp_filter_custom_fields' );
/**
* Filter the MemberPress options to set a dynamic value for custom fields.
*
* @param object $options MeprOptions
*
* @return object MeprOptions
*/