Skip to content

Commit

Permalink
Fixed PHP undefined variable notice.
Browse files Browse the repository at this point in the history
PHP Notice: Undefined variable: class in ./assets/shortcode-list.php on line 81
  • Loading branch information
takashi-matsuyama committed Jun 10, 2021
1 parent d893f55 commit 3366312
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down
5 changes: 5 additions & 0 deletions assets/shortcode-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion my-favorites.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3366312

Please sign in to comment.