Documentation

O3PO_PrimaryPublicationType extends O3PO_PublicationType
in package

Class representing the primary publication type.

Tags
since
0.1.0
subpackage

O3PO/includes

author

Christian Gogolin o3po@quantum-journal.org

Table of Contents

Properties

$environment  : O3PO_Environment
The envrironment in which this publication type exists.

Methods

__construct()  : mixed
Construct this publication type.
add_axiv_paper_doi_feed_endpoint()  : mixed
Add /arxiv_paper_doi_feed end point for serving a feed of recent papers for the arXiv.
add_custom_post_types_to_query()  : mixed
Add the custom post type of this publication type to the main query.
add_custom_post_types_to_rss_feed()  : mixed
Add the custom post type of this publication to the rss feed.
add_dublin_core_and_highwire_press_meta_tags()  : mixed
Output meta tags describing this publication type.
add_licensing_information_to_last_pdf_from_arxiv()  : mixed
Add licensing information to latest arXiv pdf.
add_metabox()  : mixed
Adds the meta box for the meta-data of posts of this publication type to the create new/update post page in the admin area.
add_pdf_endpoint()  : mixed
Add a /pdf endpoint for serving the full text pdf.
add_web_statement_endpoint()  : mixed
Add /web-statement end point for serving a web statement of the licence.
admin_page_extra_css()  : mixed
Adds css to the amin area to hide the WordPress title field for the associated post type to avoid confusion.
generate_bibtex()  : mixed
Generate a BibTeX representation of the meta-data of $post_id
generate_clockss_xml()  : mixed
Generate xml suitable for the submission to CLOCKSS
generate_crossref_xml()  : mixed
Generate an xml representation of the meta-data of that post suitable for crossref.
generate_crossref_xml_doi_batch_id()  : mixed
Generate a doi batch id for coressref
generate_doaj_json()  : mixed
Generate json suitable for the submission to DOAJ
get_active_publication_type_names()  : array<string|int, mixed>
Get the names of all registered publication types.
get_active_publication_types()  : mixed
Get all registered publication types.
get_all_arxiv_submission_histories()  : mixed
get_all_citation_counts()  : array<string|int, mixed>
Get the citation counts for all publications of the given type.
get_arxiv_submission_history()  : array<string|int, mixed>
Get the arXiv submission history
get_arxiv_upload_date()  : mixed
Get the arXiv upload date
get_basis_for_excerpt()  : The
Get the text basis for the text part of the excerpt
get_bibliography_html()  : mixed
Get the thml formated bibliography.
get_bibtex_html()  : mixed
Get the html formated bibtex data.
get_cited_by()  : mixed
Get the html formated cited by information.
get_cited_by_data()  : array<string|int, mixed>
Get cited-by data.
get_corresponding_author_email()  : mixed
Get the email of the corresponding author.
get_date_published()  : mixed
Get date published.
get_default_number_authors()  : mixed
Get the default number of authors for this publication type.
get_doi()  : mixed
Get the DOI of the post with id $post_id.
get_eprint()  : mixed
Get the eprint of the post with id $post_id.
get_feed_content()  : mixed
Get the content for for the rss feed.
get_formated_affiliations()  : mixed
Echo the afiliations text formated.
get_formated_affiliations_html()  : mixed
Echo the afiliations html formated.
get_formated_authors()  : mixed
Get the formatted authors.
get_formated_authors_bibtex()  : mixed
Get the authors BibTeX formatted.
get_formated_authors_html()  : mixed
Get the authors html formated.
get_formated_bibliography_entry_html()  : mixed
Get a formated bibliography entry.
get_formated_bibliography_html()  : mixed
Echo the html formated bibliography.
get_formated_citation()  : mixed
Get how this $post_id should be cited.
get_formated_cited_by_html()  : mixed
Get the html formated cited information.
get_formated_date_published()  : mixed
Get publication date formated.
get_formated_handling_editor()  : mixed
Outputs the html formated handling editor of this publication type.
get_formated_volume_html()  : mixed
Outptus the html formated volume of this publication type.
get_fulltext_pdf_path()  : mixed
Get the path of the fulltext pdf.
get_journal_property()  : mixed
Get a property of the associated journal.
get_last_arxiv_pdf_path()  : mixed
Get the path of the last arXiv pdf.
get_last_arxiv_pdf_url()  : mixed
Get the url of the latest arXiv pdf.
get_license_information()  : mixed
Get the license_information.
get_newer_arxiv_version_warning()  : mixed
Get the the html of the warning in case a newer arxiv version exists
get_number_authors()  : mixed
Get the number of authors.
get_page()  : mixed
Get the page of the post with id $post_id.
get_pdf_pretty_permalink()  : mixed
Get the pretty permalink of the pdf associated with a post.
get_popular_summary()  : mixed
Get the polupar summary.
get_post_meta()  : mixed
Get a meta data field.
get_post_meta_field_containing_array()  : mixed
Get a post meta field that is expected to contain an array.
get_publication_type_name()  : mixed
Get the name of this publication type.
get_publication_type_name_plural()  : mixed
Get the plural name of this publication type.
get_social_media_thumbnail_src()  : string
Get the src of the feature image.
get_the_author()  : mixed
Fake the author.
get_the_author_posts_link()  : mixed
Fake the author post link.
get_the_content()  : mixed
Construct the content.
get_the_excerpt()  : mixed
Get the excerpt of a this publication type.
get_title()  : mixed
Get the title.
get_volume()  : mixed
Get the volume of the post with id $post_id.
handle_arxiv_paper_doi_feed_endpoint_request()  : mixed
Handle requests to the arxiv_paper_doi_feed endpoint for serving a feed of recent papers for the arXiv.
handle_pdf_endpoint_request()  : mixed
Handle request to the /pdf endpoint for serving the full text pdf.
handle_web_statement_endpoint_request()  : mixed
Handle requests to the /web-statement end point for serving a web statement of the licence.
html_latex_excerpt()  : string
Excerpt from a string with html and LaTeX
init_metabox()  : mixed
Init the meta box for all publication types and add hooks for its save action.
on_transition_post_status()  : mixed
Handle post status transitions
pre_delete_post()  : mixed
Check whether this post can be deleted
pre_trash_post()  : mixed
Check whether this post can be trashed
prevent_deletion()  : mixed
Return false for posts of this type when they are already published
register_as_custom_post_type()  : mixed
Registers this publication type as a custom post type with WordPress.
render_maintenance_mode_warning()  : mixed
Render the maintenance_mode warning if appropriate.
render_metabox()  : mixed
Render the admin panel meta box.
save_metabox()  : mixed
Callback function for handling the data enterd into the meta-box when a correspnding post is saved.
show_fermats_library_permalink()  : mixed
Decide whether or not the Fermat's library permalink should be shown.
the_author_feed()  : mixed
Modify the author reported on the feed for publication posts.
the_java_script_single_page()  : mixed
Outputs some java script for the single page of this publication type.
use_page_template()  : string
Force the usage of the page template for publication posts.
get_last_arxiv_source_url()  : mixed
Get the url of the last arXiv soruce.
on_post_actually_published()  : mixed
Do things when the post is finally published.
save_meta_data()  : mixed
Callback function for handling the data enterd into the meta-box when a correspnding post is saved.
the_admin_panel_abstract()  : mixed
Echo the abstract part of the admin panel.
the_admin_panel_affiliations()  : mixed
Echo the affiliations for the admin panel.
the_admin_panel_arxiv()  : mixed
Echo the arXiv part of the admin panel.
the_admin_panel_authors()  : mixed
Echo the authors for the admin panel.
the_admin_panel_bibliography()  : mixed
Echo the bibliography for the admin panel.
the_admin_panel_buffer()  : mixed
Echo an intro text for buffer functionality on the admin panel.
the_admin_panel_clockss()  : mixed
Echo the CLOCKSS information for the admin panel.
the_admin_panel_corresponding_author_email()  : mixed
Echo the corresponding author emial for the admin panel.
the_admin_panel_crossref()  : mixed
Echo crossref information for the admin panel.
the_admin_panel_date_volume_pages()  : mixed
Echo the data, volume and pages information for the admin panel.
the_admin_panel_doaj()  : mixed
Echo the DOAJ information for the admin panel.
the_admin_panel_doi()  : mixed
Echo the DOI for the admin panel.
the_admin_panel_eprint()  : mixed
Echo the eprint part of the admin panel.
the_admin_panel_feature_image_caption()  : mixed
Echo the feature image caption part of the amdin panel.
the_admin_panel_fermats_library()  : mixed
Echo the Ferma's library part of the admin panel.
the_admin_panel_funder_information()  : mixed
Echo the funder information for the admin panel.
the_admin_panel_handling_editor()  : mixed
Echo an controls for choosing the handling editor on the admin panel.
the_admin_panel_howto()  : mixed
Echo a howto for the admin panel.
the_admin_panel_intro_text()  : mixed
Echo an intro text for the admin panel.
the_admin_panel_popular_summary()  : mixed
Echo the popular summary part of the admin panel.
the_admin_panel_title()  : mixed
Echo the title for the admin panel.
the_admin_panel_validation_result()  : mixed
Echo the validation results for the admin panel.
validate_and_process_data()  : mixed
Validate and process the meta-data that was saved in save_meta_data().
parse_publication_source()  : mixed
Parse the source files.

