Skip to content

Instantly share code, notes, and snippets.

@robneu
robneu / disable-jetpack-modules.php
Last active April 25, 2016 20:27
Disable unwanted Jetpack Modules. The whitelist array will allow any modules you want to remain enabled to continue to function. If you don't want the module to activate, remove it from the whitelist.
<?php
add_filter( 'jetpack_get_available_modules', 'prefix_hide_jetpack_modules' );
/**
* Disable all non-whitelisted jetpack modules.
*
* As it's written, this will allow all of the currently available Jetpack
* modules to work display and be activated normally.
*
* If there's a module you'd like to disable, simply comment it out or remove it
* from the whitelist and it will no longer be available for activation.
@michael-cannon
michael-cannon / tw_remove_menu_pages.php
Created September 25, 2013 16:00
Remove custom post type submenu pages.
<?php
function tw_remove_menu_pages() {
// remove testimonials menu section
// remove_menu_page( 'edit.php?post_type=testimonials-widget' );
// remove categories
remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'edit-tags.php?taxonomy=category&amp;post_type=testimonials-widget' );
// remove tags
@carlosleopoldo
carlosleopoldo / delete-orphans-usermeta.sql
Last active June 16, 2023 13:23
Delete all orphans user meta in WordPress
DELETE FROM wp_usermeta
WHERE NOT EXISTS (
SELECT * FROM wp_users
WHERE wp_usermeta.user_id = wp_users.ID
)
<?php
/*
Description: Adds a taxonomy filter in the admin list page for a custom post type.
Written for: http://wordpress.stackexchange.com/posts/582/
By: Mike Schinkel - http://mikeschinkel.com/custom-workpress-plugins
Instructions: Put this code in your theme's functions.php file or inside your own plugin. Edit to suite your post types and taxonomies. Hope this helps...
*/
add_filter('manage_listing_posts_columns', 'add_businesses_column_to_listing_list');
function add_businesses_column_to_listing_list( $posts_columns ) {
if (!isset($posts_columns['author'])) {