private function get_modules_content( \WP_Post $post ) : string {
		$flexible_content = $this->_flexible_content[ $post->ID ] ?? null;

		if ( empty( $flexible_content ) ) {
			$layouts = $this->get_current_post_layouts( $post );

			foreach ( $layouts as $layout ) {

				if ( ! isset( $layout['acf_fc_layout'] ) || empty( $layout['acf_fc_layout'] ) ) {
					continue;
				}

				ob_start();
				$this->render_module_template( $layout['acf_fc_layout'], $layout );
				$flexible_content .= ob_get_clean();
			}

			/*
			 * Store the flexible content to reuse it if `the_content` is
			 * runned more than once.
			 */
			$this->_flexible_content[ $post->ID ] = $flexible_content;
		}

		return (string) $flexible_content;
	}