Documentation

O3PO_PublicationType
in package

AbstractYes

Base class for types of publications.

Abstract base class for representing different publication types as custom WordPress post types.

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.
$active_publication_types  : array<string|int, mixed>
Array of all activated publication types derived from this class.
$default_number_authors  : int
Default number of authors for this publication type.
$journal  : O3PO_Journal
The array holding the properties of the journal this post type is associated with.
$publication_type_name  : string
Name of this publication type.
$publication_type_name_plural  : string
Plural of the name of this publication type.

Methods

__construct()  : mixed
Construct this publication type.
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
Add Dublin Core and Highwire Press meta tags.
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.
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_citation_counts()  : array<string|int, mixed>
Get the citation counts for all publications of the given type.
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_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_license_information()  : mixed
Get the license_information.
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_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.
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 meta box.
save_metabox()  : mixed
Callback function for handling the data enterd into the meta-box when a correspnding post is saved.
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.
on_post_actually_published()  : mixed
Do things when the post is finally published.
save_meta_data()  : mixed
Obtain the data entered into the meta-data metabox from the $_POST, sanitize it, set defauls, and save it.
the_admin_panel_affiliations()  : mixed
Echo the affiliations for 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_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_intro_text()  : mixed
Echo an intro text for 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().
post_update_on_buffer_com_if_not_already_done()  : string
Put an update about the given publication post in the queue of buffer.com.
upload_meta_data_and_pdf_to_clockss()  : mixed
Submit meta-data and full text to CLOCKSS.
upload_meta_data_to_crossref()  : mixed
Submit meta-data to Crossref.
upload_meta_data_to_doaj()  : mixed
Submit meta-data to DOAJ.

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

$active_publication_types

Array of all activated publication types derived from this class.

private static array<string|int, mixed> $active_publication_types

Array of all activated publication types derived from this class.

Tags
since
0.1.0
access

private

$default_number_authors

Default number of authors for this publication type.

private int $default_number_authors

Default number of authors for this publication type.

Tags
since
0.1.0
access

private

$journal

The array holding the properties of the journal this post type is associated with.

private O3PO_Journal $journal

A the journal this publication type is published in.

Tags
since
0.1.0
access

private

$publication_type_name

Name of this publication type.

private string $publication_type_name

Name of this publication type.

Tags
since
0.1.0
access

private

$publication_type_name_plural

Plural of the name of this publication type.

private string $publication_type_name_plural

Plural of the name of this publication type.

Tags
since
0.1.0
access

private

Methods

__construct()

Construct this publication type.

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

Constructs and registers this publication type in the array $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.

$default_number_authors : int

The default number of authors.

$environment : O3PO_Environment

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

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()

Add Dublin Core and Highwire Press meta tags.

public add_dublin_core_and_highwire_press_meta_tags() : mixed

Add meta information for Google Scholar (for more info on the available tags see http://webmasters.stackexchange.com/questions/11613/indexing-for-google-scholar-which-tags-to-use) and similar services. This is called from the single template.

To be added to the 'wp_head' action.

Tags
since
0.1.0
access

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

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_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_basis_for_excerpt()

Get the text basis for the text part of the excerpt

public abstract get_basis_for_excerpt(int $post_id) : The

To be overwritten in any sub-class.

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_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 abstract get_fulltext_pdf_path(int $post_id) : mixed

To be overwerites in subclasses. May return null if the subclass has no fulltext pdf.

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_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_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 abstract get_pdf_pretty_permalink(int $post_id) : mixed

To be overwerites in subclasses. May return null if the subclass has no fulltext pdf.

Parameters
$post_id : int

Id of the post.

since
0.2.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_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

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 meta box.

public render_metabox(WP_Post $post) : mixed

This function should be overwritten in any child class and but the parent implementation should be called through.

Parameters
$post : WP_Post

The post for which to render the metabox.

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

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.

on_post_actually_published()

Do things when the post is finally published.

protected on_post_actually_published(int $post_id) : mixed

Is called from validate_and_process_data().

Parameters
$post_id : int

Id of the post that is actually beeing finally published publicly.

Tags
since
0.1.0
access

protected

save_meta_data()

Obtain the data entered into the meta-data metabox from the $_POST, sanitize it, set defauls, and save it.

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

The id of the post.

Tags
since
0.1.0
access

protected

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_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_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_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

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

We also trigger interactions with external services (Crossref, DOAJ, CLOCKSS) here.

Parameters
$post_id : int

The id of the post.

Tags
since
0.1.0
access

protected

post_update_on_buffer_com_if_not_already_done()

Put an update about the given publication post in the queue of buffer.com.

private post_update_on_buffer_com_if_not_already_done(int $post_id) : string
Parameters
$post_id : int

Id of the post.

Tags
since
0.3.0
access

private

Return values
string —

The validation_result of the upload.

upload_meta_data_and_pdf_to_clockss()

Submit meta-data and full text to CLOCKSS.

private static upload_meta_data_and_pdf_to_clockss(string $clockss_xml, string $pdf_path, string $remote_filename_without_extension, string $clockss_ftp_url, string $clockss_username, string $clockss_password) : mixed

Upload an xml file with the meta-data and the full text pdf to CLOCKSS.

CLOCKSS has no test system, so that we can only get a response from the real system once we publish the final and actual record.

This function must be private since we do no longer check internally whether we are running on the test system.

Parameters
$clockss_xml : string

The xml encoded meta-data to upload.

$pdf_path : string

Path to the local fulltext pdf

$remote_filename_without_extension : string

Filename without extension under which the files are to be deposited on the remore server

$clockss_ftp_url : string

The url of the CLOCKSS ftp server.

$clockss_username : string

The CLOCKSS username

$clockss_password : string

The CLOCKSS password

Tags
since
0.1.0
access

private

upload_meta_data_to_crossref()

Submit meta-data to Crossref.

private static upload_meta_data_to_crossref(string $doi_batch_id, string $crossref_xml, string $crossref_id, string $crossref_pw, string $crossref_url) : mixed

This function must be private since we do no longer check internally whether we are running on the test system.

Parameters
$doi_batch_id : string

Batch id of this upload.

$crossref_xml : string

The xml to upload.

$crossref_id : string

The id for which to submit this upload.

$crossref_pw : string

The password corresponding to the crossref_id.

$crossref_url : string

The url of the crossref server to upload to.

Tags
since
0.1.0
access

private

upload_meta_data_to_doaj()

Submit meta-data to DOAJ.

private static upload_meta_data_to_doaj(string $doaj_json, string $doaj_api_url, string $doaj_api_key) : mixed

From the command line you could do rouhgly the smame via:

curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "[json goes here]" "https://doaj.org/api/v1/articles?api_key=XXX" see https://doaj.org/api/v1/docs#/ for more infomation.

DOAJ has no test system, so that we can only get a response from the real system once we publish the final and actual record.

This function must be private since we do no longer check internally whether we are running on the test system.

Parameters
$doaj_json : string

The JSON encoded meta-data to upload.

$doaj_api_url : string

The url of the DOAJ api to upload to.

$doaj_api_key : string

The API key with DOAJ

Tags
since
0.1.0
access

private


        
On this page

Search results