Matthieu S
Forum Replies Created
-
Forum: Plugins
In reply to: [Crayon Syntax Highlighter] Fatal error when usen PHP7.3+Hi,
TL;DR
Edit crayon_langs.class.php, search for :
return preg_replace(‘/[^\w-+#]/msi’, ”, $id);
(should be around line 340)
Replace it with :
return preg_replace(‘/[^\w\-+#]/msi’, ”, $id);Explanation :
PHP 7.3 handles regular expressions more strictly than older PHP version, due to the upgrade to PCRE2 library.
In a character class expression (between [] in the regexp), – is a special char, used for writing chars ranges, so it must be escaped.
PCRE1 was more tolerant, and considered – to be the – character when used in a context where the preceding data cannot be a start of range (\w is itself a group of chars, all alphanumeric chars plus underscore, so it cannot be a start of range).Forum: Plugins
In reply to: [Multipage] Option to change filters priorityThanks ??
Thanks for the plug-in !
I have a little suggestion to improve it : when selecting content from the site on the modal dialog, it would be great if the content title was automatically copied to the title field, as in previous WordPress version.
Forum: Fixing WordPress
In reply to: Disable HTTPS in media link ?Finally found a workaround, by replacing the scheme when displaying the post for all the URL referring to the site’s host in any src or href attribute by putting this in an mu-plugin :
function forceContentURLScheme($content) {
$host = $_SERVER[“HTTP_HOST”];
$newScheme = “http”;
$oldScheme = “https”;
if (is_ssl()) {
$newScheme = “https”;
$oldScheme = “http”;
}
return preg_replace(“#(src|href)=\”$oldScheme://$host#”, “\\1=\”$newScheme://$host”, $content);
}
add_filter(“the_content”, “forceContentURLScheme”);Not the cleanest solution, but it seems to work…
Forum: Plugins
In reply to: [Expand + Collapse Funk] Adding multiple collapsible content blocksHi Agnes,
I’ve updated the sample page on my blog to include the source code for the nested links : https://matthieu.sarter.fr/nested-sample/
Evan has integrated the required JavaScript change to the plug-in (version 2.2), so you don’t need to modify it.
Matthieu
Forum: Plugins
In reply to: [Expand + Collapse Funk] Line break after arrow iconIt’s also with the 2014 theme.
I sent you a message through your webpage contact form a few days ago with a proper fix for this (new CSS class name for the content link + onload JS to rename the class on the existing posts) and my patch for supporting nested elements. Did you receive it ?
Forum: Plugins
In reply to: [Expand + Collapse Funk] Adding multiple collapsible content blocksThat’s fine with me. I will send you an e-mail with the first set of changes.
Forum: Plugins
In reply to: [Expand + Collapse Funk] Adding multiple collapsible content blocksYou’re welcome.
FYI, I’m also working on some other improvements (shortcode, enhanced compatibility with disabled JavaScript…).
If you are interested, I can also share them when completed.Forum: Plugins
In reply to: [Expand + Collapse Funk] Adding multiple collapsible content blocksHi,
I managed to make nested expandable items.
The required HTML code can be seen here : https://matthieu.sarter.fr/nested-sampleIt required a little change in the JavaScript code from expand-collapse-funk.php :
jQuery(this).toggleClass(“ecf_opened”).parent(“.exp-col-content-holder”).find(“.hidden-content”).first().stop().slideToggle(“slow”).css(“display”,”block”);
instead of
jQuery(this).toggleClass(“ecf_opened”).parent(“.exp-col-content-holder”).find(“.hidden-content”).stop().slideToggle(“slow”).css(“display”,”block”);Without this change, when clicking on “Parent”, everything is expanded, instead of just expanding the first level.