Version Description
2020-08-03 = + Minor refactoring.
Download this release
Release Info
Developer | theluckywp |
Plugin | LuckyWP Table of Contents |
Version | 2.1.4 |
Comparing to | |
See all releases |
Code changes from version 2.1.3 to 2.1.4
- luckywp-table-of-contents.php +2 -2
- plugin/contentHandling/ContentHandling.php +20 -12
- readme.txt +5 -2
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: 2.1.
|
7 |
Author: LuckyWP
|
8 |
Author URI: https://theluckywp.com/
|
9 |
Text Domain: luckywp-table-of-contents
|
@@ -47,6 +47,6 @@ $lwptocAutoloader->register();
|
|
47 |
$lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
|
48 |
|
49 |
$config = require(__DIR__ . '/config/plugin.php');
|
50 |
-
(new \luckywp\tableOfContents\plugin\Plugin($config))->run('2.1.
|
51 |
|
52 |
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: 2.1.4
|
7 |
Author: LuckyWP
|
8 |
Author URI: https://theluckywp.com/
|
9 |
Text Domain: luckywp-table-of-contents
|
47 |
$lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
|
48 |
|
49 |
$config = require(__DIR__ . '/config/plugin.php');
|
50 |
+
(new \luckywp\tableOfContents\plugin\Plugin($config))->run('2.1.4', __FILE__, 'lwptoc_');
|
51 |
|
52 |
require_once __DIR__ . '/functions.php';
|
plugin/contentHandling/ContentHandling.php
CHANGED
@@ -9,6 +9,16 @@ use luckywp\tableOfContents\plugin\dom\Dom;
|
|
9 |
class ContentHandling
|
10 |
{
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
/**
|
13 |
* @param ContentHandlingDto $dto
|
14 |
* @return ContentHandlingResult
|
@@ -20,8 +30,7 @@ class ContentHandling
|
|
20 |
|
21 |
$skipRegex = Core::$plugin->skipHeadingTextToRegex($dto->skipText);
|
22 |
|
23 |
-
static
|
24 |
-
static::$headingIds = [];
|
25 |
|
26 |
$dom = Dom::make($dto->content);
|
27 |
if ($dom === false) {
|
@@ -92,16 +101,6 @@ class ContentHandling
|
|
92 |
return $label;
|
93 |
}
|
94 |
|
95 |
-
/**
|
96 |
-
* @var int
|
97 |
-
*/
|
98 |
-
protected static $headingIdCounter;
|
99 |
-
|
100 |
-
/**
|
101 |
-
* @var string[]
|
102 |
-
*/
|
103 |
-
protected static $headingIds;
|
104 |
-
|
105 |
/**
|
106 |
* @param string $label
|
107 |
* @param ContentHandlingDto $dto
|
@@ -172,4 +171,13 @@ class ContentHandling
|
|
172 |
|
173 |
return $id;
|
174 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
9 |
class ContentHandling
|
10 |
{
|
11 |
|
12 |
+
/**
|
13 |
+
* @var int
|
14 |
+
*/
|
15 |
+
protected static $headingIdCounter = 0;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var string[]
|
19 |
+
*/
|
20 |
+
protected static $headingIds = [];
|
21 |
+
|
22 |
/**
|
23 |
* @param ContentHandlingDto $dto
|
24 |
* @return ContentHandlingResult
|
30 |
|
31 |
$skipRegex = Core::$plugin->skipHeadingTextToRegex($dto->skipText);
|
32 |
|
33 |
+
static::reset();
|
|
|
34 |
|
35 |
$dom = Dom::make($dto->content);
|
36 |
if ($dom === false) {
|
101 |
return $label;
|
102 |
}
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
/**
|
105 |
* @param string $label
|
106 |
* @param ContentHandlingDto $dto
|
171 |
|
172 |
return $id;
|
173 |
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* @return void
|
177 |
+
*/
|
178 |
+
protected static function reset()
|
179 |
+
{
|
180 |
+
static::$headingIdCounter = 0;
|
181 |
+
static::$headingIds = [];
|
182 |
+
}
|
183 |
}
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: theluckywp
|
|
3 |
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.
|
7 |
-
Stable tag: 2.1.
|
8 |
Requires PHP: 5.6.20
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -160,6 +160,9 @@ For non-English websites it is recommended to enable the `Intl` PHP extension.
|
|
160 |
|
161 |
== Changelog ==
|
162 |
|
|
|
|
|
|
|
163 |
= 2.1.3 — 2020-06-07 =
|
164 |
+ Added hook filter `lwptoc_allow`.
|
165 |
|
3 |
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.9.2
|
7 |
+
Stable tag: 2.1.4
|
8 |
Requires PHP: 5.6.20
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
160 |
|
161 |
== Changelog ==
|
162 |
|
163 |
+
= 2.1.4 — 2020-08-03 =
|
164 |
+
+ Minor refactoring.
|
165 |
+
|
166 |
= 2.1.3 — 2020-06-07 =
|
167 |
+ Added hook filter `lwptoc_allow`.
|
168 |
|