🧑‍🍳 Block Developer Cookbook Recipe: Block Context🧑‍🍳

  Рет қаралды 311

Ryan Welcher Codes

Ryan Welcher Codes

Күн бұрын

Пікірлер
@davisvilums
@davisvilums Жыл бұрын
This looks like a good way how to create a reference from parent to child if I have a Accordion or a Slider blocks with child bloks as individuals accordion items or slides.
@RyanWelcherCodes
@RyanWelcherCodes Жыл бұрын
That’s a great use-case for context. Thanks for sharing!
@jeffersoncarvalho2566
@jeffersoncarvalho2566 Жыл бұрын
Hello. Is there a way to hook into js script for core blocks or add my custom styles and script, like passing a viewScript in block.json on custom blocks? I want to add javascript to core/quote block but i want the view.js (or my custom js) only be enqueued if the block is on the page. I achieved this by creating a core/quote block in my theme with the viewScript, but not registering the block, since the block is already registered. I had to register manually the block styles and script. For the styles, using "wp_enqueue_block_style" solves. But for the viewScript, i had to use "render_block" filter, check if the blockName is "core/quote" and then, enqueue the script.
@RyanWelcherCodes
@RyanWelcherCodes 11 ай бұрын
That's exactly how I'd do it as well. There is currently no hook available to do this. You can also use the dedicated hook for that block to remove the need to check the block - developer.wordpress.org/reference/hooks/render_block_this-name/
🧑‍🍳 Block Developer Cookbook Recipe: Command Palette 🧑‍🍳
55:07
Reviewing Gutenberg 17.7
21:19
Ryan Welcher Codes
Рет қаралды 274
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Earn $100 A DAY Online Copy & Pasting Videos Legally! (Make Money Online)
12:17
Turbocharge Your WordPress with Custom Blocks in WordPress 6.7
1:24:40
Ryan Welcher Codes
Рет қаралды 355
Diving into Typescript for WordPress development
2:50:49
Ryan Welcher Codes
Рет қаралды 174
Terraform Basics - VPC Resources - Totally Tech Tom
20:50
Totally Tech Tom
Рет қаралды 50
Transform a WordPress Block Theme with DARK MODE alongside a LEGEND!
1:06:52
Transform a WordPress Block Theme with DARK MODE alongside a LEGEND!
26:36
Angular/ThreeJS - Video 325 went over index
18:47
Marty Trujillo
Рет қаралды 23
Express your ideas by writing your own gems - Ruby Banitsa conf 2024
51:56
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН