Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@MaryOJob
MaryOJob / pmpro_move_name_fields.php
Last active Mar 2, 2021 — forked from femiyb/pmpro_move_name_fields.php
This Code Gist Will Move the Fields in this order, First Name, Last Name, Email Address and Password When using the Code to Generate a username at PMPro checkout from email for users and hiding the username field with CSS - Links for this below
View pmpro_move_name_fields.php
<?php // Do not Copy This Line
/**
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function pmpro_move_name_fields() {
global $pmpro_pages;
if(is_page($pmpro_pages['checkout'])) {
?>
View custom_options_divi.php
<?php
require_once( get_template_directory() . esc_attr( "/options_divi.php" ) );
global $options;
$epanel_key = "name";
$epanel_value = "Show RSS Icon";
$custom_options = array (
array( "name" => esc_html__( "Show GitHub Icon", $themename ),
"id" => $shortname."_show_github_icon",
@MaryOJob
MaryOJob / my_pmpro_change_text_example.php
Last active Mar 4, 2021
PMPro - Change "Discount Code" Text Example on Checkout Page
View my_pmpro_change_text_example.php
<?php // Do Not Copy This Line
/**
* This recipe will help you change text on the checkout paid in PMPro
* 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/
*/
// paste content from below this line
function pmproc_change_my_text( $translated_text, $text, $domain ) {
@MaryOJob
MaryOJob / pmpro_move_level_options_fields.php
Last active Feb 16, 2021 — forked from femiyb/pmpro_move_level_options_fields.php
Move Payment Option fields under the Page Menu title on the Checkout Page
View pmpro_move_level_options_fields.php
<?php // Do not copy this line
/**
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Move Payment Option fields
*/
function pmpro_move_level_options_fields() {
global $pmpro_pages;
if(is_page($pmpro_pages['checkout'])) {
@MaryOJob
MaryOJob / my_pmpro_custom_fields_multiple_location_headers.php
Created Feb 4, 2021
Multiple Location / Headers Custom Fields Code (PMPro & Register Helper Extension)
View my_pmpro_custom_fields_multiple_location_headers.php
<?php // Do not copy this line
// We have to put everything in a function called on init, so we are sure Register Helper is loaded.
function pmpro_register_field_mary_init() {
// Don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
View pmpro-sponsored-members-add-additional-fields-to-child-accounts.php
/*
Code demo on using pmprosm_children_fields() and pmprosm_after_child_created() hooks to add additional fields to checkout child account creation.
Adds shipping fields to child accounts at checkout. Use PMPro Shipping Address on Membership Checkout to view
*/
function pmprosm_additional_child_fields($i, $seats)
{?><label>Shipping Address 1</label><input type="text" name="add_child_saddress1[]" value="" size="20" /><label>Shipping Address 2</label><input type="text" name="add_child_saddress2[]" value="" size="20" /><label>City</label><input type="text" name="add_child_scity[]" value="" size="20" /><label>State</label><input type="text" name="add_child_sstate[]" value="" size="20" /><label>Postal Code</label><input type="text" name="add_child_szipcode[]" value="" size="20" /><?php
}
add_action('pmprosm_children_fields', 'pmprosm_additional_child_fields', 10, 2);
@MaryOJob
MaryOJob / my_pmpro_disable_email_template_per_level.php
Created Feb 1, 2021
Disable member email for a specific email template for a specific level
View my_pmpro_disable_email_template_per_level.php
<?php // Do Not Copy This Line
/**
* The function below will disable the membership expiring email (for a specific membereship level)
* sent to the Member/User by Paid Memberships Pro.
* The admin emails will still be sent as intended.
* 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 / my_pmpro_is_order_renewal.php
Created Jan 15, 2021 — forked from dparker1005/my_pmpro_is_order_renewal.php
Adds a "Renewal" column to the Orders list and order CSV export to show if the order is a membership renewal.
View my_pmpro_is_order_renewal.php
<?php
// Copy from below here...
/*
* Adds a "Renewal" column to the Orders list and order CSV export
* to show if the order is a membership renewal.
*/
function my_pmpro_is_order_renewal( $order ) {
global $wpdb;
@MaryOJob
MaryOJob / pmpro_simple_local_avatars.php
Created Jan 13, 2021 — forked from ronalfy/pmpro_simple_local_avatars.php
PMPro - Local Avatar on the Front-end and Not in the Back-end
View pmpro_simple_local_avatars.php
<?php
/**
* Shows local avatar on the front-end and doesn't allow on in the 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/
*/
@MaryOJob
MaryOJob / unset-and-hide-billing-state-field.php
Last active Jan 4, 2021 — forked from femiyb/unset-and-hide-billing-state-field.php
PMPro - Remove phone from required billing fields and hide it
View unset-and-hide-billing-state-field.php
<?php // Do NOT copy this line
/* Copy from below this line */
/*
Remove state from required billing fields and hide it the state field.
*/
// Unset state
add_action( 'pmpro_required_billing_fields', 'my_pmpro_required_billing_fields' );