From 336631210c2cda0ec053c8132f6b2e0cdde35bc9 Mon Sep 17 00:00:00 2001 From: Takashi Matsuyama Date: Thu, 10 Jun 2021 12:29:52 +0900 Subject: [PATCH] Fixed PHP undefined variable notice. PHP Notice: Undefined variable: class in ./assets/shortcode-list.php on line 81 --- README.md | 5 ++++- assets/shortcode-list.php | 5 +++++ my-favorites.php | 2 +- readme.txt | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 16721c0..85f8eae 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Tags: favorites, likes, accessibility, favorite posts Requires at least: 4.8 Tested up to: 5.7 Requires PHP: 5.4.0 -Stable tag: 1.3.1 +Stable tag: 1.3.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -46,6 +46,9 @@ Detailed usage is under preparation. ## Changelog +### 1.3.2 +Fixed PHP undefined variable notice. + ### 1.3.1 Fixed PHP 8.0 warning. diff --git a/assets/shortcode-list.php b/assets/shortcode-list.php index d68c5e8..468d76d 100644 --- a/assets/shortcode-list.php +++ b/assets/shortcode-list.php @@ -70,6 +70,11 @@ public static function custom_template($atts) { "class" => '', "style" => '', ),$atts); + if( $atts['class'] ) { + $class = 'class="'.$atts['class'].'"'; + } else { + $class = null; + } if( $atts['style'] ) { $style = $atts['style']; } else { diff --git a/my-favorites.php b/my-favorites.php index a944289..8a343eb 100644 --- a/my-favorites.php +++ b/my-favorites.php @@ -3,7 +3,7 @@ * Plugin Name: My Favorites * Plugin URI: https://wordpress.org/plugins/my-favorites/ * Description: Save user's favorite posts and list them. - * Version: 1.3.1 + * Version: 1.3.2 * Requires at least: 4.8 * Requires PHP: 5.4.0 * Author: Takashi Matsuyama diff --git a/readme.txt b/readme.txt index f0961bc..cdbd8ca 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: favorites, likes, accessibility, favorite posts Requires at least: 4.8 Tested up to: 5.7 Requires PHP: 5.4.0 -Stable tag: 1.3.1 +Stable tag: 1.3.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html