This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
footnotes/classes/footnotes_widget.php
Aricura 3b7e77da48 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
2014-06-10 08:51:02 +00:00

51 lines
No EOL
1.6 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: Stefan
* Date: 24.05.14
* Time: 13:57
*/
class Class_FootnotesWidget extends WP_Widget {
/**
* @constructor
*/
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_NAME, $widget_ops, $control_ops );
}
/**
* widget form creation
* @param $instance
*/
function form($instance) {
echo __('The widget defines the position of the reference container if set to "widget area".', FOOTNOTES_PLUGIN_NAME);
}
/**
* widget update
* @param $new_instance
* @param $old_instance
*/
function update($new_instance, $old_instance) {
return $new_instance;
}
/**
* widget display
* @param $args
* @param $instance
*/
function widget($args, $instance) {
/* access to the global settings collection */
global $g_arr_FootnotesSettings;
/* get setting for 'display reference container position' */
$l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE];
if ($l_str_ReferenceContainerPosition == "widget") {
echo footnotes_OutputReferenceContainer();
}
}
}