This plugin fetches an excerpt of an external website link. The excerpt contains the title, description and image.
V1.5.2 Update: Added option to place the button in the "Media Button" row above the editor and changed the default for new install's to use PHP's HTML Dom instead of regex's.
v1.5.0 Update: Rewrote the source parser to use PHP's HTML Dom instead of regex's. The default mode is the original regex's, so you need to change the setting on the options page to enable this. The Dom mode always tries OpenGraph tags first, then fails back to regular meta tags, then to body content, i.e. img if no og:image, h1 if no og:title or title, 1st p if no og:description or meta description
The options page allows the following to be set:
- CSS to change the look and feel of the generated links.
- The article source label. (Default "Source:")
- Control of new window opening. Options are 'target="_blank"', 'target="newwindow"', 'rel="external"' and opening in the same window. (Default 'target="_blank"')
- Which TinyMCE button row the icon is added to (1,2 or 3) or the "Media Button" row above the editor.
- Select regex parse mode (the original and default) or PHP's HTML Dom mode
Added in 1.4.5: When adding a post, if the post title field is blank, the title of the retrieved page is inserted into the title field.
The defaults are designed to suit most people.
Added the cacert.pem which CURL uses for https sites from
http://curl.haxx.se/ca/cacert.pem (the home of CURL).
ToDo: Longer term, configurable options for sites without an image and selecting from multiple OG images.
Thank you to Abhishek Saha for publishing the original URL Preview at
https://wordpress.org/plugins/link-preview/ which this is based on and for the WP review team for their help in conforming to coding rules.
Note: Tested with "TinyMCE Advanced" and "Black Studio TinyMCE Widget" modules.