Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Auto-subscribe post authors to posts for XMLRPC requests

View gist:4255237
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.