Properties

$environment

The envrironment in which this publication type exists.

protected O3PO_Environment $environment

The envrironment in which this publication type exists.

Tags
since
0.1.0
access

protected

Methods

__construct()

Construct this publication type.

public __construct(object $journal, O3PO_Environment $environment) : mixed

Constructs and registers this publication type in the array static::$active_publication_types. Throws an error in case a publication type with the same $publication_type_name is alreay registered.

Parameters
$journal : object

The journal this publication type is associated with.

$environment : O3PO_Environment

The evironment in which this post type is to be created.

Tags
since
0.1.0
access

public

add_axiv_paper_doi_feed_endpoint()

Add /arxiv_paper_doi_feed end point for serving a feed of recent papers for the arXiv.

public static add_axiv_paper_doi_feed_endpoint() : mixed

To be added to the 'init' action.

Tags
since
0.1.0
access

public

add_custom_post_types_to_query()

Add the custom post type of this publication type to the main query.

public final add_custom_post_types_to_query(WP_query $query) : mixed

To be added to the 'pre_get_posts' action.

Parameters
$query : WP_query

The current query to which the post type is potentially to be added.

Tags
since
0.1.0
access

public

add_custom_post_types_to_rss_feed()

Add the custom post type of this publication to the rss feed.

public final add_custom_post_types_to_rss_feed(array<string|int, mixed> $request) : mixed

