MWDelaney / sage-acf-wp-blocks

Composer library for generating ACF Gutenberg blocks from templates. Intended for use with Roots/Sage (http://roots.io)
346 stars 66 forks source link

Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead #79

Open dbebawy-modus opened 9 months ago

dbebawy-modus commented 9 months ago

/vendor/mwdelaney/sage-acf-gutenberg-blocks/sage-acf-gutenberg-blocks.php:56

artsunique commented 7 months ago

this works with php 8.1.xxxx /vendor/mwdelaney/sage-acf-gutenberg-blocks/sage-acf-gutenberg-blocks.php

line 56: $file = "{$dir}/{$slug}.blade.php";

line 80 and above:

if (empty($file_headers['title'])) { if (is_callable($sage_error)) { $sage_error(('This block needs a title: ' . $dir . '/' . $template->getFilename(), 'sage'), ('Block title missing', 'sage')); } else { // Handle the error appropriately echo "Error: sage_error function is not callable."; } }

if (empty($file_headers['category'])) { if (is_callable($sage_error)) { $sage_error(('This block needs a category: ' . $dir . '/' . $template->getFilename(), 'sage'), ('Block category missing', 'sage')); } else { // Handle the error appropriately echo "Error: sage_error function is not callable."; } }


namespace App;

// Check whether WordPress and ACF are available; bail if not. if (! function_exists('acf_register_block_type')) { return; } if (! function_exists('add_filter')) { return; } if (! function_exists('add_action')) { return; }

// Add the default blocks location, 'views/blocks', via filter add_filter('sage-acf-gutenberg-blocks-templates', function () { return ['views/blocks']; });

/**

/**

/**

/**

/**


Koli14 commented 5 months ago

If you install the dev-master version, the Deprication warning goes away, as it's fixed already, just there was no release from it. Put this in your composer.json: "mwdelaney/sage-acf-gutenberg-blocks": "dev-master".

vdrnn commented 5 months ago

If you install the dev-master version, the Deprication warning goes away, as it's fixed already, just there was no release from it. Put this in your composer.json: "mwdelaney/sage-acf-gutenberg-blocks": "dev-master".

Thank you for that hint! 👏🏻

zethuynh123 commented 4 months ago

If you install the dev-master version, the Deprication warning goes away, as it's fixed already, just there was no release from it. Put this in your composer.json: "mwdelaney/sage-acf-gutenberg-blocks": "dev-master".

Thank you it helped me a lot

tedw commented 1 week ago

@MWDelaney Would you mind publishing a new release so folks can get this update without using "dev-master" as the version? Thanks so much!