dshanske / bridgy-publish

Bridgy for WordPress ( Functionality now in Syndication Links Plugin. This is being deprecated)
https://wordpress.org/plugins/bridgy-publish
8 stars 6 forks source link

Set bridgy backlink options per post, not via plugin setting #5

Closed iamwebrocker closed 7 years ago

iamwebrocker commented 8 years ago

brid.gy offers two options for the omission of backlinks; "true" and "maybe". (https://brid.gy/about#omit-link) This "maybe" is interesting, because it includes a backlink only when the post has been truncated to fit the silo post's limit. Currently in the plugin settings it is only possible to set globally if a backlink should be included or not. I have made changes to add this option to the meta-box, so it can be decided on a per-post basis: https://github.com/iamwebrocker/bridgy-publish/tree/master

It works in my WordPress install, but I think it needs some more tweaking -- currently the "u-bridgy-omit-link" class always will be added to the bridgy publish link if the corresponding checkbox in the admin settings screen is ticked. But once the backlink option select in the meta-box is set to "always" or "maybe", a <data class="p-bridgy-omit-link" value="[true|maybe]"></data> element will be appended to the post. Also I'm not sure if it is smart to store the backlink option in an array - it can have only one value anyway. So, yeah, it's a bit rough, but it works for me :-)

dshanske commented 8 years ago

The query parameter can also be sent as part of the webmention. Put in a suggestion for that(https://github.com/pfefferle/wordpress-webmention/issues/86). Currently working with @pfefferle on upgrades to the webmention plugin and may revisit after that feature is in stable.

TechLifeWeb commented 8 years ago

Perhaps this is a separate request but would it be possible to set send/not send a link on a post by post basis at the time of publishing? I don't normally want to send a link but there are occasions when I do.

iamwebrocker commented 8 years ago

@TechLifeWeb yes, that's how I modded the code; in the post's meta box, next/below to the checkbox for the enabled social networks, is a dropdown where you can chose "[always | never | maybe] send backlink" line53ff line78ff

TechLifeWeb commented 8 years ago

@iamwebrocker Thanks. I guess I should learn to read more closely. I'll give your code a test.

iamwebrocker commented 8 years ago

cool, let me know how it goes. this is highly hacked together to fit my installation, not tested anywhere else :-)

miklb commented 7 years ago

When I tested this with the default option set to "maybe" , and the content was < 140 characters, I still only got Site title & link published to Twitter via bridgy.

iamwebrocker commented 7 years ago

@miklb hi, thanks for the feedback, will check. just to be sure; the title plus the link alone won't take up the char limit? not sure how the default bridgy behavior is supposed to be in that case, or if there's some kind of minimum chars must be left for the content limit before it'll be displayed.