This question already has an answer here: Where on Github, or elsewhere, can I find the code for core-blocks? (1 answer) Closed 4 years ago.admin管理员组文章数量:1323562
I apologize if this has been answered already. I've spent several hours searching through the WordPress directories and documentation, and I haven't been able to find the code for the default Gutenberg blocks. Could anyone point me in the right direction?
To clarify, I am specifically wondering where in the directory tree of a WordPress installation the blocks are defined.
This question already has an answer here: Where on Github, or elsewhere, can I find the code for core-blocks? (1 answer) Closed 4 years ago.I apologize if this has been answered already. I've spent several hours searching through the WordPress directories and documentation, and I haven't been able to find the code for the default Gutenberg blocks. Could anyone point me in the right direction?
To clarify, I am specifically wondering where in the directory tree of a WordPress installation the blocks are defined.
Share Improve this question edited Sep 13, 2020 at 2:13 blendenzo asked Sep 10, 2020 at 1:10 blendenzoblendenzo 1034 bronze badges 1- @JacobPeattie Partly. It looks like the answer there links to the most recent "bleeding edge" source code on Github. That is very helpful, but I'm specifically interested in seeing the source for the block versions in my current WordPress installation, so I would like to know where the locally installed blocks are defined. I will clarify my question with that extra detail. – blendenzo Commented Sep 10, 2020 at 15:02
1 Answer
Reset to default 3If your end goal is to have a better understanding of how blocks work, I would encourage to install the gutenberg plugin instead.
The block code within the WordPress installation itself is not intended to be read by end users nor directly modified. It's minified to save space.
To answer your question, the code is stored in a couple places:
wp-includes/js/dist/block-library.js
wp-includes/blocks/
If you wish to modify a core block, like a block style variation where you can modify the CSS of a particular block, do not modify those files, it's recommended to place your code in a custom plugin that you would make. (and depending how much you want to modify it, you may want to just create your own block).
本文标签: Where in a Wordpress installation is the code for the default Gutenberg blocks located
版权声明:本文标题:Where in a Wordpress installation is the code for the default Gutenberg blocks located? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742118690a2421591.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论