Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor author usage into WP_Stream_Author class; use System user always #448

Merged
merged 11 commits into from
May 6, 2014

Conversation

westonruter
Copy link
Contributor

@lukecarbis please review

stream__wordpress_develop__wordpress

} elseif ( ! empty( $this->meta['user_login'] ) ) {
return $this->meta['user_login'];
} else {
return __( 'N/A', 'stream' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@westonruter Should this also be "Unknown"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_NO._

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK 😺

);
}

$author_obj = new WP_Stream_Author( $user_id );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I prefer to not include the variable type in it's name (for example, I wouldn't name a string $example_string). How would you feel about changing this to $author?

WordPress does this with things like $post or $user.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realised we're already using $author. Should this be changed to $user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But id is not a type. It could be anything. And I want to distinguish between the variable containing a user object vs the underlying user ID.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - I meant the variable $author_obj, where object is the type.

@lukecarbis
Copy link
Contributor

@westonruter @fjarrett I'm happy with this and ready to merge, but I made a few minor changes in my last commit. I'd appreciate another set of eyes and opinions if possible. 😁

$agent = 'wp_cron';
}

$agent = apply_filters( 'wp_stream_current_agent', $agent );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@westonruter This hook needs a docblock, as well as wp_stream_agent_label below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went ahead and merged anyway. Will still need to do this later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in b549865

@frankiejarrett
Copy link
Contributor

@westonruter Also curious about the new class-wp-stream-author.php naming convention being introduced here. I like it, but we shouldn't rename the others to match?

@westonruter
Copy link
Contributor Author

It is the convention in Core.

@Japh
Copy link

Japh commented May 2, 2014

So we should rename the others to match the Core convention?

@westonruter
Copy link
Contributor Author

Eventually, sure. Will make autoloading easier.

frankiejarrett added a commit that referenced this pull request May 6, 2014
Refactor author usage into WP_Stream_Author class; use System user always
@frankiejarrett frankiejarrett merged commit 02056e6 into develop May 6, 2014
@frankiejarrett frankiejarrett deleted the author-class branch May 6, 2014 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants