$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>javascript - Hooking a callback into the code within a Gutenberg block|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Hooking a callback into the code within a Gutenberg block

matteradmin9PV0评论

I want to run some JavaScript when a user uploads an image or images using the core/image block or core/gallery block. Ideally I would run my own code when the onSelectImage function is called (and the equivalent for core/gallery). I've looked at hooks in Gutenberg but it seems that they're only available in a small number of places, and there are none directly for the core/image or core/gallery blocks.

I know the developers intend to make it easy to apply actions and filters in Gutenberg, but I'm not sure if they just haven't added any hooks/filters for the core/image block yet or if it's already possible but I'm not seeing how to do it.

Post a comment

comment list (0)

  1. No comments so far