From fffda173fa81b3f6bc3a35711d2e195edd9546c2 Mon Sep 17 00:00:00 2001 From: Pau Iranzo Date: Thu, 10 Dec 2015 16:38:21 +0100 Subject: [PATCH 1/2] Declare 'singleurl' variable to avoid notice in some cases --- fdfootnotes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fdfootnotes.php b/fdfootnotes.php index e620020..0a4f9a2 100644 --- a/fdfootnotes.php +++ b/fdfootnotes.php @@ -124,6 +124,7 @@ function fdfootnote_convert($content) { foreach($matches[0] as $fn) { $note = preg_replace('/\[\d+\.(.*?)\]/s', '\1', $fn); $notes[$n] = $note; + $singleurl = ''; if ($linksingle) $singleurl = get_permalink(); @@ -162,4 +163,4 @@ function fdfootnote_convert($content) { } add_action('the_content', 'fdfootnote_convert', 1); -?> \ No newline at end of file +?> From f25053d548ff916a4fcc1b0122622489e4e30d4e Mon Sep 17 00:00:00 2001 From: Pau Iranzo Date: Thu, 10 Dec 2015 16:47:18 +0100 Subject: [PATCH 2/2] Set $options array to avoid notice in settings --- fdfootnotes.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fdfootnotes.php b/fdfootnotes.php index 0a4f9a2..808599f 100644 --- a/fdfootnotes.php +++ b/fdfootnotes.php @@ -59,19 +59,17 @@ function fdfootnote_conf() { if (!isset($options['fdfootnote_collapse'])) $options['fdfootnote_collapse'] = 0; $updated = false; + $options['fdfootnote_collapse'] = 0; + $options['fdfootnote_single'] = 0; if ( isset($_POST['submit']) ) { check_admin_referer('fdfootnote', 'fdfootnote-admin'); if (isset($_POST['fdfootnote_collapse'])) { $options['fdfootnote_collapse'] = 1; - } else { - $options['fdfootnote_collapse'] = 0; } if (isset($_POST['fdfootnote_single'])) { $options['fdfootnote_single'] = 1; - } else { - $options['fdfootnote_single'] = 0; } update_option('fdfootnote', $options);