Last active
June 13, 2018 13:08
-
-
Save smartdeal/c2a64f7f61b2681781ce5521634789b3 to your computer and use it in GitHub Desktop.
[Отправка уведомлений при публикации поста] #WP #WP_functions
This file contains hidden or 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 | |
/** | |
* Отправка уведомлений при публикации поста | |
*/ | |
function roomble_send_notification( $new_status, $old_status, $post ) { | |
if( | |
'publish' === $new_status && | |
'publish' !== $old_status && | |
'post' === $post->post_type | |
) { | |
// Тут код отправки уведомления, например | |
} | |
} | |
add_action( 'transition_post_status', 'roomble_send_notification', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment