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

[#495] Misc Fixes #591

Merged
merged 11 commits into from
Mar 6, 2024
Merged

[#495] Misc Fixes #591

merged 11 commits into from
Mar 6, 2024

Conversation

bd-viget
Copy link
Contributor

@bd-viget bd-viget commented Mar 6, 2024

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:

  • Suppresses a few errors that were showing up in the logs during site creation, but there are a ton more I couldn't figure out (they're not affecting anything, it's just annoying).
  • Updates Accessibility Checker, WooCommerce Services, and WooCommerce Stripe Gateway to the latest version.
  • Removes the wp-cli dev dependency.
  • Adds a new get_view method to avoid having to do ob_start() and ob_get_contents() for view files.
  • Adjusts the priorities of some of the actions, allowing for many of the things to occur during site initialization.
  • As of WP VIP 6.1, WP VIP no longer requires usage of wpcom_vip_get_page_by_path(), so that method has been simplified to the native WP Function.
  • Fixes a bug when SVG Support doesn't have any options yet
  • Retains all the $_POST data when creating new Nonprofit site but the data fails validation.
  • Fixes a bug with the goodbids_nonprofit_verified hook that was firing anytime verification was updated (instead of only when it is set to true).

Issues

Testing Instructions

  1. Create a new Nonprofit site
  2. Try to enter an invalid EIN on the Verification step.
  3. Make sure all the fields retain their information

@bd-viget bd-viget self-assigned this Mar 6, 2024
@clatwell
Copy link
Contributor

clatwell commented Mar 6, 2024

👏 👏 👏

Copy link
Contributor

@nathan-schmidt-viget nathan-schmidt-viget left a 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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Really good idea!

@bd-viget bd-viget merged commit 526b2d9 into ns/495-init-nav Mar 6, 2024
1 check passed
@bd-viget bd-viget deleted the bd/495-mix-fixes branch March 6, 2024 09:50
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants