Skip to content

Instantly share code, notes, and snippets.

View MaryOJob's full-sized avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@MaryOJob
MaryOJob / pmpro-uk-taxes.php
Created December 18, 2020 05:59 — forked from ronalfy/pmpro-uk-taxes.php
Gist UK Taxes on Checkout / Invoice / Etc.
<?php
/**
* 1. Adds 20% tax text to the level cost text.
* 2. Adds 20% tax to invoice if checking out as UK customer.
* 3. Adds 20% tax if UK to checkout and invoice.
*
* 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 / lock-down-first-and-last-name.php
Created December 22, 2020 09:28 — forked from ipokkel/lock-down-first-and-last-name.php
Make First Name and Last Name read-only for registered members #pmpro
<?php
/**
* This recipe assigns the readonly attribute to the fields
* first_name and last_name on the PMPro profile edit page
* on the front-end and the user profile page in the
* WordPress dashboard (back-end)
*
* 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.
@MaryOJob
MaryOJob / unset-and-hide-billing-state-field.php
Last active July 7, 2021 13:01 — forked from femiyb/unset-and-hide-billing-state-field.php
PMPro - Remove required * from some billing fields and then hide these fields with CSS
<?php // Do NOT copy this line
/*
* Remove required * from some billing fields and then hide these fields with CSS
* Add this to your PMPro Customization Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
add_action( 'pmpro_required_billing_fields', 'my_pmpro_required_billing_fields' );
function my_pmpro_required_billing_fields( $fields ) {
if ( is_array( $fields ) ) {
@MaryOJob
MaryOJob / pmpro_simple_local_avatars.php
Created January 13, 2021 16:16 — forked from ronalfy/pmpro_simple_local_avatars.php
PMPro - Local Avatar on the Front-end and Not in the Back-end
<?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 / my_pmpro_is_order_renewal.php
Created January 15, 2021 06:18 — 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.
<?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;
/*
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 / pmpro_move_level_options_fields.php
Last active February 16, 2021 08:41 — forked from femiyb/pmpro_move_level_options_fields.php
Move Payment Option fields under the Page Menu title on the Checkout Page
<?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'])) {
<?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 / pmpro_move_name_fields.php
Last active December 2, 2021 17:05 — 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
<?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'])) {
?>
@MaryOJob
MaryOJob / my_pmpro_email_confirmation_text.php
Last active December 14, 2023 18:24 — forked from ideadude/my_pmpro_email_confirmation_text.php
Change the confirmation text when using PMPro and the Email Confirmation Add On.
<?php // do not copy this line
/**
* Change the "IMPORTANT!" confirmation text when using PMPro and the Email Confirmation Add On.
* Add this code into a custom plugin or code snippet.
* Be sure to change the translated lines below to the language and words you want.
* https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/
*/
function my_pmpro_email_confirmation_text( $translated_text, $text, $domain ) {
// Ignore strings for other plugins.