Created
July 27, 2020 12:26
-
-
Save ipokkel/d4fadd51e07594c0836d89465d523b8a to your computer and use it in GitHub Desktop.
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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