To be added to the 'request' filter.

Parameters
$request : array<string|int, mixed>

The request to which this post type is maybe to be added.

Tags
since
0.1.0
access

public

add_dublin_core_and_highwire_press_meta_tags()

Output meta tags describing this publication type.

public add_dublin_core_and_highwire_press_meta_tags() : mixed

Overwrites and calls function of same name in O3PO_Publication_Type.

To be added to the 'wp_head' action.

Tags
since
0.1.0
access

public

add_licensing_information_to_last_pdf_from_arxiv()

Add licensing information to latest arXiv pdf.

public add_licensing_information_to_last_pdf_from_arxiv(int $post_id) : mixed
Parameters
$post_id : int

Id of the post whose meta data is to be saved.

Tags
since
0.1.0
acesss

public

add_metabox()

Adds the meta box for the meta-data of posts of this publication type to the create new/update post page in the admin area.

public final add_metabox() : mixed
Tags
since
0.1.0
access

public

add_pdf_endpoint()

Add a /pdf endpoint for serving the full text pdf.

public add_pdf_endpoint() : mixed

To be added to the 'init' action.

Tags
since
0.1.0
access

public

add_web_statement_endpoint()

Add /web-statement end point for serving a web statement of the licence.

public static add_web_statement_endpoint() : mixed

To be added to the 'init' action.

Tags
since
0.1.0

admin_page_extra_css()

Adds css to the amin area to hide the WordPress title field for the associated post type to avoid confusion.

public admin_page_extra_css([int $post_id = null ]) : mixed

To be added to the 'admin_head' action.

Parameters
$post_id : int = null

The Id of the post that is views (defaults to null). If left empty global $post is used.

Tags
since
0.1.0
access

public

generate_bibtex()

Generate a BibTeX representation of the meta-data of $post_id

public generate_bibtex(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

generate_clockss_xml()

Generate xml suitable for the submission to CLOCKSS

public generate_clockss_xml(int $post_id) : mixed

This function returns a string containing xml formated according to the JATS scheme suitable for CLOCKSS.

Parameters
$post_id : int

Id of the post for which to generate the clockss xml.

Tags
since
0.1.0
access

public

generate_crossref_xml()

Generate an xml representation of the meta-data of that post suitable for crossref.

public generate_crossref_xml(int $post_id, string $doi_batch_id, mixed $timestamp) : mixed

This function return a string containing xml formated meta-data about the given $post_id that can be uploaded to and then processed by Crossref.

See https://www.crossref.org/education/content-registration/crossrefs-metadata-deposit-schema/crossref-xsd-schema-quick-reference/ for the documentation of the Corssref XML scheme.

Parameters
$post_id : int

Id of the post for which the crossref xml is to be generated.

$doi_batch_id : string

Batch id of the submission for which the crossref xml is to be generated.

$timestamp : mixed
Tags
since
0.1.0
access

public

generate_crossref_xml_doi_batch_id()

Generate a doi batch id for coressref

public static generate_crossref_xml_doi_batch_id(int $post_id, string $timestamp) : mixed

Cossref requires us to generate a unique id for each doi batch submission. Here we do this by adding a timestamp to the doi of the post we want to register.

Parameters
$post_id : int

Id of the post for which to generate the doi batch id.

$timestamp : string

Timestamp of the submission for which the requested batch id is to be used.

Tags
since
0.1.0
access

public

generate_doaj_json()

Generate json suitable for the submission to DOAJ

public generate_doaj_json(int $post_id) : mixed

This function returns a json encoded string containing the meta-data in a format suitable for DOAJ.

TODO: Clean this up once we got some feedback from DOAJ

Parameters
$post_id : int

Id of the post for which to generate the the json encoded meta-data.

Tags
since
0.1.0
acccess

public

get_active_publication_type_names()

Get the names of all registered publication types.

public static get_active_publication_type_names() : array<string|int, mixed>
Tags
since
0.1.0
access

public

Return values
array<string|int, mixed> —

Array of names of all active publication types.

get_active_publication_types()

Get all registered publication types.

public static get_active_publication_types([string $name = null ]) : mixed
Parameters
$name : string = null

Name of a publication type. If provided returns only that publication type (if it is acitve).

Tags
since
0.1.0
access

public

get_all_arxiv_submission_histories()

public get_all_arxiv_submission_histories([mixed $fetch_if_outdated = false ]) : mixed
Parameters
$fetch_if_outdated : mixed = false

get_all_citation_counts()

Get the citation counts for all publications of the given type.

public get_all_citation_counts([bool $fetch_if_outdated = false ]) : array<string|int, mixed>
Parameters
$fetch_if_outdated : bool = false

Whether to fetch new data if the currently cached one is considered outdated.

Tags
since
0.3.0
access

public

Return values
array<string|int, mixed> —

Array with information about citation counts.

get_arxiv_submission_history()

Get the arXiv submission history

public get_arxiv_submission_history(int $post_id[, int $fetch_if_outdated = true ]) : array<string|int, mixed>

Gets the submission history from cache if present, otherwise fetches and updates the cache.

Parameters
$post_id : int

Id of the post.

$fetch_if_outdated : int = true

Whether to fetch a new version if the cached version is outdated.

Tags
since
0.4.1+
access

public

Return values
array<string|int, mixed> —

Submission history. See O3PO_Arxiv for more details.

get_arxiv_upload_date()

Get the arXiv upload date

public get_arxiv_upload_date(int $post_id) : mixed
Parameters
$post_id : int

The id of the post for which to get the arXiv upload date.

Tags
since
0.3.0
access

public

get_basis_for_excerpt()

Get the text basis for the text part of the excerpt

public get_basis_for_excerpt(int $post_id) : The

In this case we return the abstract.

Parameters
$post_id : int

The ID of the post.

Tags
since
0.3.1
access

public

Return values
The —

basis for the text of the excerpt.

get_bibliography_html()

Get the thml formated bibliography.

public get_bibliography_html(int $post_id) : mixed

Includes a heading for use in the single templates and the like.

Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_bibtex_html()

Get the html formated bibtex data.

public get_bibtex_html(int $post_id) : mixed

Gets the bibtex data and a suitable caption. To be used in the single templates.

Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_cited_by()

Get the html formated cited by information.

public get_cited_by(int $post_id) : mixed

Echos the cited-by date including a heading for use in the single templates and the like.

Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_cited_by_data()

Get cited-by data.

public get_cited_by_data(int $post_id[, bool $fetch_if_outdated = true ]) : array<string|int, mixed>
Parameters
$post_id : int

Id of the post.

$fetch_if_outdated : bool = true

Whether to fetch new data from remote services if the cached data is considered outdated (default true).

Tags
sinde

0.3.0

access

public

Return values
array<string|int, mixed> —

Array containing cited-by data in various formats.

get_corresponding_author_email()

Get the email of the corresponding author.

public static get_corresponding_author_email(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.3.0
access

public

get_date_published()

Get date published.

public static get_date_published(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.3.0
access

public

retur

string YYYY-mm-dd representation of the date of publication.

get_default_number_authors()

Get the default number of authors for this publication type.

public get_default_number_authors() : mixed
Tags
since
0.1.0
access

public

get_doi()

Get the DOI of the post with id $post_id.

public static get_doi(int $post_id) : mixed
Parameters
$post_id : int

The id of the post for which to get the doi.

Tags
since
0.1.0
access

public

get_eprint()

Get the eprint of the post with id $post_id.

public static get_eprint(int $post_id) : mixed
Parameters
$post_id : int

The id of the post for which to get the eprint.

Tags
since
0.3.0
access

public

get_feed_content()

Get the content for for the rss feed.

public get_feed_content(string $content) : mixed

To be added to the 'the_content_feed' and 'the_excerpt_rss' filter.

Parameters
$content : string

Content to be ammended.

Tags
since
0.1.0
access

public

get_formated_affiliations()

Echo the afiliations text formated.

public static get_formated_affiliations(int $post_id) : mixed

Semicolon separated list of all distinct affiliations.

Parameters
$post_id : int

Id of the post.

Tags
since
0.4.3+
access

public

get_formated_affiliations_html()

Echo the afiliations html formated.

public static get_formated_affiliations_html(int $post_id) : mixed

Html formated list of affiliations with superscript number consistent with those of get_formated_authors_html().

Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_formated_authors()

Get the formatted authors.

public static get_formated_authors(int $post_id) : mixed

Return the list of authors in first name last name format, seperated by commas and the word 'and' including an oxford comma.

Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_formated_authors_bibtex()

Get the authors BibTeX formatted.

public static get_formated_authors_bibtex(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_formated_authors_html()

Get the authors html formated.

public get_formated_authors_html(int $post_id) : mixed

Returns html formated authors with affiliations indicated as superscripts.

Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_formated_bibliography_entry_html()

Get a formated bibliography entry.

public get_formated_bibliography_entry_html(array<string|int, mixed> $entry) : mixed

Expects a entry of a bibliography such as those that can be obtained via O3PO_Latex::parse_bbl() from bbl code.

Parameters
$entry : array<string|int, mixed>

Array describing the bibliography entry.

Tags
since
0.1.0
access

public

get_formated_bibliography_html()

Echo the html formated bibliography.

public get_formated_bibliography_html(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_formated_citation()

Get how this $post_id should be cited.

public static get_formated_citation(int $post_id) : mixed
Parameters
$post_id : int

Id of the post for which the formated citation is to be returned

Tags
since
0.1.0
access

public

get_formated_cited_by_html()

Get the html formated cited information.

public get_formated_cited_by_html(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_formated_date_published()

Get publication date formated.

public static get_formated_date_published(int $post_id) : mixed

Returns a nicely formted version of the publication date. Currently this is set to the initernational format YYYY-MM-DD.

Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_formated_handling_editor()

Outputs the html formated handling editor of this publication type.

public static get_formated_handling_editor(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.4.3
access

public

get_formated_volume_html()

Outptus the html formated volume of this publication type.

public static get_formated_volume_html(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_fulltext_pdf_path()

Get the path of the fulltext pdf.

public get_fulltext_pdf_path(int $post_id) : mixed

Overwerites a method in the base class.

Parameters
$post_id : int

Id of the post.

Tags
since
0.2.0
access

public

get_journal_property()

Get a property of the associated journal.

public get_journal_property(string $id) : mixed
Parameters
$id : string

If of the property.

Tags
since
0.1.0
access

public

get_last_arxiv_pdf_path()

Get the path of the last arXiv pdf.

public static get_last_arxiv_pdf_path(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_last_arxiv_pdf_url()

Get the url of the latest arXiv pdf.

public get_last_arxiv_pdf_url(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_license_information()

Get the license_information.

public get_license_information(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

get_newer_arxiv_version_warning()

Get the the html of the warning in case a newer arxiv version exists

public get_newer_arxiv_version_warning(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.4.1+
access

public

get_number_authors()

Get the number of authors.

public static get_number_authors(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.3.0
access

public

get_page()

Get the page of the post with id $post_id.

public static get_page(int $post_id) : mixed
Parameters
$post_id : int

The id of the post for which to get the page.

Tags
since
0.1.0
access

public

Get the pretty permalink of the pdf associated with a post.

public get_pdf_pretty_permalink(int $post_id) : mixed

For Google Scholar the full text must be available in a subdirectory of the abstract page and anyway it is nice to have a consistent api for downloading the fulltext pdf. The following functions are added to the 'init' and 'parse_request' hooks and thereby make any url of the form [post-type-name]//pdf/ return the associated pdf.

Parameters
$post_id : int

Id of the post.

since
0.1.0
access

public

Get the polupar summary.

public static get_popular_summary(int $post_id) : mixed

Get the popular summary if available. To be used in the single templates.

Parameters
$post_id : int

Id of the post.

since
0.3.0
access

public

get_post_meta()

Get a meta data field.

public static get_post_meta(int $post_id, string $field) : mixed
Parameters
$post_id : int

Id of the post.

$field : string

The field to get.

Tags
since
0.3.0
access

public

get_post_meta_field_containing_array()

Get a post meta field that is expected to contain an array.

public static get_post_meta_field_containing_array(int $post_id, string $key) : mixed

Contrary to get_post_meta($post_id, $key, true ) this returns an emty array() if the key is unset. This allows to directly add to the array with the [] notation even on php >= 7.1, wich no longer allows this notation on strings.

Parameters
$post_id : int

The Id of the post whose meta field is to be retreived.

$key : string

The key that is to be retreived.

Tags
since
0.2.1

get_publication_type_name()

Get the name of this publication type.

public get_publication_type_name() : mixed
Tags
since
0.1.0
access

public

get_publication_type_name_plural()

Get the plural name of this publication type.

public get_publication_type_name_plural() : mixed
Tags
since
0.1.0
access

public

get_social_media_thumbnail_src()

Get the src of the feature image.

public static get_social_media_thumbnail_src(int|WP_Post $post_id) : string
Parameters
$post_id : int|WP_Post

Id of the post for which to get the social media thumbnail src.

Tags
since
0.3.0
access

public

Return values
string —

Src of the social media thumbnail.

get_the_author()

Fake the author.

public get_the_author(string $display_name) : mixed

To be added to the 'the_author' filter.

Parameters
$display_name : string

Display name to be filtered.

Tags
since
0.1.0
access

pulic

Fake the author post link.

public get_the_author_posts_link(string $link) : mixed

To be added to the 'the_author_posts_link' filter.

Parameters
$link : string

Link to be filtered.

since
0.3.0
access

pulic

get_the_content()

Construct the content.

public get_the_content(string $content) : mixed

Here we output dynamic information about the publication alongside the standard content.

To be added to the 'the_content' filter.

Parameters
$content : string

Content to be filtered.

Tags
since
0.1.0
access

public

get_the_excerpt()

Get the excerpt of a this publication type.

public get_the_excerpt(string $content) : mixed

As we modify the content in get_the_content() we construct the excerpt from scratch,

To be added to the 'get_the_excerpt' filter.

Parameters
$content : string

Content to be filtered.

Tags
since
0.1.0

get_title()

Get the title.

public static get_title(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.3.0
access

public

get_volume()

Get the volume of the post with id $post_id.

public static get_volume(int $post_id) : mixed
Parameters
$post_id : int

The id of the post for which to get the volume.

Tags
since
0.1.0
access

public

handle_arxiv_paper_doi_feed_endpoint_request()

Handle requests to the arxiv_paper_doi_feed endpoint for serving a feed of recent papers for the arXiv.

public handle_arxiv_paper_doi_feed_endpoint_request(WP_Query $wp_query[, bool $do_not_exit = false ]) : mixed

To be added to the 'parse_request' action.

Parameters
$wp_query : WP_Query

The WP_Query to be handled.

$do_not_exit : bool = false

Prevent this function from calling exit() and return instead.

Tags
since
0.1.0
access

public

handle_pdf_endpoint_request()

Handle request to the /pdf endpoint for serving the full text pdf.

public handle_pdf_endpoint_request(WP_Query $wp_query[, bool $do_not_exit = false ]) : mixed

For PHPUnit testing this function needs a way to suppress the calls to exit(), which are otherwise necessary to prevent other parts of WordPress from adding additional output to the PDF we want to deliver. This can be done with the optional parameter $do_not_exit which defaults to false.

To be added to the 'parse_request' action.

Parameters
$wp_query : WP_Query

The WP_Query to be handled.

$do_not_exit : bool = false

Prevent this function from calling exit() and return instead.

Tags
since
0.1.0
access

public

handle_web_statement_endpoint_request()

Handle requests to the /web-statement end point for serving a web statement of the licence.

public handle_web_statement_endpoint_request(WP_Query $wp_query[, bool $do_not_exit = false ]) : mixed

For PHPUnit testing this function needs a way to suppress the calls to exit(), which are otherwise necessary to prevent other parts of WordPress from adding additional output to the web statement we want to deliver. This can be done with the optional parameter $do_not_exit which defaults to false. To be added to the 'parse_request' action.

Parameters
$wp_query : WP_Query

The WP_Query to be handled.

$do_not_exit : bool = false

Prevent this function from calling exit() and return instead.

Tags
since
0.1.0
access

public

html_latex_excerpt()

Excerpt from a string with html and LaTeX

public static html_latex_excerpt(string $str, int $count[, string $more = null ]) : string

Safely extracts not more than the first $count characters from a string containing html and LaTeX code (including mathematical formulas).

Parameters
$str : string

String to get the excerpt from.

$count : int

Maximum number of characters to take.

$more : string = null

(Optional) What to append if $str needs to be trimmed. Defaults to empty string. Default value: null

Tags
since
0.3.1
access

public

Return values
string —

The excerpt.

init_metabox()

Init the meta box for all publication types and add hooks for its save action.

public final static init_metabox() : mixed

Normally all hooks should be added in class-o3po.php. This method is special in that it adds two extra hooks. We do this, because we need to unhook one of them during save_metabox() (see below), so that it is better to keep this all contained in the same file

Tags
since
0.1.0
access

public

on_transition_post_status()

Handle post status transitions

public final on_transition_post_status(string $new, string $old, int $post) : mixed

To be added to the 'transition_post_status' hook.

Parameters
$new : string

The new post status after this transition.

$old : string

The old post status before this transition.

$post : int

The post that is undergoing the transitions.

Tags
since
0.3.0
access

public

pre_delete_post()

Check whether this post can be deleted

public pre_delete_post(bool $delete, WP_Post $post, bool $force_delete) : mixed

To be added to the 'pre_delete_post' filter.

Parameters
$delete : bool

Whether this post is supposed to be deleted

$post : WP_Post

Post

$force_delete : bool

Whether this is a force delete

Tags
since
0.4.2
access

public

pre_trash_post()

Check whether this post can be trashed

public pre_trash_post(mixed $trash, WP_Post $post) : mixed

To be added to the 'pre_trash_post' filter.

Parameters
$trash : mixed
$post : WP_Post

Post

Tags
since
0.4.2
access

public

prevent_deletion()

Return false for posts of this type when they are already published

public prevent_deletion(bool $delete, WP_Post $post) : mixed
Parameters
$delete : bool

Whether this post is supposed to be trashed/deleted

$post : WP_Post

Post

Tags
since
0.4.2
access

public

register_as_custom_post_type()

Registers this publication type as a custom post type with WordPress.

public final register_as_custom_post_type() : mixed

To be added to the 'init' action.

Tags
since
0.1.0
access

public

render_maintenance_mode_warning()

Render the maintenance_mode warning if appropriate.

public final static render_maintenance_mode_warning(WP_Post $post) : mixed
Parameters
$post : WP_Post

The post for which to render the metabox.

Tags
since
0.3.0
access

public

render_metabox()

Render the admin panel meta box.

public render_metabox(Post $post) : mixed
Parameters
$post : Post

Post for which the meta box is to be rendered.

Tags
since
0.1.0
access

public

save_metabox()

Callback function for handling the data enterd into the meta-box when a correspnding post is saved.

public final save_metabox(int $post_id, WP_Post $post) : mixed

Calls save_meta_data() and validate_and_process_data() as well as a bunch of other methods such as on_post_actually_published() when appropriate to actually do the processing. Also ensures that the post is forced to private as long as there are still validation ERRORs or REVIEW requests.

Warning: This is already called when a New Post is created and not only when the "Publish" or "Update" button is pressed!

Parameters
$post_id : int

The id of the post for which to save the metabox.

$post : WP_Post

The post for which to save the metabox.

Tags
since
0.1.0
access

public

Decide whether or not the Fermat's library permalink should be shown.

public static show_fermats_library_permalink(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

since
0.1.0
access

public

the_author_feed()

Modify the author reported on the feed for publication posts.

public the_author_feed(string $display_name) : mixed

To be added to the 'the_author' filter.

Parameters
$display_name : string

Original author name.

Tags
since
0.1.0
access

public

the_java_script_single_page()

Outputs some java script for the single page of this publication type.

public the_java_script_single_page() : mixed

To be added to the 'wp_head' action.

Tags
since
0.1.0
access

public

use_page_template()

Force the usage of the page template for publication posts.

public use_page_template(string $template) : string

To be added to the 'template_include' action.

Parameters
$template : string

The template that would be used.

Tags
since
0.3.0
access

public

Return values
string —

Template that should be used.

get_last_arxiv_source_url()

Get the url of the last arXiv soruce.

protected static get_last_arxiv_source_url(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

on_post_actually_published()

Do things when the post is finally published.

protected on_post_actually_published(int $post_id) : mixed

Is called from save_metabox().

Parameters
$post_id : int

Id of the post that is actually published publicly.

Tags
since
0.1.0
access

public

save_meta_data()

Callback function for handling the data enterd into the meta-box when a correspnding post is saved.

protected save_meta_data(int $post_id) : mixed

Calls save_meta_data() and validate_and_process_data() as well as a bunch of other methods such as on_post_actually_published() when appropriate to actually do the processing. Also ensures that the post is forced to private as long as there are still validation ERRORs or REVIEW requests.

Warning: This is already called when a New Post is created and not only when the "Publish" or "Update" button is pressed!

Parameters
$post_id : int

Id of the post whose meta data is to be saved.

Tags
since
0.1.0
access

public

the_admin_panel_abstract()

Echo the abstract part of the admin panel.

protected the_admin_panel_abstract(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

the_admin_panel_affiliations()

Echo the affiliations for the admin panel.

protected static the_admin_panel_affiliations(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
accesss

protected

the_admin_panel_arxiv()

Echo the arXiv part of the admin panel.

protected the_admin_panel_arxiv(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

the_admin_panel_authors()

Echo the authors for the admin panel.

protected the_admin_panel_authors(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

protected

the_admin_panel_bibliography()

Echo the bibliography for the admin panel.

protected the_admin_panel_bibliography(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0

the_admin_panel_buffer()

Echo an intro text for buffer functionality on the admin panel.

protected the_admin_panel_buffer(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.3.0
access

proteted

the_admin_panel_clockss()

Echo the CLOCKSS information for the admin panel.

protected static the_admin_panel_clockss(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0

the_admin_panel_corresponding_author_email()

Echo the corresponding author emial for the admin panel.

protected static the_admin_panel_corresponding_author_email(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

protected

the_admin_panel_crossref()

Echo crossref information for the admin panel.

protected static the_admin_panel_crossref(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0

the_admin_panel_date_volume_pages()

Echo the data, volume and pages information for the admin panel.

protected the_admin_panel_date_volume_pages(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

protected

the_admin_panel_doaj()

Echo the DOAJ information for the admin panel.

protected static the_admin_panel_doaj(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0

the_admin_panel_doi()

Echo the DOI for the admin panel.

protected the_admin_panel_doi(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

protecte

the_admin_panel_eprint()

Echo the eprint part of the admin panel.

protected the_admin_panel_eprint(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

the_admin_panel_feature_image_caption()

Echo the feature image caption part of the amdin panel.

protected the_admin_panel_feature_image_caption(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

the_admin_panel_fermats_library()

Echo the Ferma's library part of the admin panel.

protected the_admin_panel_fermats_library(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

the_admin_panel_funder_information()

Echo the funder information for the admin panel.

protected static the_admin_panel_funder_information(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.4.0

the_admin_panel_handling_editor()

Echo an controls for choosing the handling editor on the admin panel.

protected the_admin_panel_handling_editor(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.3.0
access

proteted

the_admin_panel_howto()

Echo a howto for the admin panel.

protected the_admin_panel_howto(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

public

the_admin_panel_intro_text()

Echo an intro text for the admin panel.

protected the_admin_panel_intro_text(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
0.4.0

Not static anymore.

access

protected

Echo the popular summary part of the admin panel.

protected the_admin_panel_popular_summary(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

since
0.1.0
access

public

the_admin_panel_title()

Echo the title for the admin panel.

protected static the_admin_panel_title(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

protected

the_admin_panel_validation_result()

Echo the validation results for the admin panel.

protected static the_admin_panel_validation_result(int $post_id) : mixed
Parameters
$post_id : int

Id of the post.

Tags
since
0.1.0
access

protected

validate_and_process_data()

Validate and process the meta-data that was saved in save_meta_data().

protected validate_and_process_data(int $post_id) : mixed
Parameters
$post_id : int

The id of the post whose meta-data is to be validated and processed.

Tags
since
0.1.0
access

protected

parse_publication_source()

Parse the source files.

private parse_publication_source(string $path_source, string $mime_type) : mixed

Depending on the manuscript we either got a single uncompressed .tex file or a tar.gz archive from the arXiv which we have to extract and then analyse.

Parameters
$path_source : string

Path to the source file.

$mime_type : string

Mime type of the source file.

Tags
since
0.3.0
access

private


        
On this page

Search results