A collection of (mostly) WordPress-related snippets and references I’ve found useful and worth keeping where I can find them. Feel free to use what you like, and point me to some better snippets or references.
Remove ‘Add New Form’ from +New Menu»
When you don't want to give users the ability to add a new form from the admin menu.
Custom Admin, Forms | Type: PHP
Remove GF ‘Add New Form’»
Remove 'Add NewForm' from admin bar.
Forms | Type: PHP
Remove Items from WP/CP Admin Bar»
// Remove items from the admin bar function remove_from_admin_bar($wp_admin_bar) { /* * Placing items in here will only remove them from admin bar * when viewing the fronte end of…
PHP, WP/CP | Type: PHP
Remove Metabox from Template»
When you need a particular metabox to disappear from a particular template.
Javascript, WP/CP | Type: Javascript
Remove Personal Options Section from User Profile»
Removes the 'profile.php' admin color scheme options.
Users, WP/CP | Type: PHP
Remove Registration Link from Login Page»
If you want to control how users register for a member site, it's a good idea to remove the registration link on on the login screen.
Users | Type: PHP
Remove User Personal Options»
Remove some of the clutter of user options.
Custom Admin, Users | Type: PHP
Remove Yoast Columns to Allow WooCommerce Columns»
Yoast SEO knocks all the products admin pages out due to the way it adds a load of columns to the list.
¡Important!, eCommerce, Yoast | Type: PHP
Removing autop, and when you can’t remove it»
The autop function can be very annoying when you’re trying to format content. But some plugins depend on autop to work, such as the checkout function in EDD, and possibly…
eCommerce, PHP, WP/CP | Type: PHP
Rendering a Readable Date from Start Date»
$mtgdate = DateTime::createFromFormat('Ymd', $startdate)->format('F j, Y'); echo '<p class="read-more"><a href="'.$formurl.'?mtgdate='.$mtgdate.'">'.$linktext.'</a></p>';
Date/Time, Forms, PHP | Type: PHP