bangank36 / spriral-learning

My learning resource
MIT License
1 stars 0 forks source link

Gutenberg: Fix nested template files in WP #32

Open bangank36 opened 1 year ago

bangank36 commented 1 year ago

Summary

This allows the Gutenberg plugin to modify the default block template types provided by WordPress.

Reference

bangank36 commented 1 year ago

Override template utils

Filter pre_get_block_templates

add_filter( 'pre_get_block_templates', 'gutenberg_get_block_templates', 10, 2 );


- Current `$template_type` is always bound to the initial value as wp_template or wp_template_part...
bangank36 commented 1 year ago

Override Rest Class

For Rest Template Controller

More findings

Saving template content to database

Template files retrival

bangank36 commented 1 year ago

How template path retrieve