Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
Fix draft post achievements not being attributed to the correct author.
Browse files Browse the repository at this point in the history
Fixes #71
  • Loading branch information
paulgibbs committed Feb 4, 2013
1 parent 895efa0 commit 38645f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/extensions/wordpress.php
Expand Up @@ -110,7 +110,7 @@ function event_name( $event_name, $func_args ) {
*/ */
public function event_user_id( $user_id, $action_name, $action_func_args ) { public function event_user_id( $user_id, $action_name, $action_func_args ) {
// Only deal with events added by this extension. // 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; return $user_id;


// New comment, check that the author isn't anonymous // New comment, check that the author isn't anonymous
Expand All @@ -126,7 +126,7 @@ public function event_user_id( $user_id, $action_name, $action_func_args ) {
return $comment->user_id; return $comment->user_id;


// New post, get the post author // 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 ); return $this->get_post_author( $user_id, $action_name, $action_func_args );
} }
} }
Expand Down

0 comments on commit 38645f2

Please sign in to comment.