function xmlrpc_publish_post_to_discourse($postid) { $post = get_post($postid); if (get_post_status($postid) == 'publish' && self::is_valid_sync_post_type($postid)) { add_post_meta($postid, 'publish_to_discourse', '1', true); self::sync_to_discourse($postid, $post->post_title, $post->post_content); } }