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 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changelogs/fix_make-blocks-unsynced-by-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: changed
entry: Reusable blocks are now unsynced on new installs, so they can be easily
customized in the Forms area. Clicking the Detach option can be used on
existing LifterLMS installs.
3 changes: 2 additions & 1 deletion includes/forms/class-llms-form-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private static function create_reusable_block( $field_id ) {
'post_type' => 'wp_block',
'meta_input' => array(
'_is_llms_field' => 'yes',
'wp_pattern_sync_status' => 'unsynced',
'_llms_field_id' => $field_id,
),
);
Expand Down Expand Up @@ -338,7 +339,7 @@ public static function get_template( $location ) {
*
* @param boolean $use_reusable Whether or not to use reusable blocks.
*/
$use_reusable = apply_filters( 'llms_blocks_template_use_reusable_blocks', ( 'not-set' === get_option( 'lifterlms_registration_generate_username', 'not-set' ) ) );
$use_reusable = apply_filters( 'llms_blocks_template_use_reusable_blocks', false );

$blocks = self::get_template_blocks( $location, $use_reusable );

Expand Down
Loading