carolinan / fullsiteediting

https://fullsiteediting.com/
289 stars 88 forks source link

wp_enqueue_block_style path #22

Closed MongooseDoom closed 2 years ago

MongooseDoom commented 2 years ago

I was looking into how to inline a block stylesheet and I saw references to "Stylesheets can opt in by adding path data using wp_style_add_data, and defining the file’s absolute path". I see here on line 38 of the starter themes that it includes a path but it's written different from the other arguments.

https://github.com/carolinan/fullsiteediting/blob/29ee428c1b16cdd05a37c3c506908e9ab984dd57/Starter%20themes/advanced-59/functions.php#L35-L39

I'm pretty rusty with php, but should it be written more like the following? When I change it to that, it inlines my small css file.

 'path'   => get_theme_file_path( "assets/css/blocks/$block_name.min.css" ),
carolinan commented 2 years ago

Hi

Yes, you are right, thank you for spotting and reporting this. It needs to be either outside the array or the $args[] around path needs to be removed.