Hi,
That’s true. MaxButtons uses a native WordPress function to check the url ( esc_url ) .
These protocols are allowed:
'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn', 'tel', 'fax', 'xmpp'
However there is a way around this by hooking a filter function, you can add this to your theme’s functions.php :
add_filter("kses_allowed_protocols", function ($p) { array_push($p,"file"); return $p; });
I can just copy and paste that line into the end of the functions.php?
Yes, that’s the idea π
I tried that. Didn’t work. It still removes the URL. Is there something I need to reload or refresh?
Nevermind, it worked. Any ideas how to get it to allow me to have spaces in my file paths?
Good question. Officially spaces are not allowed in URL’s, but I also see that the plugin doesn’t convert spaces as it should. I will create a bug report on that one.
For now you can add the URL to the shortcode, which doesn’t do this check:
[maxbutton id="1" url='http://www.example.com']
However adding to complication you have to convert the spaces to either %20 or + ( not sure if the last one works on networks ).
You can do that manually or with a tool like this
The links I had already had the %20 but I did it like you said and it worked. Thank you so much. This is great and your support is excellent!
I’m happy you managed, you gave some bugs for us to fix as well π
If you are happy, of course always welcome to leave a review here.
Great. I will. Thanks again!
Thanks for the rating dmezzina!!