diff --git a/classes/footnotes_settings.php b/classes/footnotes_settings.php index 0ebc561..5d48a72 100644 --- a/classes/footnotes_settings.php +++ b/classes/footnotes_settings.php @@ -403,7 +403,8 @@ class Class_FootnotesSettings */ $l_arr_Options = array( "footer" => __("in the footer", FOOTNOTES_PLUGIN_NAME), - "post_end" => __("at the end of the post", FOOTNOTES_PLUGIN_NAME) + "post_end" => __("at the end of the post", FOOTNOTES_PLUGIN_NAME), + "widget" => __("in the widget area", FOOTNOTES_PLUGIN_NAME) ); $this->AddLabel(FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE, __("Where shall the reference container appear:", FOOTNOTES_PLUGIN_NAME)); $this->AddSelectbox(FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE, $l_arr_Options, "footnote_plugin_50"); diff --git a/includes/defines.php b/includes/defines.php index 728a1f8..116b852 100644 --- a/includes/defines.php +++ b/includes/defines.php @@ -46,4 +46,10 @@ define("FOOTNOTE_REFERENCES_CONTAINER_ID", "footnote_references_container"); /* /* PLUGIN DIRECTORIES */ define("FOOTNOTES_PLUGIN_DIR_NAME", "footnotes"); define("FOOTNOTES_LANGUAGE_DIR", dirname(__FILE__) . "/../languages/"); -define("FOOTNOTES_TEMPLATES_DIR", dirname(__FILE__) . "/../templates/"); \ No newline at end of file +define("FOOTNOTES_TEMPLATES_DIR", dirname(__FILE__) . "/../templates/"); + +/* + * PLUGIN PLACEHOLDER TO NOT DISPLAY THE 'LOVE ME' SLUG + * @since 1.1.1 + */ +define("FOOTNOTES_NO_SLUGME_PLUG", "[[no footnotes: love]]"); \ No newline at end of file diff --git a/includes/replacer.php b/includes/replacer.php index c94d87c..fda63f6 100644 --- a/includes/replacer.php +++ b/includes/replacer.php @@ -4,7 +4,7 @@ * User: Stefan * Date: 15.05.14 * Time: 16:21 - * Version: 1.0.7 + * Version: 1.1.1 * Since: 1.0 */ @@ -26,6 +26,12 @@ $g_arr_FootnotesSettings = array(); */ $g_bool_FootnotesReplacementStarted = false; +/* + * flag to know íf the user wants to have NO 'love me' slug on the current page + * @since 1.1.1 + */ +$g_bool_NoLoveMeSlugOnCurrentPage = false; + /** * register all functions needed for the replacement in the wordpress core * @since 1.0-gamma @@ -49,7 +55,7 @@ function footnotes_RegisterReplacementFunctions() add_filter('widget_text', 'footnotes_Replacer_WidgetText'); /* adds the love and share me slug to the footer */ - add_filter('wp_footer', 'footnotes_LoveAndShareMe'); + add_action('wp_footer', 'footnotes_LoveAndShareMe'); } @@ -162,6 +168,7 @@ function footnotes_LoveAndShareMe() { /* access to the global settings collection */ global $g_arr_FootnotesSettings; + global $g_bool_NoLoveMeSlugOnCurrentPage; /* * updated url to wordpress.org plugin page instead of the github page * also updated the font-style and translation the string "footnotes" @@ -174,7 +181,7 @@ function footnotes_LoveAndShareMe() /* get setting for love and share this plugin and convert it to boolean */ $l_bool_LoveMe = footnotes_ConvertToBool($g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_LOVE]); /* check if the admin allows to add a link to the footer */ - if ($l_bool_LoveMe) { + if ($l_bool_LoveMe && !$g_bool_NoLoveMeSlugOnCurrentPage) { echo '