public
Last active

Auto-subscribe post authors to posts for XMLRPC requests

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php
/**
* Automatically subscribe post authors to Edit Flow notifications on XML-RPC requests
*
* @see http://wordpress.org/support/topic/mobile-app-xml-rpc-auto-subscribe-not-working?replies=2
*/
 
function efx_auto_subscribe_post_author_xmlrpc( $post_id ) {
if ( ! function_exists( 'EditFlow' ) )
return;
 
EditFlow()->notifications->follow_post_user( $post_id, get_post( $post_id )->post_author, true );
}
if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
add_action( 'wp_insert_post', 'efx_auto_subscribe_post_author_xmlrpc' );

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.