• Resolved dmezzina

    (@dmezzina)


    I want to use the buttons to link to files or folder locations on my network but when I do, it erases the URL and causes the button to link back to the page it’s on. Is there a way to link to a folder location on the network using something like “file://[server name]/location”?

    https://wordpress.org/plugins/maxbuttons/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Bas Schuiling

    (@basszje)

    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; });

    Thread Starter dmezzina

    (@dmezzina)

    I can just copy and paste that line into the end of the functions.php?

    Plugin Author Bas Schuiling

    (@basszje)

    Yes, that’s the idea πŸ™‚

    Thread Starter dmezzina

    (@dmezzina)

    I tried that. Didn’t work. It still removes the URL. Is there something I need to reload or refresh?

    Thread Starter dmezzina

    (@dmezzina)

    Nevermind, it worked. Any ideas how to get it to allow me to have spaces in my file paths?

    Plugin Author Bas Schuiling

    (@basszje)

    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

    Thread Starter dmezzina

    (@dmezzina)

    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!

    Plugin Author Bas Schuiling

    (@basszje)

    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.

    Thread Starter dmezzina

    (@dmezzina)

    Great. I will. Thanks again!

    Plugin Author maxfoundry

    (@maxfoundry)

    Thanks for the rating dmezzina!!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Buttons don't link to files’ is closed to new replies.