post_content ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Core content filter. add_filter( 'the_content', array( TocHooks::class, 'inject_toc' ), 20 ); $built = TocRenderer::build( $content, $settings ); return $built['toc']; } } if ( ! function_exists( 'airygen_the_toc' ) ) { /** * Echo the TOC HTML for the current post. * * @return void */ function airygen_the_toc(): void { echo wp_kses_post( airygen_get_toc() ); } }