• Resolved bjp232004

    (@bjp232004)


    Hi,

    Thank you for a very useful plugin!

    I have used this plugin for more than 30 sites. For all sites, I am facing one issue while using shortcodes. When I am using a shortcode to store some social networking URL and while using those shortcodes in anchor tag facing issue because of comments which you have added while returning a result.

    So, just wanted to check with you that, can you remove that comments from return result line.

    Current Output: return ‘<!– Start shortcoder –>’ . do_shortcode( $sc_content_final ) . ‘<!– End shortcoder v’ . SC_VERSION . ‘–>’;

    Expected Output: return do_shortcode( $sc_content_final );

    Thanks in advance!

    • This topic was modified 6 years, 8 months ago by bjp232004.
Viewing 8 replies - 1 through 8 (of 8 total)
  • David Derby

    (@itsonlycomputers)

    +1

    Plugin Author vaakash

    (@vaakash)

    Sorry for the late reply.

    Those comments are added for debugging purpose as they are useful when any user reports an issue.

    This being an HTML comment does not affect anything.
    As of now you can edit code and remove them.

    I can add option in future release to make it optional.

    +1

    Those automatic comments cause problems when you want to enter raw text into a property of an html tag like an anchor tag. For example:

    <a href="<!-- Shortcoder-Start...-->https://www.google.com<!-- Shortcoder-End -->" target="_blank">

    That link above is totally malformed! There should be a way to turn off these HTML comments globally with a check button on the settings page, in all future versions of Shortcoder.

    For now though, I had to do some plugin surgery to remove those annoying comment tags!!
    This should NOT be necessary! ??

    Sorry for the exclamation points, but this is especially irritating.

    Plugin Author vaakash

    (@vaakash)

    @jamesandersonjr,

    I guess you can make use of “custom parameters” to solve your use case here.

    In your shortcode content, you can use

    <a href="%%url%%"></a>

    and use the shortcode as

    [sc name="mylink" url="https://www.google.com"]

    I’ll also consider removing the tags as many people consider it.
    Thanks,
    Aakash

    I think you’re missing the point. I just want to use Shortcoder to store repetitive data that may one day change (e.g. a ‘click-to-dial’ telephone number, or postal address, or a URL), and when that day comes, I would like to change it in only one place, to populate everywhere that short-code is. As this plugin is, that functionality is being ruined by those pesky comment tags!

    Example Code:

    
    <a href="tel:1-<!-- Shortcoder-Start...-->555<!-- Shortcoder-End -->-<!-- Shortcoder-Start...-->555<!-- Shortcoder-End -->-<!-- Shortcoder-Start...-->5555<!-- Shortcoder-End -->">1-<!-- Shortcoder-Start...-->555<!-- Shortcoder-End -->-<!-- Shortcoder-Start...-->555<!-- Shortcoder-End -->-<!-- Shortcoder-Start...-->5555<!-- Shortcoder-End --></a>
    

    Can you spot the issue with this anchor tag?? Will this number actually be callable, even while using the ‘tel:’ link-type?

    While I can appreciate the purpose of debugging, I too would like to see these start/end comments removed.

    Perhaps, as you say, have an option to remove them. Or perhaps show them if the following constants are set to TRUE in ‘wp-config.php’:

    define('WP_DEBUG', true);
    define('WP_DEBUG_DISPLAY', true);

    If possible, I try to avoid updating a plugin’s core files directly, as the changes will just be overwritten when the plugin is next updated.

    Thanks.

    • This reply was modified 6 years, 2 months ago by jumbo.
    • This reply was modified 6 years, 2 months ago by jumbo.
    Plugin Author vaakash

    (@vaakash)

    @jumbo Thanks for the suggestion !!

    Here’s another vote for the option to remove the comments. I’tried to use a shortcode inside a url, but the comment messed it up.

    Great plugin BTW!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Remove comments’ is closed to new replies.