Created
January 15, 2015 12:50
-
-
Save RShergold/8e3e843b627f7600becf to your computer and use it in GitHub Desktop.
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 | |
// 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