Ultimate FAQ - Version 1.5.27

Version Description

  • Added an option for a title on a number of the FAQ widgets
Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Ultimate FAQ
Version 1.5.27
Comparing to
See all releases

Code changes from version 1.5.26 to 1.5.27

Files changed (3) hide show
  1. Functions/EWD_UFAQ_Widgets.php +34 -1
  2. Main.php +4 -2
  3. readme.txt +3 -0
Functions/EWD_UFAQ_Widgets.php CHANGED
@@ -20,6 +20,7 @@ class EWD_UFAQ_Display_FAQ_Post_List extends WP_Widget {
20
  */
21
  public function widget( $args, $instance ) {
22
  echo $args['before_widget'];
 
23
  echo do_shortcode("[select-faq faq_id='". $instance['faq_id'] . "' no_comments='Yes']");
24
  echo $args['after_widget'];
25
  }
@@ -36,6 +37,10 @@ class EWD_UFAQ_Display_FAQ_Post_List extends WP_Widget {
36
  <label for="<?php echo $this->get_field_id( 'faq_id' ); ?>"><?php _e( 'FAQ ID List:', 'EWD_UFAQ' ); ?></label>
37
  <input class="widefat" id="<?php echo $this->get_field_id( 'faq_id' ); ?>" name="<?php echo $this->get_field_name( 'faq_id' ); ?>" type="text" value="<?php echo esc_attr( $faq_id ); ?>">
38
  </p>
 
 
 
 
39
  <?php
40
  }
41
 
@@ -48,6 +53,7 @@ class EWD_UFAQ_Display_FAQ_Post_List extends WP_Widget {
48
  public function update( $new_instance, $old_instance ) {
49
  $instance = array();
50
  $instance['faq_id'] = ( ! empty( $new_instance['faq_id'] ) ) ? strip_tags( $new_instance['faq_id'] ) : '';
 
51
 
52
  return $instance;
53
  }
@@ -75,6 +81,7 @@ class EWD_UFAQ_Display_Recent_FAQS extends WP_Widget {
75
  */
76
  public function widget( $args, $instance ) {
77
  echo $args['before_widget'];
 
78
  echo do_shortcode("[recent-faqs post_count='". $instance['post_count'] . "' no_comments='Yes']");
79
  echo $args['after_widget'];
80
  }
@@ -91,6 +98,10 @@ class EWD_UFAQ_Display_Recent_FAQS extends WP_Widget {
91
  <label for="<?php echo $this->get_field_id( 'post_count' ); ?>"><?php _e( 'Number of FAQs:', 'EWD_UFAQ' ); ?></label>
92
  <input class="widefat" id="<?php echo $this->get_field_id( 'post_count' ); ?>" name="<?php echo $this->get_field_name( 'post_count' ); ?>" type="text" value="<?php echo esc_attr( $post_count ); ?>">
93
  </p>
 
 
 
 
94
  <?php
95
  }
96
 
@@ -103,6 +114,7 @@ class EWD_UFAQ_Display_Recent_FAQS extends WP_Widget {
103
  public function update( $new_instance, $old_instance ) {
104
  $instance = array();
105
  $instance['post_count'] = ( ! empty( $new_instance['post_count'] ) ) ? strip_tags( $new_instance['post_count'] ) : '';
 
106
 
107
  return $instance;
108
  }
@@ -130,6 +142,7 @@ class EWD_UFAQ_Display_Popular_FAQS extends WP_Widget {
130
  */
131
  public function widget( $args, $instance ) {
132
  echo $args['before_widget'];
 
133
  echo do_shortcode("[popular-faqs post_count='". $instance['post_count'] . "' no_comments='Yes']");
134
  echo $args['after_widget'];
135
  }
@@ -146,6 +159,10 @@ class EWD_UFAQ_Display_Popular_FAQS extends WP_Widget {
146
  <label for="<?php echo $this->get_field_id( 'post_count' ); ?>"><?php _e( 'Number of FAQs:', 'EWD_UFAQ' ); ?></label>
147
  <input class="widefat" id="<?php echo $this->get_field_id( 'post_count' ); ?>" name="<?php echo $this->get_field_name( 'post_count' ); ?>" type="text" value="<?php echo esc_attr( $post_count ); ?>">
148
  </p>
 
 
 
 
149
  <?php
150
  }
151
 
@@ -158,6 +175,7 @@ class EWD_UFAQ_Display_Popular_FAQS extends WP_Widget {
158
  public function update( $new_instance, $old_instance ) {
159
  $instance = array();
160
  $instance['post_count'] = ( ! empty( $new_instance['post_count'] ) ) ? strip_tags( $new_instance['post_count'] ) : '';
 
161
 
162
  return $instance;
163
  }
@@ -187,6 +205,7 @@ class EWD_UFAQ_Display_Random_FAQ extends WP_Widget {
187
  $FAQs = get_posts(array('orderby' => 'rand', 'posts_per_page' => '1', 'post_type' => 'ufaq'));
188
 
189
  echo $args['before_widget'];
 
190
  foreach ($FAQs as $FAQ) {echo do_shortcode("[select-faq faq_id='". $FAQ->ID . "' no_comments='Yes']");}
191
  echo $args['after_widget'];
192
  }
@@ -197,7 +216,13 @@ class EWD_UFAQ_Display_Random_FAQ extends WP_Widget {
197
  * @param array $instance The widget options
198
  */
199
  public function form( $instance ) {
200
-
 
 
 
 
 
 
201
  }
202
 
203
  /**
@@ -208,6 +233,7 @@ class EWD_UFAQ_Display_Random_FAQ extends WP_Widget {
208
  */
209
  public function update( $new_instance, $old_instance ) {
210
  $instance = array();
 
211
 
212
  return $instance;
213
  }
@@ -235,6 +261,7 @@ class EWD_UFAQ_Display_FAQ_Categories extends WP_Widget {
235
  */
236
  public function widget( $args, $instance ) {
237
  echo $args['before_widget'];
 
238
  echo do_shortcode("[ultimate-faqs include_category='". $instance['include_category'] . "' no_comments='Yes']");
239
  echo $args['after_widget'];
240
  }
@@ -246,11 +273,16 @@ class EWD_UFAQ_Display_FAQ_Categories extends WP_Widget {
246
  */
247
  public function form( $instance ) {
248
  $include_category = ! empty( $instance['include_category'] ) ? $instance['include_category'] : __( 'FAQ Category List', 'EWD_UFAQ' );
 
249
  ?>
250
  <p>
251
  <label for="<?php echo $this->get_field_id( 'include_category' ); ?>"><?php _e( 'FAQ Category List:', 'EWD_UFAQ' ); ?></label>
252
  <input class="widefat" id="<?php echo $this->get_field_id( 'include_category' ); ?>" name="<?php echo $this->get_field_name( 'include_category' ); ?>" type="text" value="<?php echo esc_attr( $include_category ); ?>">
253
  </p>
 
 
 
 
254
  <?php
255
  }
256
 
@@ -263,6 +295,7 @@ class EWD_UFAQ_Display_FAQ_Categories extends WP_Widget {
263
  public function update( $new_instance, $old_instance ) {
264
  $instance = array();
265
  $instance['include_category'] = ( ! empty( $new_instance['include_category'] ) ) ? strip_tags( $new_instance['include_category'] ) : '';
 
266
 
267
  return $instance;
268
  }
20
  */
21
  public function widget( $args, $instance ) {
22
  echo $args['before_widget'];
23
+ if ($instance['faq_title'] != "") {echo "<h3>" . $instance['faq_title'] . "</h3>";}
24
  echo do_shortcode("[select-faq faq_id='". $instance['faq_id'] . "' no_comments='Yes']");
25
  echo $args['after_widget'];
26
  }
37
  <label for="<?php echo $this->get_field_id( 'faq_id' ); ?>"><?php _e( 'FAQ ID List:', 'EWD_UFAQ' ); ?></label>
38
  <input class="widefat" id="<?php echo $this->get_field_id( 'faq_id' ); ?>" name="<?php echo $this->get_field_name( 'faq_id' ); ?>" type="text" value="<?php echo esc_attr( $faq_id ); ?>">
39
  </p>
40
+ <p>
41
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
42
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
43
+ </p>
44
  <?php
45
  }
46
 
53
  public function update( $new_instance, $old_instance ) {
54
  $instance = array();
55
  $instance['faq_id'] = ( ! empty( $new_instance['faq_id'] ) ) ? strip_tags( $new_instance['faq_id'] ) : '';
56
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
57
 
58
  return $instance;
59
  }
81
  */
82
  public function widget( $args, $instance ) {
83
  echo $args['before_widget'];
84
+ if ($instance['faq_title'] != "") {echo "<h3>" . $instance['faq_title'] . "</h3>";}
85
  echo do_shortcode("[recent-faqs post_count='". $instance['post_count'] . "' no_comments='Yes']");
86
  echo $args['after_widget'];
87
  }
98
  <label for="<?php echo $this->get_field_id( 'post_count' ); ?>"><?php _e( 'Number of FAQs:', 'EWD_UFAQ' ); ?></label>
99
  <input class="widefat" id="<?php echo $this->get_field_id( 'post_count' ); ?>" name="<?php echo $this->get_field_name( 'post_count' ); ?>" type="text" value="<?php echo esc_attr( $post_count ); ?>">
100
  </p>
101
+ <p>
102
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
103
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
104
+ </p>
105
  <?php
106
  }
107
 
114
  public function update( $new_instance, $old_instance ) {
115
  $instance = array();
116
  $instance['post_count'] = ( ! empty( $new_instance['post_count'] ) ) ? strip_tags( $new_instance['post_count'] ) : '';
117
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
118
 
119
  return $instance;
120
  }
142
  */
143
  public function widget( $args, $instance ) {
144
  echo $args['before_widget'];
145
+ if ($instance['faq_title'] != "") {echo "<h3>" . $instance['faq_title'] . "</h3>";}
146
  echo do_shortcode("[popular-faqs post_count='". $instance['post_count'] . "' no_comments='Yes']");
147
  echo $args['after_widget'];
148
  }
159
  <label for="<?php echo $this->get_field_id( 'post_count' ); ?>"><?php _e( 'Number of FAQs:', 'EWD_UFAQ' ); ?></label>
160
  <input class="widefat" id="<?php echo $this->get_field_id( 'post_count' ); ?>" name="<?php echo $this->get_field_name( 'post_count' ); ?>" type="text" value="<?php echo esc_attr( $post_count ); ?>">
161
  </p>
162
+ <p>
163
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
164
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
165
+ </p>
166
  <?php
167
  }
168
 
175
  public function update( $new_instance, $old_instance ) {
176
  $instance = array();
177
  $instance['post_count'] = ( ! empty( $new_instance['post_count'] ) ) ? strip_tags( $new_instance['post_count'] ) : '';
178
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
179
 
180
  return $instance;
181
  }
205
  $FAQs = get_posts(array('orderby' => 'rand', 'posts_per_page' => '1', 'post_type' => 'ufaq'));
206
 
207
  echo $args['before_widget'];
208
+ if ($instance['faq_title'] != "") {echo "<h3>" . $instance['faq_title'] . "</h3>";}
209
  foreach ($FAQs as $FAQ) {echo do_shortcode("[select-faq faq_id='". $FAQ->ID . "' no_comments='Yes']");}
210
  echo $args['after_widget'];
211
  }
216
  * @param array $instance The widget options
217
  */
218
  public function form( $instance ) {
219
+ $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'EWD_UFAQ' );
220
+ ?>
221
+ <p>
222
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
223
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
224
+ </p>
225
+ <?php
226
  }
227
 
228
  /**
233
  */
234
  public function update( $new_instance, $old_instance ) {
235
  $instance = array();
236
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
237
 
238
  return $instance;
239
  }
261
  */
262
  public function widget( $args, $instance ) {
263
  echo $args['before_widget'];
264
+ if ($instance['faq_title'] != "") {echo "<h3>" . $instance['faq_title'] . "</h3>";}
265
  echo do_shortcode("[ultimate-faqs include_category='". $instance['include_category'] . "' no_comments='Yes']");
266
  echo $args['after_widget'];
267
  }
273
  */
274
  public function form( $instance ) {
275
  $include_category = ! empty( $instance['include_category'] ) ? $instance['include_category'] : __( 'FAQ Category List', 'EWD_UFAQ' );
276
+ $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'EWD_UFAQ' );
277
  ?>
278
  <p>
279
  <label for="<?php echo $this->get_field_id( 'include_category' ); ?>"><?php _e( 'FAQ Category List:', 'EWD_UFAQ' ); ?></label>
280
  <input class="widefat" id="<?php echo $this->get_field_id( 'include_category' ); ?>" name="<?php echo $this->get_field_name( 'include_category' ); ?>" type="text" value="<?php echo esc_attr( $include_category ); ?>">
281
  </p>
282
+ <p>
283
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
284
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
285
+ </p>
286
  <?php
287
  }
288
 
295
  public function update( $new_instance, $old_instance ) {
296
  $instance = array();
297
  $instance['include_category'] = ( ! empty( $new_instance['include_category'] ) ) ? strip_tags( $new_instance['include_category'] ) : '';
298
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
299
 
300
  return $instance;
301
  }
Main.php CHANGED
@@ -7,7 +7,7 @@ Author: Etoile Web Design
7
  Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: EWD_UFAQ
10
- Version: 1.5.26
11
  */
12
 
13
  global $ewd_ufaq_message;
@@ -109,7 +109,7 @@ $plugin = plugin_basename(__FILE__);
109
  add_filter("plugin_action_links_$plugin", 'EWD_UFAQ_plugin_settings_link' );
110
 
111
  function Add_EWD_UFAQ_Scripts($hook) {
112
- global $post;
113
 
114
  if ((isset($_GET['post_type']) && $_GET['post_type'] == 'ufaq') or
115
  (isset($_GET['page']) && $_GET['page'] == 'EWD-UFAQ-Options')) {
@@ -131,6 +131,8 @@ function Add_EWD_UFAQ_Scripts($hook) {
131
  }
132
 
133
  function EWD_UFAQ_Admin_Options() {
 
 
134
  wp_enqueue_style( 'ewd-ufaq-admin', plugins_url("ultimate-faqs/css/Admin.css"), array(), $EWD_UFAQ_Version);
135
  wp_enqueue_style( 'ewd-ufaq-spectrum', plugins_url("ultimate-faqs/css/spectrum.css"));
136
  }
7
  Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: EWD_UFAQ
10
+ Version: 1.5.27
11
  */
12
 
13
  global $ewd_ufaq_message;
109
  add_filter("plugin_action_links_$plugin", 'EWD_UFAQ_plugin_settings_link' );
110
 
111
  function Add_EWD_UFAQ_Scripts($hook) {
112
+ global $post, $EWD_UFAQ_Version;
113
 
114
  if ((isset($_GET['post_type']) && $_GET['post_type'] == 'ufaq') or
115
  (isset($_GET['page']) && $_GET['page'] == 'EWD-UFAQ-Options')) {
131
  }
132
 
133
  function EWD_UFAQ_Admin_Options() {
134
+ global $EWD_UFAQ_Version;
135
+
136
  wp_enqueue_style( 'ewd-ufaq-admin', plugins_url("ultimate-faqs/css/Admin.css"), array(), $EWD_UFAQ_Version);
137
  wp_enqueue_style( 'ewd-ufaq-spectrum', plugins_url("ultimate-faqs/css/spectrum.css"));
138
  }
readme.txt CHANGED
@@ -247,6 +247,9 @@ Video 3 - FAQs Ordering
247
  13. View of FAQ custom fields in the admin
248
 
249
  == Changelog ==
 
 
 
250
  = 1.5.26 =
251
  - Made a number of changes to speed up page loads for longer FAQs
252
  - Fixed an issue with the "Random FAQ" widget where an FAQ would be displayed multiple times if it was in multiple categories
247
  13. View of FAQ custom fields in the admin
248
 
249
  == Changelog ==
250
+ = 1.5.27 =
251
+ - Added an option for a title on a number of the FAQ widgets
252
+
253
  = 1.5.26 =
254
  - Made a number of changes to speed up page loads for longer FAQs
255
  - Fixed an issue with the "Random FAQ" widget where an FAQ would be displayed multiple times if it was in multiple categories