WordPress Coding Standards compliance update. Stable Tag 2.5.10. Package version: 2.5.11d0.

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2486043 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-03-03 18:58:03 +00:00
parent dfcbdc6adc
commit daf0a8612f
32 changed files with 4838 additions and 3664 deletions

View file

@ -1,14 +1,12 @@
<?php
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/**
* Widget base.
*
* @filesource
* @author Stefan Herndler
* @package footnotes
* @since 1.5.0
* @date 14.09.14 14:30
*
* @lastmodified 2021-02-18T0306+0100
* @date 2021-02-18T0240+0100
*
* @since 1.6.4 Update: replace deprecated function WP_Widget() with recommended __construct(), thanks to @dartiss code contribution.
*/
@ -21,68 +19,69 @@
* @author Stefan Herndler
* @since 1.5.0
*/
abstract class MCI_Footnotes_WidgetBase extends WP_Widget {
abstract class MCI_Footnotes_Widget_Base extends WP_Widget {
/**
* Returns an unique ID as string used for the Widget Base ID.
*
* @author Stefan Herndler
* @since 1.5.0
* @return string
*/
abstract protected function getID();
abstract protected function get_id();
/**
* Returns the Public name of child Widget to be displayed in the Configuration page.
*
* @author Stefan Herndler
* @since 1.5.0
* @return string
*/
abstract protected function getName();
abstract protected function get_name();
/**
* Returns the Description of the child widget.
*
* @author Stefan Herndler
* @since 1.5.0
* @return string
*/
abstract protected function getDescription();
abstract protected function get_description();
/**
* Returns the width of the Widget. Default width is 250 pixel.
*
* @author Stefan Herndler
* @since 1.5.0
* @return int
*/
protected function getWidgetWidth() {
protected function get_widget_width() {
return 250;
}
/**
* Class Constructor. Registers the child Widget to WordPress.
*
* @author Stefan Herndler
* @since 1.5.0
*
*
* - Update: replace deprecated function WP_Widget() with recommended __construct(), thanks to @dartiss code contribution.
*
*
* @since 1.6.4
* @contributor @dartiss
* @link https://plugins.trac.wordpress.org/browser/footnotes/trunk/class/widgets/base.php?rev=1445720
* “The called constructor method for WP_Widget in MCI_Footnotes_Widget_ReferenceContainer is deprecated since version 4.3.0! Use __construct() instead.
*/
public function __construct() {
$l_arr_WidgetOptions = array("classname" => __CLASS__, "description" => $this->getDescription());
$l_arr_ControlOptions = array("id_base" => strtolower($this->getID()), "width" => $this->getWidgetWidth());
// registers the Widget
$l_arr_widget_options = array(
'classname' => __CLASS__,
'description' => $this->get_description(),
);
$l_arr_control_options = array(
'id_base' => strtolower( $this->get_id() ),
'width' => $this->get_widget_width(),
);
// Registers the Widget.
parent::__construct(
strtolower($this->getID()), // unique ID for the widget, has to be lowercase
$this->getName(), // Plugin name to be displayed
$l_arr_WidgetOptions, // Optional Widget Options
$l_arr_ControlOptions // Optional Widget Control Options
);
strtolower( $this->get_id() ), // Unique ID for the widget, has to be lowercase.
$this->get_name(), // Plugin name to be displayed.
$l_arr_widget_options, // Optional Widget Options.
$l_arr_control_options // Optional Widget Control Options.
);
}
}