Support » Plugin: Highlight and Share » add filter

  • Resolved chriskal

    (@chriskal)


    Thank you for this great plugin. It works fine.

    I have two problems.
    1. I would love to modify the selected text a bit. When the User highlights “Here is an example text” from the website and tries to share it, it would be great if there are quotation marks or guillemets in the tweet.

    2. I would like to modify the URL of the posting. I have two domains, one is a short URL which redirects to the original post. It is simply a mirror. So what I did (for other sharing plugins) to modify the URL is to change the

    wp_get_shortlink function

    in

    link-template.php

    like this:

    (…)
    add_filter( ‘get_shortlink’, ‘my_short_domain_function’ );
    return apply_filters( ‘get_shortlink’, $shortlink, $id, $context, $allow_slugs );

    function my_short_domain_function( $shortlink ) {
    return str_replace( ‘MUglyOldWayToLongDomainName.de’, ‘short.de’, $shortlink );
    }

    which works good. But the Highlight and Share plugin does not use this modified shortlink, it uses the long form anyway. I don’t know why. So I noticed the “Modify the Content URL” filter provided here: https://mediaron.com/highlight-and-share/
    which is writter like this:

    add_filter( ‘has_content_url’, function( $url, $post_id ) {
    return ‘https://wordpress.org’;
    }, 10, 2 );

    but I do not know where to insert it. Also, I do not understand the “10,2” part. I know a little bit php, but I have no clue about the WordPress architecture. Can somebody tell me how to change the MUglyOldWayToLongDomainName.de/?p=123 to short.de/?p=123

    I guess the first problem – changing the quoted text to the text with quotation marks – also works with a filter. But I have no idea how to implemtent this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter chriskal

    (@chriskal)

    Hi again,

    I worked out how to modify the URL using a filter. It works fine.

    But I am not good enough to see if I can modify the quoted content (adding quotationsmarks) in any way. Does somebody know this?

    Thank you

    Plugin Author Ronald Huereca

    (@ronalfy)

    @chriskal

    Sorry for my delayed reply. I’ve been out the last few days.

    Can you leave a note here? https://mediaron.com/contact/

    Thanks,

    Ronald

    Thread Starter chriskal

    (@chriskal)

    Hi Ronald,
    it is a free plugin, and you give your time developing it. I think there is no need to say sorry if you don’t reply every day every time immediately 🙂 Thank you for your work!

    Of course, I can leave a note there. I will do this right now. I don´t understand why it is better to write there instead of here, though.

    Plugin Author Ronald Huereca

    (@ronalfy)

    @chriskal I tested and released 3.4.0 just now. It has two new options in the settings, which will allow you to insert before and after text. You can place quotations or pretty much whatever you like in a before and after context.

    I look forward to your feedback regarding this new feature.

    Thread Starter chriskal

    (@chriskal)

    Worst support of all time! You needed SOME HOURS until you updated the plugin! I think with a free plugin we would deserve a good support within minutes! 😉

    Ok, seriously, I love you man. This was the fastest and best solution I have ever seen for a free plugin, I will absolutely vote it 5 stars right after sending this text. The updated plugin works great, and with the possibility to insert any text after the highlighted text I am free to decide how to use it. It is even better than just enabling “quotation marks? yes/no” into the settings tab, which is what I was thinking about.

    Plugin Author Ronald Huereca

    (@ronalfy)

    Ha you scared me for a bit there!

    I’m happy I was able to honor your feature request. You caught me on a good day 🙂

    Cheers,

    Ronald

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.