-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#495] Misc Fixes #591
Merged
Merged
[#495] Misc Fixes #591
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
👏 👏 👏 |
f649de9
to
08fab0b
Compare
nathan-schmidt-viget
approved these changes
Mar 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works! Ship it
Comment on lines
1175
to
1189
private function create_navigation(): ?int { | ||
$id = wp_insert_post( | ||
[ | ||
'post_title' => __( 'Navigation', 'goodbids' ), | ||
'post_content' => '<!-- wp:page-list /-->', | ||
'post_status' => 'publish', | ||
'post_type' => 'wp_navigation', | ||
'post_name' => 'navigation', | ||
'post_author' => 1, | ||
] | ||
); | ||
|
||
if ( is_wp_error( $id ) ) { | ||
Log::error( 'Error creating Nonprofit Navigation: ' . $id->get_error_message() ); | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good idea!
nathan-schmidt-viget
added a commit
that referenced
this pull request
Mar 6, 2024
* [#495] Setting up basic test with nav links * [#495] testing out pattern for custom menu * [#495] pulling in the created pages into the new nav * [#495] adding notes for TODO * [#495] getting active nav post id * [#495] A couple of tweaks, potential bug fixes * [#495] Some fixes/adjustments * [#495] Used Verified hook for Navigation Changes * [#495] Misc Fixes (#591) * [#495] Setting up basic test with nav links * [#495] testing out pattern for custom menu * [#495] pulling in the created pages into the new nav * [#495] adding notes for TODO * [#495] getting active nav post id * [#495] A couple of tweaks, potential bug fixes * [#495] Some fixes/adjustments * [#495] Used Verified hook for Navigation Changes * [#495] Fix nav + other bug fixes --------- Co-authored-by: Nathan Schmidt <[email protected]> --------- Co-authored-by: Brian DiChiara <[email protected]> Co-authored-by: Brian DiChiara <[email protected]>
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.
Summary
This PR generates a new Navigation post type if one doesn't exist in order to set up the navigation during the site init. This needs to be tested, but I don't think it will show as updated until you either (1) visit WP Admin, or (2) visit the Site Editor, but see if you see the updated navigation by visiting the front-end after you create the site.
This PR also:
get_view
method to avoid having to doob_start()
andob_get_contents()
for view files.wpcom_vip_get_page_by_path()
, so that method has been simplified to the native WP Function.goodbids_nonprofit_verified
hook that was firing anytimeverification
was updated (instead of only when it is set totrue
).Issues
Testing Instructions