Version Description
- Added support Beaver Builder plugin.
- Fix: in some cases, headings processing did not work correctly.
Download this release
Release Info
Developer | theluckywp |
Plugin | LuckyWP Table of Contents |
Version | 1.5.4 |
Comparing to | |
See all releases |
Code changes from version 1.5.3 to 1.5.4
- integrations/BeaverBuilder.php +15 -0
- luckywp-table-of-contents.php +2 -2
- plugin/Plugin.php +9 -0
- plugin/contentHandling/ContentHandling.php +1 -1
- readme.txt +6 -2
integrations/BeaverBuilder.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 BeaverBuilder extends BaseObject
|
9 |
+
{
|
10 |
+
|
11 |
+
public function init()
|
12 |
+
{
|
13 |
+
add_filter('fl_builder_before_render_shortcodes', [Core::$plugin->shortcode, 'theContent'], 9999);
|
14 |
+
}
|
15 |
+
}
|
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.5.
|
7 |
Author: LuckyWP
|
8 |
Author URI: https://theluckywp.com/
|
9 |
Text Domain: lwptoc
|
@@ -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.5.
|
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.5.4
|
7 |
Author: LuckyWP
|
8 |
Author URI: https://theluckywp.com/
|
9 |
Text Domain: lwptoc
|
29 |
$lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
|
30 |
|
31 |
$config = require(__DIR__ . '/config/plugin.php');
|
32 |
+
(new \luckywp\tableOfContents\plugin\Plugin($config))->run('1.5.4', __FILE__, 'lwptoc_');
|
33 |
|
34 |
require_once __DIR__ . '/functions.php';
|
plugin/Plugin.php
CHANGED
@@ -7,9 +7,11 @@ use luckywp\tableOfContents\admin\Rate;
|
|
7 |
use luckywp\tableOfContents\core\base\BasePlugin;
|
8 |
use luckywp\tableOfContents\core\base\Request;
|
9 |
use luckywp\tableOfContents\core\base\View;
|
|
|
10 |
use luckywp\tableOfContents\core\helpers\ArrayHelper;
|
11 |
use luckywp\tableOfContents\core\wp\Options;
|
12 |
use luckywp\tableOfContents\front\Front;
|
|
|
13 |
use luckywp\tableOfContents\plugin\editorBlock\EditorBlock;
|
14 |
use luckywp\tableOfContents\plugin\mcePlugin\McePlugin;
|
15 |
use WP_Post_Type;
|
@@ -60,6 +62,13 @@ class Plugin extends BasePlugin
|
|
60 |
add_action('widgets_init', function () {
|
61 |
register_widget(WpWidget::class);
|
62 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
private $_postTypes;
|
7 |
use luckywp\tableOfContents\core\base\BasePlugin;
|
8 |
use luckywp\tableOfContents\core\base\Request;
|
9 |
use luckywp\tableOfContents\core\base\View;
|
10 |
+
use luckywp\tableOfContents\core\Core;
|
11 |
use luckywp\tableOfContents\core\helpers\ArrayHelper;
|
12 |
use luckywp\tableOfContents\core\wp\Options;
|
13 |
use luckywp\tableOfContents\front\Front;
|
14 |
+
use luckywp\tableOfContents\integrations\BeaverBuilder;
|
15 |
use luckywp\tableOfContents\plugin\editorBlock\EditorBlock;
|
16 |
use luckywp\tableOfContents\plugin\mcePlugin\McePlugin;
|
17 |
use WP_Post_Type;
|
62 |
add_action('widgets_init', function () {
|
63 |
register_widget(WpWidget::class);
|
64 |
});
|
65 |
+
|
66 |
+
// Интеграции с другими плагинами
|
67 |
+
add_action('plugins_loaded', function () {
|
68 |
+
if (defined('FL_BUILDER_VERSION')) {
|
69 |
+
Core::createObject(BeaverBuilder::className());
|
70 |
+
}
|
71 |
+
});
|
72 |
}
|
73 |
|
74 |
private $_postTypes;
|
plugin/contentHandling/ContentHandling.php
CHANGED
@@ -21,7 +21,7 @@ class ContentHandling
|
|
21 |
|
22 |
static::$headingIdCounter = 0;
|
23 |
static::$headingIds = [];
|
24 |
-
$result->content = preg_replace_callback('#<h([1-6])(.*?)>(.*?)</h\d>#', function ($m) use ($dto, $result, $skipRegex) {
|
25 |
$label = trim(strip_tags($m[3]));
|
26 |
$headingId = static::makeHeadingId($label, $dto->hashFormat);
|
27 |
$headingIndex = (int)$m[1];
|
21 |
|
22 |
static::$headingIdCounter = 0;
|
23 |
static::$headingIds = [];
|
24 |
+
$result->content = preg_replace_callback('#<h([1-6])(.*?)>(.*?)</h\d>#imsu', function ($m) use ($dto, $result, $skipRegex) {
|
25 |
$label = trim(strip_tags($m[3]));
|
26 |
$headingId = static::makeHeadingId($label, $dto->hashFormat);
|
27 |
$headingIndex = (int)$m[1];
|
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.2.
|
7 |
-
Stable tag: 1.5.
|
8 |
Requires PHP: 5.6.20
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -138,6 +138,10 @@ For non-English websites it is recommended to enable the `Intl` PHP extension.
|
|
138 |
|
139 |
== Changelog ==
|
140 |
|
|
|
|
|
|
|
|
|
141 |
= 1.5.3 =
|
142 |
* Fix: when auto insert TOC do not overrided settings "Wrap table of contents with <!--noindex--> tag" and "Skip headings".
|
143 |
* Fix: in some cases, auto insert after first block did not work.
|
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.2.2
|
7 |
+
Stable tag: 1.5.4
|
8 |
Requires PHP: 5.6.20
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
138 |
|
139 |
== Changelog ==
|
140 |
|
141 |
+
= 1.5.4 =
|
142 |
+
* Added support Beaver Builder plugin.
|
143 |
+
* Fix: in some cases, headings processing did not work correctly.
|
144 |
+
|
145 |
= 1.5.3 =
|
146 |
* Fix: when auto insert TOC do not overrided settings "Wrap table of contents with <!--noindex--> tag" and "Skip headings".
|
147 |
* Fix: in some cases, auto insert after first block did not work.
|