Easy Table of Contents - Version 2.0-rc8

Version Description

Download this release

Release Info

Developer shazahm1@hotmail.com
Plugin Icon 128x128 Easy Table of Contents
Version 2.0-rc8
Comparing to
See all releases

Code changes from version 2.0-rc7 to 2.0-rc8

README.txt CHANGED
@@ -19,7 +19,7 @@ A user friendly, featured focused plugin which allows you to insert a table of c
19
  * Automatically generate a table of contents for your posts, pages and custom post types by parsing its contents for headers.
20
  * Supports the `<!--nextpage-->` tag.
21
  * Supports the Rank Math plugin.
22
- * Supports the Classic Editor, Gutenberg, Elementor and Visual Composer page editors.
23
  * Optionally enable for pages and/or posts. Custom post types are supported, as long as their content is output with the `the_content()` template tag.
24
  * Optionally auto insert the table of contents into the page, selectable by enabled post type.
25
  * Provides many easy to understand options to configure when and where to insert the table of contents.
19
  * Automatically generate a table of contents for your posts, pages and custom post types by parsing its contents for headers.
20
  * Supports the `<!--nextpage-->` tag.
21
  * Supports the Rank Math plugin.
22
+ * Supports the Classic Editor, Gutenberg, Elementor, WPBakery Page Builder and Visual Composer page editors.
23
  * Optionally enable for pages and/or posts. Custom post types are supported, as long as their content is output with the `the_content()` template tag.
24
  * Optionally auto insert the table of contents into the page, selectable by enabled post type.
25
  * Provides many easy to understand options to configure when and where to insert the table of contents.
easy-table-of-contents.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: http://connections-pro.com/
5
  * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
6
- * Version: 2.0-rc7
7
  * Author: Steven A. Zahm
8
  * Author URI: http://connections-pro.com/
9
  * Text Domain: easy-table-of-contents
@@ -26,7 +26,7 @@
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Steven A. Zahm
29
- * @version 2.0-rc7
30
  */
31
 
32
  use function Easy_Plugins\Table_Of_Contents\String\mb_find_replace;
@@ -47,7 +47,7 @@ if ( ! class_exists( 'ezTOC' ) ) {
47
  * @since 1.0
48
  * @var string
49
  */
50
- const VERSION = '2.0-rc7';
51
 
52
  /**
53
  * Stores the instance of this class.
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: http://connections-pro.com/
5
  * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
6
+ * Version: 2.0-rc8
7
  * Author: Steven A. Zahm
8
  * Author URI: http://connections-pro.com/
9
  * Text Domain: easy-table-of-contents
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Steven A. Zahm
29
+ * @version 2.0-rc8
30
  */
31
 
32
  use function Easy_Plugins\Table_Of_Contents\String\mb_find_replace;
47
  * @since 1.0
48
  * @var string
49
  */
50
+ const VERSION = '2.0-rc8';
51
 
52
  /**
53
  * Stores the instance of this class.
includes/inc.plugin-compatibility.php CHANGED
@@ -132,3 +132,45 @@ add_filter(
132
  return $apply;
133
  }
134
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  return $apply;
133
  }
134
  );
135
+
136
+ /**
137
+ * Do not allow `the_content` TOC callback to run when editing a page in WPBakery Page Builder.
138
+ *
139
+ * @link https://wordpress.org/support/topic/correct-method-to-determine-if-using-frontend-editor/#post-12404679
140
+ *
141
+ * @since 2.0
142
+ */
143
+ add_filter(
144
+ 'ez_toc_maybe_apply_the_content_filter',
145
+ function( $apply ) {
146
+
147
+ if ( function_exists( 'vc_is_page_editable' ) ) {
148
+
149
+ if ( vc_is_page_editable() ) {
150
+
151
+ $apply = false;
152
+ }
153
+ }
154
+
155
+ return $apply;
156
+ }
157
+ );
158
+
159
+ /**
160
+ * Filter to remove WPBakery Page Builder related shortcodes from being processed as eligible TOC items.
161
+ *
162
+ * @since 2.0
163
+ */
164
+ add_filter(
165
+ 'ez_toc_strip_shortcodes_tagnames',
166
+ function( $tags_to_remove ) {
167
+
168
+ $shortcodes = array (
169
+ 'vc_tta_section',
170
+ );
171
+
172
+ $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
173
+
174
+ return $tags_to_remove;
175
+ }
176
+ );