diff --git a/lib/Core/Compat.php b/lib/Core/Compat.php index 225aa6f..ad3de98 100644 --- a/lib/Core/Compat.php +++ b/lib/Core/Compat.php @@ -4,6 +4,9 @@ get_stl_config, get_script }; + +use function SGI\STL\Frontend\Utils\script_selector; + use const SGI\STL\DOMAIN; /** @@ -119,4 +122,11 @@ function stl_get_script_identifier() return get_stl_config()['core']['param']; +} + +function stl_show_selector($p_selection_type = 'oneline', $p_oneline_separator = ' | ', $p_cirilica_title = 'ћирилица', $p_latinica_title = 'латиница', $p_inactive_script_only = false, $p_show_only_on_wpml_languages = '') +{ + + script_selector($p_selection_type, $p_oneline_separator, $p_cirilica_title, $p_latinica_title, $p_inactive_script_only, $p_show_only_on_wpml_languages); + } \ No newline at end of file diff --git a/lib/Shortcode/Cyrilizer.php b/lib/Shortcode/Cyrilizer.php index 35de9d7..917e818 100644 --- a/lib/Shortcode/Cyrilizer.php +++ b/lib/Shortcode/Cyrilizer.php @@ -24,7 +24,7 @@ public function __construct() } - public function shortcode_callback($atts, ?string $content) + public function shortcode_callback($atts, $content) { $script = get_script(); diff --git a/lib/Shortcode/Info.php b/lib/Shortcode/Info.php index c9f17f4..65c1fce 100644 --- a/lib/Shortcode/Info.php +++ b/lib/Shortcode/Info.php @@ -34,7 +34,7 @@ public function __construct() } - public function multicode_callback($atts, ?string $content, ?string $shortcode) + public function multicode_callback($atts, $content, $shortcode) { switch ($shortcode) : @@ -67,7 +67,7 @@ public function multicode_callback($atts, ?string $content, ?string $shortcode) } - public function shortcode_callback($atts, ?string $content) + public function shortcode_callback($atts, $content) { shortcode_atts([ diff --git a/lib/Shortcode/Legacy.php b/lib/Shortcode/Legacy.php index 05893fb..5320558 100644 --- a/lib/Shortcode/Legacy.php +++ b/lib/Shortcode/Legacy.php @@ -9,7 +9,7 @@ trait Legacy private $name; - public function legacy_callback($atts, ?string $content) + public function legacy_callback($atts, string $content) { trigger_error( diff --git a/lib/Shortcode/Multicode.php b/lib/Shortcode/Multicode.php index 8840dd0..584d8ce 100644 --- a/lib/Shortcode/Multicode.php +++ b/lib/Shortcode/Multicode.php @@ -5,5 +5,5 @@ interface Multicode { - public function multicode_callback($atts, ?string $content, ?string $shortcode); + public function multicode_callback($atts, $content, $shortcode); } \ No newline at end of file diff --git a/lib/Shortcode/Selective_Output.php b/lib/Shortcode/Selective_Output.php index a205719..6354055 100644 --- a/lib/Shortcode/Selective_Output.php +++ b/lib/Shortcode/Selective_Output.php @@ -16,7 +16,7 @@ public function __construct() } - public function multicode_callback($atts, ?string $content, ?string $shortcode) + public function multicode_callback($atts, $content, $shortcode) { $atts = ($shortcode == 'stl_cyrillic') ? ['script' => 'cir'] : ['script' => 'lat']; @@ -25,7 +25,7 @@ public function multicode_callback($atts, ?string $content, ?string $shortcode) } - public function shortcode_callback($atts, ?string $content) + public function shortcode_callback($atts, $content) { shortcode_atts([ diff --git a/lib/Shortcode/Shortcode.php b/lib/Shortcode/Shortcode.php index e1961e2..e873e0f 100644 --- a/lib/Shortcode/Shortcode.php +++ b/lib/Shortcode/Shortcode.php @@ -5,5 +5,6 @@ interface Shortcode { - public function shortcode_callback($atts, ?string $content); + public function shortcode_callback($atts, $content); + } \ No newline at end of file diff --git a/lib/Shortcode/Translator.php b/lib/Shortcode/Translator.php index bee575a..a30bcba 100644 --- a/lib/Shortcode/Translator.php +++ b/lib/Shortcode/Translator.php @@ -20,7 +20,7 @@ public function __construct() } - public function shortcode_callback($atts, ?string $content) + public function shortcode_callback($atts, $content) { shortcode_atts([ diff --git a/lib/Update/Handler.php b/lib/Update/Handler.php index ef5bc2e..a487d9e 100644 --- a/lib/Update/Handler.php +++ b/lib/Update/Handler.php @@ -117,7 +117,7 @@ private function migrate_legacy_stl() { $this->stl['core']['script'] = $this->stl_old['stl_default_language']; - $this->stl['core']['cookie'] = $this->stl_old['stl_use_cookie']; + $this->stl['core']['cookie'] = true; $this->stl['core']['param'] = $this->stl_old['stl_lang_identificator']; $this->stl['file']['names'] = ($this->stl_old['stl_sanitize_file_names']) ? true : false; $this->stl['file']['delim'] = $this->stl_old['file_lang_delimiter']; diff --git a/readme.txt b/readme.txt index 41ffde3..ebdeb31 100644 --- a/readme.txt +++ b/readme.txt @@ -104,6 +104,13 @@ Feel free to contact me via e-mail, and I'll see if I can assist you for your sp == Changelog == += 2.0.2 = + +Bug Fixes: +* Fixed PHP Fatal Error on certain hosting configurations +* Fixed PHP notices on certaing PHP configurations +* Fixed legacy script selector function + = 2.0.1 = Release date: March 22nd, 2020