From 3b7e77da48198ff65f8bc6ce9b011b652d6f519b Mon Sep 17 00:00:00 2001 From: Aricura Date: Tue, 10 Jun 2014 08:51:02 +0000 Subject: [PATCH] Release 1.2.3 - Bugfix: Removed 'Warning output' of Plugins activation and deactivation function (thanks to Piet Bos, Spain) - Bugfix: Added missing meta boxes parameter on Settings page (thanks to Piet Bos, Spain) - Bugfix: Removed Widget text formatting - Bugfix: Load default settings value of setting doesn't exist yet (first usage) - Bugfix: Replacement of footnotes tag on public pages with html special characters in the content - Feature: Footnotes tag color is set to the default link color depending on the current Theme (thanks to Daniel Formo, Norway) git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@929484 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- classes/footnotes.php | 6 +++--- classes/footnotes_settings.php | 2 +- classes/footnotes_widget.php | 2 +- css/footnote.css | 4 ++-- includes/plugin-settings.php | 8 ++++++++ includes/replacer.php | 12 ++++++------ index.php | 12 ++++++------ readme.txt | 10 +++++++++- templates/footnote.html | 2 +- 9 files changed, 37 insertions(+), 21 deletions(-) diff --git a/classes/footnotes.php b/classes/footnotes.php index 0eb5af3..a101373 100644 --- a/classes/footnotes.php +++ b/classes/footnotes.php @@ -42,7 +42,7 @@ class Class_Footnotes * activates the plugin * @since 1.0 */ - function activate() + static function activate() { // unused } @@ -51,7 +51,7 @@ class Class_Footnotes * deactivates the plugin * @since 1.0 */ - function deactivate() + static function deactivate() { // unused } @@ -61,7 +61,7 @@ class Class_Footnotes * updated file path in version 1.0.6 * @since 1.0 */ - function uninstall() + static function uninstall() { /* uninstalling the plugin is only allowed for logged in users */ if (!is_user_logged_in()) { diff --git a/classes/footnotes_settings.php b/classes/footnotes_settings.php index b427721..fd32f80 100644 --- a/classes/footnotes_settings.php +++ b/classes/footnotes_settings.php @@ -137,7 +137,7 @@ class Class_FootnotesSettings settings_fields($l_str_tab); /* outputs the settings field of the current active tab */ do_settings_sections($l_str_tab); - do_meta_boxes($l_str_tab, 'main'); + do_meta_boxes($l_str_tab, 'main', NULL); /* adds a submit button to the current page */ /* * add submit button only if there are some settings on the current page diff --git a/classes/footnotes_widget.php b/classes/footnotes_widget.php index 4033d16..3513a72 100644 --- a/classes/footnotes_widget.php +++ b/classes/footnotes_widget.php @@ -14,7 +14,7 @@ class Class_FootnotesWidget extends WP_Widget { function Class_FootnotesWidget() { $widget_ops = array( 'classname' => 'Class_FootnotesWidget', 'description' => __('The widget defines the position of the reference container if set to "widget area".', FOOTNOTES_PLUGIN_NAME) ); $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'footnotes_widget' ); - $this->WP_Widget( 'footnotes_widget', FOOTNOTES_PLUGIN_PUBLIC_NAME, $widget_ops, $control_ops ); + $this->WP_Widget( 'footnotes_widget', FOOTNOTES_PLUGIN_NAME, $widget_ops, $control_ops ); } /** diff --git a/css/footnote.css b/css/footnote.css index d451bdf..d29187e 100755 --- a/css/footnote.css +++ b/css/footnote.css @@ -90,7 +90,7 @@ } .footnote_plugin_link:hover { - color: #4777ff !important; + /*color: #4777ff !important;*/ text-decoration: none !important; } @@ -102,7 +102,7 @@ /* tooltip */ .footnote_plugin_tooltip { outline: none !important; - color: #4777ff !important; + /*color: #4777ff !important;*/ text-decoration: none !important; cursor: pointer !important; } diff --git a/includes/plugin-settings.php b/includes/plugin-settings.php index 65b21ee..79ea68b 100644 --- a/includes/plugin-settings.php +++ b/includes/plugin-settings.php @@ -66,6 +66,14 @@ function footnotes_filter_options($p_str_OptionsField, $p_arr_DefaultValues, $p_ $l_arr_Options[$l_str_Key] = ""; } } + + // check if each key from the default values exist in return array + foreach($p_arr_DefaultValues as $l_str_Key => $l_str_Value) { + // if key not exists, add it with its default value + if (!array_key_exists($l_str_Key, $l_arr_Options)) { + $l_arr_Options[$l_str_Key] = $l_str_Value; + } + } /* returns the filtered array */ return $l_arr_Options; } diff --git a/includes/replacer.php b/includes/replacer.php index 731d7e5..49568b9 100644 --- a/includes/replacer.php +++ b/includes/replacer.php @@ -64,7 +64,7 @@ function footnotes_Replacer_Content($p_str_Content) /* get setting for 'display reference container position' */ $l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE]; /* returns content */ - return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false, true); + return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false); } /** @@ -81,7 +81,7 @@ function footnotes_Replacer_Excerpt($p_str_Content) $l_bool_SearchExcerpt = footnotes_ConvertToBool($g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_SEARCH_IN_EXCERPT]); /* search in the excerpt only if activated */ if ($l_bool_SearchExcerpt) { - return footnotes_replaceFootnotes($p_str_Content, false, false, true); + return footnotes_replaceFootnotes($p_str_Content, false, false); } /* returns content */ return $p_str_Content; @@ -112,7 +112,7 @@ function footnotes_Replacer_WidgetText($p_str_Content) /* get setting for 'display reference container position' */ $l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE]; /* returns content */ - return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false, false); + return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false); } /** @@ -182,10 +182,9 @@ function footnotes_LoveAndShareMe() * @param string $p_str_Content * @param bool $p_bool_OutputReferences [default: true] * @param bool $p_bool_ReplaceHtmlCharsSettings [ default: false] - * @param bool $p_bool_ReplaceHtmlCharsContent [ default: false] * @return string */ -function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = true, $p_bool_ReplaceHtmlCharsSettings = false, $p_bool_ReplaceHtmlCharsContent = false) +function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = true, $p_bool_ReplaceHtmlCharsSettings = false) { /* access to the global settings collection */ global $g_arr_FootnotesSettings; @@ -193,7 +192,8 @@ function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = t $g_arr_FootnotesSettings = footnotes_filter_options(FOOTNOTE_SETTINGS_CONTAINER, Class_FootnotesSettings::$a_arr_Default_Settings, $p_bool_ReplaceHtmlCharsSettings); /* replace all footnotes in the content */ - $p_str_Content = footnotes_getFromString($p_str_Content, $p_bool_ReplaceHtmlCharsContent); + $p_str_Content = footnotes_getFromString($p_str_Content, true); + $p_str_Content = footnotes_getFromString($p_str_Content, false); /* add the reference list if set */ if ($p_bool_OutputReferences) { diff --git a/index.php b/index.php index da7c120..53d9834 100755 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ Plugin URI: http://wordpress.org/plugins/footnotes/ Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine. Author: media competence institute - Version: 1.2.2 + Version: 1.2.3 Author URI: http://cheret.co.uk/mci Text Domain: footnotes Domain Path: /languages @@ -35,7 +35,6 @@ * Since: 1.0 */ - /* include constants */ require_once(dirname(__FILE__) . "/includes/defines.php"); /* include language functions */ @@ -83,6 +82,11 @@ add_filter("plugin_action_links_{$l_str_plugin_file}", 'footnotes_plugin_setting /* register footnotes widget */ add_action('widgets_init', create_function('', 'return register_widget("Class_FootnotesWidget");')); +/* register hook for activating the plugin */ +register_activation_hook(__FILE__, array('Class_Footnotes', 'activate')); +/* register hook for deactivating the plugin */ +register_deactivation_hook(__FILE__, array('Class_Footnotes', 'deactivate')); + /* only admin is allowed to execute the plugin settings */ if (!function_exists('is_admin')) { header('Status: 403 Forbidden'); @@ -90,10 +94,6 @@ if (!function_exists('is_admin')) { exit(); } -/* register hook for activating the plugin */ -register_activation_hook(__FILE__, array('Class_Footnotes', 'activate')); -/* register hook for deactivating the plugin */ -register_deactivation_hook(__FILE__, array('Class_Footnotes', 'deactivate')); /* register hook for uninstalling the plugin */ register_uninstall_hook(__FILE__, array('Class_Footnotes', 'uninstall')); diff --git a/readme.txt b/readme.txt index 9905c43..3b22118 100755 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Requires at least: 3.9 Tested up to: 3.9.1 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html -Stable Tag: 1.2.2 +Stable Tag: 1.2.3 == Description == @@ -64,6 +64,14 @@ No, this Plugin has been written from scratch. Of course some inspirations on ho == Changelog == += 1.2.3 = +- Bugfix: Removed 'Warning output' of Plugins activation and deactivation function (thanks to Piet Bos, Spain) +- Bugfix: Added missing meta boxes parameter on Settings page (thanks to Piet Bos, Spain) +- Bugfix: Removed Widget text formatting +- Bugfix: Load default settings value of setting doesn't exist yet (first usage) +- Bugfix: Replacement of footnotes tag on public pages with html special characters in the content +- Feature: Footnotes tag color is set to the default link color depending on the current Theme (thanks to Daniel Formo, Norway) + = 1.2.2 = - Bugfix: WYSIWYG editor and plain text editor buttons insert footnote short code correctly (also if defined like html tag) - Update: The admin can decide which "I love footnotes" text (or not text) will be displayed in the footer diff --git a/templates/footnote.html b/templates/footnote.html index 73897d6..63da890 100755 --- a/templates/footnote.html +++ b/templates/footnote.html @@ -1,6 +1,6 @@ - [[FOOTNOTE INDEX]]) + [[FOOTNOTE INDEX]]) [[FOOTNOTE TEXT]]