LuckyWP Table of Contents - Version 1.9.1

Version Description

2019-08-04 = + Added support Toolset Views plugin.

Download this release

Release Info

Developer theluckywp
Plugin Icon 128x128 LuckyWP Table of Contents
Version 1.9.1
Comparing to
See all releases

Code changes from version 1.9 to 1.9.1

front/Front.php CHANGED
@@ -94,6 +94,10 @@ class Front extends BaseFront
94
  return $content;
95
  }
96
 
 
 
 
 
97
  $settings = new PostSettings($post->ID);
98
  if (!$settings->enabled) {
99
  return $content;
94
  return $content;
95
  }
96
 
97
+ if (apply_filters('lwptoc_disable_autoinsert', false)) {
98
+ return $content;
99
+ }
100
+
101
  $settings = new PostSettings($post->ID);
102
  if (!$settings->enabled) {
103
  return $content;
integrations/ToolsetViews.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace luckywp\tableOfContents\integrations;
4
+
5
+ use luckywp\tableOfContents\core\base\BaseObject;
6
+ use luckywp\tableOfContents\core\Core;
7
+
8
+ class ToolsetViews extends BaseObject
9
+ {
10
+
11
+ protected $isToolseView = false;
12
+ protected $hasShortcode = false;
13
+
14
+ public function init()
15
+ {
16
+ add_action('wpv_before_shortcode_post_body', function () {
17
+ $this->isToolseView = true;
18
+ });
19
+ add_filter('the_content', [$this, 'theContent'], 9998);
20
+ add_action('lwptoc_disable_autoinsert', function ($value) {
21
+ if ($this->isToolseView || $this->hasShortcode) {
22
+ return true;
23
+ }
24
+ return $value;
25
+ });
26
+ add_action('wpv_after_shortcode_post_body', function () {
27
+ $this->isToolseView = false;
28
+ });
29
+ }
30
+
31
+ public function theContent($content)
32
+ {
33
+ $this->hasShortcode = has_shortcode($content, Core::$plugin->shortcode->getTag());
34
+ return $content;
35
+ }
36
+ }
luckywp-table-of-contents.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: LuckyWP Table of Contents
4
  Plugin URI: https://theluckywp.com/product/table-of-contents/
5
  Description: Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).
6
- Version: 1.9
7
  Author: LuckyWP
8
  Author URI: https://theluckywp.com/
9
  Text Domain: luckywp-table-of-contents
@@ -29,6 +29,6 @@ $lwptocAutoloader->register();
29
  $lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
30
 
31
  $config = require(__DIR__ . '/config/plugin.php');
32
- (new \luckywp\tableOfContents\plugin\Plugin($config))->run('1.9', __FILE__, 'lwptoc_');
33
 
34
  require_once __DIR__ . '/functions.php';
3
  Plugin Name: LuckyWP Table of Contents
4
  Plugin URI: https://theluckywp.com/product/table-of-contents/
5
  Description: Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).
6
+ Version: 1.9.1
7
  Author: LuckyWP
8
  Author URI: https://theluckywp.com/
9
  Text Domain: luckywp-table-of-contents
29
  $lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
30
 
31
  $config = require(__DIR__ . '/config/plugin.php');
32
+ (new \luckywp\tableOfContents\plugin\Plugin($config))->run('1.9.1', __FILE__, 'lwptoc_');
33
 
34
  require_once __DIR__ . '/functions.php';
plugin/Plugin.php CHANGED
@@ -13,6 +13,7 @@ use luckywp\tableOfContents\core\wp\Options;
13
  use luckywp\tableOfContents\front\Front;
14
  use luckywp\tableOfContents\integrations\BeaverBuilder;
15
  use luckywp\tableOfContents\integrations\RankMath;
 
16
  use luckywp\tableOfContents\plugin\editorBlock\EditorBlock;
17
  use luckywp\tableOfContents\plugin\mcePlugin\McePlugin;
18
  use WP_Post_Type;
@@ -66,6 +67,9 @@ class Plugin extends BasePlugin
66
  if (class_exists('\RankMath')) {
67
  Core::createObject(RankMath::className());
68
  }
 
 
 
69
  });
70
  }
71
 
13
  use luckywp\tableOfContents\front\Front;
14
  use luckywp\tableOfContents\integrations\BeaverBuilder;
15
  use luckywp\tableOfContents\integrations\RankMath;
16
+ use luckywp\tableOfContents\integrations\ToolsetViews;
17
  use luckywp\tableOfContents\plugin\editorBlock\EditorBlock;
18
  use luckywp\tableOfContents\plugin\mcePlugin\McePlugin;
19
  use WP_Post_Type;
67
  if (class_exists('\RankMath')) {
68
  Core::createObject(RankMath::className());
69
  }
70
+ if (defined('WPV_VERSION')) {
71
+ Core::createObject(ToolsetViews::className());
72
+ }
73
  });
74
  }
75
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://theluckywp.com/product/table-of-contents/
4
  Tags: table of contents, toc, navigation, links, seo
5
  Requires at least: 4.7
6
  Tested up to: 5.2.2
7
- Stable tag: 1.9
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -139,6 +139,9 @@ For non-English websites it is recommended to enable the `Intl` PHP extension.
139
 
140
  == Changelog ==
141
 
 
 
 
142
  = 1.9 — 2019-08-04 =
143
  + Added special color scheme "Inherit from theme".
144
  + Added option "List Markup Tags".
4
  Tags: table of contents, toc, navigation, links, seo
5
  Requires at least: 4.7
6
  Tested up to: 5.2.2
7
+ Stable tag: 1.9.1
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
139
 
140
  == Changelog ==
141
 
142
+ = 1.9.1 — 2019-08-04 =
143
+ + Added support Toolset Views plugin.
144
+
145
  = 1.9 — 2019-08-04 =
146
  + Added special color scheme "Inherit from theme".
147
  + Added option "List Markup Tags".