-
Notifications
You must be signed in to change notification settings - Fork 202
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
Fix/general code tidy #995
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Not supported until PHP 7.0.
Replace `dirname( __FILE__ )` with `__DIR__`.
This allows file and directory paths to the root plugin file to be referenced irrespective of where the CoAuthors_Plus class lives.
The `can_edit_coauthors()` doesn't take any parameters.
The first part of the condition means the second parts were redundant.
While some of these may be architecturally better as non-public, that would be a breaking change, so leave as `public` for now.
Added for portability to make it binary safe.
`get_queried_object()` returns one of `WP_Term|WP_Post_Type|WP_Post|WP_User|null`, never `false`, so `empty()` is not the right check here.
Run less expensive bit first
Uses built-in caches.
Not sure how that quote came to be missing. But curiously enough, it was committed exactly 10 years ago today! fa07126#diff-e7386ab20f24895fea28bb6180fe917bc3ccef7f528de49c7dfb1b33aa4abbeaR327
Captures the CSS change for alignment of authors in the block editor sidebar.
ecb236e
to
e1b84e0
Compare
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A general tidy-up of code. There should be no breaking changes here. All still compatible with PHP 5.6.
Easiest to look through the individual commits than look at the whole set of changes in one go.