-
Notifications
You must be signed in to change notification settings - Fork 43
Function Reference: get_publications
This function returns an array or an object of publications. It's the general API function for getting publication data.
$array = TP_Publications::get_publications( $args, $count = false );
You can set $count to true if you want to receive only the number of publications.
$defaults = array(
'user' => '',
'type' => '',
'tag' => '',
'key' => '',
'author_id' => '',
'import_id' => '',
'year' => '',
'author' => '',
'editor' => '',
'include' => '',
'include_editor_as_author' => true,
'exclude' => '',
'exclude_tags' => '',
'exclude_types' => '',
'order' => 'date DESC',
'limit' => '',
'search' => '',
'meta_key_search' => array(),
'output_type' => OBJECT
);
$array = TP_Publications::get_publications( $args, $count = false );
(integer) The ID of the user whose publications you want to show. You can separate more than one by comma.
(string) The publication types you want to show. You can separate more than one by comma.
(string) If you want to display only publications with a determined tag, so set with this parameter the tag-ID of this tag. You can separate more than one by comma.
(string) If you want to display only publications with a determined bibtex key. You can separate more than one by comma.
(string) If you want to display only publications with a determined year, so set it with this parameter. You can separate more than one by comma.
(string) If you want to display only publications with a determined author. You can separate more than one author name by comma.
(string) If you want to display only publications with a determined author. You can separate more than one author ID my comma.
(string) If you want to display only publications with a determined import ID. You can separate more than one import ID my comma.
(string) If you want to display only publications with a determined editor. You can separate more than one editor name by comma.
(string) Define a comma-separated list of publication IDs to be excluded from the list.
(string) Use it to exclude publications via tag IDs (separated by comma)
(string) Use it to exclude publications via types (separated by comma)
(string) Define a comma-separated list of publication IDs to be included from the list.
(BOOL) True or false. Default: true.
(string) Change the order of the list.
(string) Limits the number of publications. Example: „0,30“ for the first 30 entries;
(string) Use this parameter for a search over names, booktitles, authors, editors, journals, years and isbns.
(Array) An array which contains the parameters for meta_keys as key=>value pair.
Example for an checkbox:
meta_key_search => array( 'tp_meta_pub_custom_label' => '{Open Access}' )
(string) You can choice between:
OBJECT (default) ARRAY_A ARRAY_N
(array or object)
An array or object containing all the publications matching the request
The fields returned for each row are:
(integer) ID of the publication
(string) Title of the publication
(string) Type of the publication
(string) BibTeX key of the publication
(string) The name(s) of the author(s) (in the case of more than one author, separated by and)
(string) The name(s) of the editor(s) (in the case of more than one editor, separated by and)
(string) Date of publishing (YYYY-MM-DD)
(string) Year of publishing (YYYY)
(string) Date of visiting (YYYY-MM-DD)
(string) The ISBN/ISSN number
(string) Some URLs
(string) The title of the book, if only part of it is being cited
(string) The journal or magazine the work was published in.
(string) Volume of the journal where the work was published
(string) Number of the journal where the work was published
(string) Page numbers
(string) Name of the publisher
(string) Publisher’s address (usually just the city, but can be the full address for lesser-known publishers)
(string) Edition of the resource where the publication can be found
(string) Chapter of the resource where the publication can be found
(string) The institution that was involved in the publishing, but not necessarily the publisher
(string) The conference sponsor
(string) The school where the thesis was written
(string) The series of books the book was published in
(string) The key of the cross-referenced entry
(string) The abstract of the work
(string) How it was published, if the publishing method is nonstandard
(string) A hidden field used for specifying or overriding the alphabetical order of entries.
(string) Additional type of publication (e.g. „Research Note“ for techreport, „{PhD} dissertation“ for phdthesis, „Section“ for inbook/incollection)
(string) Miscellaneous extra information
(integer) Says if the type of the number in the isbn field is a ISBN or ISSN number (1|0)
(string) URL of a publication image
(integer) ID of a WordPress post or page
(string) The DOI number of a publication
(string) The status of publishing (for example: published)
(integer) The date where the publication entry was added
(integer) The date where the publication entry was modified at last
The method also returns the values for custom meta data
Get all articles and inproceedings:
$publications = TP_Publications::get_publications( array('type' => 'article, inproceedings') );
foreach ($publications as $row) {
// put your code here
}
Get the number of publications which are published in 2019 and 2020:
$args = array( 'year' => '2019,2020' );
$number = TP_Publications::get_publications($args, true);
- Since: 5.0.0