Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • in reply to: Custom Parameters Get truncated on replacement [part 2]
    Dennis Bareis
    Participant

    I didn’t create this site and have never used WP before, no doco provided either… I only just realised that this wasn’t a standard WordPress gallery but once enhanced by Jetpack.

    I have raised an issue in their forum.

    in reply to: Custom Parameters Get truncated on replacement [part 2]
    Dennis Bareis
    Participant

    Hi,

    It would appear that it must be a theme (I’m using OceanWp, child) or plugin issue, I haven’t created a new site yet but I will try that as well.

    What I have tried is “Shortcodes Blocks Creator Ultimate” but it only partially works in 6.1.1 and fails a similar same way. It is also unsupported although I have seen you answer questions there, but nothing has been answered for ages and emails aren’t responded to.

    I am now trying standard shortcodes and they also fail.

    The rest is FYI (as I just worked out the answer to my intended question):

    If I dump one of the parameters (to view on html page) the value is: “Desc” (the first quote is a normal one and the trailing one is “x201D” – NO QUOTES WERE PASSED BY ME).

    If I use “bin2hex()” to dump the value it shows it as being 16 characters long (2671756f743b446573632671756f743b), and using a hex editor I just worked out the value is “"Desc"“. I will see if I can just strip the garbage off if I see it.

    in reply to: Custom Parameters Get truncated on replacement
    Dennis Bareis
    Participant

    As a sanity check I tried the following without shortcodes:

    sorry WP hangs with the sample

    That worked, but both the single and double quotes were modified as I’ve mentioned before. Do WP (or your) shortcodes handle other quote characters such as “`” (backtick), I’m not sure who parses the parameters etc, but I suspect that that would work as they don’t get modified by WP.

    Failing that, is there any hooks I should try to work around this?

    in reply to: Custom Parameters Get truncated on replacement
    Dennis Bareis
    Participant

    I don’t quite understand what it is trying to say yet, but it sounds like this may be what is happening on DESCRIPTION but not TITLE: WordPress attempts to insert curly quotes between the [name] and [/name] tags

    Dennis Bareis
    Participant

    Excellent, thanks, it is a bit harder if 2 or more shortcodes are involved… I also found one when examining the html with chrome debugger, it’s painful to work out which one it applies to.

    in reply to: Custom Parameters Get truncated on replacement
    Dennis Bareis
    Participant

    I will try again later but for now using single quotes works for a gallery image’s TITLE attribute but not for an image’s DESCRIPTION. I will try a WP shortcode and see if I can reproduce this issue and then report as a bug/feature.

    Dennis Bareis
    Participant

    Don’t worry about the 2nd part (my question), it does work, just made an ‘oops’ 🙂

    in reply to: Custom Parameters Get truncated on replacement
    Dennis Bareis
    Participant

    Thanks for that. I actually tried leaving double quotes where you changed then and changed all the quotes in the html as I know that is supported. That appaers to have worked also.

    I haven’t seen any mention in your doco that single quotes were supported.

    I will play with this some more but for now I have asked a new question about invoking one shortcut from another which I already know works, where it doesn’t seem to work is if the name of the 2nd shortcut uses passed parameters!

    in reply to: Custom Parameters Get truncated on replacement
    Dennis Bareis
    Participant

    Hi Aakash,

    So you tried the code earlier, have you now tried it in a images description and it also worked?

    You have my full example (“IMAGE SOURCE: %%text%%“) if there is a syntax error in that text then please let me know what it is… It doesn’t even contain HTML or have any characters that need escaping and it fails.

    Both your info/FAQ and WordPress’s says “where supported” many times, but I haven’t seen any place that documents where those supported places are… I’m guessing, since it sort of works (rather than show the shortcode text as I enter it) that it is supported for image descriptions but perhaps needs to be processed differently.

    About the parameters, it’s a pity that I have to hard code the default value in multiple places then, it sort of forces me to do the opposite of what Shortcoder’s aim is (everything in a single place).

    in reply to: Custom Parameters Get truncated on replacement
    Dennis Bareis
    Participant

    Hi,

    I can copy paste the exact same shortcode into the page and it will work, it will not work when pasted into an images’s description field (and as mentioned Advanced, Title when referred to in a gallery).

    This is the output as shown by chrome’s debugger:

    <p><i>[AUTHOR’S LICENCE/RESUSE DETAILS]</i>
    <br>
    Licenced by 
    <a rel="noreferrer noopener" href="”https://commons.wikimedia.org/wiki/File:Starr_050815-3471_Wahlenbergia_gracilis.jpg" ”="" target="_blank" title="”Click" to="" see="" the="" original="" source="" image="" (in="" a="" new="" tab):="" ”https:="" commons.wikimedia.org="" wiki="" file:starr_050815-3471_wahlenbergia_gracilis.jpg””="">”Forest</a> 
    with the creative commons licence
    	<a rel="noreferrer noopener" href="https://creativecommons.org/licenses/by/3.0" target="_blank" title="”Click" to="" see="" complete="" licence="" details="" (in="" a="" new="" tab):="" https:="" creativecommons.org="" licenses="" by="" 3.0”="">CC BY 3.0</a></p>

    The first part is corrupted, the 2nd part (url etc) works. Apart from some truncation, notice the unicode “”” quote characters that were inserted.

    I do have another unrelated question, if you provide a default to a parameter at the definition, what happens on subsequent references that don’t provide a default (do they inherit the previously defined default value?).

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

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms