Skip to content

Instantly share code, notes, and snippets.

@mlteal
Created July 13, 2016 18:02
Show Gist options
  • Save mlteal/105856053fa2895cf179648c9ef2191c to your computer and use it in GitHub Desktop.
Save mlteal/105856053fa2895cf179648c9ef2191c to your computer and use it in GitHub Desktop.
Remove the do_pings action
<?php
/*
Plugin Name: Disable Pings
Plugin URI: http://fansided.com
Description: Remove the do_pings action
Version: 0.1
Author: Maura Teal
Author URI: http://fansided.com
License: GPL
*/
/**
* Disable pings by removing action
*
* *** Note, by removing do_all_pings action, we'll also not be
* cleaning up the _pingme and _encloseme post meta, as that function
* loops over items with that meta and tidies it itself. So if this
* plugin gets disabled, the next time do_pings runs it'll find all of
* those posts that have the _pingme or _encloseme meta set ¯\_(ツ)_/¯
*
* @since 0.1
*
* @return void
*/
function ml_disable_pings() {
remove_action( 'do_pings', 'do_all_pings', 10 );
}
add_action( 'init', 'ml_disable_pings' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment