array(),
'tags' => array(),
'excludetags' => '',
'style' => '',
'theme' => '',
), $atts );
$query_args = array(
'post_type' => 'academizer_reference',
'order' => 'DESC',
'orderby' => 'academizer_date',
'meta_key' => 'academizer_date'
);
if (!empty($attrs['type'])) {
$terms = get_terms(array(
'taxonomy' => 'academizer_reftype',
'meta_key' => 'academizer_entry_type',
'meta_value'=> $attrs['type'],
'fields' => 'ids'
));
$query_args['tax_query'] = array(
array(
'taxonomy' => 'academizer_reftype',
'terms' => $terms,
),
);
}
if(!empty($attrs['tags'])) {
$query_args['meta_query'] = array(
array(
'key' => 'academizer_tags',
'value' => $attrs['tags'],
'compare' => 'REGEXP'
)
);
}
$options = get_option('academizer_options');
if (empty($attrs['style'])) {
$attrs['style'] = $options['style'];
}
if (empty($attrs['theme'])) {
$attrs['theme'] = $options['theme'];
}
$parser = new AcademizerBibtexParser();
$query = new WP_Query($query_args);
echo '
';
while ($query->have_posts()) {
$query->the_post();
$post_id = get_the_ID();
$tags = get_post_meta($post_id, 'academizer_tags', true);
$tag_array = explode(',', $tags);
if (!empty($tag_array) || !empty($attrs['excludetags'])) {
$tag_array = array_map('trim', $tag_array);
$tag_array = array_unique($tag_array);
if (false !== array_search($attrs['excludetags'], $tag_array))
continue;
}
$term_ids = wp_get_post_terms($post_id, 'academizer_reftype', array('fields' => 'ids'));
$entry_type = $term_ids[0];
$ref = AcademizerReference::Create(
$options['name'],
get_post_meta($post_id, 'academizer_bibtex_json', true),
array(get_term_meta($entry_type, 'academizer_format_full', true), get_term_meta($entry_type, 'academizer_format_short', true)),
get_post_meta($post_id, 'academizer_links', true)
);
switch ($attrs['style']) {
case "thumbnail":
case "thumbnail_left":
academizer_references_thumbnail($parser, $ref);
break;
case "detailed":
wp_enqueue_script('popper');
wp_enqueue_script('bootstrap-js');
wp_enqueue_script('academizer_bibtexParser');
wp_enqueue_script('academizer_clientReferences');
academizer_detailed_bootstrap($parser, $ref);
break;
case "simple":
default:
academizer_references_simple($parser, $ref);
break;
}
}
?>
set($ref);
$reference = $parser->fullCitation();
?>
set($ref);
$reference = $parser->fullCitation();
?>format))
return;
$parser->set($ref);
preg_match('/(\.+)(.*)/', htmlspecialchars_decode($ref->format[0]), $matches);
$citation = htmlspecialchars_decode($ref->format[1]);
$authors = '';
$entryType = $parser->getCurrentElement('');
$series = $parser->getCurrentElement('');
if (!empty($matches))
$authors = $parser->getCurrentElement($matches[1]);
?>
links['paper_url'])) : ?>
">
getCurrentElement('', true); ?>
bibtex_json))
academizer_create_button("#", 'ref-tooltip ref-btn-citation btn-secondary', 'quotes', 'Citation', 'Click to copy the citation text to the clipboard.',
'data-citation="' . wp_strip_all_tags($parser->fullCitation()) . '" ' . 'data-toggle="tooltip" data-placement="top" ');?>
bibtex_json))
academizer_create_button("#", 'ref-tooltip ref-btn-bib btn-secondary', 'bib', 'Bibtex', 'Click to copy the Bibtex code to the clipboard.',
'data-bibtex="' . htmlspecialchars($ref->bibtex_json) . '" ' . 'data-toggle="tooltip" data-placement="top" ');?>
getCurrentElement(''))) academizer_create_link("http://dx.doi.org/{$parser->getCurrentElement('')}", "ref-btn-doi btn-dark", 'link', 'DOI Link');?>
links['video_url'])) academizer_create_link($ref->links['video_url'], 'ref-btn-video btn-dark', 'video', 'Video');?>
links['talk_url'])) academizer_create_link($ref->links['video_url'], 'ref-btn-talk btn-dark', 'talk', 'Talk Video');?>
links['git_url'])) academizer_create_link($ref->links['git_url'], 'ref-btn-git btn-dark', 'git', 'GitHub');?>
links['slides_url'])) academizer_create_link($ref->links['slides_url'], 'ref-btn-slides btn-dark', 'slide', 'Slides');?>
links['paper_url'])) academizer_create_link($ref->links['paper_url'], 'ref-btn-paper btn-danger', 'file', 'Read PDF' );?>
'academizer_reftype',
'hide_empty' => false,
) );
$termNames = array();
foreach ($terms as &$term)
{
$termNames[] = $term->name;
}
return $termNames;
}
function academizer_create_link($url, $classes, $icon, $text, $tooltip=null, $other=null) {
?>>