linchpin / post-type-spotlight

Allows admin chosen post types to have a featured post check box on the edit screen. Also adds appropriate classes to front end post display, and allows featured posts to be queried via a taxonomy query.
GNU General Public License v2.0
0 stars 0 forks source link

Update enqueue for block JS #96

Open maxinacube opened 7 months ago

maxinacube commented 7 months ago

Update enqueue of post-type-spotlight-block-editor in class-post-type-spotlight-block-editor.php to use https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/

maxinacube commented 7 months ago

@aaronware Can you review these updates?

I updated the init hook to enqueue_block_editor_assets. With that, I also removed the logic within the hooked function (block_scripts) to check for admin and post type. The block editor does not have context to the $_POST and these checks were preventing scripts from loading anywhere.

I noticed console errors for the admin CSS, but the file does not exist within the last few releases. I downloaded an older version and see the admin style we did introduce were very minimal and not necessary.