LuckyWP Table of Contents - Version 1.3.1

Version Description

  • Bug fix
Download this release

Release Info

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

Code changes from version 1.3.0 to 1.3.1

core/helpers/ValueHelper.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace luckywp\tableOfContents\core\helpers;
4
+
5
+ class ValueHelper
6
+ {
7
+
8
+ /**
9
+ * @param mixed $value
10
+ * @return array
11
+ */
12
+ public static function assertArray($value)
13
+ {
14
+ return is_array($value) ? $value : [];
15
+ }
16
+ }
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 or Gutenberg block).
6
- Version: 1.3.0
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.3.0', __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 or Gutenberg block).
6
+ Version: 1.3.1
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.3.1', __FILE__, 'lwptoc_');
33
 
34
  require_once __DIR__ . '/functions.php';
plugin/Shortcode.php CHANGED
@@ -6,6 +6,7 @@ use luckywp\tableOfContents\core\base\BaseObject;
6
  use luckywp\tableOfContents\core\Core;
7
  use luckywp\tableOfContents\core\helpers\ArrayHelper;
8
  use luckywp\tableOfContents\core\helpers\Html;
 
9
  use WP_Post;
10
 
11
  /**
@@ -141,7 +142,7 @@ class Shortcode extends BaseObject
141
  $this->shortcodesAttrs = [];
142
  preg_match_all($this->getShortcodeRegex(), $content, $matches);
143
  foreach ($matches[3] as $match) {
144
- $this->shortcodesAttrs[] = shortcode_parse_atts($match);
145
  }
146
 
147
  $headingsRegex = $this->makeHeadingsRegex();
6
  use luckywp\tableOfContents\core\Core;
7
  use luckywp\tableOfContents\core\helpers\ArrayHelper;
8
  use luckywp\tableOfContents\core\helpers\Html;
9
+ use luckywp\tableOfContents\core\helpers\ValueHelper;
10
  use WP_Post;
11
 
12
  /**
142
  $this->shortcodesAttrs = [];
143
  preg_match_all($this->getShortcodeRegex(), $content, $matches);
144
  foreach ($matches[3] as $match) {
145
+ $this->shortcodesAttrs[] = ValueHelper::assertArray(shortcode_parse_atts($match));
146
  }
147
 
148
  $headingsRegex = $this->makeHeadingsRegex();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://theluckywp.com/product/table-of-contents/
4
  Tags: table of contents, toc, navigation, links, heading
5
  Requires at least: 4.7
6
  Tested up to: 5.2
7
- Stable tag: 1.3.0
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -125,6 +125,9 @@ For non-English websites it is recommended to enable the `Intl` PHP extension.
125
 
126
  == Changelog ==
127
 
 
 
 
128
  = 1.3.0 =
129
  + Skip headings by level or text.
130
 
4
  Tags: table of contents, toc, navigation, links, heading
5
  Requires at least: 4.7
6
  Tested up to: 5.2
7
+ Stable tag: 1.3.1
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
125
 
126
  == Changelog ==
127
 
128
+ = 1.3.1 =
129
+ * Bug fix
130
+
131
  = 1.3.0 =
132
  + Skip headings by level or text.
133