• Hi,

    When selecting the output method ‘PHP’ for block code, if I insert some code – for ex. <?php echo ‘test’; ?> – and save the block, the insertion is not saved (I refresh the page, and my insertion is not there)…

    With WP 6.0 and your latest plugin version.

    Can you help ?
    Thank you in advance,

    Kind regards,

    Stephane

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter stephanemartinw

    (@stephanemartinw)

    (PHP version is 8.0)

    Hi,

    same here with WP 5.9.3 by using Gutenberg on PHP 7.4 with Lazy Block 2.5.3

    Updated new data with images and multiple selection field (radio inputs …) can’t get saved and can’t get deleted. This counts to placed elements in inspector or content.

    I recognized by switching to Code Editor in Gutenberg, that all fields with images and multiple options won’t have a data entry in the dataset.

    For example. A workaround for urgent updates was to add another temporary image field and overwrite the existing image variable with it in the template.

    In the WP debug log appears a log entry like
    `PHP Notice: Trying to access array offset on value of type null in /wp-content/plugins/lazy-blocks/classes/class-blocks.php(1238) : eval()’d code on line 19

    I hope this information helps with debugging.

    Kind regards
    webathlet

    So, it seems that all fields data that are saved in postmeta can’t get updated if an partial entry dataset exits.

    For example. If a image field entry value is flushed and re assigned in Editor then the new image value isn’t savend in this data entry.

    If I delete this data entry in the postmeta and re assign an image in the Editor it will be saved this time.

    Thread Starter stephanemartinw

    (@stephanemartinw)

    Hi Lazy Blocks support team,

    Do you think you can help here on this issue ?
    I cannot save a block output using PHP:

    <p><?php echo $attributes[‘texte’]; ?></p>

    Post seems to be updated but page refresh empties the output field.

    Thank you in advance,

    Regards,

    Stephane

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unable to save php code in block editor’ is closed to new replies.