Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of adding custom CSS for the Admin area in WordPress. This example hides the Payment dropdown and total fields in Add Member From Admin
<?php
/**
* This recipe is an example of how to add custom CSS to WordPress Admin
*
*
* 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_custom_admin_css() {
echo '<style>
.memberships_page_pmpro-addmember #payment,
.memberships_page_pmpro-addmember tr.payment,
.memberships_page_pmpro-addmember label[for=payment],
.memberships_page_pmpro-addmember #total {
display:none;
}
</style>';
}
add_action( 'admin_head', 'my_custom_admin_css' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.