Changeset 2260538
- Timestamp:
- 03/13/2020 01:40:49 PM (6 years ago)
- Location:
- http-syndication/trunk
- Files:
-
- 2 edited
-
http_syndication.php (modified) (4 diffs)
-
readme.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
http-syndication/trunk/http_syndication.php
r2259310 r2260538 2 2 /** 3 3 * Plugin Name: http-syndication 4 * Plugin URI: https://wordpress.org/plugins/http-syndication/ 4 5 * Description: Allows to offer the content of page to other sites and import content from this or other sites. 5 * Version: 1. 66 * Version: 1.7 6 7 * Author: Thierry.Vieville@inria.fr 7 8 * Author URI: http://www-sop.inria.fr/members/Thierry.Vieville … … 95 96 $content = str_replace(']]>', ']]>', $content); 96 97 unset($this->import_ids[$atts['id']]); 98 $content = $this->http_syndication_encapsulate($content, $atts); 97 99 return self::html_repair($content); 98 100 } else … … 125 127 $content = apply_filters($filter, $content, $atts); 126 128 } 129 $content = $this->http_syndication_encapsulate($content, $atts); 127 130 return self::html_repair($content); 128 131 } … … 202 205 } 203 206 $content = substr($content, $begin, $end - $begin); 204 if (isset($atts['class'])) 205 $content = preg_replace('/<\s*([^\s]*)/', '$0 class="'.$atts['class'].'" ', $content, 1); 206 if (isset($atts['style'])) 207 $content = preg_replace('/<\s*([^\s]*)/', '$0 style="'.$atts['style'].'" ', $content, 1); 207 return $content; 208 } 209 210 function http_syndication_encapsulate($content, $atts) { 211 if (isset($atts['class']) || isset($atts['style'])) 212 $content = "<div". 213 (isset($atts['class']) ? " class='".$atts['class']."'" : ""). 214 (isset($atts['style']) ? " style='".$atts['style']."'" : ""). 215 ">".$content."</div>"; 208 216 return $content; 209 217 } -
http-syndication/trunk/readme.txt
r2259310 r2260538 12 12 This plugins offers the following "ground" functionnalities: 13 13 14 1. Display the content of a post or page without any header, sidebar and footer.15 2. Importing an internal content of the wordpresssite16 3. Importing the content from an external website17 4. A few other deprecated functionalities14 * 1. Display the content of a post or page without any header, sidebar and footer. 15 * 2. Importing the content from an external web site 16 * 3. Importing an internal content of the wordpress site 17 * 4. A few other deprecated functionalities 18 18 19 19 = 1. Displaying a post or page without any header, sidebar and footer = … … 27 27 * `#mywordpressadress` is the wordpress web site adress. 28 28 * `#post_or_page_id` is the post or page id (you can read the post id in the http link when you edit the post). 29 * `#1_or_0 defines whether the post title (enclosed in`<h1>` HTML tag) is displayed (default is `1`, i.e., true).29 * `#1_or_0` defines whether the post title (enclosed in a `<h1>` HTML tag) is displayed (default is `1`, i.e., true). 30 30 31 31 *Remarks:* … … 33 33 * The post content is exported after filtering. 34 34 35 = 2. Importing an internal content of the wordpress site = 36 37 In order to import a post or page contents in another post or page, use the following shortcode: 38 39 * `[import id="#post_or_page_id"]` to include the filtered content of another post or page in the current content. 40 * `[import id="#post_or_page_id" content=1]` to include the raw (with shortcode expanded, but not content filter applied) of another post or page in the current content (to be used only if required). 41 * `[import id="#post_or_page_id" title=1]` to include the title of another post or page in the current content. 42 43 where: 44 45 * `#post_or_page_id` is the post or page id (you can read the post id in the http link when you edit the post). 46 47 *Remarks:* 48 49 * This avoids spurious import, e.g. of social media buttons (contrary to usual [include plugins](http://wordpress.org/plugins/search.php?q=include)). 50 * Shortcode recursion is managed (i.e. stopped when an infinite loop is detected). 51 52 = 3. Importing the content from an external web site = 35 = 2. Importing the content from an external web site = 53 36 54 37 In order to import an external a post or page contents in another post or page, use the following shortcode: … … 72 55 * `raw_href=1` : in order to provide raw href values, instead of properly relocating relative href in the source HTML code, as done by default. 73 56 * `mediawiki=1` : adds the `?printable=yes&action=render` query to the URL, in order to properly syndicate mediawiki sites. 74 * `style=#style` or `class=#class` allows to add a customized class or style attribute to the tag.57 * `style=#style` or `class=#class` allows to encapsulate the content in a `<div .` with customized class and/or style attribute. 75 58 76 59 *Example* : … … 88 71 * The [embed](http://codex.wordpress.org/Embeds) shortcode is a core WordPress feature. It can embed content from many resources via direct link, and the [iframe](http://www.w3schools.com/tags/tag_iframe.asp) allows to safely and obviously include any external site page in "frame". The [iframe plugin](http://wordpress.org/plugins/iframe) works well and properly make the job. The present import is a 3rd alternative, to be preferred when the former fail or mixing pages content is required. 89 72 73 = 3. Importing an internal content of the wordpress site = 74 75 In order to import a post or page contents in another post or page, use the following shortcode: 76 77 * `[import id="#post_or_page_id"]` to include the filtered content of another post or page in the current content. 78 * `[import id="#post_or_page_id" content=1]` to include the raw (with shortcode expanded, but not content filter applied) of another post or page in the current content (to be used only if required). 79 * `[import id="#post_or_page_id" title=1]` to include the title of another post or page in the current content. 80 81 where: 82 83 * `#post_or_page_id` is the post or page id (you can read the post id in the http link when you edit the post). 84 85 *Remarks:* 86 87 * This avoids spurious import, e.g. of social media buttons (contrary to usual [include plugins](http://wordpress.org/plugins/search.php?q=include)). 88 * Shortcode recursion is managed (i.e. stopped when an infinite loop is detected). 90 89 91 90 = 4. A few other deprecated functionalities = … … 118 117 119 118 == Changelog == 119 120 = 1.7 = 121 122 Improve the introduction of style or class in import. 120 123 121 124 = 1.6 =
Note: See TracChangeset
for help on using the changeset viewer.