Permalink
Browse files

Fix draft post achievements not being attributed to the correct author.

Fixes #71
  • Loading branch information...
1 parent 895efa0 commit 38645f25c931a694a2fdd33d52e44e2c455c6c37 @paulgibbs committed Feb 4, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 includes/extensions/wordpress.php
@@ -110,7 +110,7 @@ function event_name( $event_name, $func_args ) {
*/
public function event_user_id( $user_id, $action_name, $action_func_args ) {
// Only deal with events added by this extension.
- if ( ! in_array( $action_name, array( 'comment_post', 'draft_to_publish', ) ) )
+ if ( ! in_array( $action_name, array( 'comment_post', 'wordpress_draft_to_publish', ) ) )
return $user_id;
// New comment, check that the author isn't anonymous
@@ -126,7 +126,7 @@ public function event_user_id( $user_id, $action_name, $action_func_args ) {
return $comment->user_id;
// New post, get the post author
- } elseif ( 'draft_to_publish' == $action_name && 'post' == $action_func_args[0]->post_type ) {
+ } elseif ( 'wordpress_draft_to_publish' == $action_name && 'post' == $action_func_args[0]->post_type ) {
return $this->get_post_author( $user_id, $action_name, $action_func_args );
}
}

0 comments on commit 38645f2

Please sign in to comment.