$tab ) { $tab_properties = $tab[1]; if ( 'general' === $tab_properties['id'] ) { $tab_sections = $tab[2]; foreach ( $tab_sections as $section_index => $section ) { $section_properties = $section[1]; // TODO: this is not the right way to do this, since it is checking a localized string. if ( 'Basic details' === $section_properties['title'] ) { $section_fields = $section[2]; // add our block to the end of the section $section_fields[] = [ '{{namespace}}/{{slug}}', [ 'message' => '{{title}}', ] ]; // update the template with our new block $args[ 'template' ][ $tab_index ][2][ $section_index ][2] = $section_fields; break; } } break; } } return $args; } add_filter( 'woocommerce_register_post_type_product', '{{namespaceSnakeCase}}_{{slugSnakeCase}}_add_block_to_product_editor', 100 );