Plugin Author
Katie
(@kseaborn)
Hi @timtom Sorry but that’s very much a testing ground and not monitored at all. But now that I have this post, I’ll add it to the list for next time. Or you can submit it yourself. Cheers!
Thread Starter
timtom
(@timtom)
Thanks @kseaborn! I’m not familiar with svn so I’m not sure how I could submit a patch, so I think the best way would be for you to bring over the relevant lines from my PR (very small changes).
In the meantime I should learn how to contribute to an svn project…
Thread Starter
timtom
(@timtom)
Unless I’m mistaken, latest Zotpress versions still do not include the APA fix I had submitted to GitHub. So I tried creating a patch instead but I can’t seem to work out how to submit it to the svn repository. The WP contribution guidelines talk about opening a trac ticket for this, but I don’t have enough privileges to open one (at least on plugins.trac…).
@kseaborn I’m really grateful for the work you’re putting into Zotpress and would love to do this little fix myself, if only I knew how… Really sorry if I’m missing something obvious.
Here’s my patch:
Index: lib/shortcode/shortcode.request.php
===================================================================
--- lib/shortcode/shortcode.request.php (revision 3170834)
+++ lib/shortcode/shortcode.request.php (working copy)
@@ -561,6 +561,8 @@
// REVIEW: Does this account for all citation styles?
/* chicago-author-date */ $item->bib = str_ireplace( htmlentities($item->data->url."."), "", $item->bib ); // Note the period
/* APA */ $item->bib = str_ireplace( htmlentities($item->data->url), "", $item->bib );
+ // Fix APA citation by removing the last part of the "Retrieved from" text
+ $item->bib = preg_replace('/(Retrieved \w+ \d+, \d+)(, from)/','${1}.',$item->bib);
$item->bib = str_ireplace( " Retrieved from ", "", $item->bib );
$item->bib = str_ireplace( " Available from: ", "", $item->bib );
@@ -618,7 +620,8 @@
"\xE2\x80\x9E" => '"', // U+201E double low-9 quotation mark
"\xE2\x80\x9F" => '"', // U+201F double high-reversed-9 quotation mark
"\xE2\x80\xB9" => "'", // U+2039 single left-pointing angle quotation mark
- "\xE2\x80\xBA" => "'" // U+203A single right-pointing angle quotation mark
+ "\xE2\x80\xBA" => "'", // U+203A single right-pointing angle quotation mark
+ "\xE2\x80\xAF" => " " // U+206F nominal digit shapes
);
$chr = array_keys( $chr_map );
$rpl = array_values( $chr_map );
Plugin Author
Katie
(@kseaborn)
Hi @timtom Thanks for submitting your code! As I mentioned, the GitHub isn’t monitored (and seems to be extremely outdated). But I’ll add your code with credit to 7.3.15.
Thread Starter
timtom
(@timtom)
Thank you! Apologies, I wasn’t very clear in my message. I know GH isn’t monitored so I tried submitting the fix to WP Trac but wasn’t able to figure out how…
Plugin Author
Katie
(@kseaborn)
No worries! Thank you for the contribution.