Open dparker1005 opened 4 months ago
Leaving a note for anyone else that this gist by @dparker1005 provides a current solution to the issue above.
<?php
// Copy from below this line.
/**
* Unhooks using the custom Check gateway class in the PMPro PBC plugin.
*
* This removes the "delayed checkout" functionality and gives users membership
* access immediately after checkout. This is not typically reccomended as it is
* not compatible with many PMPro Add Ons.
*
* This code recipe also may not be supported in future versions of PMPro Pay By Check.
* Use this code recipe at your own risk.
*
* 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_unhook_pmpropbc_use_custom_gateway_class() {
remove_filter( 'pmpro_order_gateway_object', 'pmpropbc_use_custom_gateway_class' );
remove_filter( 'pmpro_subscription_gateway_object', 'pmpropbc_use_custom_gateway_class' );
}
add_action( 'init', 'my_unhook_pmpropbc_use_custom_gateway_class' );
I have also put together a code snippet here that will allow users to access restricted content for a level when they have a pending order for that level: https://github.com/strangerstudios/pmpro-snippets-library/pull/203
Note that the level still won't actually be given until the check is received. This code recipe will only allow access when the “Requires Membership” checkbox is checked for a page/post, not in situations where individual blocks are restricted for example.
Some sites don't want users to have to wait until the first check is received to get membership access.