Skip to content

Instantly share code, notes, and snippets.

@RShergold
Created January 15, 2015 12:50
Show Gist options
  • Save RShergold/8e3e843b627f7600becf to your computer and use it in GitHub Desktop.
Save RShergold/8e3e843b627f7600becf to your computer and use it in GitHub Desktop.
<?php
// only allow a single post to be sticky
function post_published_notification( $ID, $post ) {
global $_POST;
if (array_key_exists('sticky', $_POST)) {
update_option('sticky_posts', array() );
}
}
add_action( 'publish_post', 'post_published_notification', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment