I have troubles creating the blocks myself, I just don’t have the time and skills but I am wondering how secure is adding php though admin? I am worried and this is stopping me.
]]>Hello, I’ve been using this service regularly and find it very useful.
I’m experiencing an issue with the URL block functionality that’s causing some problems.
Steps to Reproduce:
I’ve verified this issue both in my environment and in the playground to confirm it’s reproducible.
Could you please investigate and address this problem?
]]>Hi Lazy Blocks Team,
First of all, thank you for creating such a great plugin; it’s been incredibly helpful for my work!
I recently encountered the following error message:
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the lazy-blocks domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.)
This might be related to my theme, but just in case, could you please confirm if this error might stem from the Lazy Blocks plugin?
Thank you for your time and assistance!
]]>Hi,
The documentation states that the only field that can’t go inside a Repeater Field is an InnerBlock. I need to add nested Repeater Fields but Repeater Fields is greyed out in the list of available blocks. Is this possible?
Thanks
]]>I have a few things that i have to create with lazy blocks. Like individual slider elements. These slider elements dont work anymore if they are automatically wrapped in a div by lazyblock.
So what i found here is the solution to at this line to the functions.php:
add_filter( ‘lazyblock/slider-item/frontend_allow_wrapper’, ‘__return_false’ );
So that this specific lazyblock wont get wrapped. So far so good.
But cant we get this option inside of the UI without having to manually add this to the functions.php ? Please ? Where can i propose this a feature for future versions ?
My dev has to comit these functions.php changes via github in our situation and its really complicated for something that might ne useful for more people with a little toggle inside the lazyblock settings for example.
Thanks for considering!
Hello,
I have the same problem as https://www.ads-software.com/support/topic/custom-blocks-page-not-saving-edits/ and hope to be able to provide some more information for analysis.
So: as soon as I use a certain block in a post, I can no longer save the post. If I switch to the code editor in the block editor, it works.
The block uses a custom template. I have emptied it completely as a test, but it doesn’t change anything.
I have already ruled out all other plugins as the cause. WordPress is up to date.
Here is the export of the block in question:
[
{
"id": 2498,
"title": "Team Members",
"icon": "<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\" \/><\/svg>",
"keywords": [],
"slug": "lazyblock\/team-members",
"description": "",
"category": "widgets",
"category_label": "widgets",
"supports": {
"customClassName": true,
"anchor": false,
"html": false,
"multiple": true,
"inserter": true,
"reusable": true,
"lock": true,
"align": [
"wide",
"full"
],
"ghostkit": {
"effects": false,
"position": false,
"spacings": false,
"frame": false,
"transform": false,
"customCSS": false,
"display": false,
"attributes": false
}
},
"controls": {
"control_9cb84d41ca": {
"type": "number",
"name": "count",
"default": "3",
"label": "Anzahl",
"help": "",
"child_of": "",
"placement": "content",
"width": "100",
"hide_if_not_selected": "false",
"required": "true",
"translate": "false",
"save_in_meta": "false",
"save_in_meta_name": "",
"min": "1",
"max": "10",
"step": "1",
"placeholder": "",
"characters_limit": ""
},
"control_0f5a0b440e": {
"type": "url",
"name": "team-url",
"default": "\/ueber-uns\/team\/",
"label": "Team-Seite",
"help": "",
"child_of": "",
"placement": "content",
"width": "100",
"hide_if_not_selected": "false",
"required": "true",
"translate": "false",
"save_in_meta": "false",
"save_in_meta_name": "",
"placeholder": "",
"characters_limit": ""
}
},
"code": {
"output_method": "template",
"editor_html": "",
"editor_callback": "",
"editor_css": "",
"frontend_html": "",
"frontend_callback": "",
"frontend_css": "",
"show_preview": "always",
"single_output": false
},
"styles": [],
"condition": []
}
]
Any ideas?
]]>Hi,
I have a simple lazy block with a status field as a select. The value of the field is stored in a meta field. This works correctly the first time it is saved. However, when I edit the post and change the value, the initial value is still saved after saving. How can I overwrite the initial value?
Thanks a lot for the help
Chris
]]>Hi,
A page with several custom blocks containing content (text, links, images) cannot be saved when new content is added or edits made in a block or if a new custom block is added. In all cases the page save button remains grayed out.
What method does save content edits is after exiting the page edit window several times the WordPress autosave functionality is engaged resulting in “restore previous version” button which saves the updated content.
All URLs used in the custom blocks are valid and site’s running latest WordPress version (v6.6.1) with Lazy Blocks v3.7.0.
Please advise, thanks.
]]>URLs in URL fields starting with a hash (#) are not validating.
Also, URLs starting with a slash (/) or an alpha numeric character are not validating.
]]>If there is a block on the page with an invalid url in a url field, you are prevented from updating the page, but there is no indication of which block is preventing the updated when the focus is not on that specific block.
This is especially an issue with the 3.7.0 update as blocks that had previously been validated are now preventing the page from validating.
]]>Hello,
I want to add choice field to child pages of specific page. How can I add this?
Or show it by page template.
]]>Hello,
I am using “Classic editor” element in lazy block. I tried insert youtube link so it would embed video but it is not displaying anything.
I tried using insert media from url. I can see it in backend editor but not on front-end as a visitor.
Please advise.
]]>Is there a way to specify the placement of controls within the built-in block editor InspectorControl Groups (Settings and Styles)? I looked through the documentation but didn’t see anything regarding Inspector Control Groups.
https://make.www.ads-software.com/core/2023/03/07/introduction-of-block-inspector-tabs/
]]>Hello,
I’m trying to load a block created in lazybloc directly in the template in my theme.
Actually I’ve put this in the php
$reuse_block = get_post( 84 );
$context['block'] =apply_filters( 'the_content', $reuse_block->post_content);
And in the twig template{{ block}}
But the block don’t appear. Am I missing something? Is it even possible to do that?
Thanks in advance
Hi, I am unable to edit any blocks or create a new one currently.
I am only getting 404 Errors https://prnt.sc/nw0R54jnjNr2
Any help would be appreciated.
Thank you
]]>Hi,
I made a block ‘multiple popups on same page’ with LazyBlocks. Now I also want to close the popup by clicking outside the popup. Therefore I need to use javascript. How can I use the Id selector generated by a control_name in javascript?
Thanks in advance.
]]>Hello,
first of all: I am delighted with the plugin and the documentation.
Despite the good documentation, I couldn’t find out how to preset the current date in the date picker field. Can anyone give me a tip?
Best regards
Klaus
]]>Hi guys,
every time when I want to edit a block, my debug.log is filled with PHP warnings about Ghost Kit. I know warnings aren’t problematic, but it’s annoying if I want to debug other stuff. Can you take a look at it?
PHP Warning: Undefined array key "lazyblocks_supports_ghostkit_effects" in /domain.com/wp-content/plugins/lazy-blocks/classes/class-blocks.php on line 696
PHP Warning: Undefined array key "lazyblocks_supports_ghostkit_position" in /domain.com/wp-content/plugins/lazy-blocks/classes/class-blocks.php on line 696
PHP Warning: Undefined array key "lazyblocks_supports_ghostkit_transform" in /domain.com/wp-content/plugins/lazy-blocks/classes/class-blocks.php on line 696
PHP Warning: Undefined array key "lazyblocks_supports_ghostkit_attributes" in /domain.com/wp-content/plugins/lazy-blocks/classes/class-blocks.php on line 696
PHP Warning: Trying to access array offset on null in /domain.com/wp-includes/class-wp-block-supports.php on line 98
Thanks in advance and many thanks for this awesome plugin!
]]>Hi guys,
first and foremost: Thanks. for this amazing Plugin, I’m loving it!!!
But I think I’ve actually found a bug. I renamed my WP API prefix for security reasons. It’s done with the ‘rest_url_prefix’ filter.
add_filter( 'rest_url_prefix', function() {
return 'customprefix';
});
I didn’t notice anything in the frontend but the lazy blocks backend breaks. I’ve got this JS error:
Failed to load resource: the server responded with a status of 404 (Not Found): https://mydomain.com/customprefix/wp/v2/lazyblocks/247?_locale=user
I think the API URL’s may be hardcoded in the plugin or something similar. Can you take a look at it?
Thanks in advance!
]]>Hey,
I just want to have a textfield, where the user can copy and paste an SVG code / snippet, which will be parsed 1:1 into the lazyblock HTML+Handlebars structure.
Is this somehow possible ? When i use a Textfield or similar, the SVG code gets put into ” ” and gets rendered as text.
Hello,
I get the following error message under a lazy block in the backend:
‘Error loading block preview: A critical error has occurred on this site’
In the console the following message:
‘Failed to load resource: the server responded with a status of 500 ()’
Thanks in advance.
]]>My problem is I have multiple plugins using Handlebars and for some reason there’s a versioning issue.
I’m wondering if it’s possible to add a namespace prefix to the version of Handlebars used in this plugin?
]]>I’m using the Lazy Blocks plugin and even though I have just now moved to a dedicated WP server and extra resources, I am still getting this critical error when I try to access the page in WP to update it.
Hii!
WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with one of your plugins, Lazy Blocks.
WordPress version 6.4.3
Active theme: Norcon (version )
Current plugin: Lazy Blocks (version 3.5.1) PHP version 8.0.30
Error Details
=============
An error of type E_ERROR was caused in line 37 of the file /var/www/vhosts/nor-con.co.uk/httpdocs/wp-content/plugins/lazy-blocks/classes/class-blocks.php(1383) : eval()'d code. Error message: Uncaught TypeError: Cannot access offset of type string on string in /var/www/vhosts/nor-con.co.uk/httpdocs/wp-content/plugins/lazy-blocks/classes/class-blocks.php(1383) : eval()'d code:37 Stack trace:
#0 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-content/plugins/lazy-blocks/classes/class-blocks.php(1383): eval()
#1 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-content/plugins/lazy-blocks/classes/class-blocks.php(1543): LazyBlocks_Blocks->php_eval()
#2 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-content/plugins/lazy-blocks/classes/class-blocks.php(1415): LazyBlocks_Blocks->render_callback()
#3 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/class-wp-block.php(258): LazyBlocks_Blocks->{closure}()
#4 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/class-wp-block.php(244): WP_Block->render()
#5 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/class-wp-block.php(244): WP_Block->render()
#6 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/blocks.php(1484): WP_Block->render()
#7 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/blocks.php(1522): render_block()
#8 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/class-wp-hook.php(324): do_blocks()
#9 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#10 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php(620): apply_filters()
#11 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php(451): WP_REST_Revisions_Controller->prepare_item_for_response()
#12 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php(314): WP_REST_Autosaves_Controller->prepare_item_for_response()
#13 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/rest-api/class-wp-rest-server.php(1193): WP_REST_Autosaves_Controller->get_items()
#14 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/rest-api/class-wp-rest-server.php(1041): WP_REST_Server->respond_to_request()
#15 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/rest-api.php(551): WP_REST_Server->dispatch()
#16 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/rest-api.php(2918): rest_do_request()
#17 [internal function]: rest_preload_api_request()
#18 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-includes/block-editor.php(753): array_reduce()
#19 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-admin/edit-form-blocks.php(77): block_editor_rest_api_preload()
#20 /var/www/vhosts/nor-con.co.uk/httpdocs/wp-admin/post.php(187): require('...')
#21 {main}
thrown
]]>
Hello!
We have Lazy Blocks version 3.5.1 and Gutenberg version 17.5.1. WordPress version 6.4.2. When trying to create a new block using your plugin, we get the error “This block has included an error and cannot be previewed.” Will there be plugin updates in which this error will be corrected?
Dear Nikita,
I’m a kind of young developer and I’ve been using lazyblock for a while. My approach is in a sense different: instead of storing or preparing each block on the db, I hard-code them as a php element:
}class Isabeltheme_Lazyblock {
public function __construct() {
add_action( 'init', array( $this, 'load_my_lazy_blocks' ));
add_action( 'lzb/handlebars/object', array($this, 'project_custom_lazyblock_handlebars_helper'));
}
public function load_my_lazy_blocks() {
if (function_exists('lazyblocks')) {
$blocks_dir = get_template_directory() . '/lazy-blocks/';
if (!is_dir($blocks_dir)) {
return;
}
$blocks = array_diff(scandir($blocks_dir), array('.', '..'));
foreach ($blocks as $block) {
if (!is_dir($blocks_dir . $block) || !file_exists($blocks_dir . $block . '/' . $block . '-block.php')) {
continue;
}
add_filter('lazyblock/' . $block . '/allow_wrapper', function ($a, $b) {
return false;
}, 10, 2);
require_once $blocks_dir . $block . '/' . $block . '-block.php';
}
}
}
public function project_custom_lazyblock_handlebars_helper(Handlebars\Handlebars $handlebars) {}
After then, I only want to use them instead of the core ones or others, so with my lazyblock.js file I will unregister those ones that I don’t need:
document.addEventListener('DOMContentLoaded', function() {
wp.blocks.getBlockTypes().forEach( function( blockType ){
let match = "lazyblock";
if (!blockType.name.match(match)) {
wp.blocks.unregisterBlockType(blockType.name);
}
});
});
//or
wp.domReady(function () {}
I recently noticed that my approach is not valid anymore because I was somehow forced to also include the tadv and the core/paragraph item.
wp.domReady(function () {
wp.blocks.getBlockTypes().forEach( function( blockType ) {
let match1 = "lazyblock";
let match2 = "tadv";
let match3 = "core/paragraph";
if (!blockType.name.startsWith(match1) && !blockType.name.startsWith(match2) && blockType.name !== match3) {
wp.blocks.unregisterBlockType(blockType.name);
}
});
});
I was wondering if you have a better suggestion on how to approach this issue and continue my script in order to rely only on lazyblock (also, today I notice that the ghostkit were also added.
Thank you in advance and I wish you a good rest of the day!
When I save the PHP code in backend. I get the error: Could not generate the preview.
Finally I found out, that one of the ModSec security rules of my provider (hoststar.ch) prohibited saving of the code. Temporarely disabling ModSec solved the problem.
In case other users of the wonderful plugin have similar problems, it would be helpful, if the plugin would substitute the appearance of the string “<?php” by something else on uploading (and recovr it after uploading).
Or is there another solution besides disabling security rules?
]]>Similar to this post, I cannot save blocks. It doesn’t show any errors in the console, but the update/publish button is disabled.
I already disabled all additional plugins and tested it with the 2024 default theme, same result.
Hi,
Is there a way to insert a Lazy Block into the navigation block?
I have selected the “Navigation Menus” in the “Condition” settings, but it seems like it’s not working, or maybe I misunderstood what that option is supposed to do.
The Lazy Block I created works perfectly and ii can be inserted anywhere else, but it’s not available in the Navigation block.
Regards.
]]>I just upgraded a development site to WordPress 6.4 and Lazy Blocks are not working in the editor. Instead, WordPress displays a message like:Your site doesn’t include support for the "lazyblock/hero-cta" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.
Is this a known issue? Thanks!
]]>Javing just started using Lazy Blocks, I need a block with full rich text (ie with full html).
I tried using Rich Text (wysiwyg) but this doesn’t seem to allow adding bulleted lists, images etc.
Classic editor does all of that, but is it ok to use this, or is it deprecated?
In other words, will classic editor be a problem in the future or is safe to use for the long term?
]]>