Skip to content

Instantly share code, notes, and snippets.

View ronalfy's full-sized avatar
🏠
Working from home

Ronald Huereca ronalfy

🏠
Working from home
View GitHub Profile
@ronalfy
ronalfy / remove-pmpro-gpf-restriction.php
Last active September 16, 2020 13:34 — forked from andrewlimaza/remove-pmpro-gpf-restriction.php
Remove Paid Memberships Pro content restriction for Google Product Feed
<?php
/**
* Disabled the PMPro content restriction forr WooCommerce GPF plugin.
* Add this code to your WordPress site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function disable_pmpro_for_woocommerce_gpf( $content ) {
if ( ! is_single() && isset( $_REQUEST['woocommerce_gpf' ] ) && $_REQUEST['woocommerce_gpf'] == 'google' ) {
remove_filter('the_content', 'pmpro_membership_content_filter', 5);
}
@ronalfy
ronalfy / pmpro-buddyboss-radio-box.css
Last active September 14, 2020 15:39
Paid Memberships Pro - BuddyBoss Radio Box Alignment
/*Fluent Form Checkbox alignment*/
.ff-el-form-check-input {
margin-top: 4px !important;
}
form.pmpro_form .pmpro_checkout-fields div.pmpro_checkout-field-radio-item, form.pmpro_form .pmpro_member_profile_edit-fields div.pmpro_checkout-field-radio-item {
display: block;
}
form.pmpro_form .pmpro_checkout-fields div.pmpro_checkout-field-radio-item input, form.pmpro_form .pmpro_member_profile_edit-fields div.pmpro_checkout-field-radio-item input {
width: auto;
}
@ronalfy
ronalfy / pmpro-payment-plan.php
Created September 14, 2020 14:57
Paid Memberships Pro - Payment Plan
<?php
/**
* Adds a payment plan to a membership 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/
*/
@ronalfy
ronalfy / pmpro-move-pay-by-check-field.php
Created September 14, 2020 14:16
PMPro - Move Pay by Check Field
<?php
/**
* Moves the Pay by Check instructions below the payment options.
*
* 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_checkout_check_field_move() {
@ronalfy
ronalfy / pmpro-rest-api-exclude.php
Created September 13, 2020 20:15
Paid Memberships Pro - REST API Exclude
<?php
/**
* Show full content when using REST.
*
* 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/
*/
@ronalfy
ronalfy / pmpro-paypal-description-test.php
Last active September 11, 2020 18:10
PMPro - Paypal Description test
<?php
/**
* Returns an empty string for PayPal to make sure special characters are not causing PayPal to fail.
*
* 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/
*/
/**
@ronalfy
ronalfy / pmpro-gettext-example.php
Created September 10, 2020 20:58
PMPro - Gettext Example
<?php
/**
* This recipe replaces text strings in the content filter.
*
* 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/
*/
@ronalfy
ronalfy / pmpro-woo-account-page.php
Created September 4, 2020 18:30
Paid Memberships Pro - Show Memberships on Account Page
<?php
/**
* Show Memberships options on WooCommerce account page.
* Output should be customized per customer use-case.
* Please refresh your permalinks after installing this snippet.
*
* 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/
@ronalfy
ronalfy / pmpro-woo-cpt.php
Created September 4, 2020 16:47
WooCommerce + PMPro + CPT Add on - Hide Show to Cart and Enable Product Viewing
<?php
/**
* Using the PMPro CPT add-on, you can hide access to a product page depending on level.
* User can see the product loop and instead of add to cart, they are shown a read more.
* When visiting the product page, the user can view it instead of being redirected.
* Add to cart purchase on product page is disabled.
*
* 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.
@ronalfy
ronalfy / pmpro-move-company-bililng.php
Created August 31, 2020 14:14
Paid Memberships Pro - Move Company Field to Billing
<?php
/**
* Move custom company field to the top of the billing information section if it exists.
*/
function pmpro_move_company_to_billing() {
if ( is_page( 'paiement-dadhesion' ) && wp_script_is( 'jquery', 'done' ) ) {
?>
<script>
jQuery( '#company_div' ).prependTo( '.pmpro_checkout-field-bfirstname' );
</script>