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

Clean up dashboard-note logic #578

Merged
merged 2 commits into from
Jan 17, 2020

Conversation

WPprodigy
Copy link
Contributor

Fixes #471

The else clause was actually necessary for the first time a note was created. It was a bit confusing though, so I've cleaned up the logic to make a single path of execution. wp_insert_post() will handle updating the post if the ID is passed.

Testing

Checkout the PR and update the dashboard note. Can also delete the post from the database manually and then ensure you're still able to create a note.

Copy link
Contributor

@cojennin cojennin left a comment

Choose a reason for hiding this comment

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

Two small PHPCS fixes and then good to merge

modules/dashboard/widgets/dashboard-notepad.php Outdated Show resolved Hide resolved
modules/dashboard/widgets/dashboard-notepad.php Outdated Show resolved Hide resolved
Copy link
Contributor

@cojennin cojennin left a comment

Choose a reason for hiding this comment

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

Looks good

@cojennin cojennin merged commit 7a28f54 into master Jan 17, 2020
@cojennin cojennin added this to the 0.9.4 milestone Feb 4, 2020
@cojennin cojennin deleted the fix/471-clean-up-dashboard-note-updating branch April 11, 2020 14:56
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.

Remove $_REQUEST['create-note'] reference
2 participants