Ultimate FAQ - Version 1.1.7

Version Description

  • Should fix small problems with the "select-faq" shortcode and the "FAQ ID List" widget
Download this release

Release Info

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

Code changes from version 1.1.6 to 1.1.7

Files changed (3) hide show
  1. Main.php +1 -1
  2. Shortcodes/SelectFAQ.php +128 -56
  3. readme.txt +3 -0
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.1.6
11
  */
12
 
13
  global $ewd_ufaq_message;
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.1.7
11
  */
12
 
13
  global $ewd_ufaq_message;
Shortcodes/SelectFAQ.php CHANGED
@@ -2,16 +2,30 @@
2
  /* The function that creates the HTML on the front-end, based on the parameters
3
  * supplied in the product-catalog shortcode */
4
  function Display_Select_FAQs($atts) {
 
5
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
 
6
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
 
 
7
  $Reveal_Effect = get_option("EWD_UFAQ_Reveal_Effect");
 
 
 
 
 
 
 
 
 
 
8
  $Display_All_Answers = get_option("EWD_UFAQ_Display_All_Answers");
9
  $Scroll_To_Top = get_option("EWD_UFAQ_Scroll_To_Top");
10
- $Include_Permalink = get_option("EWD_UFAQ_Include_Permalink");
11
- $Socialmedia_String = get_option("EWD_UFAQ_Social_Media");
12
  $Socialmedia = explode(",", $Socialmedia_String);
13
  $Display_Author = get_option("EWD_UFAQ_Display_Author");
14
  $Display_Date = get_option("EWD_UFAQ_Display_Date");
 
15
 
16
  $ReturnString = "";
17
 
@@ -63,60 +77,118 @@ function Display_Select_FAQs($atts) {
63
  $ReturnString .= "<div class='ufaq-faq-list' id='ufaq-faq-list'>";
64
  $Counter = 0;
65
  foreach ($faqs as $faq) {
66
- if ($Pretty_Permalinks == "Yes") {$FAQ_Permalink = get_the_permalink() . "single-faq/" . $faq->post_name;}
67
- else {$FAQ_Permalink = get_the_permalink() . "?Display_FAQ=" . $faq->ID;}
68
-
69
- $ReturnString .= "<div class='ufaq-faq-div'>";
70
-
71
- $ReturnString .= "<div class='ufaq-faq-title' id='ufaq-title-" . $faq->ID . "' data-postid='" . $faq->ID . "-" . $Counter . "'>";
72
- $ReturnString .= "<h4 ><a class='ewd-ufaq-post-margin-symbol' id='ewd-ufaq-post-margin-symbol-" . $faq->ID . "' href='" . get_permalink($faq->ID) . "' data-id='" . $faq->ID . "'>+ </a>";
73
- $ReturnString .= "<a class='ewd-ufaq-post-margin' href='" . get_permalink($faq->ID) . "'>" .$faq->post_title . " </a></h4>";
74
- $ReturnString .= "</div>";
75
-
76
- if (strlen($faq->post_excerpt) > 0) {$ReturnString .= "<div class='ufaq-faq-excerpt' id='ufaq-excerpt-" . $faq->ID . "'>" . $faq->post_excerpt . "</div>";}
77
- $ReturnString .= "<div class='ufaq-faq-body ";
78
- if ($Display_All_Answers != "Yes") {$ReturnString .= "ewd-ufaq-hidden";}
79
- $ReturnString .= "' id='ufaq-body-" . $faq->ID . "-" . $Counter . "'>";
80
-
81
- if ($Display_Author == "Yes" or $Display_Date == "Yes") {
82
- $Display_Author_Value = get_post_meta($faq->ID, "EWD_UFAQ_Post_Author", true);
83
- $Display_Date_Value = get_the_date("", $faq->ID);
84
- $ReturnString .= "<div class='ewd-ufaq-author-date'>";
85
- $ReturnString .= __("Posted ", 'EWD_UFAQ');
86
- if ($Display_Author == "Yes" and $Display_Author_Value != "") {$ReturnString .= __("by ", 'EWD_UFAQ') . "<span class='ewd-ufaq-author'>" . $Display_Author_Value . "</span> ";}
87
- if ($Display_Date == "Yes") {$ReturnString .= __("on ", 'EWD_UFAQ') . "<span class='ewd-ufaq-date'>" . $Display_Date_Value . "</span> ";}
88
- $ReturnString .= "</div>";
89
- }
90
-
91
- $ReturnString .= "<div class='ufaq-faq-post' id='ufaq-post-" . $faq->ID . "'>" . $faq->post_content . "</div>";
92
-
93
- if ($Socialmedia[0] != "Blank" and $Socialmedia[0] != "") {
94
- $ReturnString .= "<div class='ufaq-social-links'>Share: ";
95
- $ReturnString .= "<ul class='rrssb-buttons'>";
96
- }
97
- if(in_array("Facebook", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Facebook", $FAQ_Permalink, $faq->post_title);}
98
- if(in_array("Google", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Google", $FAQ_Permalink, $faq->post_title);}
99
- if(in_array("Twitter", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Twitter", $FAQ_Permalink, $faq->post_title);}
100
- if(in_array("Linkedin", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Linkedin", $FAQ_Permalink, $faq->post_title);}
101
- if(in_array("Pinterest", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Pinterest", $FAQ_Permalink, $faq->post_title);}
102
- if(in_array("Email", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Email", $FAQ_Permalink, $faq->post_title);}
103
- if ($Socialmedia[0] != "Blank" and $Socialmedia[0] != "") {
104
- $ReturnString .= "</ul>";
105
- $ReturnString .= "</div>";
106
- }
107
-
108
- if ($Include_Permalink == "Yes" and $ajax == "No") {
109
- $ReturnString .= "<div class='ufaq-permalink'>Permalink: ";
110
- $ReturnString .= "<a href='" . $FAQ_Permalink . "'>";
111
- $ReturnString .= "<div class='ufaq-permalink-image'></div>";
112
- $ReturnString .= "</a>";
113
- $ReturnString .= "</div>";
114
- }
115
-
116
- $ReturnString .= "</div>";
117
- $ReturnString .= "</div>";
118
-
119
- $Counter++;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  }
121
  $ReturnString .= "</div>";
122
 
2
  /* The function that creates the HTML on the front-end, based on the parameters
3
  * supplied in the product-catalog shortcode */
4
  function Display_Select_FAQs($atts) {
5
+ $current_url = $_SERVER['REQUEST_URI'];
6
  $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
7
+ $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
8
  $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
9
+ $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
10
+ $Hide_Tags = get_option("EWD_UFAQ_Hide_Tags");
11
  $Reveal_Effect = get_option("EWD_UFAQ_Reveal_Effect");
12
+ $Group_By_Category = get_option("EWD_UFAQ_Group_By_Category");
13
+ $Group_By_Order_By = get_option("EWD_UFAQ_Group_By_Order_By");
14
+ $Group_By_Order = get_option("EWD_UFAQ_Group_By_Order");
15
+ $Order_By_Setting = get_option("EWD_UFAQ_Order_By");
16
+ $Order_Setting = get_option("EWD_UFAQ_Order");
17
+ $Include_Permalink = get_option("EWD_UFAQ_Include_Permalink");
18
+ $Permalink_Type = get_option("EWD_UFAQ_Permalink_Type");
19
+ $Display_Style = get_option("EWD_UFAQ_Display_Style");
20
+ $Color_Block_Shape = get_option("EWD_UFAQ_Color_Block_Shape");
21
+ $Pretty_Permalinks = get_option("EWD_UFAQ_Pretty_Permalinks");
22
  $Display_All_Answers = get_option("EWD_UFAQ_Display_All_Answers");
23
  $Scroll_To_Top = get_option("EWD_UFAQ_Scroll_To_Top");
24
+ $Socialmedia_String = get_option("EWD_UFAQ_Social_Media");
 
25
  $Socialmedia = explode(",", $Socialmedia_String);
26
  $Display_Author = get_option("EWD_UFAQ_Display_Author");
27
  $Display_Date = get_option("EWD_UFAQ_Display_Date");
28
+ $Display_Back_To_Top = get_option("EWD_UFAQ_Display_Back_To_Top");
29
 
30
  $ReturnString = "";
31
 
77
  $ReturnString .= "<div class='ufaq-faq-list' id='ufaq-faq-list'>";
78
  $Counter = 0;
79
  foreach ($faqs as $faq) {
80
+ $Category_Terms = wp_get_post_terms($faq->ID, 'ufaq-category');
81
+ $Tag_Terms = wp_get_post_terms($faq->ID, 'ufaq-tag');
82
+
83
+ if ($Permalink_Type == "IndividualPage") {
84
+ $FAQ_Permalink = get_permalink($faq->ID);
85
+ }
86
+ else {
87
+ if ($Pretty_Permalinks == "Yes") {$FAQ_Permalink = get_the_permalink() . "single-faq/" . $faq->post_name;}
88
+ else {$FAQ_Permalink = get_the_permalink() . "?Display_FAQ=" . $faq->ID;}
89
+ }
90
+
91
+ if ($Display_FAQ_ID == $faq->ID) {
92
+ $ReturnString = str_replace("%Counter_Placeholder%", $Counter, $ReturnString);
93
+ $Display_FAQ_ID = "";
94
+ }
95
+
96
+ $TitlesArray[] = json_encode($faq->post_title);
97
+ $HeaderString .= "<div class='ufaq-faq-header-title'><a href='' class='ufaq-faq-header-link' data-postid='" . $faq->ID . "-" . $Counter . "'>" . $faq->post_title . "</a></div>";
98
+
99
+ $ReturnString .= "<div class='ufaq-faq-div ufaq-faq-display-style-" . $Display_Style . " id='ufaq-post-" . $faq->ID . "-" . $Counter . "' data-postid='" . $faq->ID . "-" . $Counter . "'>";
100
+
101
+ $ReturnString .= "<div class='ufaq-faq-title";
102
+ if ($FAQ_Toggle != "No") {$ReturnString .= " ufaq-faq-toggle";}
103
+ $ReturnString .= "' id='ufaq-title-" . $faq->ID . "' data-postid='" . $faq->ID . "-" . $Counter . "'>";
104
+ $ReturnString .= "<a class='ewd-ufaq-post-margin' href='" . get_permalink($faq->ID) . "'><div class='ewd-ufaq-post-margin-symbol " . $Color_Block_Shape . "' id='ewd-ufaq-post-margin-symbol-" . $faq->ID . "-" . $Counter . "'><span id='ewd-ufaq-post-symbol-" . $faq->ID . "-" . $Counter;
105
+ if ($Display_All_Answers == "Yes") {$ReturnString .= "'> - </span></div>";}
106
+ else {$ReturnString .= "'> + </span></div>";}
107
+ $ReturnString .= "<div class='ufaq-faq-title-text'><h4>" .$faq->post_title . "</h4></div><div class='ewd-ufaq-clear'></div></a>";
108
+ $ReturnString .= "</div>";
109
+
110
+ if (strlen($faq->post_excerpt) > 0) {$ReturnString .= "<div class='ufaq-faq-excerpt' id='ufaq-excerpt-" . $faq->ID . "'>" . apply_filters('the_content', html_entity_decode($faq->post_excerpt)) . "</div>";}
111
+ $ReturnString .= "<div class='ufaq-faq-body ufaq-body-" . $faq->ID;
112
+ if ($Display_All_Answers != "Yes") {$ReturnString .= " ewd-ufaq-hidden";}
113
+ $ReturnString .= "' id='ufaq-body-" . $faq->ID . "-" . $Counter . "'>";
114
+
115
+ if ($Display_Author == "Yes" or $Display_Date == "Yes") {
116
+ $Display_Author_Value = get_post_meta($faq->ID, "EWD_UFAQ_Post_Author", true);
117
+ $Display_Date_Value = get_the_date("", $faq->ID);
118
+ $ReturnString .= "<div class='ewd-ufaq-author-date'>";
119
+ $ReturnString .= $Posted_Label . " " ;
120
+ if ($Display_Author == "Yes" and $Display_Author_Value != "") {$ReturnString .= $By_Label . " <span class='ewd-ufaq-author'>" . $Display_Author_Value . "</span> ";}
121
+ if ($Display_Date == "Yes") {$ReturnString .= $On_Label . " <span class='ewd-ufaq-date'>" . $Display_Date_Value . "</span> ";}
122
+ $ReturnString .= "</div>";
123
+ }
124
+
125
+ $ReturnString .= "<div class='ewd-ufaq-post-margin ufaq-faq-post' id='ufaq-post-" . $faq->ID . "'>" . apply_filters('the_content', html_entity_decode($faq->post_content)) . "</div>";
126
+
127
+ if ($Hide_Categories == "No") {
128
+ $ReturnString .= "<div class='ufaq-faq-categories' id='ufaq-categories-" . $faq->ID . "'>";
129
+ if ($Category_Label == ""){
130
+ if (sizeOf($Category_Terms) > 1) {$ReturnString .= "Categories: ";}
131
+ else {$ReturnString .= "Category: ";}}
132
+ else {$ReturnString .= $Category_Label . ": ";}
133
+ foreach ($Category_Terms as $Category_Term) {
134
+ if ($Pretty_Permalinks == "Yes") {$Category_URL = $current_url . "faq-category/" . $Category_Term->slug . "/";}
135
+ else {$Category_URL = $current_url . "?include_category=" . $Category_Term->slug;}
136
+ $ReturnString .= "<a href='" . $Category_URL ."'>" .$Category_Term->name . "</a>, ";
137
+ }
138
+ if (sizeOf($Category_Terms) > 0) {$ReturnString = substr($ReturnString, 0, strlen($ReturnString)-2);}
139
+ $ReturnString .= "</div>";
140
+ }
141
+
142
+ if ($Hide_Tags == "No") {
143
+ $ReturnString .= "<div class='ufaq-faq-tags' id='ufaq-tags-" . $faq->ID . "'>";
144
+ if ($Tag_Label == ""){
145
+ if (sizeOf($Tag_Terms) > 1) {$ReturnString .= "Tags: ";}
146
+ else {$ReturnString .= "Tag: ";}}
147
+ else {$ReturnString .= $Tag_Label . ": ";}
148
+ foreach ($Tag_Terms as $Tag_Term) {
149
+ if ($Pretty_Permalinks == "Yes") {$Tag_URL = $current_url . "faq-tag/" . $Tag_Term->slug . "/";}
150
+ else {$Tag_URL = $current_url . "?include_tag=" . $Tag_Term->slug;}
151
+ $ReturnString .= "<a href='" . $Tag_URL . "'>" .$Tag_Term->name . "</a>, ";
152
+ }
153
+ if (sizeOf($Tag_Terms) > 0) {$ReturnString = substr($ReturnString, 0, strlen($ReturnString)-2);}
154
+ $ReturnString .= "</div>";
155
+ }
156
+
157
+ if ($Socialmedia[0] != "Blank" and $Socialmedia[0] != "") {
158
+ $ReturnString .= "<div class='ufaq-social-links'>Share: ";
159
+ $ReturnString .= "<ul class='rrssb-buttons'>";
160
+ }
161
+ if(in_array("Facebook", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Facebook", $FAQ_Permalink, $faq->post_title);}
162
+ if(in_array("Google", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Google", $FAQ_Permalink, $faq->post_title);}
163
+ if(in_array("Twitter", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Twitter", $FAQ_Permalink, $faq->post_title);}
164
+ if(in_array("Linkedin", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Linkedin", $FAQ_Permalink, $faq->post_title);}
165
+ if(in_array("Pinterest", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Pinterest", $FAQ_Permalink, $faq->post_title);}
166
+ if(in_array("Email", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Email", $FAQ_Permalink, $faq->post_title);}
167
+ if ($Socialmedia[0] != "Blank" and $Socialmedia[0] != "") {
168
+ $ReturnString .= "</ul>";
169
+ $ReturnString .= "</div>";
170
+ }
171
+
172
+ if ($Include_Permalink == "Yes" and $ajax == "No") {
173
+ $ReturnString .= "<div class='ufaq-permalink'>Permalink: ";
174
+ $ReturnString .= "<a href='" . $FAQ_Permalink . "'>";
175
+ $ReturnString .= "<div class='ufaq-permalink-image'></div>";
176
+ $ReturnString .= "</a>";
177
+ $ReturnString .= "</div>";
178
+ }
179
+
180
+ if ($Display_Back_To_Top == "Yes") {
181
+ $ReturnString .= "<div class='ufaq-back-to-top'>";
182
+ $ReturnString .= "<a class='ufaq-back-to-top-link'>";
183
+ $ReturnString .= __("Back to Top", 'EWD_UFAQ');
184
+ $ReturnString .= "</a>";
185
+ $ReturnString .= "</div>";
186
+ }
187
+
188
+ $ReturnString .= "</div>";
189
+ $ReturnString .= "</div>";
190
+
191
+ $Counter++;
192
  }
193
  $ReturnString .= "</div>";
194
 
readme.txt CHANGED
@@ -126,6 +126,9 @@ For more questions and support you can post in the support forum:
126
  9. All answers displayed in the 'list' FAQ mode
127
 
128
  == Changelog ==
 
 
 
129
  = 1.1.6 =
130
  - Removed blank categories from FAQ search results
131
  - Added in a "Permalink Type" option, which lets you decide between linking to the post in the main page and the individual post page
126
  9. All answers displayed in the 'list' FAQ mode
127
 
128
  == Changelog ==
129
+ = 1.1.7 =
130
+ - Should fix small problems with the "select-faq" shortcode and the "FAQ ID List" widget
131
+
132
  = 1.1.6 =
133
  - Removed blank categories from FAQ search results
134
  - Added in a "Permalink Type" option, which lets you decide between linking to the post in the main page and the individual post page