• Resolved bgmahesh

    (@bgmahesh)


    Is there anyway the plugin can pick og:title while sharing the article on social media?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author micropat

    (@micropat)

    Yep, you can use AddToAny Events to modify the shared URL for services that accept an arbitrary title.

    // If the current page is being shared, use the page's og:title tag for services that accept an arbitrary title.
    a2a_config.callbacks.push({
        share: function(data) {
            if ( data.url === location.href ) {
                var ogTitle = document.querySelector('meta[property="og:title"]');
                if (ogTitle) data.title = ogTitle;
            }
            return data;
        }
    });

    Note that a few major services will always use the the og:title meta tag.

Viewing 1 replies (of 1 total)
  • The topic ‘Can the plugin pick up og:title?’ is closed to new replies.