Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created February 13, 2023 17:23
Show Gist options
  • Save hellofromtonya/8c4176c4ea87e02424cf3bfd7b954ac0 to your computer and use it in GitHub Desktop.
Save hellofromtonya/8c4176c4ea87e02424cf3bfd7b954ac0 to your computer and use it in GitHub Desktop.
Register block type with invalid properties data types.
<?php
$args = array(
'title' => true,
'description' => true,
'icon' => true,
'attributes' => 'invalid_attributes',
'provides_context' => 'invalid_provides_context',
'uses_context' => 'invalid_uses_context',
'category' => true,
'editor_script' => true,
'script' => true,
'view_script' => true,
'editor_style' => true,
'style' => true,
'keywords' => 'invalid_keywords',
'example' => 'invalid_example',
'parent' => 'invalid_parent',
'ancestor' => 'invalid_ancestor',
'script_handles' => 'invalid_script_handles',
'view_script_handles' => 'invalid_view_script_handles',
'editor_style_handles' => 'invalid_editor_style_handles',
'style_handles' => 'nvalid_style_handles',
'supports' => 'invalid_supports',
'styles' => 'invalid_styles',
'render_callback' => 'invalid_callback',
'textdomain' => true,
'variations' => 'invalid_variations',
);
register_block_type( 'test/invalid', $args );
unset( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment