Skip to content

Commit

Permalink
IMPROVEMENT: support multiple keys
Browse files Browse the repository at this point in the history
  • Loading branch information
masuhar committed Oct 21, 2024
1 parent 9d7260b commit 9a5bb87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions prg-bib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: PRG Bibliography Shortcode
* Plugin URI: https://github.com/prg-titech/bib-shortcode/
* Description: Shortcode to embed publication lists.
* Version: 0.1.4-alpha
* Version: 0.1.5-alpha
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: Hidehiko Masuhara
Expand Down Expand Up @@ -48,16 +48,17 @@ function prg_bib_shortcode( $atts ) {
),
$atts
);

$code = "";
foreach(preg_split("/\,/", $atts['key']) as $key) {
// $code = "<script> function resizeIframe(obj) {
// obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px';
// obj.style.width = '100%';
// obj.style.border = 'none';
// }
// </script>";
$code = "
<iframe src='https://prg.is.titech.ac.jp/papers/bibtexbrowser.php?key=". $atts['key'] ."&bib=prg-e.bib;prg-j.bib;thesis-d.bib;thesis-m.bib;thesis-b.bib' class='bibtexbrowser' onload='resizeIframe(this)'></iframe>";

$code .= "
<iframe src='https://prg.is.titech.ac.jp/papers/bibtexbrowser.php?key=". $key ."&bib=prg-e.bib;prg-j.bib;thesis-d.bib;thesis-m.bib;thesis-b.bib' class='bibtexbrowser' onload='resizeIframe(this)'></iframe>";
}

return $code; // '<p>Hello PRG Bib Shortcode</p>';

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: masuhara
Tags: bibtex, bibliography, citation
Requires at least: 5.2
Tested up to: 6.6.1
Stable tag: v0.1.4-alpha
Stable tag: v0.1.5-alpha
Requires PHP: 7.2
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -34,6 +34,9 @@ Usage

== Changelog ==

- v0.1.5-alpha
IMPROVEMENT: support multiple keys

- v0.1.4-alpha
FIX: check release tag in .php

Expand Down

0 comments on commit 9a5bb87

Please sign in to comment.