2021-02-23 16:44:18 +00:00
|
|
|
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
|
2021-02-23 16:00:59 +00:00
|
|
|
/**
|
|
|
|
* Includes the Plugin Widget to put the Reference Container to the Widget area.
|
|
|
|
*
|
|
|
|
* @filesource
|
2021-02-23 16:44:18 +00:00
|
|
|
* @package footnotes
|
2021-02-25 16:48:04 +00:00
|
|
|
* @since 1.5.0
|
|
|
|
* @date 14.09.14 14:26
|
2021-02-23 16:44:18 +00:00
|
|
|
*
|
2021-02-25 16:48:04 +00:00
|
|
|
* @since 2.2.0 (TBD) 2020-12-12T2131+0100
|
2021-02-23 16:00:59 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registers a Widget to put the Reference Container to the widget area.
|
|
|
|
*
|
|
|
|
* @since 1.5.0
|
|
|
|
*/
|
2021-02-23 16:44:18 +00:00
|
|
|
class MCI_Footnotes_Widget_Reference_Container extends MCI_Footnotes_Widget_Base {
|
2021-02-23 16:00:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns an unique ID as string used for the Widget Base ID.
|
|
|
|
*
|
|
|
|
* @since 1.5.0
|
|
|
|
* @return string
|
|
|
|
*/
|
2021-02-23 16:44:18 +00:00
|
|
|
protected function get_id() {
|
|
|
|
return 'footnotes_widget';
|
2021-02-23 16:00:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Public name of the Widget to be displayed in the Configuration page.
|
|
|
|
*
|
|
|
|
* @since 1.5.0
|
|
|
|
* @return string
|
|
|
|
*/
|
2021-02-23 16:44:18 +00:00
|
|
|
protected function get_name() {
|
2021-02-23 16:00:59 +00:00
|
|
|
return MCI_Footnotes_Config::C_STR_PLUGIN_NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Description of the child widget.
|
|
|
|
*
|
|
|
|
* @since 1.5.0
|
|
|
|
* @return string
|
2021-02-23 16:44:18 +00:00
|
|
|
*
|
2021-02-23 16:00:59 +00:00
|
|
|
* Edit: curly quotes 2.2.0 2020-12-12T2130+0100
|
|
|
|
*/
|
2021-02-23 16:44:18 +00:00
|
|
|
protected function get_description() {
|
|
|
|
return __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' );
|
2021-02-23 16:00:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Outputs the Settings of the Widget.
|
|
|
|
*
|
|
|
|
* @since 1.5.0
|
2021-02-23 16:44:18 +00:00
|
|
|
* @param mixed $instance The instance of the widget.
|
2021-02-23 16:00:59 +00:00
|
|
|
* @return void
|
2021-02-23 16:44:18 +00:00
|
|
|
*
|
2021-02-23 16:00:59 +00:00
|
|
|
* Edit: curly quotes 2.2.0 2020-12-12T2130+0100
|
|
|
|
*/
|
2021-02-23 16:44:18 +00:00
|
|
|
public function form( $instance ) {
|
|
|
|
echo wp_kses_post( __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' ) );
|
2021-02-23 16:00:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Outputs the Content of the Widget.
|
|
|
|
*
|
|
|
|
* @since 1.5.0
|
2021-02-23 16:44:18 +00:00
|
|
|
* @param mixed $args The widget's arguments.
|
|
|
|
* @param mixed $instance The instance of the widget.
|
2021-02-23 16:00:59 +00:00
|
|
|
*/
|
2021-02-23 16:44:18 +00:00
|
|
|
public function widget( $args, $instance ) {
|
|
|
|
global $g_obj_mci_footnotes;
|
|
|
|
// Reference container positioning is set to "widget area".
|
|
|
|
if ( 'widget' === MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
|
2021-02-23 18:13:52 +00:00
|
|
|
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
|
|
echo $g_obj_mci_footnotes->a_obj_task->Reference_Container();
|
|
|
|
// phpcs:enable
|
2021-02-23 16:00:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|