Skip to content

Commit 53cd8c3

Browse files
committed
EFAQ 6.1.5
= 6.1.5 = * Abbreviation functions support added as `es(..)`, `at(..)`, `abh(..)`, `eh()`, `ej()`, `et()` for use mostly in templates, but they can also be used in models, if you use observer models that may be generating and returning to controller whole HTML blocks. Also these functions may be valuable for developers, that wants to have their HTML templates (or PHP-enhanced templates) be fully based only on SolidMVC (MIT-licensed), and not WordPress (GPL-licensed), as in this case your templates would be intensively calling only the MIT-licensed SolidMVC micro-framework’s functions. Additionally, this allows you to write a shorter code for your templates, which is easier to read for your designers. * escBrHTML(..) support added for language interface. * Minor documentation and code tune-up.
1 parent 954f547 commit 53cd8c3

File tree

11 files changed

+133
-11
lines changed

11 files changed

+133
-11
lines changed

ExpandableFAQ.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Expandable FAQ
44
* Plugin URI: https://wordpress.org/plugins/expandable-faq/
55
* Description: It’s a high quality, native and responsive WordPress plugin to create and view F.A.Q.'s
6-
* Version: 6.1.4
6+
* Version: 6.1.5
77
* Author: KestutisIT
88
* Author URI: https://profiles.wordpress.org/KestutisIT
99
* Text Domain: expandable-faq
@@ -43,7 +43,7 @@ final class ExpandableFAQ
4343
const REQUIRED_PHP_VERSION = '5.6.0';
4444
const REQUIRED_WP_VERSION = 4.6;
4545
const OLDEST_COMPATIBLE_PLUGIN_SEMVER = '6.0.0';
46-
const PLUGIN_SEMVER = '6.1.4';
46+
const PLUGIN_SEMVER = '6.1.5';
4747

4848
// Settings
4949
/**

Models/Import/Demo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function replaceContent()
144144
// DEBUG
145145
if($this->debugMode > 0)
146146
{
147-
$debugMessage = "[DEMO] FAILED TO REPLACE IN PLUGIN TABLE: ".nl2br(esc_html($sqlQuery));
147+
$debugMessage = "[DEMO] FAILED TO REPLACE IN PLUGIN TABLE: ".esc_br_html($sqlQuery);
148148
$this->debugMessages[] = $debugMessage;
149149
//echo $debugMessage; // This class is used with redirect, do not output here
150150
}

Models/Language/Language.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ public function escAttr($paramKey)
190190
return esc_attr($this->getText($paramKey));
191191
}
192192

193+
/**
194+
* NOTE: Just an abbreviation method
195+
* @param $paramKey
196+
* @return string
197+
*/
198+
public function escBrHTML($paramKey)
199+
{
200+
return esc_br_html($this->getText($paramKey));
201+
}
202+
193203
/**
194204
* NOTE: Just an abbreviation method
195205
* @param $paramKey

Models/Language/LanguageInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public function escSQL($paramKey);
4848
*/
4949
public function escAttr($paramKey);
5050

51+
/**
52+
* NOTE: Just an abbreviation method
53+
* @param $paramKey
54+
* @return string
55+
*/
56+
public function escBrHTML($paramKey);
57+
5158
/**
5259
* NOTE: Just an abbreviation method
5360
* @param $paramKey

Models/Update/Patches61Z.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class Patches61Z extends AbstractDatabase implements StackInterface, Datab
1717
{
1818
const CURRENT_MAJOR = 6; // Positive integer [X]
1919
const CURRENT_MINOR = 1; // Positive integer [Y]
20-
const LATEST_PATCH = 4; // Positive integer [Z]
20+
const LATEST_PATCH = 5; // Positive integer [Z]
2121
const LATEST_RELEASE = ''; // String
2222
const LATEST_BUILD_METADATA = ''; // String
2323
const PLUGIN_PREFIX = "expandable_faq_";

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ to your website's FAQ page and make automatically expand specific FAQ with a pag
108108

109109
# Changelog
110110

111+
= 6.1.5 =
112+
* Abbreviation functions support added as `es(..)`, `at(..)`, `abh(..)`, `eh()`, `ej()`, `et()` for use mostly in templates, but they can also be used in models, if you use observer models that may be generating and returning to controller whole HTML blocks. Also these functions may be valuable for developers, that wants to have their HTML templates (or PHP-enhanced templates) be fully based only on SolidMVC (MIT-licensed), and not WordPress (GPL-licensed), as in this case your templates would be intensively calling only the MIT-licensed SolidMVC micro-framework’s functions. Additionally, this allows you to write a shorter code for your templates, which is easier to read for your designers.
113+
* escBrHTML(..) support added for language interface.
114+
* Minor documentation and code tune-up.
115+
111116
= 6.1.4 =
112117
* Small tune-up, gallery support added to configuration.
113118
* [SITE_URL] BBCode support added for install/import.

UI/Templates/Admin/Manual/Shared/InstructionsPartial.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</h1>
77
<p><strong>Step 1</strong> - You already have the plugin installed in your system.</p>
88
<ul>
9-
<li><em>(Optional) Step 1.1</em> - If your theme <span class="failed"><strong>does not</strong></span> support FontAwesome icons,
10-
please <span class="success"><strong>enable</strong></span> FontAwesome in Expandable FAQ -&gt; Settings -&gt; &quot;Global&quot; tab.</li>
9+
<li><em>(Optional) Step 1.1</em> - If your theme <span class="success"><strong>already supports</strong></span> support FontAwesome icons,
10+
please <span class="failed"><strong>disable</strong></span> FontAwesome in Expandable FAQ -&gt; Settings -&gt; &quot;Global&quot; tab.</li>
1111
</ul>
1212
<p><strong>Step 2</strong> - Now create a page by clicking the [Add New] button under the page menu.</p>
1313
<p><strong>Step 3</strong> - Add <strong>[expandable_faq display=&quot;faqs&quot; layout=&quot;list&quot;]</strong> shortcode to page content and click on [Publish] button.</p>

UI/Templates/Admin/Manual/Shared/ShortcodeParametersPartial.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@
5454
</p>
5555
<ul>
5656
<li>
57-
expanded_faq=&quot;1&quot; (default is no expanded F.A.Q.&#39;s - &#39;-1&#39;)
57+
expanded_faq=&quot;4&quot; (default is no expanded F.A.Q.&#39;s - &#39;-1&#39;)
5858
</li>
5959
</ul>
6060

6161

6262
<h3>Example:</h3>
6363
<pre>
6464
[expandable_faq display=&quot;faqs&quot; layout=&quot;list&quot;]
65+
[expandable_faq display=&quot;faqs&quot; expanded_faq=&quot;4&quot; layout=&quot;list&quot; style=&quot;2&quot;]
6566
</pre>

UI/Templates/Admin/Manual/Shared/URL_ParametersHashtagsPartial.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
</ol>
3535

3636
<h3>Example:</h3>
37-
<p>To expand a F.A.Q. with ID=1 and focus screen to it, go to &#39;https://your-site.com/faqs/?expanded_faq=1#faq-1&#39; URL.</p>
37+
<p>To expand a F.A.Q. with ID=4 and focus screen to it, go to &#39;https://your-site.com/faqs/?expanded_faq=4#faq-4&#39; URL.</p>

formatting.php

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
11
<?php
22
/**
3-
* Patches to Main WordPress Formatting API.
3+
* S.O.L.I.D. MVC additional functions and abbreviations for Main WordPress Formatting API.
44
*
55
* This is the file of functions, that is missing in wp-includes\formatting.php
66
*
77
* @see \wp-includes\formatting.php
88
* @package WordPress
99
*/
1010

11+
if(!function_exists('es'))
12+
{
13+
/**
14+
* Short name for esc_sql
15+
* @see esc_sql()
16+
*
17+
* @param string $text
18+
* @return string
19+
*/
20+
function es($text)
21+
{
22+
return esc_sql($text);
23+
}
24+
}
25+
if(!function_exists('ea'))
26+
{
27+
/**
28+
* Short name for esc_attr
29+
* @see esc_attr()
30+
*
31+
* @param string $text
32+
* @return string
33+
*/
34+
function ea($text)
35+
{
36+
return esc_attr($text);
37+
}
38+
}
39+
1140
if(!function_exists('esc_br_html'))
1241
{
1342
/**
@@ -25,4 +54,69 @@ function esc_br_html($text)
2554

2655
return $escaped_multiline_text;
2756
}
57+
}
58+
59+
if(!function_exists('ebh'))
60+
{
61+
/**
62+
* Short name for esc_br_html
63+
* @see esc_br_html()
64+
*
65+
* Related ticked - https://core.trac.wordpress.org/ticket/46188
66+
*
67+
* @param string $text
68+
* @return string
69+
*/
70+
function ebh($text)
71+
{
72+
$escaped_text_array = array_map('esc_html', explode("\n", $text));
73+
$escaped_multiline_text = implode("<br />", $escaped_text_array);
74+
75+
return $escaped_multiline_text;
76+
}
77+
}
78+
79+
if(!function_exists('eh'))
80+
{
81+
/**
82+
* Short name for esc_html
83+
* @see esc_html()
84+
*
85+
* @param string $text
86+
* @return string
87+
*/
88+
function eh($text)
89+
{
90+
return esc_html($text);
91+
}
92+
}
93+
94+
if(!function_exists('ej'))
95+
{
96+
/**
97+
* Short name for esc_js
98+
* @see esc_js()
99+
*
100+
* @param string $text
101+
* @return string
102+
*/
103+
function ej($text)
104+
{
105+
return esc_js($text);
106+
}
107+
}
108+
109+
if(!function_exists('et'))
110+
{
111+
/**
112+
* Short name for esc_textarea
113+
* @see esc_textarea()
114+
*
115+
* @param string $text
116+
* @return string
117+
*/
118+
function et($text)
119+
{
120+
return esc_textarea($text);
121+
}
28122
}

0 commit comments

Comments
 (0)