From: Anthony Talarico Date: Sat, 19 Oct 2019 23:31:26 +0000 (-0400) Subject: adding new view file and widget options X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=08e4575fe798e8dfba89d369a1892c0a7c825c90;p=WP-Plugins%2Fglm-client-info.git adding new view file and widget options extending the widget class to add admin side input fields and addding another view file --- diff --git a/models/Glmclientinfo_Widget.php b/models/Glmclientinfo_Widget.php index 9d748e7..686fbc1 100644 --- a/models/Glmclientinfo_Widget.php +++ b/models/Glmclientinfo_Widget.php @@ -41,7 +41,9 @@ class Glmclientinfo_Widget parent::__construct( 'GlmClientInfo_Widget', __('Client Info Widget', 'text_domain'), - array('description' => __('A Gaslight Widget', 'text_domain')) + array( + 'description' => __('A Gaslight Widget', 'text_domain'), + ) ); } @@ -59,9 +61,34 @@ class Glmclientinfo_Widget public function widget($args, $instance) { $path = plugin_dir_path(__FILE__); - include $path . '../views/vCard.php'; + include $path . "../views/".$instance['view_file'] . ".php"; } + public function form( $instance ) { + $view_file = ! empty( $instance['view_file'] ) ? $instance['view_file'] : esc_html__( 'footer', 'text_domain' ); + ?> +

+ + + +

+ + $value){ ?> +
+ +
:
+ + + +
+ + +
+ + \ No newline at end of file