From eccd03b749bf1a0e083bb69f9842c5c63813f799 Mon Sep 17 00:00:00 2001 From: Eric van der Vlist Date: Sat, 9 May 2020 12:14:09 +0200 Subject: [PATCH] Defining $post as a global variable (#4) --- extended-toc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extended-toc.php b/extended-toc.php index 317cd71..64ed2c8 100644 --- a/extended-toc.php +++ b/extended-toc.php @@ -375,7 +375,8 @@ if( !class_exists('ExToC') ) { // we didn't find any markup... if( $pos === false ) { - // There was no markup, so insert at top or return original if this type does not need a ToC + global $post; + // There was no markup, so insert at top or return original if this type does not need a ToC if( !in_array(get_post_type($post), $this->options['auto_insert_post_types']) ) return $content; else