From 08e4575fe798e8dfba89d369a1892c0a7c825c90 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Sat, 19 Oct 2019 19:31:26 -0400 Subject: [PATCH] adding new view file and widget options extending the widget class to add admin side input fields and addding another view file --- models/Glmclientinfo_Widget.php | 31 +++++++++++++++++++++++++++++-- views/footer.php | 14 ++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 views/footer.php 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 -- 2.17.1