From eeb6ddcc2fc0131cba9571e8fda4db67e7027c60 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 3 Feb 2026 17:21:59 +1000 Subject: [PATCH] Avoid processing the_content when o2_process_the_content is false This method isn't using the `o2_process_the_content` filter which can cause a significant speed issue when the content filters are being run in a context that doesn't require the metadata - such as within a shortcode output in the middle of the page. --- o2.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/o2.php b/o2.php index 1584558..92d5836 100644 --- a/o2.php +++ b/o2.php @@ -891,6 +891,10 @@ public static function add_json_data( $content ) { return $content; } + if ( ! apply_filters( 'o2_process_the_content', true ) ) { + return $content; + } + // password protected post? return immediately (password protected pages are OK) if ( ! is_page() && ! empty( $post->post_password ) ) { return $content;