Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Created June 22, 2020 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimcoleman/8fd87884b5fdd9bda17584665d7ed202 to your computer and use it in GitHub Desktop.
Save kimcoleman/8fd87884b5fdd9bda17584665d7ed202 to your computer and use it in GitHub Desktop.
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