Version Description
- Added a unique identifier to each FAQ so that if it is repeated on the same page, the correct post should open
Download this release
Release Info
Developer | Rustaurius |
Plugin | Ultimate FAQ |
Version | 1.0.8 |
Comparing to | |
See all releases |
Code changes from version 1.0.7 to 1.0.8
- Main.php +1 -1
- Shortcodes/DisplayFAQs.php +17 -14
- Shortcodes/SelectFAQ.php +5 -2
- 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.0.
|
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.0.8
|
11 |
*/
|
12 |
|
13 |
global $ewd_ufaq_message;
|
Shortcodes/DisplayFAQs.php
CHANGED
@@ -106,6 +106,18 @@ function Display_FAQs($atts) {
|
|
106 |
}
|
107 |
if (isset($_GET['Display_FAQ'])) {$ReturnString .= "<script>var Display_FAQ_ID = " . $_GET['Display_FAQ'] . ";</script>";}
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
foreach ($Category_Array as $Category) {
|
110 |
|
111 |
if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {$category_array = array( 'taxonomy' => 'ufaq-category',
|
@@ -129,24 +141,13 @@ function Display_FAQs($atts) {
|
|
129 |
if ($orig_order_setting == "set_order") {$params['meta_key'] = 'ufaq_order';}
|
130 |
$faqs = get_posts($params);
|
131 |
|
132 |
-
if ($Custom_CSS != "") {$ReturnString .= "<style>" . $Custom_CSS . "</style>";}
|
133 |
-
$ReturnString .= EWD_UFAQ_Add_Modified_Styles();
|
134 |
-
|
135 |
-
$ReturnString .= "<script language='JavaScript' type='text/javascript'>";
|
136 |
-
if ($FAQ_Accordion == "Yes") {$ReturnString .= "var faq_accordion = true;";}
|
137 |
-
else {$ReturnString .= "var faq_accordion = false;";}
|
138 |
-
if ($Scroll_To_Top == "Yes") {$ReturnString .= "var faq_scroll = true;";}
|
139 |
-
else {$ReturnString .= "var faq_scroll = false;";}
|
140 |
-
$ReturnString .= "var reveal_effect = '" . $Reveal_Effect . "';";
|
141 |
-
$ReturnString .= "</script>";
|
142 |
-
|
143 |
if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and sizeOf($faqs) > 0) {
|
144 |
$ReturnString .= "<div class='ufaq-faq-category'>";
|
145 |
$ReturnString .= "<div class='ufaq-faq-category-title'>";
|
146 |
$ReturnString .= "<h4>" . $Category->name . "</h4>";
|
147 |
$ReturnString .= "</div>";
|
148 |
}
|
149 |
-
|
150 |
foreach ($faqs as $faq) {
|
151 |
if ($search_string == "" or strpos(strtolower($faq->post_content), $search_string) !== false or strpos(strtolower($faq->post_title), $search_string) !== false) {
|
152 |
$Category_Terms = wp_get_post_terms($faq->ID, 'ufaq-category');
|
@@ -158,7 +159,7 @@ function Display_FAQs($atts) {
|
|
158 |
$ReturnString .= "<div class='ufaq-faq-div'>";
|
159 |
|
160 |
|
161 |
-
$ReturnString .= "<div class='ufaq-faq-title' id='ufaq-title-" . $faq->ID . "' data-postid='" . $faq->ID . "'>";
|
162 |
$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>";
|
163 |
$ReturnString .= "<a class='ewd-ufaq-post-margin' href='" . get_permalink($faq->ID) . "'>" .$faq->post_title . " </a></h4>";
|
164 |
$ReturnString .= "</div>";
|
@@ -166,7 +167,7 @@ function Display_FAQs($atts) {
|
|
166 |
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>";}
|
167 |
$ReturnString .= "<div class='ufaq-faq-body ";
|
168 |
if ($Display_All_Answers != "Yes") {$ReturnString .= "ewd-ufaq-hidden";}
|
169 |
-
$ReturnString .= "' id='ufaq-body-" . $faq->ID . "'>";
|
170 |
|
171 |
if ($Display_Author == "Yes" or $Display_Date == "Yes") {
|
172 |
$Display_Author_Value = get_post_meta($faq->ID, "EWD_UFAQ_Post_Author", true);
|
@@ -236,6 +237,8 @@ function Display_FAQs($atts) {
|
|
236 |
$ReturnString .= "</div>";
|
237 |
$ReturnString .= "</div>";
|
238 |
}
|
|
|
|
|
239 |
}
|
240 |
|
241 |
if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and sizeOf($faqs) > 0) {
|
106 |
}
|
107 |
if (isset($_GET['Display_FAQ'])) {$ReturnString .= "<script>var Display_FAQ_ID = " . $_GET['Display_FAQ'] . ";</script>";}
|
108 |
|
109 |
+
if ($Custom_CSS != "") {$ReturnString .= "<style>" . $Custom_CSS . "</style>";}
|
110 |
+
$ReturnString .= EWD_UFAQ_Add_Modified_Styles();
|
111 |
+
|
112 |
+
$ReturnString .= "<script language='JavaScript' type='text/javascript'>";
|
113 |
+
if ($FAQ_Accordion == "Yes") {$ReturnString .= "var faq_accordion = true;";}
|
114 |
+
else {$ReturnString .= "var faq_accordion = false;";}
|
115 |
+
if ($Scroll_To_Top == "Yes") {$ReturnString .= "var faq_scroll = true;";}
|
116 |
+
else {$ReturnString .= "var faq_scroll = false;";}
|
117 |
+
$ReturnString .= "var reveal_effect = '" . $Reveal_Effect . "';";
|
118 |
+
$ReturnString .= "</script>";
|
119 |
+
|
120 |
+
$Counter = 0;
|
121 |
foreach ($Category_Array as $Category) {
|
122 |
|
123 |
if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {$category_array = array( 'taxonomy' => 'ufaq-category',
|
141 |
if ($orig_order_setting == "set_order") {$params['meta_key'] = 'ufaq_order';}
|
142 |
$faqs = get_posts($params);
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and sizeOf($faqs) > 0) {
|
145 |
$ReturnString .= "<div class='ufaq-faq-category'>";
|
146 |
$ReturnString .= "<div class='ufaq-faq-category-title'>";
|
147 |
$ReturnString .= "<h4>" . $Category->name . "</h4>";
|
148 |
$ReturnString .= "</div>";
|
149 |
}
|
150 |
+
|
151 |
foreach ($faqs as $faq) {
|
152 |
if ($search_string == "" or strpos(strtolower($faq->post_content), $search_string) !== false or strpos(strtolower($faq->post_title), $search_string) !== false) {
|
153 |
$Category_Terms = wp_get_post_terms($faq->ID, 'ufaq-category');
|
159 |
$ReturnString .= "<div class='ufaq-faq-div'>";
|
160 |
|
161 |
|
162 |
+
$ReturnString .= "<div class='ufaq-faq-title' id='ufaq-title-" . $faq->ID . "' data-postid='" . $faq->ID . "-" . $Counter . "''>";
|
163 |
$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>";
|
164 |
$ReturnString .= "<a class='ewd-ufaq-post-margin' href='" . get_permalink($faq->ID) . "'>" .$faq->post_title . " </a></h4>";
|
165 |
$ReturnString .= "</div>";
|
167 |
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>";}
|
168 |
$ReturnString .= "<div class='ufaq-faq-body ";
|
169 |
if ($Display_All_Answers != "Yes") {$ReturnString .= "ewd-ufaq-hidden";}
|
170 |
+
$ReturnString .= "' id='ufaq-body-" . $faq->ID . "-" . $Counter . "'>";
|
171 |
|
172 |
if ($Display_Author == "Yes" or $Display_Date == "Yes") {
|
173 |
$Display_Author_Value = get_post_meta($faq->ID, "EWD_UFAQ_Post_Author", true);
|
237 |
$ReturnString .= "</div>";
|
238 |
$ReturnString .= "</div>";
|
239 |
}
|
240 |
+
|
241 |
+
$Counter++;
|
242 |
}
|
243 |
|
244 |
if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and sizeOf($faqs) > 0) {
|
Shortcodes/SelectFAQ.php
CHANGED
@@ -61,13 +61,14 @@ function Display_Select_FAQs($atts) {
|
|
61 |
$ReturnString .= "</script>";
|
62 |
|
63 |
$ReturnString .= "<div class='ufaq-faq-list' id='ufaq-faq-list'>";
|
|
|
64 |
foreach ($faqs as $faq) {
|
65 |
if ($Pretty_Permalinks == "Yes") {$FAQ_Permalink = get_the_permalink() . "single-faq/" . $faq->post_name;}
|
66 |
else {$FAQ_Permalink = get_the_permalink() . "?Display_FAQ=" . $faq->ID;}
|
67 |
|
68 |
$ReturnString .= "<div class='ufaq-faq-div'>";
|
69 |
|
70 |
-
$ReturnString .= "<div class='ufaq-faq-title' id='ufaq-title-" . $faq->ID . "' data-postid='" . $faq->ID . "'>";
|
71 |
$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>";
|
72 |
$ReturnString .= "<a class='ewd-ufaq-post-margin' href='" . get_permalink($faq->ID) . "'>" .$faq->post_title . " </a></h4>";
|
73 |
$ReturnString .= "</div>";
|
@@ -75,7 +76,7 @@ function Display_Select_FAQs($atts) {
|
|
75 |
if (strlen($faq->post_excerpt) > 0) {$ReturnString .= "<div class='ufaq-faq-excerpt' id='ufaq-excerpt-" . $faq->ID . "'>" . $faq->post_excerpt . "</div>";}
|
76 |
$ReturnString .= "<div class='ufaq-faq-body ";
|
77 |
if ($Display_All_Answers != "Yes") {$ReturnString .= "ewd-ufaq-hidden";}
|
78 |
-
$ReturnString .= "' id='ufaq-body-" . $faq->ID . "'>";
|
79 |
|
80 |
if ($Display_Author == "Yes" or $Display_Date == "Yes") {
|
81 |
$Display_Author_Value = get_post_meta($faq->ID, "EWD_UFAQ_Post_Author", true);
|
@@ -114,6 +115,8 @@ function Display_Select_FAQs($atts) {
|
|
114 |
|
115 |
$ReturnString .= "</div>";
|
116 |
$ReturnString .= "</div>";
|
|
|
|
|
117 |
}
|
118 |
$ReturnString .= "</div>";
|
119 |
|
61 |
$ReturnString .= "</script>";
|
62 |
|
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>";
|
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);
|
115 |
|
116 |
$ReturnString .= "</div>";
|
117 |
$ReturnString .= "</div>";
|
118 |
+
|
119 |
+
$Counter++;
|
120 |
}
|
121 |
$ReturnString .= "</div>";
|
122 |
|
readme.txt
CHANGED
@@ -113,6 +113,9 @@ For more questions and support you can post in the support forum:
|
|
113 |
8. All answers displayed in the 'list' FAQ mode
|
114 |
|
115 |
== Changelog ==
|
|
|
|
|
|
|
116 |
= 1.0.7 =
|
117 |
- Minor CSS update
|
118 |
|
113 |
8. All answers displayed in the 'list' FAQ mode
|
114 |
|
115 |
== Changelog ==
|
116 |
+
= 1.0.8 =
|
117 |
+
- Added a unique identifier to each FAQ so that if it is repeated on the same page, the correct post should open
|
118 |
+
|
119 |
= 1.0.7 =
|
120 |
- Minor CSS update
|
121 |
|