From e7746a1061f397aa8d6951903bc31c3bd79fa003 Mon Sep 17 00:00:00 2001 From: Mandi Wise Date: Sat, 5 Jul 2014 09:13:36 -0700 Subject: [PATCH] Fix fatal error if plugin options don't exist yet --- README.md | 3 +++ admin/class-isotope-posts-admin.php | 2 +- admin/views/admin.php | 4 ++-- admin/views/settings.php | 2 +- isotope-posts.php | 2 +- public/class-isotope-posts.php | 2 +- readme.txt | 5 ++++- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ef7b565..123b53c 100755 --- a/README.md +++ b/README.md @@ -74,6 +74,9 @@ Yes, but no translations are available quite yet. ## Changelog +### 2.0.1 +* Fixed fatal error on activation + ### 2.0 * Refactored all plugin code * Revamped the plugin settings page to allow users to save multiple post loops (this is a breaking change) diff --git a/admin/class-isotope-posts-admin.php b/admin/class-isotope-posts-admin.php index 1c3bc58..15b0ce9 100755 --- a/admin/class-isotope-posts-admin.php +++ b/admin/class-isotope-posts-admin.php @@ -176,7 +176,7 @@ public function delete_post_loop() { die(); $loop_id = isset( $_POST['loop_id'] ) ? $_POST['loop_id'] : null; - $isotope_loops = !empty( get_option('isotope_options') ) ? get_option( 'isotope_options' ) : array(); + $isotope_loops = ( get_option('isotope_options') != false ) ? get_option( 'isotope_options' ) : array(); // Check for the loop ID in the plugin options (deletion occurs in validation callback) if ( $loop_id && $isotope_loops && array_key_exists( $loop_id, $isotope_loops ) ) { diff --git a/admin/views/admin.php b/admin/views/admin.php index 36791b7..0686a29 100755 --- a/admin/views/admin.php +++ b/admin/views/admin.php @@ -16,14 +16,14 @@

Isotope Post Shortcodes

- +

plugin_slug ); ?>

diff --git a/admin/views/settings.php b/admin/views/settings.php index ebca7c0..2afbe6f 100644 --- a/admin/views/settings.php +++ b/admin/views/settings.php @@ -360,7 +360,7 @@ public function validate_settings( $input = array() ) { $loop_id = isset( $_POST['loop_id'] ) ? $_POST['loop_id'] : null; // Check if any options already exist - $isotope_loops = !empty( get_option('isotope_options') ) ? get_option( 'isotope_options' ) : array(); + $isotope_loops = ( get_option( 'isotope_options' ) != false ) ? get_option( 'isotope_options' ) : array(); if ( $save_flag == 'delete' ) { diff --git a/isotope-posts.php b/isotope-posts.php index b64dae8..60a707c 100755 --- a/isotope-posts.php +++ b/isotope-posts.php @@ -12,7 +12,7 @@ * Plugin Name: Isotope Posts * Plugin URI: http://mandiwise.com/wordpress/isotope-posts/ * Description: Allows you to use Metafizzy's Isotope to display feeds of WordPress posts using simple shortcodes. Works with custom post types and custom taxonomies too. - * Version: 2.0.0 + * Version: 2.0.1 * Author: Mandi Wise * Author URI: http://mandiwise.com * Text Domain: isotope-posts diff --git a/public/class-isotope-posts.php b/public/class-isotope-posts.php index 066114a..36b54aa 100755 --- a/public/class-isotope-posts.php +++ b/public/class-isotope-posts.php @@ -18,7 +18,7 @@ class Isotope_Posts { * * @var string */ - const VERSION = '2.0.0'; + const VERSION = '2.0.1'; /** * Unique identifier for the plugin. diff --git a/readme.txt b/readme.txt index 9a9e1be..5383b1c 100755 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: mandiwise Tags: isotope, jquery, posts Requires at least: 3.5.1 Tested up to: 3.9.1 -Stable tag: 2.0.0 +Stable tag: 2.0.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -83,6 +83,9 @@ Yes, but no translations are available quite yet. == Changelog == += 2.0.1 = +* Fixed fatal error on activation + = 2.0 = * Refactored all plugin code * Revamped the plugin settings page to allow users to save multiple post loops (this is a breaking change)