*/
// @codingStandardsIgnoreStart
class feedzy_wp_widget extends WP_Widget {
// @codingStandardsIgnoreEnd
/**
* The class instance.
*
* @since 3.0.0
* @access public
* @var feedzy_wp_widget $instance The instance of the class.
*/
public static $instance;
/**
* The feedzy_wp_widget constructor method
*
* @since 3.0.0
* @access public
*
* @param Feedzy_Rss_Feeds_Admin $plugin_admin The Feedzy_Rss_Feeds_Admin object.
*/
public function __construct( $plugin_admin = null ) {
parent::__construct( false, $name = __( 'Feedzy RSS Feeds', 'feedzy-rss-feeds' ) );
self::$instance = $this;
}
/**
* Returns the instance of this class as in the singleton pattern
*
* @since 3.0.0
* @access public
* @return feedzy_wp_widget
*/
public static function get_instance() {
if ( self::$instance === null ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* The register method for registering this widget class
*
* @since 3.0.0
* @access public
*/
public function registerWidget() {
register_widget( 'feedzy_wp_widget' );
}
/**
* The widget form creation
*
* @since 3.0.0
* @access public
*
* @param string $instance The Widget instance.
*
* @return mixed
*/
public function form( $instance ) {
$screen = get_current_screen();
// to prevent conflicts with plugins such as siteorigin page builder that call this function from outside of the 'widgets' screen.
if ( ! empty( $screen ) && 'widgets' !== $screen->id ) {
return;
}
$instance = wp_parse_args( $instance, $this->get_widget_defaults() );
$widget_form = '