Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Replace all elements with the selector 'pmpro_btn' to instead use the selector 'button'.
<?php
/**
* Replace all elements with the selector 'pmpro_btn' to instead use the selector 'button'.
*
* 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_pmpro_element_class_buttons( $class, $element ) {
if ( in_array( 'pmpro_btn', $class ) ) {
$class = array();
$class[] = 'button';
}
return $class;
}
add_filter( 'pmpro_element_class', 'my_pmpro_element_class_buttons', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment