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

Make blocks unsynced by default #2643

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

brianhogg
Copy link
Contributor

@brianhogg brianhogg commented Apr 30, 2024

Description

Since a couple version of WP ago, reusable blocks are now Synced by default. Make them unsynced on new installs so they can be edited more easily.

Note this would only fix things on a fresh install of WordPress. To fix on an existing install we'd need some kind of migration script to change things like this in Forms:

<!-- wp:block {"ref":7} /-->

to this:

<!-- wp:llms/form-field-confirm-group {"llms_visibility":"logged_out"} -->
<!-- wp:llms/form-field-user-password {"description":"","field":"password","required":true,"label":"Password","label_show_empty":false,"match":"password_confirm","options":[],"options_preset":"","placeholder":"","columns":6,"last_column":false,"name":"password","id":"password","data_store":"users","data_store_key":"user_pass","html_attrs":{"minlength":8},"isConfirmationField":false,"isConfirmationControlField":true,"meter":true,"meter_description":"A strong password is required with at least 8 characters. To make it stronger, use both upper and lower case letters, numbers, and symbols.","min_strength":"strong","llms_visibility":"off"} /-->

<!-- wp:llms/form-field-text {"description":"","field":"password","required":true,"label":"Confirm Password","label_show_empty":false,"match":"password","options":[],"options_preset":"","placeholder":"","columns":6,"last_column":true,"name":"password_confirm","id":"password_confirm","data_store":"usermeta","data_store_key":"password_confirm","html_attrs":{"minlength":8},"isConfirmationField":true,"isConfirmationControlField":false,"llms_visibility":"off"} /-->
<!-- /wp:llms/form-field-confirm-group -->

while taking into account any changes that have been made to the reusable block.

This doesn't create the reusable blocks anymore since it doesn't run through get_reusable_block, but reusable blocks seem very buggy right now (ie. we can't uncheck "Confirmation field" for the Email Address block due to an error).

How has this been tested?

Manually

Checklist:

  • This PR requires and contains at least one changelog file.
  • My code has been tested.
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Standards.

@brianhogg brianhogg marked this pull request as draft April 30, 2024 20:07
@brianhogg
Copy link
Contributor Author

The legacy blocks don't include things like the Confirmation email field on by default. Need to go through and compare.

@brianhogg brianhogg removed the request for review from ideadude May 7, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Blocked
Development

Successfully merging this pull request may close these issues.

None yet

1 participant