$new_slug, 'title' => $new_title]) { $has_category = true; } } if(!$has_category) { $categories[] = array( 'slug' => $new_slug, 'title' => $new_title ); }; return $categories; }); /** * Registers the block using the metadata loaded from the `block.json` file. * Behind the scenes, it registers also all assets so they can be enqueued * through the block editor in the corresponding context. * * @see https://developer.wordpress.org/reference/functions/register_block_type/ */ function tsu_financial_progress_block_tsu_financial_progress_block_block_init() { register_block_type( __DIR__ . '/build' ); } add_action( 'init', 'tsu_financial_progress_block_tsu_financial_progress_block_block_init' );