Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created January 4, 2022 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellofromtonya/3fc80da6d76146e08921a38ffaad0e7e to your computer and use it in GitHub Desktop.
Save hellofromtonya/3fc80da6d76146e08921a38ffaad0e7e to your computer and use it in GitHub Desktop.
Discover the data given by the 'block_type_metadata_settings' filter.
<?php
add_filter(
'block_type_metadata_settings',
static function( $settings, $metadata ) {
if (
! isset( $settings['parent'][0] ) ||
'core/navigation' !== $settings['parent'][0]
) {
return $settings;
}
?>
<h2>block_type_metadata_settings</h2>
<h3>Settings</h3>
<pre>
<?php var_dump( $settings ); ?>
</pre><br>
<?php
return $settings;
},
10, 2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment