Skip to content

Instantly share code, notes, and snippets.

@JarrydLong
Created July 14, 2020 08:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JarrydLong/40dfd32b819b0a140a1b5616c6382908 to your computer and use it in GitHub Desktop.
Save JarrydLong/40dfd32b819b0a140a1b5616c6382908 to your computer and use it in GitHub Desktop.
<?php
/**
* This recipe will add in the necessary classes to PMPro Buttons, ensuring they
* have the same look & feel as your theme: ColorMag
*
* https://wordpress.org/themes/colormag/
*
* 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 mypmpro_colormag_classes( $class, $element ){
if ( in_array( 'pmpro_btn', $class ) ) {
$class = array();
$class[] = 'colormag-button';
}
return $class;
}
add_action( 'pmpro_element_class', 'mypmpro_colormag_classes', 10, 2 );
@laurenhagan0306
Copy link

This recipe is included in the post on "Using the ColorMag Theme by ThemeGrill with Paid Memberships Pro" at Paid Memberships Pro here: https://www.paidmembershipspro.com/colormag-theme-by-themegrill-paid-memberships-pro/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment