Ultimate FAQ - Version 1.5.11

Version Description

  • Added an "Expand/Collapse All" optional set of controls
  • Added in a "Retrieving Results" label for the search shortcode
  • Added a "Link" custom field type
  • Added in helper text when you're editing a category, to show the shortcode required to display only the selected category of FAQs
  • Fixed a problem with sharing an FAQ on Facebook
Download this release

Release Info

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

Code changes from version 1.5.10 to 1.5.11

Blog.html CHANGED
@@ -1,2 +1,2 @@
1
- <a target='_blank' href='http://www.etoilewebdesign.com/wordpress-beginner-how-to-build-a-business-website-or-blog-in-24-hours/'><h3>WORDPRESS BEGINNER? HOW TO BUILD A BUSINESS WEBSITE OR BLOG IN 24 HOURS.</h3></a>
2
- <p>If you are considering a WordPress website project you’ll be in good company. Over 70…</p>
1
+ <a target='_blank' href='http://www.etoilewebdesign.com/completely-customizable-lightbox/'><h3>NEW COMPLETELY CUSTOMIZABLE LIGHTBOX</h3></a>
2
+ <p>Product Catalog now has a new customizable lightbox, using the <a href='https://wordpress.org/plugins/ultimate-lightbox/'>Ultimate Lightbox</a> plugin.</p>
Functions/EWD_UFAQ_Meta_Boxes.php ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_filter("get_sample_permalink_html", "EWD_UFAQ_Add_FAQ_Shortcode", 10, 5);
4
+ function EWD_UFAQ_Add_FAQ_Shortcode($HTML, $post_id, $title, $slug, $post) {
5
+ if ($post->post_type == "ufaq") {
6
+ $HTML .= "<div class='ewd-ufaq-shortcode-help'>";
7
+ $HTML .= __("Use the following shortcode to add this FAQ to a page:", 'EWD_UFAQ') . "<br>";
8
+ $HTML .= "[select-faq faq_id='" . $post_id . "']";
9
+ $HTML .= "</div>";
10
+ }
11
+
12
+ return $HTML;
13
+ }
14
+
15
+ add_action("ufaq-category_edit_form_fields", "EWD_UFAQ_Taxonomy_Page", 10, 2);
16
+ function EWD_UFAQ_Taxonomy_Page($tag, $taxonomy) {
17
+ echo __("FAQ shortcode for this category", 'EWD_UFAQ') . ":<br />[ultimate-faqs include_category='" . $tag->slug . "']";
18
+ }
19
+
20
+ add_action( 'add_meta_boxes', 'EWD_UFAQ_Add_Meta_Boxes' );
21
+ function EWD_UFAQ_Add_Meta_Boxes () {
22
+ add_meta_box("ufaq-meta", __("FAQ Details", 'EWD_UFAQ'), "EWD_UFAQ_Meta_Box", "ufaq", "normal", "high");
23
+ }
24
+
25
+ /**
26
+ * Prints the box content.
27
+ *
28
+ * @param WP_Post $post The object for the current post/page.
29
+ */
30
+ function EWD_UFAQ_Meta_Box( $post ) {
31
+ $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
32
+ if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
33
+ $FAQ_Ratings = get_option("EWD_UFAQ_FAQ_Ratings");
34
+
35
+ // Add a nonce field so we can check for it later.
36
+ wp_nonce_field( 'EWD_UFAQ_Save_Meta_Box_Data', 'EWD_UFAQ_meta_box_nonce' );
37
+
38
+ /*
39
+ * Use get_post_meta() to retrieve an existing value
40
+ * from the database and use the value for the form.
41
+ */
42
+ $Author = get_post_meta( $post->ID, 'EWD_UFAQ_Post_Author', true );
43
+
44
+ if ($Author == "") {
45
+ $User = wp_get_current_user();
46
+ $Author = $User->display_name;
47
+ }
48
+
49
+ echo "<div class='ewd-ufaq-meta-field'>";
50
+ echo "<label for='Post_Author'>";
51
+ echo __( "Author Display Name:", 'EWD_UFAQ' );
52
+ echo " </label>";
53
+ echo "<input type='text' id='ewd-ufaq-post-author' name='Post_Author' value='" . esc_attr( $Author ) . "' size='25' />";
54
+ echo "</div>";
55
+
56
+ if ($FAQ_Ratings == "Yes") {
57
+ $Up_Votes = get_post_meta($post->ID, "FAQ_Up_Votes", true);
58
+ $Down_Votes = get_post_meta($post->ID, "FAQ_Down_Votes", true);
59
+
60
+ echo "<div class='ewd-ufaq-meta-field'>";
61
+ echo "<label for='Up_Votes'>";
62
+ echo __( "Up Votes:", 'EWD_UFAQ' );
63
+ echo " </label>";
64
+ echo "<input type='text' id='ewd-ufaq-up-votes' name='Up_Votes' value='" . esc_attr( $Up_Votes ) . "' size='25' />";
65
+ echo "</div>";
66
+ echo "<div class='ewd-ufaq-meta-field'>";
67
+ echo "<label for='Down_Votes'>";
68
+ echo __( "Down Votes:", 'EWD_UFAQ' );
69
+ echo " </label>";
70
+ echo "<input type='text' id='ewd-ufaq-down-votes' name='Down_Votes' value='" . esc_attr( $Down_Votes ) . "' size='25' />";
71
+ echo "</div>";
72
+ }
73
+
74
+ foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
75
+ echo "<div class='ewd-ufaq-meta-field'>";
76
+ echo "<label for='" . $FAQ_Field_Item['FieldName'] . "'>";
77
+ echo $FAQ_Field_Item['FieldName'] . ": ";
78
+ echo "</label>";
79
+ $Value = get_post_meta($post->ID, "Custom_Field_" . $FAQ_Field_Item['FieldID'], true);
80
+ if ($FAQ_Field_Item['FieldType'] == "text") {
81
+ echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-text-input' type='text' value='" . htmlspecialchars($Value, ENT_QUOTES) . "' size='60' />";
82
+ }
83
+ elseif ($FAQ_Field_Item['FieldType'] == "textarea") {
84
+ echo "<textarea name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-textarea' cols='60' rows='6'>" . $Value . "</textarea>";
85
+ }
86
+ elseif ($FAQ_Field_Item['FieldType'] == "select") {
87
+ $Options = explode(",", $FAQ_Field_Item['FieldValues']);
88
+ echo "<select name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-select'>";
89
+ foreach ($Options as $Option) {
90
+ echo "<option value='" . $Option . "' ";
91
+ if (trim($Option) == trim($Value)) {echo "selected='selected'";}
92
+ echo ">" . $Option . "</option>";
93
+ }
94
+ echo "</select>";
95
+ }
96
+ elseif ($FAQ_Field_Item['FieldType'] == "radio") {
97
+ $Counter = 0;
98
+ $Options = explode(",", $FAQ_Field_Item['FieldValues']);
99
+ echo "";
100
+ foreach ($Options as $Option) {
101
+ if ($Counter != 0) {echo "<label class='radio'></label>";}
102
+ echo "<input type='radio' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' value='" . $Option . "' class='ewd-ufaq-radio' ";
103
+ if (trim($Option) == trim($Value)) {echo "checked";}
104
+ echo ">" . $Option;
105
+ $Counter++;
106
+ }
107
+ echo "";
108
+ }
109
+ elseif ($FAQ_Field_Item['FieldType'] == "checkbox") {
110
+ $Counter = 0;
111
+ $Options = explode(",", $FAQ_Field_Item['FieldValues']);
112
+ $Values = explode(",", $Value);
113
+ echo "";
114
+ foreach ($Options as $Option) {
115
+ if ($Counter != 0) {echo "<label class='radio'></label>";}
116
+ echo "<input type='checkbox' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "[]' value='" . $Option . "' class='ewd-ufaq-checkbox' ";
117
+ if (in_array($Option, $Values)) {echo "checked";}
118
+ echo ">" . $Option . "</br>";
119
+ $Counter++;
120
+ }
121
+ echo "";
122
+ }
123
+ elseif ($FAQ_Field_Item['FieldType'] == "file") {
124
+ echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-file-input' type='file' value='" . $Value . "' /><br/>Current Filename: " . $Value . "";
125
+ }
126
+ elseif ($FAQ_Field_Item['FieldType'] == "link") {
127
+ echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-text-input' type='text' value='" . $Value . "' size='60' />";
128
+ }
129
+ elseif ($FAQ_Field_Item['FieldType'] == "date") {
130
+ echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-date-input' type='date' value='" . $Value . "' />";
131
+ }
132
+ elseif ($FAQ_Field_Item['FieldType'] == "datetime") {
133
+ echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-datetime-input' type='datetime-local' value='" . $Value . "' />";
134
+ }
135
+ unset($Value);
136
+ echo "</div>";
137
+ }
138
+ }
139
+
140
+ add_action( 'save_post', 'EWD_UFAQ_Save_Meta_Box_Data' );
141
+ function EWD_UFAQ_Save_Meta_Box_Data($post_id) {
142
+ $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
143
+ if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
144
+ $FAQ_Ratings = get_option("EWD_UFAQ_FAQ_Ratings");
145
+
146
+ /*
147
+ * We need to verify this came from our screen and with proper authorization,
148
+ * because the save_post action can be triggered at other times.
149
+ */
150
+
151
+ // Check if our nonce is set.
152
+ if ( ! isset( $_POST['EWD_UFAQ_meta_box_nonce'] ) ) {
153
+ return;
154
+ }
155
+
156
+ // Verify that the nonce is valid.
157
+ if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_meta_box_nonce'], 'EWD_UFAQ_Save_Meta_Box_Data' ) ) {
158
+ return;
159
+ }
160
+
161
+ // If this is an autosave, our form has not been submitted, so we don't want to do anything.
162
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
163
+ return;
164
+ }
165
+
166
+ // Check the user's permissions.
167
+ if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {
168
+
169
+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
170
+ return;
171
+ }
172
+
173
+ } else {
174
+
175
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
176
+ return;
177
+ }
178
+ }
179
+
180
+ foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
181
+ $FieldName = "Custom_Field_" . $FAQ_Field_Item['FieldID'];
182
+ if (isset($_POST[$FieldName]) or isset($_FILES[$FieldName])) {
183
+ // If it's a file, pass back to Prepare_Data_For_Insertion.php to upload the file and get the name
184
+ if ($FAQ_Field_Item['FieldType'] == "file") {
185
+ $File_Upload_Return = EWD_UFAQ_Handle_File_Upload($FieldName);
186
+ if ($File_Upload_Return['Success'] == "No") {return $File_Upload_Return['Data'];}
187
+ elseif ($File_Upload_Return['Success'] == "N/A") {$NoFile = "Yes";}
188
+ else {$Value = $File_Upload_Return['Data'];}
189
+ }
190
+ elseif ($FAQ_Field_Item['FieldType'] == "checkbox") {
191
+ foreach ($_POST[$FieldName] as $SingleValue) {$Value .= trim($SingleValue) . ",";}
192
+ $Value = substr($Value, 0, strlen($Value)-1);
193
+ }
194
+ else {
195
+ $Value = stripslashes_deep(trim($_POST[$FieldName]));
196
+ $Options = explode(",", $FAQ_Field_Item['FieldValues']);
197
+ if (sizeOf($Options) > 0 and $Options[0] != "") {
198
+ array_walk($Options, create_function('&$val', '$val = trim($val);'));
199
+ $InArray = in_array($Value, $Options);
200
+ }
201
+ }
202
+ if (!isset($InArray) or $InArray) {
203
+ if ($NoFile != "Yes") {
204
+ update_post_meta($post_id, "Custom_Field_" . $FAQ_Field_Item['FieldID'], $Value);
205
+ }
206
+ }
207
+ elseif ($InArray == false) {$CustomFieldError = __(" One or more custom field values were incorrect.", 'EWD_UFAQ');}
208
+ unset($Value);
209
+ unset($InArray);
210
+ unset($NoFile);
211
+ unset($CombinedValue);
212
+ unset($FieldName);
213
+ }
214
+ }
215
+
216
+ // Sanitize user input.
217
+ $Post_Author = sanitize_text_field( $_POST['Post_Author'] );
218
+
219
+ // Update the meta field in the database.
220
+ update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', $Post_Author );
221
+
222
+ if ($FAQ_Ratings == "Yes") {
223
+ update_post_meta($post_id, "FAQ_Up_Votes", sanitize_text_field($_POST['Up_Votes']));
224
+ update_post_meta($post_id, "FAQ_Down_Votes", sanitize_text_field($_POST['Down_Votes']));
225
+ update_post_meta($post_id, "FAQ_Total_Score", sanitize_text_field($_POST['Up_Votes']) - sanitize_text_field($_POST['Down_Votes']));
226
+ }
227
+ }
228
+
229
+ function EWD_UFAQ_Add_Edit_Form_Multipart_Encoding() {
230
+ global $post;
231
+
232
+ if(!$post) {return;}
233
+
234
+ $post_type = get_post_type($post->ID);
235
+
236
+ if ($post_type = "ufaq") {echo ' enctype="multipart/form-data"';}
237
+ }
238
+ add_action('post_edit_form_tag', 'EWD_UFAQ_Add_Edit_Form_Multipart_Encoding');
239
+
240
+ function EWD_UFAQ_Handle_File_Upload($Field_Name) {
241
+
242
+ if (!is_user_logged_in()) {exit();}
243
+
244
+ if (isset($_FILES[$Field_Name]) && ($_FILES[$Field_Name]['size'] > 0)) {
245
+ $uploaded_file = wp_handle_upload($_FILES[$Field_Name], array( 'test_form' => false ));
246
+ if (isset($uploaded_file['file'])) {
247
+ $Return['Success'] = "Yes";
248
+ $Return['Data'] = $uploaded_file['url'];
249
+ }
250
+ else {
251
+ $Return['Success'] = "No";
252
+ $Return['Data'] = "There was an error with the file upload";
253
+ }
254
+ }
255
+ else {
256
+ $Return['Success'] = "N/A";
257
+ $Return['Data'] = __('No file was uploaded.', 'UPCP');
258
+ }
259
+
260
+ return $Return;
261
+ }
262
+
263
+ ?>
Functions/Register_EWD_UFAQ_Posts_Taxonomies.php CHANGED
@@ -79,263 +79,4 @@ function EWD_UFAQ_Create_Category_Taxonomy() {
79
  }
80
  add_action( 'init', 'EWD_UFAQ_Create_Category_Taxonomy', 0 );
81
 
82
-
83
-
84
-
85
-
86
- add_filter("get_sample_permalink_html", "EWD_UFAQ_Add_FAQ_Shortcode", 10, 5);
87
- function EWD_UFAQ_Add_FAQ_Shortcode($HTML, $post_id, $title, $slug, $post) {
88
- if ($post->post_type == "ufaq") {
89
- $HTML .= "<div class='ewd-ufaq-shortcode-help'>";
90
- $HTML .= __("Use the following shortcode to add this FAQ to a page:", 'EWD_UFAQ') . "<br>";
91
- $HTML .= "[select-faq faq_id='" . $post_id . "']";
92
- $HTML .= "</div>";
93
- }
94
-
95
- return $HTML;
96
- }
97
-
98
-
99
-
100
-
101
-
102
- add_action( 'add_meta_boxes', 'EWD_UFAQ_Add_Meta_Boxes' );
103
- function EWD_UFAQ_Add_Meta_Boxes () {
104
- add_meta_box("ufaq-meta", __("FAQ Details", 'EWD_UFAQ'), "EWD_UFAQ_Meta_Box", "ufaq", "normal", "high");
105
- }
106
-
107
- /**
108
- * Prints the box content.
109
- *
110
- * @param WP_Post $post The object for the current post/page.
111
- */
112
- function EWD_UFAQ_Meta_Box( $post ) {
113
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
114
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
115
- $FAQ_Ratings = get_option("EWD_UFAQ_FAQ_Ratings");
116
-
117
- // Add a nonce field so we can check for it later.
118
- wp_nonce_field( 'EWD_UFAQ_Save_Meta_Box_Data', 'EWD_UFAQ_meta_box_nonce' );
119
-
120
- /*
121
- * Use get_post_meta() to retrieve an existing value
122
- * from the database and use the value for the form.
123
- */
124
- $Author = get_post_meta( $post->ID, 'EWD_UFAQ_Post_Author', true );
125
-
126
- if ($Author == "") {
127
- $User = wp_get_current_user();
128
- $Author = $User->display_name;
129
- }
130
-
131
- echo "<div class='ewd-ufaq-meta-field'>";
132
- echo "<label for='Post_Author'>";
133
- echo __( "Author Display Name:", 'EWD_UFAQ' );
134
- echo " </label>";
135
- echo "<input type='text' id='ewd-ufaq-post-author' name='Post_Author' value='" . esc_attr( $Author ) . "' size='25' />";
136
- echo "</div>";
137
-
138
- if ($FAQ_Ratings == "Yes") {
139
- $Up_Votes = get_post_meta($post->ID, "FAQ_Up_Votes", true);
140
- $Down_Votes = get_post_meta($post->ID, "FAQ_Down_Votes", true);
141
-
142
- echo "<div class='ewd-ufaq-meta-field'>";
143
- echo "<label for='Up_Votes'>";
144
- echo __( "Up Votes:", 'EWD_UFAQ' );
145
- echo " </label>";
146
- echo "<input type='text' id='ewd-ufaq-up-votes' name='Up_Votes' value='" . esc_attr( $Up_Votes ) . "' size='25' />";
147
- echo "</div>";
148
- echo "<div class='ewd-ufaq-meta-field'>";
149
- echo "<label for='Down_Votes'>";
150
- echo __( "Down Votes:", 'EWD_UFAQ' );
151
- echo " </label>";
152
- echo "<input type='text' id='ewd-ufaq-down-votes' name='Down_Votes' value='" . esc_attr( $Down_Votes ) . "' size='25' />";
153
- echo "</div>";
154
- }
155
-
156
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
157
- echo "<div class='ewd-ufaq-meta-field'>";
158
- echo "<label for='" . $FAQ_Field_Item['FieldName'] . "'>";
159
- echo $FAQ_Field_Item['FieldName'] . ": ";
160
- echo "</label>";
161
- $Value = get_post_meta($post->ID, "Custom_Field_" . $FAQ_Field_Item['FieldID'], true);
162
- if ($FAQ_Field_Item['FieldType'] == "text") {
163
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-text-input' type='text' value='" . htmlspecialchars($Value, ENT_QUOTES) . "' size='60' />";
164
- }
165
- elseif ($FAQ_Field_Item['FieldType'] == "textarea") {
166
- echo "<textarea name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-textarea' cols='60' rows='6'>" . $Value . "</textarea>";
167
- }
168
- elseif ($FAQ_Field_Item['FieldType'] == "select") {
169
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
170
- echo "<select name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-select'>";
171
- foreach ($Options as $Option) {
172
- echo "<option value='" . $Option . "' ";
173
- if (trim($Option) == trim($Value)) {echo "selected='selected'";}
174
- echo ">" . $Option . "</option>";
175
- }
176
- echo "</select>";
177
- }
178
- elseif ($FAQ_Field_Item['FieldType'] == "radio") {
179
- $Counter = 0;
180
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
181
- echo "";
182
- foreach ($Options as $Option) {
183
- if ($Counter != 0) {echo "<label class='radio'></label>";}
184
- echo "<input type='radio' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' value='" . $Option . "' class='ewd-ufaq-radio' ";
185
- if (trim($Option) == trim($Value)) {echo "checked";}
186
- echo ">" . $Option;
187
- $Counter++;
188
- }
189
- echo "";
190
- }
191
- elseif ($FAQ_Field_Item['FieldType'] == "checkbox") {
192
- $Counter = 0;
193
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
194
- $Values = explode(",", $Value);
195
- echo "";
196
- foreach ($Options as $Option) {
197
- if ($Counter != 0) {echo "<label class='radio'></label>";}
198
- echo "<input type='checkbox' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "[]' value='" . $Option . "' class='ewd-ufaq-checkbox' ";
199
- if (in_array($Option, $Values)) {echo "checked";}
200
- echo ">" . $Option . "</br>";
201
- $Counter++;
202
- }
203
- echo "";
204
- }
205
- elseif ($FAQ_Field_Item['FieldType'] == "file") {
206
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-file-input' type='file' value='" . $Value . "' /><br/>Current Filename: " . $Value . "";
207
- }
208
- elseif ($FAQ_Field_Item['FieldType'] == "date") {
209
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-date-input' type='date' value='" . $Value . "' />";
210
- }
211
- elseif ($FAQ_Field_Item['FieldType'] == "datetime") {
212
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-datetime-input' type='datetime-local' value='" . $Value . "' />";
213
- }
214
- unset($Value);
215
- echo "</div>";
216
- }
217
- }
218
-
219
- add_action( 'save_post', 'EWD_UFAQ_Save_Meta_Box_Data' );
220
- function EWD_UFAQ_Save_Meta_Box_Data($post_id) {
221
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
222
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
223
- $FAQ_Ratings = get_option("EWD_UFAQ_FAQ_Ratings");
224
-
225
- /*
226
- * We need to verify this came from our screen and with proper authorization,
227
- * because the save_post action can be triggered at other times.
228
- */
229
-
230
- // Check if our nonce is set.
231
- if ( ! isset( $_POST['EWD_UFAQ_meta_box_nonce'] ) ) {
232
- return;
233
- }
234
-
235
- // Verify that the nonce is valid.
236
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_meta_box_nonce'], 'EWD_UFAQ_Save_Meta_Box_Data' ) ) {
237
- return;
238
- }
239
-
240
- // If this is an autosave, our form has not been submitted, so we don't want to do anything.
241
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
242
- return;
243
- }
244
-
245
- // Check the user's permissions.
246
- if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {
247
-
248
- if ( ! current_user_can( 'edit_page', $post_id ) ) {
249
- return;
250
- }
251
-
252
- } else {
253
-
254
- if ( ! current_user_can( 'edit_post', $post_id ) ) {
255
- return;
256
- }
257
- }
258
-
259
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
260
- $FieldName = "Custom_Field_" . $FAQ_Field_Item['FieldID'];
261
- if (isset($_POST[$FieldName]) or isset($_FILES[$FieldName])) {
262
- // If it's a file, pass back to Prepare_Data_For_Insertion.php to upload the file and get the name
263
- if ($FAQ_Field_Item['FieldType'] == "file") {
264
- $File_Upload_Return = EWD_UFAQ_Handle_File_Upload($FieldName);
265
- if ($File_Upload_Return['Success'] == "No") {return $File_Upload_Return['Data'];}
266
- elseif ($File_Upload_Return['Success'] == "N/A") {$NoFile = "Yes";}
267
- else {$Value = $File_Upload_Return['Data'];}
268
- }
269
- elseif ($FAQ_Field_Item['FieldType'] == "checkbox") {
270
- foreach ($_POST[$FieldName] as $SingleValue) {$Value .= trim($SingleValue) . ",";}
271
- $Value = substr($Value, 0, strlen($Value)-1);
272
- }
273
- else {
274
- $Value = stripslashes_deep(trim($_POST[$FieldName]));
275
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
276
- if (sizeOf($Options) > 0 and $Options[0] != "") {
277
- array_walk($Options, create_function('&$val', '$val = trim($val);'));
278
- $InArray = in_array($Value, $Options);
279
- }
280
- }
281
- if (!isset($InArray) or $InArray) {
282
- if ($NoFile != "Yes") {
283
- update_post_meta($post_id, "Custom_Field_" . $FAQ_Field_Item['FieldID'], $Value);
284
- }
285
- }
286
- elseif ($InArray == false) {$CustomFieldError = __(" One or more custom field values were incorrect.", 'EWD_UFAQ');}
287
- unset($Value);
288
- unset($InArray);
289
- unset($NoFile);
290
- unset($CombinedValue);
291
- unset($FieldName);
292
- }
293
- }
294
-
295
- // Sanitize user input.
296
- $Post_Author = sanitize_text_field( $_POST['Post_Author'] );
297
-
298
- // Update the meta field in the database.
299
- update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', $Post_Author );
300
-
301
- if ($FAQ_Ratings == "Yes") {
302
- update_post_meta($post_id, "FAQ_Up_Votes", sanitize_text_field($_POST['Up_Votes']));
303
- update_post_meta($post_id, "FAQ_Down_Votes", sanitize_text_field($_POST['Down_Votes']));
304
- update_post_meta($post_id, "FAQ_Total_Score", sanitize_text_field($_POST['Up_Votes']) - sanitize_text_field($_POST['Down_Votes']));
305
- }
306
- }
307
-
308
- function EWD_UFAQ_Add_Edit_Form_Multipart_Encoding() {
309
- global $post;
310
-
311
- if(!$post) {return;}
312
-
313
- $post_type = get_post_type($post->ID);
314
-
315
- if ($post_type = "ufaq") {echo ' enctype="multipart/form-data"';}
316
- }
317
- add_action('post_edit_form_tag', 'EWD_UFAQ_Add_Edit_Form_Multipart_Encoding');
318
-
319
- function EWD_UFAQ_Handle_File_Upload($Field_Name) {
320
-
321
- if (!is_user_logged_in()) {exit();}
322
-
323
- if (isset($_FILES[$Field_Name]) && ($_FILES[$Field_Name]['size'] > 0)) {
324
- $uploaded_file = wp_handle_upload($_FILES[$Field_Name], array( 'test_form' => false ));
325
- if (isset($uploaded_file['file'])) {
326
- $Return['Success'] = "Yes";
327
- $Return['Data'] = $uploaded_file['url'];
328
- }
329
- else {
330
- $Return['Success'] = "No";
331
- $Return['Data'] = "There was an error with the file upload";
332
- }
333
- }
334
- else {
335
- $Return['Success'] = "N/A";
336
- $Return['Data'] = __('No file was uploaded.', 'UPCP');
337
- }
338
-
339
- return $Return;
340
- }
341
  ?>
