Changeset 890 for plugins/footnotes/trunk/footnotes.plugin.php
- Timestamp:
- 09/04/08 11:03:46 (4 months ago)
- Files:
-
- 1 modified
-
plugins/footnotes/trunk/footnotes.plugin.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/footnotes/trunk/footnotes.plugin.php
r757 r890 19 19 class Footnotes extends Plugin 20 20 { 21 const VERSION = '2. 2';21 const VERSION = '2.3'; 22 22 private $footnotes; 23 23 private $current_id; … … 34 34 'authorurl' => 'http://habariproject.org', 35 35 'version' => self::VERSION, 36 'description' => 'Use footnotes in your posts. Syntax: <footnote>Your footnote</footnote>, wherever you want the reference point to be. Everything is done automatically. You can also cite a source using a url attribute like this <footnote url="http://foo.bar/foo/">Title</footnote>. ',36 'description' => 'Use footnotes in your posts. Syntax: <footnote>Your footnote</footnote>, wherever you want the reference point to be. Everything is done automatically. You can also cite a source using a url attribute like this <footnote url="http://foo.bar/foo/">Title</footnote>. Also now supports ((WP-Footnotes syntax, for compatibility.)).', 37 37 'license' => 'Apache License 2.0' 38 38 ); … … 73 73 74 74 // If there are no footnotes, save the trouble and just return it as is. 75 if ( strpos( $content, '<footnote' ) === false ) {75 if ( strpos( $content, '<footnote' ) === false && strpos( $content, ' ((' ) === false ) { 76 76 return $content; 77 77 } … … 81 81 82 82 $this->post= $post; 83 $return = preg_replace_callback( '/ <footnote(\s+url=[\'"].*[\'"])?>(.*)<\/footnote>/Us', array('self', 'add_footnote'), $content );84 83 $return = preg_replace_callback( '/(?:<footnote(\s+url=[\'"].*[\'"])?>|\s\(\()(.*)(?:\)\)|<\/footnote>)/Us', array('self', 'add_footnote'), $content ); 84 85 85 if ( count( $this->footnotes ) == 0 ) { 86 86 return $content;
