- Feature: Short code to not display the 'love me' slug on specific pages ( short code = [[no footnotes: love]] )
- Update: Setting where the reference container appears on public pages can also be set to the widget area git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@919367 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
8fa83b117b
commit
72c239feb1
5 changed files with 38 additions and 9 deletions
|
@ -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");
|
||||
|
|
|
@ -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/");
|
||||
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]]");
|
|
@ -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 '
|
||||
<div style="text-align:center; color:#acacac;">' .
|
||||
sprintf(__("Hey there, I'm using the awesome WordPress Plugin called %s", FOOTNOTES_PLUGIN_NAME), '<a href="http://wordpress.org/plugins/footnotes/" target="_blank" style="text-decoration: none;">' . FOOTNOTES_PLUGIN_PUBLIC_NAME . '</a>') .
|
||||
|
@ -208,6 +215,17 @@ function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = t
|
|||
/* free all found footnotes if reference container will be displayed */
|
||||
$g_arr_Footnotes = array();
|
||||
}
|
||||
|
||||
/*
|
||||
* checks if the user doesn't want to have a 'love me' on current page
|
||||
* @since 1.1.1
|
||||
*/
|
||||
if (strpos($p_str_Content, FOOTNOTES_NO_SLUGME_PLUG) !== false) {
|
||||
global $g_bool_NoLoveMeSlugOnCurrentPage;
|
||||
$g_bool_NoLoveMeSlugOnCurrentPage = true;
|
||||
$p_str_Content = str_replace(FOOTNOTES_NO_SLUGME_PLUG, "", $p_str_Content);
|
||||
}
|
||||
|
||||
/* return the replaced content */
|
||||
return $p_str_Content;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Plugin URI: https://github.com/media-competence-institute/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.1.0
|
||||
Version: 1.1.1
|
||||
Author URI: http://cheret.co.uk/mci
|
||||
Text Domain: footnotes
|
||||
Domain Path: /languages
|
||||
|
@ -31,7 +31,7 @@
|
|||
* User: Stefan
|
||||
* Date: 15.05.14
|
||||
* Time: 16:21
|
||||
* Version: 1.0.5
|
||||
* Version: 1.1.1
|
||||
* Since: 1.0
|
||||
*/
|
||||
|
||||
|
|
|
@ -38,13 +38,17 @@ No, this Plugin has been written from scratch. Of course some inspirations on ho
|
|||
|
||||
== Changelog ==
|
||||
|
||||
= 1.1.1 =
|
||||
- Feature: Short code to not display the 'love me' slug on specific pages ( short code = [[no footnotes: love]] )
|
||||
- Update: Setting where the reference container appears on public pages can also be set to the widget area
|
||||
|
||||
= 1.1.0 =
|
||||
- Update: Global styling for the public plugin name
|
||||
- Update: Easier usage of the public plugin name in translations
|
||||
- Update: New Layout for the settings page to group similar settings to get a better overview
|
||||
- Update: Display settings submit button only if there is at least 1 editable setting in the current tab
|
||||
- Add: setting where the reference container appears on public pages (needs some corrections!)
|
||||
- Bugfix: displays only one reference container in front of the footer on category pages
|
||||
- Add: Setting where the reference container appears on public pages (needs some corrections!)
|
||||
- Bugfix: Displays only one reference container in front of the footer on category pages
|
||||
|
||||
= 1.0.6 =
|
||||
- Bugfix: Uninstall function to delete all plugin settings
|
||||
|
|
Reference in a new issue