79
  }
80
  add_action( 'init', 'EWD_UFAQ_Create_Category_Taxonomy', 0 );
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  ?>
Functions/Update_Admin_Databases.php CHANGED
@@ -22,6 +22,7 @@ function EWD_UFAQ_UpdateOptions() {
22
  if (isset($_POST['custom_css'])) {update_option('EWD_UFAQ_Custom_CSS', $Custom_CSS);}
23
  if (isset($_POST['faq_toggle'])) {update_option('EWD_UFAQ_Toggle', $_POST['faq_toggle']);}
24
  if (isset($_POST['faq_category_toggle'])) {update_option('EWD_UFAQ_Category_Toggle', $_POST['faq_category_toggle']);}
 
25
  if (isset($_POST['faq_accordion'])) {update_option('EWD_UFAQ_FAQ_Accordion', $_POST['faq_accordion']);}
26
  if (isset($_POST['faq_auto_complete_titles'])) {update_option('EWD_UFAQ_Auto_Complete_Titles', $_POST['faq_auto_complete_titles']);}
27
  if (isset($_POST['hide_categories'])) {update_option('EWD_UFAQ_Hide_Categories', $_POST['hide_categories']);}
@@ -83,7 +84,6 @@ function EWD_UFAQ_UpdateOptions() {
83
  if (isset($_POST['search_label'])) {update_option('EWD_UFAQ_Search_Label', $_POST['search_label']);}
84
  if (isset($_POST['permalink_label'])) {update_option('EWD_UFAQ_Permalink_Label', $_POST['permalink_label']);}
85
  if (isset($_POST['back_to_top_label'])) {update_option('EWD_UFAQ_Back_To_Top_Label', $_POST['back_to_top_label']);}
86
- if (isset($_POST['no_results_found_text'])) {update_option('EWD_UFAQ_No_Results_Found_Text', $_POST['no_results_found_text']);}
87
 
88
  if (isset($_POST['thank_you_submit_label'])) {update_option('EWD_UFAQ_Thank_You_Submit_Label', $_POST['thank_you_submit_label']);}
89
  if (isset($_POST['submit_question_label'])) {update_option('EWD_UFAQ_Submit_Question_Label', $_POST['submit_question_label']);}
@@ -94,6 +94,8 @@ function EWD_UFAQ_UpdateOptions() {
94
  if (isset($_POST['proposed_answer_label'])) {update_option('EWD_UFAQ_Proposed_Answer_Label', $_POST['proposed_answer_label']);}
95
  if (isset($_POST['review_author_label'])) {update_option('EWD_UFAQ_Review_Author_Label', $_POST['review_author_label']);}
96
  if (isset($_POST['what_name_with_review_label'])) {update_option('EWD_UFAQ_What_Name_With_Review_Label', $_POST['what_name_with_review_label']);}
 
 
97
 
98
  if (isset($_POST['ufaq_styling_default_bg_color'])) {update_option('EWD_UFAQ_Styling_Default_Bg_Color', $_POST['ufaq_styling_default_bg_color']);}
99
  if (isset($_POST['ufaq_styling_default_font_color'])) {update_option('EWD_UFAQ_Styling_Default_Font_Color', $_POST['ufaq_styling_default_font_color']);}
22
  if (isset($_POST['custom_css'])) {update_option('EWD_UFAQ_Custom_CSS', $Custom_CSS);}
23
  if (isset($_POST['faq_toggle'])) {update_option('EWD_UFAQ_Toggle', $_POST['faq_toggle']);}
24
  if (isset($_POST['faq_category_toggle'])) {update_option('EWD_UFAQ_Category_Toggle', $_POST['faq_category_toggle']);}
25
+ if (isset($_POST['expand_collapse_all'])) {update_option('EWD_UFAQ_Expand_Collapse_All', $_POST['expand_collapse_all']);}
26
  if (isset($_POST['faq_accordion'])) {update_option('EWD_UFAQ_FAQ_Accordion', $_POST['faq_accordion']);}
27
  if (isset($_POST['faq_auto_complete_titles'])) {update_option('EWD_UFAQ_Auto_Complete_Titles', $_POST['faq_auto_complete_titles']);}
28
  if (isset($_POST['hide_categories'])) {update_option('EWD_UFAQ_Hide_Categories', $_POST['hide_categories']);}
84
  if (isset($_POST['search_label'])) {update_option('EWD_UFAQ_Search_Label', $_POST['search_label']);}
85
  if (isset($_POST['permalink_label'])) {update_option('EWD_UFAQ_Permalink_Label', $_POST['permalink_label']);}
86
  if (isset($_POST['back_to_top_label'])) {update_option('EWD_UFAQ_Back_To_Top_Label', $_POST['back_to_top_label']);}
 
87
 
88
  if (isset($_POST['thank_you_submit_label'])) {update_option('EWD_UFAQ_Thank_You_Submit_Label', $_POST['thank_you_submit_label']);}
89
  if (isset($_POST['submit_question_label'])) {update_option('EWD_UFAQ_Submit_Question_Label', $_POST['submit_question_label']);}
94
  if (isset($_POST['proposed_answer_label'])) {update_option('EWD_UFAQ_Proposed_Answer_Label', $_POST['proposed_answer_label']);}
95
  if (isset($_POST['review_author_label'])) {update_option('EWD_UFAQ_Review_Author_Label', $_POST['review_author_label']);}
96
  if (isset($_POST['what_name_with_review_label'])) {update_option('EWD_UFAQ_What_Name_With_Review_Label', $_POST['what_name_with_review_label']);}
97
+ if (isset($_POST['retrieving_results'])) {update_option('EWD_UFAQ_Retrieving_Results', $_POST['retrieving_results']);}
98
+ if (isset($_POST['no_results_found_text'])) {update_option('EWD_UFAQ_No_Results_Found_Text', $_POST['no_results_found_text']);}
99
 
100
  if (isset($_POST['ufaq_styling_default_bg_color'])) {update_option('EWD_UFAQ_Styling_Default_Bg_Color', $_POST['ufaq_styling_default_bg_color']);}
101
  if (isset($_POST['ufaq_styling_default_font_color'])) {update_option('EWD_UFAQ_Styling_Default_Font_Color', $_POST['ufaq_styling_default_font_color']);}
Main.php CHANGED
@@ -7,14 +7,14 @@ 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.10
11
  */
12
 
13
  global $ewd_ufaq_message;
14
  global $UFAQ_Full_Version;
15
  global $EWD_UFAQ_Version;
16
 
17
- $EWD_UFAQ_Version = '1.5.5';
18
 
19
  define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
  define( 'EWD_UFAQ_CD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
@@ -129,6 +129,15 @@ function EWD_UFAQ_Admin_Options() {
129
  add_action( 'wp_enqueue_scripts', 'Add_EWD_UFAQ_FrontEnd_Scripts' );
130
  function Add_EWD_UFAQ_FrontEnd_Scripts() {
131
  wp_enqueue_script('ewd-ufaq-js', plugins_url( '/js/ewd-ufaq-js.js' , __FILE__ ), array( 'jquery' ));
 
 
 
 
 
 
 
 
 
132
 
133
  wp_enqueue_script("jquery-ui-core");
134
  wp_enqueue_script("jquery-effects-core");
@@ -168,6 +177,7 @@ function save_ufaq_error(){
168
  function Set_EWD_UFAQ_Options() {
169
  if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
170
  if (get_option("EWD_UFAQ_Category_Toggle") == "") {update_option("EWD_UFAQ_Category_Toggle", "No");}
 
171
  if (get_option("EWD_UFAQ_FAQ_Accordion") == "") {update_option("EWD_UFAQ_FAQ_Accordion", "No");}
172
  if (get_option("EWD_UFAQ_Hide_Categories") == "") {update_option("EWD_UFAQ_Hide_Categories", "No");}
173
  if (get_option("EWD_UFAQ_Hide_Tags") == "") {update_option("EWD_UFAQ_Hide_Tags", "No");}
@@ -290,6 +300,7 @@ include "Functions/EWD_UFAQ_Add_Views_Column.php";
290
  include "Functions/EWD_UFAQ_Export.php";
291
  include "Functions/EWD_UFAQ_Help_Pointers.php";
292
  include "Functions/EWD_UFAQ_Import.php";
 
293
  include "Functions/EWD_UFAQ_Styling.php";
294
  include "Functions/EWD_UFAQ_Output_Pages.php";
295
  include "Functions/EWD_UFAQ_Pointers_Manager_Interface.php";
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.11
11
  */
12
 
13
  global $ewd_ufaq_message;
14
  global $UFAQ_Full_Version;
15
  global $EWD_UFAQ_Version;
16
 
17
+ $EWD_UFAQ_Version = '1.5.11';
18
 
19
  define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
  define( 'EWD_UFAQ_CD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
129
  add_action( 'wp_enqueue_scripts', 'Add_EWD_UFAQ_FrontEnd_Scripts' );
130
  function Add_EWD_UFAQ_FrontEnd_Scripts() {
131
  wp_enqueue_script('ewd-ufaq-js', plugins_url( '/js/ewd-ufaq-js.js' , __FILE__ ), array( 'jquery' ));
132
+
133
+ $Retrieving_Results = get_option("EWD_UFAQ_Retrieving_Results");
134
+ if ($Retrieving_Results == "") {$Retrieving_Results = __("Retrieving Results", 'EWD_UFAQ') . "...";}
135
+
136
+ $ewd_ufaq_php_data = array(
137
+ 'retrieving_results' => $Retrieving_Results
138
+ );
139
+
140
+ wp_localize_script('ewd-ufaq-js', 'ewd_ufaq_php_data', $ewd_ufaq_php_data );
141
 
142
  wp_enqueue_script("jquery-ui-core");
143
  wp_enqueue_script("jquery-effects-core");
177
  function Set_EWD_UFAQ_Options() {
178
  if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
179
  if (get_option("EWD_UFAQ_Category_Toggle") == "") {update_option("EWD_UFAQ_Category_Toggle", "No");}
180
+ if (get_option("EWD_UFAQ_Expand_Collapse_All") == "") {update_option("EWD_UFAQ_Expand_Collapse_All", "No");}
181
  if (get_option("EWD_UFAQ_FAQ_Accordion") == "") {update_option("EWD_UFAQ_FAQ_Accordion", "No");}
182
  if (get_option("EWD_UFAQ_Hide_Categories") == "") {update_option("EWD_UFAQ_Hide_Categories", "No");}
183
  if (get_option("EWD_UFAQ_Hide_Tags") == "") {update_option("EWD_UFAQ_Hide_Tags", "No");}
300
  include "Functions/EWD_UFAQ_Export.php";
301
  include "Functions/EWD_UFAQ_Help_Pointers.php";
302
  include "Functions/EWD_UFAQ_Import.php";
303
+ include "Functions/EWD_UFAQ_Meta_Boxes.php";
304
  include "Functions/EWD_UFAQ_Styling.php";
305
  include "Functions/EWD_UFAQ_Output_Pages.php";
306
  include "Functions/EWD_UFAQ_Pointers_Manager_Interface.php";
Shortcodes/DisplayFAQs.php CHANGED
@@ -11,6 +11,7 @@ function Display_FAQs($atts) {
11
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
12
  $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
13
  $Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
 
14
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
15
  $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
16
  $Hide_Tags = get_option("EWD_UFAQ_Hide_Tags");
@@ -191,6 +192,13 @@ function Display_FAQs($atts) {
191
  $ReturnString .= "var reveal_effect = '" . $Reveal_Effect . "';";
192
  $ReturnString .= "</script>";
193
 
 
 
 
 
 
 
 
194
  if ($Display_Style == "List") {
195
  $ReturnString .= "%LIST_HEADER_PLACEHOLDER%";
196
  }
@@ -302,6 +310,7 @@ function Display_FAQs($atts) {
302
  $ReturnString .= "<div class='ufaq-custom-field-label'>" . $FAQ_Field_Item['FieldName'] . ": </div>";
303
  $ReturnString .= "<div class='ufaq-custom-field-value'>&nbsp;";
304
  if ($FAQ_Field_Item['FieldType'] == "file") {$ReturnString .= "<a href='" . $Value . "'>" . substr($Value, strrpos($Value, "/"+1)) . "</a>";}
 
305
  else {$ReturnString .= $Value;}
306
  $ReturnString .= "</div>";
307
  $ReturnString .= "<div class='ewd-ufaq-clear'></div>";
@@ -361,7 +370,7 @@ function Display_FAQs($atts) {
361
  $ReturnString .= "<div class='ufaq-social-links'>Share: ";
362
  $ReturnString .= "<ul class='rrssb-buttons'>";
363
  }
364
- if(in_array("Facebook", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Facebook", $FAQ_Permalink, $faq->post_title);}
365
  if(in_array("Google", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Google", $FAQ_Permalink, $faq->post_title);}
366
  if(in_array("Twitter", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Twitter", $FAQ_Permalink, $faq->post_title);}
367
  if(in_array("Linkedin", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Linkedin", $FAQ_Permalink, $faq->post_title);}
11
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
12
  $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
13
  $Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
14
+ $Expand_Collapse_All = get_option("EWD_UFAQ_Expand_Collapse_All");
15
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
16
  $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
17
  $Hide_Tags = get_option("EWD_UFAQ_Hide_Tags");
192
  $ReturnString .= "var reveal_effect = '" . $Reveal_Effect . "';";
193
  $ReturnString .= "</script>";
194
 
195
+ if ($Expand_Collapse_All == "Yes") {
196
+ $ReturnString .= "<div class='ewd-ufaq-expand-collapse-div'><a>";
197
+ $ReturnString .= "<span class='ewd-ufaq-expand-all'><span class='ewd-ufaq-toggle-all-symbol'>c</span> " . __("Expand All", 'EWD_UFAQ') . "</span>";
198
+ $ReturnString .= "<span class='ewd-ufaq-collapse-all ewd-ufaq-hidden'><span class='ewd-ufaq-toggle-all-symbol'>C</span> " . __("Collapse All", 'EWD_UFAQ') . "</span>";
199
+ $ReturnString .= "</div></a>";
200
+ }
201
+
202
  if ($Display_Style == "List") {
203
  $ReturnString .= "%LIST_HEADER_PLACEHOLDER%";
204
  }
310
  $ReturnString .= "<div class='ufaq-custom-field-label'>" . $FAQ_Field_Item['FieldName'] . ": </div>";
311
  $ReturnString .= "<div class='ufaq-custom-field-value'>&nbsp;";
312
  if ($FAQ_Field_Item['FieldType'] == "file") {$ReturnString .= "<a href='" . $Value . "'>" . substr($Value, strrpos($Value, "/"+1)) . "</a>";}
313
+ elseif ($FAQ_Field_Item['FieldType'] == "link") {$ReturnString .= "<a href='" . $Value . "' target='_blank'>" . $Value ."</a>";}
314
  else {$ReturnString .= $Value;}
315
  $ReturnString .= "</div>";
316
  $ReturnString .= "<div class='ewd-ufaq-clear'></div>";
370
  $ReturnString .= "<div class='ufaq-social-links'>Share: ";
371
  $ReturnString .= "<ul class='rrssb-buttons'>";
372
  }
373
+ if(in_array("Facebook", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Facebook", get_permalink($faq->ID), $faq->post_title);}
374
  if(in_array("Google", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Google", $FAQ_Permalink, $faq->post_title);}
375
  if(in_array("Twitter", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Twitter", $FAQ_Permalink, $faq->post_title);}
376
  if(in_array("Linkedin", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Linkedin", $FAQ_Permalink, $faq->post_title);}
css/ewd-ufaq-styles.css CHANGED
@@ -385,6 +385,15 @@ Ratings
385
  background-repeat: no-repeat;
386
  }
387
 
 
 
 
 
 
 
 
 
 
388
 
389
  /*
390
  ==============================================
@@ -403,6 +412,7 @@ Toggle Font
403
  font-style: normal;
404
  }
405
 
406
- .ewd-ufaq-post-margin-symbol {
 
407
  font-family: 'ewd-toggle-icon';
408
  }
385
  background-repeat: no-repeat;
386
  }
387
 
388
+ /************************
389
+ * Expand/Collapse
390
+ ************************/
391
+ .ewd-ufaq-expand-all,
392
+ .ewd-ufaq-collapse-all {
393
+ text-decoration: none;
394
+ cursor: pointer;
395
+ font-size: 0.9em;
396
+ }
397
 
398
  /*
399
  ==============================================
412
  font-style: normal;
413
  }
414
 
415
+ .ewd-ufaq-post-margin-symbol,
416
+ .ewd-ufaq-toggle-all-symbol {
417
  font-family: 'ewd-toggle-icon';
418
  }
html/OptionsPage.php CHANGED
@@ -2,6 +2,7 @@
2
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
3
  $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
4
  $FAQ_Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
 
5
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
6
  $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
7
  $Hide_Tags = get_option("EWD_UFAQ_Hide_Tags");
@@ -57,6 +58,7 @@
57
  $Proposed_Answer_Label = get_option("EWD_UFAQ_Proposed_Answer_Label");
58
  $Review_Author_Label = get_option("EWD_UFAQ_Review_Author_Label");
59
  $What_Name_With_Review_Label = get_option("EWD_UFAQ_What_Name_With_Review_Label");
 
60
  $No_Results_Found_Text = get_option("EWD_UFAQ_No_Results_Found_Text");
61
 
62
  $UFAQ_Styling_Default_Bg_Color = get_option("EWD_UFAQ_Styling_Default_Bg_Color");
@@ -148,6 +150,16 @@
148
  </td>
149
  </tr>
150
  <tr>
 
 
 
 
 
 
 
 
 
 
151
  <th scope="row">FAQ Accordion</th>
152
  <td>
153
  <fieldset><legend class="screen-reader-text"><span>FAQ Accordion</span></legend>
@@ -582,6 +594,7 @@
582
  <option value='radio' <?php if ($FAQ_Field_Item['FieldType'] == "radio") {echo "selected='selected'";} ?>>Radio Buttons</option>
583
  <option value='checkbox' <?php if ($FAQ_Field_Item['FieldType'] == "checkbox") {echo "selected='selected'";} ?>>Checkbox</option>
584
  <option value='file' <?php if ($FAQ_Field_Item['FieldType'] == "file") {echo "selected='selected'";} ?>>File</option>
 
585
  <option value='date' <?php if ($FAQ_Field_Item['FieldType'] == "date") {echo "selected='selected'";} ?>>Date</option>
586
  <option value='datetime' <?php if ($FAQ_Field_Item['FieldType'] == "datetime") {echo "selected='selected'";} ?>>Date/Time</option>
587
  <?php echo "</select></td>";
@@ -732,6 +745,12 @@
732
  <input type='text' name='what_name_with_review_label' value='<?php echo $What_Name_With_Review_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
733
  </fieldset>
734
  </div>
 
 
 
 
 
 
735
  <div class='ufaq-option ufaq-label-option'>
736
  <?php _e("No results FAQ's contained the term '%s'", 'EWD_UFAQ')?>
737
  <fieldset>
2
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
3
  $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
4
  $FAQ_Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
5
+ $Expand_Collapse_All = get_option("EWD_UFAQ_Expand_Collapse_All");
6
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
7
  $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
8
  $Hide_Tags = get_option("EWD_UFAQ_Hide_Tags");
58
  $Proposed_Answer_Label = get_option("EWD_UFAQ_Proposed_Answer_Label");
59
  $Review_Author_Label = get_option("EWD_UFAQ_Review_Author_Label");
60
  $What_Name_With_Review_Label = get_option("EWD_UFAQ_What_Name_With_Review_Label");
61
+ $Retrieving_Results = get_option("EWD_UFAQ_Retrieving_Results");
62
  $No_Results_Found_Text = get_option("EWD_UFAQ_No_Results_Found_Text");
63
 
64
  $UFAQ_Styling_Default_Bg_Color = get_option("EWD_UFAQ_Styling_Default_Bg_Color");
150
  </td>
151
  </tr>
152
  <tr>
153
+ <th scope="row">FAQ Expand/Collapse All</th>
154
+ <td>
155
+ <fieldset><legend class="screen-reader-text"><span>FAQ Toggle</span></legend>
156
+ <label title='Yes'><input type='radio' name='expand_collapse_all' value='Yes' <?php if($Expand_Collapse_All == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
157
+ <label title='No'><input type='radio' name='expand_collapse_all' value='No' <?php if($Expand_Collapse_All == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
158
+ <p>Should the FAQs hide/open when they are clicked? </p>
159
+ </fieldset>
160
+ </td>
161
+ </tr>
162
+ <tr>
163
  <th scope="row">FAQ Accordion</th>
164
  <td>
165
  <fieldset><legend class="screen-reader-text"><span>FAQ Accordion</span></legend>
594
  <option value='radio' <?php if ($FAQ_Field_Item['FieldType'] == "radio") {echo "selected='selected'";} ?>>Radio Buttons</option>
595
  <option value='checkbox' <?php if ($FAQ_Field_Item['FieldType'] == "checkbox") {echo "selected='selected'";} ?>>Checkbox</option>
596
  <option value='file' <?php if ($FAQ_Field_Item['FieldType'] == "file") {echo "selected='selected'";} ?>>File</option>
597
+ <option value='link' <?php if ($FAQ_Field_Item['FieldType'] == "link") {echo "selected='selected'";} ?>>Link</option>
598
  <option value='date' <?php if ($FAQ_Field_Item['FieldType'] == "date") {echo "selected='selected'";} ?>>Date</option>
599
  <option value='datetime' <?php if ($FAQ_Field_Item['FieldType'] == "datetime") {echo "selected='selected'";} ?>>Date/Time</option>
600
  <?php echo "</select></td>";
745
  <input type='text' name='what_name_with_review_label' value='<?php echo $What_Name_With_Review_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
746
  </fieldset>
747
  </div>
748
+ <div class='ufaq-option ufaq-label-option'>
749
+ <?php _e("Retrieving Results", 'EWD_UFAQ')?>
750
+ <fieldset>
751
+ <input type='text' name='retrieving_results' value='<?php echo $Retrieving_Results; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
752
+ </fieldset>
753
+ </div>
754
  <div class='ufaq-option ufaq-label-option'>
755
  <?php _e("No results FAQ's contained the term '%s'", 'EWD_UFAQ')?>
756
  <fieldset>
js/Admin.js CHANGED
@@ -62,6 +62,7 @@ jQuery(document).ready(function() {
62
  HTML += "<option value='radio'>Radio Buttons</option>";
63
  HTML += "<option value='checkbox'>Checkbox</option>";
64
  HTML += "<option value='file'>File</option>";
 
65
  HTML += "<option value='date'>Date</option>";
66
  HTML += "<option value='datetime'>Date/Time</option>";
67
  HTML += "</select></td>";
62
  HTML += "<option value='radio'>Radio Buttons</option>";
63
  HTML += "<option value='checkbox'>Checkbox</option>";
64
  HTML += "<option value='file'>File</option>";
65
+ HTML += "<option value='link'>Link</option>";
66
  HTML += "<option value='date'>Date</option>";
67
  HTML += "<option value='datetime'>Date/Time</option>";
68
  HTML += "</select></td>";
js/ewd-ufaq-js.js CHANGED
@@ -2,6 +2,7 @@ jQuery(function(){ //DOM Ready
2
  ufaqSetClickHandlers();
3
  UFAQSetAutoCompleteClickHandlers();
4
  UFAQSetRatingHandlers();
 
5
  });
6
 
7
  function runEffect(display, post_id) {
@@ -161,7 +162,7 @@ function Ufaq_Ajax_Reload() {
161
  var order = jQuery('#ufaq-order').val();
162
  var post_count = jQuery('#ufaq-post-count').val();
163
 
164
- jQuery('#ufaq-ajax-results').html('<h3>Retrieving results...</h3>');
165
  RequestCount = RequestCount + 1;
166
 
167
  var data = 'Q=' + Question + '&include_category=' + include_cat + '&exclude_category=' + exclude_cat + '&orderby=' + orderby + '&order=' + order + '&post_count=' + post_count + '&request_count=' + RequestCount + '&action=ufaq_search';
@@ -195,6 +196,28 @@ function UFAQSetRatingHandlers() {
195
  });
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  /*jQuery(document).ready(function() {
199
  jQuery('a[href*=#]:not([href=#])').click(function() {
200
  var post_id = jQuery(this).attr("data-postid");
2
  ufaqSetClickHandlers();
3
  UFAQSetAutoCompleteClickHandlers();
4
  UFAQSetRatingHandlers();
5
+ UFAQSetExpandCollapseHandlers();
6
  });
7
 
8
  function runEffect(display, post_id) {
162
  var order = jQuery('#ufaq-order').val();
163
  var post_count = jQuery('#ufaq-post-count').val();
164
 
165
+ jQuery('#ufaq-ajax-results').html('<h3>' + ewd_ufaq_php_data.retrieving_results + '</h3>');
166
  RequestCount = RequestCount + 1;
167
 
168
  var data = 'Q=' + Question + '&include_category=' + include_cat + '&exclude_category=' + exclude_cat + '&orderby=' + orderby + '&order=' + order + '&post_count=' + post_count + '&request_count=' + RequestCount + '&action=ufaq_search';
196
  });
197
  }
198
 
199
+ function UFAQSetExpandCollapseHandlers() {
200
+ jQuery('.ewd-ufaq-expand-all').on('click', function() {
201
+ jQuery('.ufaq-faq-toggle').each(function() {
202
+ var post_id = jQuery(this).attr("data-postid");
203
+ var selectedIDString = 'ufaq-body-'+post_id;
204
+ EWD_UFAQ_Reveal_FAQ(post_id, selectedIDString);
205
+ });
206
+ jQuery('.ufaq-faq-category-inner').removeClass('ufaq-faq-category-body-hidden');
207
+ jQuery('.ewd-ufaq-collapse-all').removeClass('ewd-ufaq-hidden');
208
+ jQuery('.ewd-ufaq-expand-all').addClass('ewd-ufaq-hidden');
209
+ });
210
+ jQuery('.ewd-ufaq-collapse-all').on('click', function() {
211
+ jQuery('.ufaq-faq-toggle').each(function() {
212
+ var post_id = jQuery(this).attr("data-postid");
213
+ EWD_UFAQ_Hide_FAQ(post_id);
214
+ });
215
+ if (jQuery('.ufaq-faq-category-title-toggle').length > 0) {jQuery('.ufaq-faq-category-inner').addClass('ufaq-faq-category-body-hidden');}
216
+ jQuery('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
217
+ jQuery('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
218
+ });
219
+ }
220
+
221
  /*jQuery(document).ready(function() {
222
  jQuery('a[href*=#]:not([href=#])').click(function() {
223
  var post_id = jQuery(this).attr("data-postid");
readme.txt CHANGED
@@ -210,6 +210,13 @@ Video 3 - FAQs Ordering
210
  9. All answers displayed in the 'list' FAQ mode
211
 
212
  == Changelog ==
 
 
 
 
 
 
 
213
  = 1.5.10 =
214
  - Fixed an error where permalinks weren't displaying
215
 
210
  9. All answers displayed in the 'list' FAQ mode
211
 
212
  == Changelog ==
213
+ = 1.5.11 =
214
+ - Added an "Expand/Collapse All" optional set of controls
215
+ - Added in a "Retrieving Results" label for the search shortcode
216
+ - Added a "Link" custom field type
217
+ - Added in helper text when you're editing a category, to show the shortcode required to display only the selected category of FAQs
218
+ - Fixed a problem with sharing an FAQ on Facebook
219
+
220
  = 1.5.10 =
221
  - Fixed an error where permalinks weren't displaying
222